summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-16 00:48:58 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-05-16 00:48:58 +0000
commit09bfa58edd62af6ecbf1ea5177e27e55ab782160 (patch)
tree755ced1155cc5b92085dbe060e70e3e4ab2513dc /llvm/lib/MC
parentf48de1cb7b1c3c59011f9d3d34e00bcf8ca29b01 (diff)
downloadbcm5719-llvm-09bfa58edd62af6ecbf1ea5177e27e55ab782160.tar.gz
bcm5719-llvm-09bfa58edd62af6ecbf1ea5177e27e55ab782160.zip
MC: Change MCFragment::Atom to an MCSymbol, NFC
Change `MCFragment::Atom` from an `MCSymbolData` to an `MCSymbol`, moving in the direction of removing the back-pointer. llvm-svn: 237497
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp4
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp4
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp7
3 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index ff230dfd9f9..197b9221b3f 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -460,10 +460,10 @@ bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const {
return false;
}
-const MCSymbolData *MCAssembler::getAtom(const MCSymbolData *SD) const {
+const MCSymbol *MCAssembler::getAtom(const MCSymbolData *SD) const {
// Linker visible symbols define atoms.
if (isSymbolLinkerVisible(SD->getSymbol()))
- return SD;
+ return &SD->getSymbol();
// Absolute and undefined symbols have no defining atom.
if (!SD->getFragment())
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index ee3f35878ed..b381e578040 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -478,11 +478,11 @@ void MCMachOStreamer::FinishImpl() {
// symbol.
for (MCAssembler::iterator it = getAssembler().begin(),
ie = getAssembler().end(); it != ie; ++it) {
- MCSymbolData *CurrentAtom = nullptr;
+ const MCSymbol *CurrentAtom = nullptr;
for (MCSectionData::iterator it2 = it->begin(),
ie2 = it->end(); it2 != ie2; ++it2) {
if (MCSymbolData *SD = DefiningSymbolMap.lookup(it2))
- CurrentAtom = SD;
+ CurrentAtom = &SD->getSymbol();
it2->setAtom(CurrentAtom);
}
}
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 3ffdc701e65..109e908988f 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -679,8 +679,6 @@ bool MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
// - addr(atom(B)) - offset(B)
// and the offsets are not relocatable, so the fixup is fully resolved when
// addr(atom(A)) - addr(atom(B)) == 0.
- const MCSymbolData *A_Base = nullptr, *B_Base = nullptr;
-
const MCSymbol &SA = findAliasedSymbol(DataA.getSymbol());
const MCSection &SecA = SA.getSection();
const MCSection &SecB = FB.getParent()->getSection();
@@ -733,11 +731,8 @@ bool MachObjectWriter::IsSymbolRefDifferenceFullyResolvedImpl(
if (!FA)
return false;
- A_Base = FA->getAtom();
- B_Base = FB.getAtom();
-
// If the atoms are the same, they are guaranteed to have the same address.
- if (A_Base == B_Base)
+ if (FA->getAtom() == FB.getAtom())
return true;
// Otherwise, we can't prove this is fully resolved.
OpenPOWER on IntegriCloud