summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreFrameInfo.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-11-18 21:19:35 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-11-18 21:19:35 +0000
commit0eecf5d201358ac82a1effe19dc838cc9e086d9f (patch)
treeeefb16517be24fc9a176db39cb560827df68b01e /llvm/lib/Target/XCore/XCoreFrameInfo.cpp
parentc92331b9849845e64140ecbd0508e8db6c3dc1e1 (diff)
downloadbcm5719-llvm-0eecf5d201358ac82a1effe19dc838cc9e086d9f.tar.gz
bcm5719-llvm-0eecf5d201358ac82a1effe19dc838cc9e086d9f.zip
Move hasFP() and few related hooks to TargetFrameInfo.
llvm-svn: 119740
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreFrameInfo.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreFrameInfo.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/XCore/XCoreFrameInfo.cpp b/llvm/lib/Target/XCore/XCoreFrameInfo.cpp
index 0a7f747cf38..ae86c954cd0 100644
--- a/llvm/lib/Target/XCore/XCoreFrameInfo.cpp
+++ b/llvm/lib/Target/XCore/XCoreFrameInfo.cpp
@@ -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;
OpenPOWER on IntegriCloud