llvm-project/lld/MachO
Jez Ng 1752f28506 [lld-macho][nfc] Remove `MachO::` prefix where possible
Previously, SyntheticSections.cpp did not have a top-level `using namespace
llvm::MachO` because it caused a naming conflict: `llvm::MachO::Symbol` would
collide with `lld::macho::Symbol`.

`MachO::Symbol` represents the symbols defined in InterfaceFiles (TBDs). By
moving the inclusion of InterfaceFile.h into our .cpp files, we can avoid this
name collision in other files where we are only dealing with LLD's own symbols.

Along the way, I removed all unnecessary "MachO::" prefixes in our code.

Cons of this approach: If TextAPI/MachO/Symbol.h gets included via some other
header file in the future, we could run into this collision again.

Alternative 1: Have either TextAPI/MachO or BinaryFormat/MachO.h use a different
namespace. Most of the benefit of `using namespace llvm::MachO` comes from being
able to use things in BinaryFormat/MachO.h conveniently; if TextAPI was under a
different (and fully-qualified) namespace like `llvm::tapi` that would solve our
problems. Cons: lots of files across llvm-project will need to be updated, and
folks who own the TextAPI code need to agree to the name change.

Alternative 2: Rename our Symbol to something like `LldSymbol`. I think this is
ugly.

Personally I think alternative #1 is ideal, but I'm not sure the effort to do it is
worthwhile, this diff's halfway solution seems good enough to me. Thoughts?

Reviewed By: #lld-macho, oontvoo, MaskRay

Differential Revision: https://reviews.llvm.org/D98149
2021-03-11 13:28:08 -05:00
..
Arch [lld/mac] tweak comment based on feedback on D98053 2021-03-05 16:28:38 -05:00
CMakeLists.txt [lld-macho] Add ARM64 target arch 2021-02-08 18:14:07 -07:00
Config.h [lld-macho] minimal TimeTrace support 2021-03-11 15:30:45 +01:00
Driver.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
Driver.h [lld-macho] Change loadReexport to handle the case where a TAPI re-exports to reference documents nested within other TBD. 2021-03-02 12:14:31 -05:00
DriverUtils.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
Dwarf.cpp [lld-macho][NFC] add const to pointer/reference induction variables of range-based for loops 2021-03-10 12:07:31 -08:00
Dwarf.h [lld-macho] Emit STABS symbols for debugging, and drop debug sections 2020-12-01 15:05:20 -08:00
ExportTrie.cpp [lld-macho][NFC] add const to pointer/reference induction variables of range-based for loops 2021-03-10 12:07:31 -08:00
ExportTrie.h [lld-macho] Export trie addresses should be relative to the image base 2020-09-20 20:43:15 -07:00
InputFiles.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
InputFiles.h [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
InputSection.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
InputSection.h [lld-macho] Add ARM64 target arch 2021-02-08 18:14:07 -07:00
LTO.cpp [lld-macho][NFC] when reasonable, replace auto keyword with type names 2021-03-09 22:08:32 -08:00
LTO.h [lld-macho] Add very basic support for LTO 2020-11-10 12:19:28 -08:00
MachOStructs.h [lld-macho] Ensure reads from nlist_64 structs are aligned when necessary 2020-06-02 13:19:38 -07:00
MergedOutputSection.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
MergedOutputSection.h [lld-macho] Refactor segment/section creation, sorting, and merging 2020-06-21 17:13:59 -07:00
ObjC.cpp [lld-macho] Implement -ObjC 2020-08-26 19:20:55 -07:00
ObjC.h [lld-macho] Implement -ObjC 2020-08-26 19:20:55 -07:00
Options.td [lld-macho] minimal TimeTrace support 2021-03-11 15:30:45 +01:00
OutputSection.cpp [lld-macho] Refactor segment/section creation, sorting, and merging 2020-06-21 17:13:59 -07:00
OutputSection.h [lld-macho] Emit indirect symbol table 2020-09-23 19:26:40 -07:00
OutputSegment.cpp [lld-macho] Filter TAPI re-exports by target 2021-03-04 14:36:47 -05:00
OutputSegment.h [lld-macho] add code signature for native arm64 macOS 2021-02-24 17:05:23 -08:00
SymbolTable.cpp [lld-macho][NFC] when reasonable, replace auto keyword with type names 2021-03-09 22:08:32 -08:00
SymbolTable.h [lld/mac] Add some support for dynamic lookup symbols, and implement -U 2021-02-26 16:50:53 -05:00
Symbols.cpp [lld-macho] Associate each Symbol with an InputFile 2021-02-03 13:43:47 -05:00
Symbols.h [lld/mac] Add some support for dynamic lookup symbols, and implement -U 2021-02-26 16:50:53 -05:00
SyntheticSections.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
SyntheticSections.h [lld][MachO] Add support for LC_FUNCTION_STARTS 2021-03-08 22:08:36 -08:00
Target.cpp [lld-macho] Fix semantics & add tests for ARM64 GOT/TLV relocs 2021-02-23 22:02:38 -05:00
Target.h [lld-macho] Don't emit rebase opcodes for subtractor minuend relocs 2021-02-27 12:31:34 -05:00
UnwindInfoSection.cpp [lld-macho][NFC] add const to pointer/reference induction variables of range-based for loops 2021-03-10 12:07:31 -08:00
UnwindInfoSection.h [lld-macho] Emit LSDA info in compact unwind 2021-02-08 13:48:00 -05:00
Writer.cpp [lld-macho][nfc] Remove `MachO::` prefix where possible 2021-03-11 13:28:08 -05:00
Writer.h [lld-macho] Fix TLV data initialization 2021-01-08 18:48:12 -05:00