May 2015
Intermediate to advanced
296 pages
5h 10m
English
This recipe talks about frame lowering for target architecture. Frame lowering involves emitting the prologue and epilogue of the function call.
Two functions need to be defined for frame lowering, namely TOYFrameLowering::emitPrologue() and TOYFrameLowering::emitEpilogue().
The following functions are defined in the TOYFrameLowering.cpp file in the lib/Target/TOY folder:
emitPrologue function can be defined as follows:void TOYFrameLowering::emitPrologue(MachineFunction &MF) const { const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); MachineBasicBlock &MBB = MF.front(); MachineBasicBlock::iterator MBBI = MBB.begin(); DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); ...Read now
Unlock full access