From 9f8549a4a0ce39450ab5f02f6dbc221287f22bd9 Mon Sep 17 00:00:00 2001 From: Toma Tabacu Date: Thu, 16 Apr 2015 13:37:32 +0000 Subject: [PATCH] [mips] [IAS] Preserve microMIPS label marking for objects when assigning. Summary: Previously, this was only happening for functions, but because of .insn, objects can also be marked now. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8007 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235095 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 5 ++--- test/MC/Mips/micromips-alias.s | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index ccc019e86aa..cfd56c6a5cd 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -513,9 +513,8 @@ void MipsTargetELFStreamer::emitAssignment(MCSymbol *Symbol, const MCSymbol &RhsSym = static_cast(Value)->getSymbol(); MCSymbolData &Data = getStreamer().getOrCreateSymbolData(&RhsSym); - uint8_t Type = MCELF::GetType(Data); - if ((Type != ELF::STT_FUNC) || - !(MCELF::getOther(Data) & (ELF::STO_MIPS_MICROMIPS >> 2))) + + if (!(MCELF::getOther(Data) & (ELF::STO_MIPS_MICROMIPS >> 2))) return; MCSymbolData &SymbolData = getStreamer().getOrCreateSymbolData(Symbol); diff --git a/test/MC/Mips/micromips-alias.s b/test/MC/Mips/micromips-alias.s index c0bf4b3a8e3..256b3b68aa6 100644 --- a/test/MC/Mips/micromips-alias.s +++ b/test/MC/Mips/micromips-alias.s @@ -14,3 +14,15 @@ f: nop .globl bar bar = f + +# CHECK: Name: foo +# CHECK: Other: 128 + .type o,@object + .set micromips +o: + .insn + .word 0x00000000 + .set nomicromips + + .globl foo +foo = o -- 2.34.1