Fix fallout from getOffsetOfLocalArea() being negated. Debugging dumps were being
authorChris Lattner <sabre@nondot.org>
Fri, 11 Jun 2004 06:37:11 +0000 (06:37 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 11 Jun 2004 06:37:11 +0000 (06:37 +0000)
printed incorrectly, and we were reserving 8 extra bytes of stack space for functions
on X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14152 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineFunction.cpp
lib/CodeGen/PrologEpilogInserter.cpp

index 221d67b82c68f97f7f1a117c44845d090cb94846..4dfd7f77826d76dcb2aa1eeae51ab78443b4fad1 100644 (file)
@@ -201,7 +201,7 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
     if (i < NumFixedObjects)
       OS << " fixed";
     if (i < NumFixedObjects || SO.SPOffset != -1) {
-      int Off = SO.SPOffset + ValOffset;
+      int Off = SO.SPOffset - ValOffset;
       OS << " at location [SP";
       if (Off > 0)
        OS << "+" << Off;
index e9a998b8739b7139a82f312df8226358b3ae82d1..6157e3fc99f607248f43d4a306c916f423183ddb 100644 (file)
@@ -206,7 +206,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   // of stack growth -- so it's always positive.
   int Offset = TFI.getOffsetOfLocalArea();
   if (StackGrowsDown)
-      Offset = -Offset;
+    Offset = -Offset;
   assert(Offset >= 0 
          && "Local area offset should be in direction of stack growth");
 
@@ -256,7 +256,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
     Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment;
 
   // Set the final value of the stack pointer...
-  FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea());
+  FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea());
 }