diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 5a687f2ad4ea..594ff4f44119 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -2350,7 +2350,7 @@ bool MipsAsmParser::parseSetMips16Directive() { reportParseError("unexpected token in statement"); return false; } - getTargetStreamer().emitDirectiveSetMips16(true); + getTargetStreamer().emitDirectiveSetMips16(); Parser.Lex(); // Consume the EndOfStatement. return false; } diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index 786edf5d35f9..6b57dff2c83d 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -63,12 +63,6 @@ void MipsTargetAsmStreamer::emitDirectiveAbiCalls() { OS << "\t.abicalls\n"; } void MipsTargetAsmStreamer::emitDirectiveOptionPic0() { OS << "\t.option\tpic0\n"; } -void MipsTargetAsmStreamer::emitDirectiveSetMips16(bool IsMips16) { - if (IsMips16) - OS << "\t.set\tmips16\n"; - else - OS << "\t.set\tnomips16\n"; -} // This part is for ELF object output. MipsTargetELFStreamer::MipsTargetELFStreamer() : MicroMipsEnabled(false) {} @@ -105,7 +99,10 @@ void MipsTargetELFStreamer::emitDirectiveSetNoMicroMips() { } void MipsTargetELFStreamer::emitDirectiveSetMips16() { - // FIXME: implement. + MCAssembler &MCA = getStreamer().getAssembler(); + unsigned Flags = MCA.getELFHeaderEFlags(); + Flags |= ELF::EF_MIPS_ARCH_ASE_M16; + MCA.setELFHeaderEFlags(Flags); } void MipsTargetELFStreamer::emitDirectiveSetNoMips16() { @@ -128,13 +125,3 @@ void MipsTargetELFStreamer::emitDirectiveOptionPic0() { Flags &= ~ELF::EF_MIPS_PIC; MCA.setELFHeaderEFlags(Flags); } -void MipsTargetELFStreamer::emitDirectiveSetMips16(bool IsMips16) { - // Don't do anything for .set nomips16 - if (!IsMips16) - return; - - MCAssembler &MCA = getStreamer().getAssembler(); - unsigned Flags = MCA.getELFHeaderEFlags(); - Flags |= ELF::EF_MIPS_ARCH_ASE_M16; - MCA.setELFHeaderEFlags(Flags); -} diff --git a/llvm/lib/Target/Mips/MipsTargetStreamer.h b/llvm/lib/Target/Mips/MipsTargetStreamer.h index 5b7591c80e70..d6d0bf1a8e34 100644 --- a/llvm/lib/Target/Mips/MipsTargetStreamer.h +++ b/llvm/lib/Target/Mips/MipsTargetStreamer.h @@ -26,7 +26,6 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0; virtual void emitDirectiveAbiCalls() = 0; virtual void emitDirectiveOptionPic0() = 0; - virtual void emitDirectiveSetMips16(bool IsMips16) = 0; }; // This part is for ascii assembly output @@ -43,7 +42,6 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol); virtual void emitDirectiveAbiCalls(); virtual void emitDirectiveOptionPic0(); - virtual void emitDirectiveSetMips16(bool IsMips16); }; // This part is for ELF object output @@ -66,7 +64,6 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol); virtual void emitDirectiveAbiCalls(); virtual void emitDirectiveOptionPic0(); - virtual void emitDirectiveSetMips16(bool IsMips16); }; } #endif