[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp PrologEpilogInserter.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jun 11 01:43:01 PDT 2004


Changes in directory llvm/lib/CodeGen:

MachineFunction.cpp updated: 1.59 -> 1.60
PrologEpilogInserter.cpp updated: 1.24 -> 1.25

---
Log message:

Fix fallout from getOffsetOfLocalArea() being negated.  Debugging dumps were being
printed incorrectly, and we were reserving 8 extra bytes of stack space for functions
on X86.


---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.59 llvm/lib/CodeGen/MachineFunction.cpp:1.60
--- llvm/lib/CodeGen/MachineFunction.cpp:1.59	Wed Jun  2 00:56:52 2004
+++ llvm/lib/CodeGen/MachineFunction.cpp	Fri Jun 11 01:37:11 2004
@@ -201,7 +201,7 @@
     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: llvm/lib/CodeGen/PrologEpilogInserter.cpp
diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.24 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.25
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.24	Thu Jun 10 01:23:35 2004
+++ llvm/lib/CodeGen/PrologEpilogInserter.cpp	Fri Jun 11 01:37:11 2004
@@ -206,7 +206,7 @@
   // 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 @@
     Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment;
 
   // Set the final value of the stack pointer...
-  FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea());
+  FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea());
 }
 
 





More information about the llvm-commits mailing list