summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-15 03:07:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-15 03:07:12 +0000
commit26e917cde059275c3257bec3fe895a444fb7909d (patch)
treee96b38b924d225a65d11112533a22c14e54c9f15 /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
parentd4245acf195c47981cd697f2ff3a58f06fe11190 (diff)
downloadbcm5719-llvm-26e917cde059275c3257bec3fe895a444fb7909d.tar.gz
bcm5719-llvm-26e917cde059275c3257bec3fe895a444fb7909d.zip
Only mark functions as micromips.
The GNU as behavior is a bit different and very strange. It will mark any label that contains an instruction. We can implement that, but using the type looks more natural since gas will not mark a function if a .word is used to output the instructions! llvm-svn: 199287
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index 738fa2b204d..d94d33ad24f 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -68,12 +68,17 @@ void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
MipsTargetELFStreamer::MipsTargetELFStreamer() {}
void MipsTargetELFStreamer::emitLabel(MCSymbol *Symbol) {
+ if (!isMicroMipsEnabled())
+ return;
MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Symbol);
+ uint8_t Type = MCELF::GetType(Data);
+ 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.
- if (isMicroMipsEnabled())
- MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2);
+ MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2);
}
MCELFStreamer &MipsTargetELFStreamer::getStreamer() {
OpenPOWER on IntegriCloud