Make the legalizer completely non-recursive
[oota-llvm.git] / lib / CodeGen / PrologEpilogInserter.cpp
index 6fcf423f7c848809fd34f61afbf8bbf6c46e3721..e38c740e8dd5aea9778a83305e04b4e2ea090db0 100644 (file)
@@ -165,6 +165,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
   // stack slots for them.
   for (unsigned i = 0, e = RegsToSave.size(); i != e; ++i) {
     unsigned Reg = RegsToSave[i].first;
+    const TargetRegisterClass *RC = RegsToSave[i].second;
 
     // Check to see if this physreg must be spilled to a particular stack slot
     // on this target.
@@ -176,12 +177,10 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
     int FrameIdx;
     if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
       // Nope, just spill it anywhere convenient.
-      FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg)/8,
-                                        RegInfo->getSpillAlignment(Reg)/8);
+      FrameIdx = FFI->CreateStackObject(RC->getSize(), RC->getAlignment());
     } else {
       // Spill it to the stack where we must.
-      FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg)/8,
-                                        FixedSlot->second);
+      FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second);
     }
     StackSlots.push_back(FrameIdx);
   }