aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-20 02:08:16 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-20 02:08:16 +0000
commit0327863a73a888e4f2ab103067bf4144ff3d462d (patch)
treee8d3ed48c6eb577fdfc171a75e3d04e491583e9b
parent57a2306074989dfd6e1c0d9ddd2b5084f664e2a9 (diff)
Backend is reponsible for aligning the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33388 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86RegisterInfo.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 6f9f3b627c..ac1b4ef0b3 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -997,18 +997,16 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const {
// Get the number of bytes to allocate from the FrameInfo
unsigned NumBytes = MFI->getStackSize();
- if (MFI->hasCalls() || MF.getFrameInfo()->hasVarSizedObjects()) {
+ if (MFI->hasCalls() && !hasFP(MF))
// When we have no frame pointer, we reserve argument space for call sites
// in the function immediately on entry to the current function. This
// eliminates the need for add/sub ESP brackets around call sites.
//
- if (!hasFP(MF))
- NumBytes += MFI->getMaxCallFrameSize();
+ NumBytes += MFI->getMaxCallFrameSize();
- // Round the size to a multiple of the alignment (don't forget the 4/8 byte
- // offset though).
- NumBytes = ((NumBytes+SlotSize)+Align-1)/Align*Align - SlotSize;
- }
+ // Round the size to a multiple of the alignment (don't forget the 4/8 byte
+ // offset though).
+ NumBytes = ((NumBytes+SlotSize)+Align-1)/Align*Align - SlotSize;
// Update frame info to pretend that this is part of the stack...
MFI->setStackSize(NumBytes);