aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/PrologEpilogInserter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-12-07 02:25:34 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-12-07 02:25:34 +0000
commit7d3223eef2982d7acdfb24facde6605fd9a8b5e8 (patch)
treefc55eabcb700c8b2bbdca36bf6f14cd45ca9b9b9 /lib/CodeGen/PrologEpilogInserter.cpp
parente81561909d128c6e2d8033cb5465a49b2596b26a (diff)
Initialize {Min|Max}CSFrameIndex properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 5a18b920fc..9bcc6f2a43 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -115,6 +115,10 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
int FrameSetupOpcode = RegInfo->getCallFrameSetupOpcode();
int FrameDestroyOpcode = RegInfo->getCallFrameDestroyOpcode();
+ // These are used to keep track the callee-save area. Initialize them.
+ MinCSFrameIndex = INT_MAX;
+ MaxCSFrameIndex = 0;
+
// Early exit for targets which have no callee saved registers and no call
// frame setup/destroy pseudo instructions.
if ((CSRegs == 0 || CSRegs[0] == 0) &&
@@ -174,8 +178,6 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) {
// Now that we know which registers need to be saved and restored, allocate
// stack slots for them.
- MinCSFrameIndex = INT_MAX;
- MaxCSFrameIndex = 0;
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
unsigned Reg = CSI[i].getReg();
const TargetRegisterClass *RC = CSI[i].getRegClass();