diff options
author | Chris Lattner <sabre@nondot.org> | 2003-01-16 02:22:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-01-16 02:22:08 +0000 |
commit | 78d6db5627bdf41ab3ffd96133821647dbc60d53 (patch) | |
tree | 01366d83927fa1f99bef6cb813853babee0d015c /lib/CodeGen/PrologEpilogInserter.cpp | |
parent | f158da2f78b5bedbffddeb15ff19de647954e645 (diff) |
Add assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r-- | lib/CodeGen/PrologEpilogInserter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index 1f3c9e2217..b5715da242 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -186,20 +186,23 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) { // Loop over all of the stack objects, assigning sequential addresses... MachineFrameInfo *FFI = Fn.getFrameInfo(); + unsigned StackAlign = TFI.getStackAlignment(); + // Start at the beginning of the local area... int Offset = TFI.getOffsetOfLocalArea(); for (unsigned i = 0, e = FFI->getObjectIndexEnd(); i != e; ++i) { Offset += FFI->getObjectSize(i); // Allocate Size bytes... unsigned Align = FFI->getObjectAlignment(i); + assert(Align < StackAlign && "Cannot align stack object to higher " + "alignment boundary than the stack itself!"); Offset = (Offset+Align-1)/Align*Align; // Adjust to Alignment boundary... FFI->setObjectOffset(i, -Offset); // Set the computed offset } // Align the final stack pointer offset... - unsigned StackAlign = TFI.getStackAlignment(); - Offset = (Offset+StackAlign-1)/StackAlign*StackAlign; + Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment; // Set the final value of the stack pointer... FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea()); |