Create proper frame index for FP

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2009-08-03 08:14:30 +00:00
parent 6dde14bc25
commit dd93f5eb71

View File

@ -653,9 +653,11 @@ X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
if (hasFP(MF)) { if (hasFP(MF)) {
assert((TailCallReturnAddrDelta <= 0) && assert((TailCallReturnAddrDelta <= 0) &&
"The Delta should always be zero or negative"); "The Delta should always be zero or negative");
const TargetFrameInfo &TFI = *MF.getTarget().getFrameInfo();
// Create a frame entry for the EBP register that must be saved. // Create a frame entry for the EBP register that must be saved.
int FrameIdx = MFI->CreateFixedObject(SlotSize, int FrameIdx = MFI->CreateFixedObject(SlotSize,
(int)SlotSize * -2+ -(int)SlotSize +
TFI.getOffsetOfLocalArea() +
TailCallReturnAddrDelta); TailCallReturnAddrDelta);
assert(FrameIdx == MFI->getObjectIndexBegin() && assert(FrameIdx == MFI->getObjectIndexBegin() &&
"Slot for EBP register must be last in order to be found!"); "Slot for EBP register must be last in order to be found!");