diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index 82e8a968791..5478f0b3fdc 100644 --- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "InstPrinter/MipsInstPrinter.h" #include "MipsTargetStreamer.h" #include "MipsMCTargetDesc.h" #include "llvm/MC/MCELF.h" @@ -85,6 +86,14 @@ void MipsTargetAsmStreamer::emitDirectiveOptionPic0() { OS << "\t.option\tpic0\n"; } +void MipsTargetAsmStreamer::emitFrame(unsigned StackReg, unsigned StackSize, + unsigned ReturnReg) { + OS << "\t.frame\t$" + << StringRef(MipsInstPrinter::getRegisterName(StackReg)).lower() << "," + << StackSize << ",$" + << StringRef(MipsInstPrinter::getRegisterName(ReturnReg)).lower(); +} + // This part is for ELF object output. MipsTargetELFStreamer::MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI) @@ -208,3 +217,8 @@ void MipsTargetELFStreamer::emitDirectiveOptionPic0() { Flags &= ~ELF::EF_MIPS_PIC; MCA.setELFHeaderEFlags(Flags); } + +void MipsTargetELFStreamer::emitFrame(unsigned StackReg, unsigned StackSize, + unsigned ReturnReg) { + // FIXME: implement. +} diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp index ed42365e328..debbb95b392 100644 --- a/lib/Target/Mips/MipsAsmPrinter.cpp +++ b/lib/Target/Mips/MipsAsmPrinter.cpp @@ -248,11 +248,7 @@ void MipsAsmPrinter::emitFrameDirective() { unsigned returnReg = RI.getRARegister(); unsigned stackSize = MF->getFrameInfo()->getStackSize(); - if (OutStreamer.hasRawTextSupport()) - OutStreamer.EmitRawText("\t.frame\t$" + - StringRef(MipsInstPrinter::getRegisterName(stackReg)).lower() + - "," + Twine(stackSize) + ",$" + - StringRef(MipsInstPrinter::getRegisterName(returnReg)).lower()); + getTargetStreamer().emitFrame(stackReg, stackSize, returnReg); } /// Emit Set directives. diff --git a/lib/Target/Mips/MipsTargetStreamer.h b/lib/Target/Mips/MipsTargetStreamer.h index a8a846023d3..a239bd6c11c 100644 --- a/lib/Target/Mips/MipsTargetStreamer.h +++ b/lib/Target/Mips/MipsTargetStreamer.h @@ -35,6 +35,8 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0; virtual void emitDirectiveAbiCalls() = 0; virtual void emitDirectiveOptionPic0() = 0; + virtual void emitFrame(unsigned StackReg, unsigned StackSize, + unsigned ReturnReg) = 0; }; // This part is for ascii assembly output @@ -59,6 +61,8 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol); virtual void emitDirectiveAbiCalls(); virtual void emitDirectiveOptionPic0(); + virtual void emitFrame(unsigned StackReg, unsigned StackSize, + unsigned ReturnReg); }; // This part is for ELF object output @@ -88,6 +92,8 @@ public: virtual void emitDirectiveEnt(const MCSymbol &Symbol); virtual void emitDirectiveAbiCalls(); virtual void emitDirectiveOptionPic0(); + virtual void emitFrame(unsigned StackReg, unsigned StackSize, + unsigned ReturnReg); }; } #endif