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/Mips | |
| 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/Mips')
3 files changed, 9 insertions, 13 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp index d95b448c4b0..8cc6b3b1354 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -271,9 +271,7 @@ static unsigned getMatchingLoType(const MCAssembler &Asm, if (Type == ELF::R_MIPS16_HI16) return ELF::R_MIPS16_LO16; - const MCSymbolData &SD = Reloc.Symbol->getData(); - - if (MCELF::GetBinding(SD) != ELF::STB_LOCAL) + if (MCELF::GetBinding(*Reloc.Symbol) != ELF::STB_LOCAL) return ELF::R_MIPS_NONE; if (Type == ELF::R_MIPS_GOT16) @@ -433,7 +431,7 @@ bool MipsELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym, return true; case ELF::R_MIPS_32: - if (MCELF::getOther(Sym.getData()) & (ELF::STO_MIPS_MICROMIPS >> 2)) + if (MCELF::getOther(Sym) & (ELF::STO_MIPS_MICROMIPS >> 2)) return true; // falltrough case ELF::R_MIPS_26: diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp index d2b51831245..8abd93bd668 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp @@ -42,11 +42,11 @@ void MipsELFStreamer::createPendingLabelRelocs() { // FIXME: Also mark labels when in MIPS16 mode. if (ELFTargetStreamer->isMicroMipsEnabled()) { for (auto Label : Labels) { - MCSymbolData &Data = getOrCreateSymbolData(Label); + getOrCreateSymbolData(Label); // 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. - MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2); + MCELF::setOther(*Label, ELF::STO_MIPS_MICROMIPS >> 2); } } diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index 0ff14e495c1..aa414d73ac3 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -441,15 +441,15 @@ MipsTargetELFStreamer::MipsTargetELFStreamer(MCStreamer &S, void MipsTargetELFStreamer::emitLabel(MCSymbol *Symbol) { if (!isMicroMipsEnabled()) return; - MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Symbol); - uint8_t Type = MCELF::GetType(Data); + getStreamer().getOrCreateSymbolData(Symbol); + uint8_t Type = MCELF::GetType(*Symbol); if (Type != ELF::STT_FUNC) return; // 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. - MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2); + MCELF::setOther(*Symbol, ELF::STO_MIPS_MICROMIPS >> 2); } void MipsTargetELFStreamer::finish() { @@ -510,16 +510,14 @@ void MipsTargetELFStreamer::emitAssignment(MCSymbol *Symbol, return; const MCSymbol &RhsSym = static_cast<const MCSymbolRefExpr *>(Value)->getSymbol(); - MCSymbolData &Data = getStreamer().getOrCreateSymbolData(&RhsSym); - if (!(MCELF::getOther(Data) & (ELF::STO_MIPS_MICROMIPS >> 2))) + if (!(MCELF::getOther(RhsSym) & (ELF::STO_MIPS_MICROMIPS >> 2))) return; - 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. - MCELF::setOther(SymbolData, ELF::STO_MIPS_MICROMIPS >> 2); + MCELF::setOther(*Symbol, ELF::STO_MIPS_MICROMIPS >> 2); } MCELFStreamer &MipsTargetELFStreamer::getStreamer() { |

