From 7f7bbc2fdb833485ac3d865a405fd948e58e8ddb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 11 Jun 2004 06:37:11 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14152 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineFunction.cpp | 2 +- lib/CodeGen/PrologEpilogInserter.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 221d67b..4dfd7f7 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/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/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index e9a998b..6157e3f 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/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()); } -- cgit v1.1