Hopefully a good crack at making debugging work on intel -disable-fp-elim.
authorJim Laskey <jlaskey@mac.com>
Fri, 17 Nov 2006 21:19:15 +0000 (21:19 +0000)
committerJim Laskey <jlaskey@mac.com>
Fri, 17 Nov 2006 21:19:15 +0000 (21:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31830 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineFrameInfo.h
lib/Target/MRegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.cpp

index be6f1b9c42339732eee2f55fecfd1ff7a7bce1b9..1f111abe514fcfa17d86f2201ccd9b878b48ff15 100644 (file)
@@ -112,6 +112,14 @@ class MachineFrameInfo {
   ///
   unsigned StackSize;
   
+  /// OffsetAdjustment - The amount that a frame offset needs to be adjusted to
+  /// have the actual offset from the stack/frame pointer.  The calculation is 
+  /// MFI->getObjectOffset(Index) + StackSize - TFI.getOffsetOfLocalArea() +
+  /// OffsetAdjustment.  If OffsetAdjustment is zero (default) then offsets are
+  /// away from TOS. If OffsetAdjustment == StackSize then offsets are toward
+  /// TOS.
+  int OffsetAdjustment;
+  
   /// MaxAlignment - The prolog/epilog code inserter may process objects 
   /// that require greater alignment than the default alignment the target
   /// provides. To handle this, MaxAlignment is set to the maximum alignment 
@@ -148,7 +156,7 @@ class MachineFrameInfo {
   
 public:
   MachineFrameInfo() {
-    NumFixedObjects = StackSize = MaxAlignment = 0;
+    NumFixedObjects = StackSize = OffsetAdjustment = MaxAlignment = 0;
     HasVarSizedObjects = false;
     HasCalls = false;
     MaxCallFrameSize = 0;
@@ -212,6 +220,14 @@ public:
   /// setStackSize - Set the size of the stack...
   ///
   void setStackSize(unsigned Size) { StackSize = Size; }
+  
+  /// getOffsetAdjustment - Return the correction for frame offsets.
+  ///
+  int getOffsetAdjustment() const { return OffsetAdjustment; }
+  
+  /// setOffsetAdjustment - Set the correction for frame offsets.
+  ///
+  void setOffsetAdjustment(int Adj) { OffsetAdjustment = Adj; }
 
   /// getMaxAlignment - Return the alignment in bytes that this function must be 
   /// aligned to, which is greater than the default stack alignment provided by 
index eb58a3a05998e0179e59a515fb87370f8fde6b12..515ff9af7376049cfd3afd01c38f5016a7999ab9 100644 (file)
@@ -57,7 +57,8 @@ void MRegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
   ML.set(getFrameRegister(MF),
          MFI->getObjectOffset(Index) +
          MFI->getStackSize() -
-         TFI.getOffsetOfLocalArea());
+         TFI.getOffsetOfLocalArea() +
+         MFI->getOffsetAdjustment());
 }
 
 /// getInitialFrameState - Returns a list of machine moves that are assumed
index f061aeed7ee6f3ba2773efd763eba41433842d13..d9057e048c4233b4e95392be426dc8f60337e49e 100644 (file)
@@ -1029,7 +1029,9 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
     // Get the offset of the stack slot for the EBP register... which is
     // guaranteed to be the last slot by processFunctionBeforeFrameFinalized.
     int EBPOffset = MFI->getObjectOffset(MFI->getObjectIndexBegin())+SlotSize;
-
+    // Update the frame offset adjustment.
+    MFI->setOffsetAdjustment(SlotSize-NumBytes);
+    
     // Save EBP into the appropriate stack slot...
     // mov [ESP-<offset>], EBP
     MI = addRegOffset(BuildMI(TII, Is64Bit ? X86::MOV64mr : X86::MOV32mr, 5),