diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-05-29 18:47:23 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-05-29 18:47:23 +0000 |
commit | e3b2acf2743f957bf084e7d4bbcf61c8f21817ea (patch) | |
tree | 130e25b196dbd5aa6e1e454cf7719087080d427c /llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | |
parent | 223dd95f248f37a27ab5e720dbb21fc5997117f1 (diff) | |
download | bcm5719-llvm-e3b2acf2743f957bf084e7d4bbcf61c8f21817ea.tar.gz bcm5719-llvm-e3b2acf2743f957bf084e7d4bbcf61c8f21817ea.zip |
Pass MCSymbols to the helper functions in MCELF.h.
llvm-svn: 238596
Diffstat (limited to 'llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp index 847437611a5..ef1db075ccf 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp @@ -161,7 +161,6 @@ public: } void emitLocalEntry(MCSymbol *S, const MCExpr *LocalOffset) override { MCAssembler &MCA = getStreamer().getAssembler(); - MCSymbolData &Data = getStreamer().getOrCreateSymbolData(S); int64_t Res; if (!LocalOffset->EvaluateAsAbsolute(Res, MCA)) @@ -174,10 +173,10 @@ public: // The "other" values are stored in the last 6 bits of the second byte. // The traditional defines for STO values assume the full byte and thus // the shift to pack it. - unsigned Other = MCELF::getOther(Data) << 2; + unsigned Other = MCELF::getOther(*S) << 2; Other &= ~ELF::STO_PPC64_LOCAL_MASK; Other |= Encoded; - MCELF::setOther(Data, Other >> 2); + MCELF::setOther(*S, Other >> 2); // For GAS compatibility, unless we already saw a .abiversion directive, // set e_flags to indicate ELFv2 ABI. @@ -192,15 +191,13 @@ public: return; const MCSymbol &RhsSym = static_cast<const MCSymbolRefExpr *>(Value)->getSymbol(); - MCSymbolData &Data = getStreamer().getOrCreateSymbolData(&RhsSym); - MCSymbolData &SymbolData = getStreamer().getOrCreateSymbolData(Symbol); // The "other" values are stored in the last 6 bits of the second byte. // The traditional defines for STO values assume the full byte and thus // the shift to pack it. - unsigned Other = MCELF::getOther(SymbolData) << 2; + unsigned Other = MCELF::getOther(*Symbol) << 2; Other &= ~ELF::STO_PPC64_LOCAL_MASK; - Other |= (MCELF::getOther(Data) << 2) & ELF::STO_PPC64_LOCAL_MASK; - MCELF::setOther(SymbolData, Other >> 2); + Other |= (MCELF::getOther(RhsSym) << 2) & ELF::STO_PPC64_LOCAL_MASK; + MCELF::setOther(*Symbol, Other >> 2); } }; |