Add support for trampolines on the XCore.
[oota-llvm.git] / lib / Target / XCore / XCoreFrameLowering.cpp
index 0645c1654a8e9709b787e9ab13d528facadf810a..057822074e5469cdb9bdd29a98efc36c49102d23 100644 (file)
@@ -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();