summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-11 06:37:11 +0000
committerChris Lattner <sabre@nondot.org>2004-06-11 06:37:11 +0000
commit5888b5d4b19677af709ec5cc48607f2071b25637 (patch)
tree5fade2bafda38d79a330baceb340f3746b96de3f /llvm/lib
parent66f313725cac06a50c38e6d2d60cfb1ba835d48e (diff)
downloadbcm5719-llvm-5888b5d4b19677af709ec5cc48607f2071b25637.tar.gz
bcm5719-llvm-5888b5d4b19677af709ec5cc48607f2071b25637.zip
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. llvm-svn: 14152
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp2
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 221d67b82c6..4dfd7f77826 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -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;
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index e9a998b8739..6157e3fc99f 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -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());
}
OpenPOWER on IntegriCloud