diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-21 00:39:24 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-21 00:39:24 +0000 |
commit | 24f4775f71ba8c844eabe42341440d66bce04a2c (patch) | |
tree | ff131abc89c20e07232a62182183103d29ae7ab4 /llvm/lib/MC/MachObjectWriter.cpp | |
parent | 7ac5c86ba933fd02148e72c88b467b2313fdb8d3 (diff) | |
download | llvm-24f4775f71ba8c844eabe42341440d66bce04a2c.zip llvm-24f4775f71ba8c844eabe42341440d66bce04a2c.tar.gz llvm-24f4775f71ba8c844eabe42341440d66bce04a2c.tar.bz2 |
MC: Remove last use of MCSymbolData::getSymbol(), NFC
Remove the last use of `MCSymbolData::getSymbol()`. There's some
*really* hairy stuff going on in `MachObjectWriter::WriteNList()` that I
want to come back to. In particular, it updates `Symbol` to point at
its aliasee (if any), but leaves `Data` behind, and it's not clear
whether everything makes sense there.
For now I've left the logic unchanged by adding `OrigSymbol` and moving
the FIXME from r237750 up a bit higher. I've filed PR23598 to track
looking into this.
llvm-svn: 237867
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/MachObjectWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index b4fd55e8..2799298 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -338,12 +338,14 @@ void MachObjectWriter::WriteNlist(MachSymbolData &MSD, uint64_t Address = 0; bool IsAlias = Symbol != AliasedSymbol; + const MCSymbol &OrigSymbol = *Symbol; MachSymbolData *AliaseeInfo; if (IsAlias) { AliaseeInfo = findSymbolData(*AliasedSymbol); if (AliaseeInfo) SectionIndex = AliaseeInfo->SectionIndex; Symbol = AliasedSymbol; + // FIXME: Should this update Data as well? Do we need OrigSymbol at all? } // Set the N_TYPE bits. See <mach-o/nlist.h>. @@ -371,9 +373,7 @@ void MachObjectWriter::WriteNlist(MachSymbolData &MSD, if (IsAlias && Symbol->isUndefined()) Address = AliaseeInfo->StringIndex; else if (Symbol->isDefined()) - // FIXME: Should Data.getSymbol() always be *Symbol? It doesn't look like - // that's true. - Address = getSymbolAddress(Data.getSymbol(), Layout); + Address = getSymbolAddress(OrigSymbol, Layout); else if (Data.isCommon()) { // Common symbols are encoded with the size in the address // field, and their alignment in the flags. |