diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-19 23:53:20 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-05-19 23:53:20 +0000 |
commit | 2a40483418370b97149ce9e87384cdd1d0b702ac (patch) | |
tree | a7a70ec4ed639b4ad6887534258249f101943f9c /llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp | |
parent | c6c660b3dd60784662879dc4e236fdf066e79d10 (diff) | |
download | bcm5719-llvm-2a40483418370b97149ce9e87384cdd1d0b702ac.tar.gz bcm5719-llvm-2a40483418370b97149ce9e87384cdd1d0b702ac.zip |
MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC
Continue to canonicalize on MCSymbol instead of MCSymbolData when both
are needed.
llvm-svn: 237749
Diffstat (limited to 'llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp')
-rw-r--r-- | llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp index 3ede3ce1df1..01f4bbe03e1 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp @@ -232,9 +232,9 @@ void X86MachObjectWriter::RecordX86_64Relocation( // non-local symbol). if (RelSymbol) { // Add the local offset, if needed. - if (&RelSymbol->getData() != &SD) - Value += Layout.getSymbolOffset(&SD) - - Layout.getSymbolOffset(&RelSymbol->getData()); + if (RelSymbol != Symbol) + Value += Layout.getSymbolOffset(*Symbol) - + Layout.getSymbolOffset(*RelSymbol); } else if (Symbol->isInSection() && !Symbol->isVariable()) { // The index is the section ordinal (1-based). Index = SD.getFragment()->getParent()->getOrdinal() + 1; @@ -553,7 +553,7 @@ void X86MachObjectWriter::RecordX86Relocation(MachObjectWriter *Writer, // compensate for the addend of the symbol address, if it was // undefined. This occurs with weak definitions, for example. if (!SD->getSymbol().isUndefined()) - FixedValue -= Layout.getSymbolOffset(SD); + FixedValue -= Layout.getSymbolOffset(SD->getSymbol()); } else { // The index is the section ordinal (1-based). const MCSectionData &SymSD = Asm.getSectionData( |