llvm.org GIT mirror llvm / 1943ce9
Print .frame via the target streamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200186 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
3 changed file(s) with 21 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "InstPrinter/MipsInstPrinter.h"
1314 #include "MipsTargetStreamer.h"
1415 #include "MipsMCTargetDesc.h"
1516 #include "llvm/MC/MCELF.h"
8485 OS << "\t.option\tpic0\n";
8586 }
8687
88 void MipsTargetAsmStreamer::emitFrame(unsigned StackReg, unsigned StackSize,
89 unsigned ReturnReg) {
90 OS << "\t.frame\t$"
91 << StringRef(MipsInstPrinter::getRegisterName(StackReg)).lower() << ","
92 << StackSize << ",$"
93 << StringRef(MipsInstPrinter::getRegisterName(ReturnReg)).lower();
94 }
95
8796 // This part is for ELF object output.
8897 MipsTargetELFStreamer::MipsTargetELFStreamer(MCStreamer &S,
8998 const MCSubtargetInfo &STI)
207216 Flags &= ~ELF::EF_MIPS_PIC;
208217 MCA.setELFHeaderEFlags(Flags);
209218 }
219
220 void MipsTargetELFStreamer::emitFrame(unsigned StackReg, unsigned StackSize,
221 unsigned ReturnReg) {
222 // FIXME: implement.
223 }
247247 unsigned returnReg = RI.getRARegister();
248248 unsigned stackSize = MF->getFrameInfo()->getStackSize();
249249
250 if (OutStreamer.hasRawTextSupport())
251 OutStreamer.EmitRawText("\t.frame\t$" +
252 StringRef(MipsInstPrinter::getRegisterName(stackReg)).lower() +
253 "," + Twine(stackSize) + ",$" +
254 StringRef(MipsInstPrinter::getRegisterName(returnReg)).lower());
250 getTargetStreamer().emitFrame(stackReg, stackSize, returnReg);
255251 }
256252
257253 /// Emit Set directives.
3434 virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0;
3535 virtual void emitDirectiveAbiCalls() = 0;
3636 virtual void emitDirectiveOptionPic0() = 0;
37 virtual void emitFrame(unsigned StackReg, unsigned StackSize,
38 unsigned ReturnReg) = 0;
3739 };
3840
3941 // This part is for ascii assembly output
5860 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
5961 virtual void emitDirectiveAbiCalls();
6062 virtual void emitDirectiveOptionPic0();
63 virtual void emitFrame(unsigned StackReg, unsigned StackSize,
64 unsigned ReturnReg);
6165 };
6266
6367 // This part is for ELF object output
8791 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
8892 virtual void emitDirectiveAbiCalls();
8993 virtual void emitDirectiveOptionPic0();
94 virtual void emitFrame(unsigned StackReg, unsigned StackSize,
95 unsigned ReturnReg);
9096 };
9197 }
9298 #endif