X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FXCore%2FXCoreFrameLowering.cpp;h=057822074e5469cdb9bdd29a98efc36c49102d23;hb=11bd0784d935a669865fb8a27561286e05451365;hp=1b91d4231477d4bb44c06a3a80df62daef9bb0ab;hpb=16c29b5f285f375be53dabaa73e3e91107485fe4;p=oota-llvm.git diff --git a/lib/Target/XCore/XCoreFrameLowering.cpp b/lib/Target/XCore/XCoreFrameLowering.cpp index 1b91d423147..057822074e5 100644 --- a/lib/Target/XCore/XCoreFrameLowering.cpp +++ b/lib/Target/XCore/XCoreFrameLowering.cpp @@ -100,6 +100,11 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const { DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); bool FP = hasFP(MF); + bool Nested = MF.getFunction()->getAttributes().hasAttrSomewhere(Attribute::Nest); + + if (Nested) { + loadFromStack(MBB, MBBI, XCore::R11, 0, dl, TII); + } // Work out frame sizes. int FrameSize = MFI->getStackSize(); @@ -208,7 +213,7 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const { void XCoreFrameLowering::emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const { MachineFrameInfo *MFI = MF.getFrameInfo(); - MachineBasicBlock::iterator MBBI = prior(MBB.end()); + MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr(); const XCoreInstrInfo &TII = *static_cast(MF.getTarget().getInstrInfo()); DebugLoc dl = MBBI->getDebugLoc();