Skip to content

Commit

Permalink
[mips] [IAS] Preserve microMIPS label marking for objects when assign…
Browse files Browse the repository at this point in the history
…ing.

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

llvm-svn: 235095
  • Loading branch information
Toma Tabacu committed Apr 16, 2015
1 parent a2f9943 commit 2cc44f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
Expand Up @@ -513,9 +513,8 @@ void MipsTargetELFStreamer::emitAssignment(MCSymbol *Symbol,
const MCSymbol &RhsSym =
static_cast<const MCSymbolRefExpr *>(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);
Expand Down
12 changes: 12 additions & 0 deletions llvm/test/MC/Mips/micromips-alias.s
Expand Up @@ -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

0 comments on commit 2cc44f5

Please sign in to comment.