mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Move hasFP() and few related hooks to TargetFrameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -82,6 +82,10 @@ XCoreFrameInfo::XCoreFrameInfo(const XCoreSubtarget &sti)
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
bool XCoreFrameInfo::hasFP(const MachineFunction &MF) const {
|
||||
return DisableFramePointerElim(MF) || MF.getFrameInfo()->hasVarSizedObjects();
|
||||
}
|
||||
|
||||
void XCoreFrameInfo::emitPrologue(MachineFunction &MF) const {
|
||||
MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
|
||||
MachineBasicBlock::iterator MBBI = MBB.begin();
|
||||
@@ -94,7 +98,7 @@ void XCoreFrameInfo::emitPrologue(MachineFunction &MF) const {
|
||||
XCoreFunctionInfo *XFI = MF.getInfo<XCoreFunctionInfo>();
|
||||
DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
|
||||
|
||||
bool FP = RegInfo->hasFP(MF);
|
||||
bool FP = hasFP(MF);
|
||||
|
||||
// Work out frame sizes.
|
||||
int FrameSize = MFI->getStackSize();
|
||||
@@ -204,14 +208,11 @@ void XCoreFrameInfo::emitEpilogue(MachineFunction &MF,
|
||||
MachineBasicBlock &MBB) const {
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
MachineBasicBlock::iterator MBBI = prior(MBB.end());
|
||||
const XCoreRegisterInfo *RegInfo =
|
||||
static_cast<const XCoreRegisterInfo*>(MF.getTarget().getRegisterInfo());
|
||||
const XCoreInstrInfo &TII =
|
||||
*static_cast<const XCoreInstrInfo*>(MF.getTarget().getInstrInfo());
|
||||
DebugLoc dl = MBBI->getDebugLoc();
|
||||
|
||||
bool FP = RegInfo->hasFP(MF);
|
||||
|
||||
bool FP = hasFP(MF);
|
||||
if (FP) {
|
||||
// Restore the stack pointer.
|
||||
unsigned FramePtr = XCore::R10;
|
||||
|
Reference in New Issue
Block a user