diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-04 02:32:20 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-04 02:32:20 +0000 |
commit | d31203ae218637b8bb44824c9a7c63b1241fee8a (patch) | |
tree | 175660a504c8433606daa1781ed16d4baa9ecb32 /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | |
parent | eb262ce4b63e76a70d95fef83ef55c9d222a3007 (diff) | |
download | bcm5719-llvm-d31203ae218637b8bb44824c9a7c63b1241fee8a.tar.gz bcm5719-llvm-d31203ae218637b8bb44824c9a7c63b1241fee8a.zip |
Pack the MCSymbolELF bit fields into MCSymbol's Flags.
This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64.
While at it, also make getOther/setOther easier to use by accepting unshifted
STO_* values.
llvm-svn: 239006
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index 787d9a7b450..a051f4c123f 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -462,10 +462,7 @@ void MipsTargetELFStreamer::emitLabel(MCSymbol *S) { 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. - Symbol->setOther(ELF::STO_MIPS_MICROMIPS >> 2); + Symbol->setOther(ELF::STO_MIPS_MICROMIPS); } void MipsTargetELFStreamer::finish() { @@ -527,13 +524,10 @@ void MipsTargetELFStreamer::emitAssignment(MCSymbol *S, const MCExpr *Value) { const auto &RhsSym = cast<MCSymbolELF>( static_cast<const MCSymbolRefExpr *>(Value)->getSymbol()); - if (!(RhsSym.getOther() & (ELF::STO_MIPS_MICROMIPS >> 2))) + if (!(RhsSym.getOther() & ELF::STO_MIPS_MICROMIPS)) 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. - Symbol->setOther(ELF::STO_MIPS_MICROMIPS >> 2); + Symbol->setOther(ELF::STO_MIPS_MICROMIPS); } MCELFStreamer &MipsTargetELFStreamer::getStreamer() { |