[all-commits] [llvm/llvm-project] 217993: [lld-macho] Fix unwind info personality size

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Aug 26 15:57:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2179930868f6166deccbf21f2f7565ec7666ff70
      https://github.com/llvm/llvm-project/commit/2179930868f6166deccbf21f2f7565ec7666ff70
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-08-26 (Thu, 26 Aug 2021)

  Changed paths:
    M lld/MachO/UnwindInfoSection.cpp

  Log Message:
  -----------
  [lld-macho] Fix unwind info personality size

This was missed by {D107035}. This fix addresses the following warning:

  loop variable 'personality' has type 'const uint32_t &' (aka 'const unsigned int &') but is initialized with type 'const unsigned long long' resulting in a copy [-Wrange-loop-analysis]

In addition to fixing the size, I also removed the const reference,
since there's no performance benefit to avoiding copies of integer-sized
values.


  Commit: 9065fe55911923c158e0d0e739081996d4ff86f2
      https://github.com/llvm/llvm-project/commit/9065fe55911923c158e0d0e739081996d4ff86f2
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-08-26 (Thu, 26 Aug 2021)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/Driver.h
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/ObjC.cpp
    M lld/test/MachO/invalid/bad-archive-member.s
    M lld/test/MachO/thin-archive.s

  Log Message:
  -----------
  [lld-macho] Refactor archive loading

The previous logic was duplicated between symbol-initiated
archive loads versus flag-initiated loads (i.e. `-force_load` and
`-ObjC`). This resulted in code duplication as well as redundant work --
we would create Archive instances twice whenever we had one of those
flags; once in `getArchiveMembers` and again when we constructed the
ArchiveFile.

This was motivated by an upcoming diff where we load archive members
containing ObjC-related symbols before loading those containing
ObjC-related sections, as well as before performing symbol resolution.
Without this refactor, it would be difficult to do that while avoiding
loading the same archive member twice.

Differential Revision: https://reviews.llvm.org/D108780


  Commit: 9b5148d4262dd07019f66d122a960607985fdcd3
      https://github.com/llvm/llvm-project/commit/9b5148d4262dd07019f66d122a960607985fdcd3
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-08-26 (Thu, 26 Aug 2021)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/test/MachO/lto-archive.ll
    M lld/test/MachO/objc.s

  Log Message:
  -----------
  [lld-macho] Have -ObjC load archive members before symbol resolution

This is what ld64 does. Deviating in behavior here can result
in some subtle duplicate symbol errors, as detailed in the objc.s test.

Differential Revision: https://reviews.llvm.org/D108781


Compare: https://github.com/llvm/llvm-project/compare/1e35a7690d77...9b5148d4262d


More information about the All-commits mailing list