Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
authorBob Wilson <bob.wilson@apple.com>
Thu, 24 Sep 2009 16:42:27 +0000 (16:42 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 24 Sep 2009 16:42:27 +0000 (16:42 +0000)
commitc34666ee1871d47dfa4865c7138902dd1b770101
treef77fd6810eb527db843f18c2a84a688def61a4ac
parentf9e0a220fc97df6bcbd545009e036a91f67e9cc4
Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset.  (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size.  It then adds the raw value of the LocalAreaOffset
to the stack size.  For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target.  Change
to subtract the absolute value of the LocalAreaOffset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82693 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/PrologEpilogInserter.cpp