Skip to content

Commit

Permalink
CodeGen: use range based for loop
Browse files Browse the repository at this point in the history
Convert a loop to use a range based style loop.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263884 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
compnerd committed Mar 19, 2016
1 parent 649040b commit b6275da
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/CodeGen/PrologEpilogInserter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,13 @@ void PEI::assignCalleeSavedSpillSlots(MachineFunction &F,

// Now that we know which registers need to be saved and restored, allocate
// stack slots for them.
for (std::vector<CalleeSavedInfo>::iterator I = CSI.begin(), E = CSI.end();
I != E; ++I) {
unsigned Reg = I->getReg();
for (auto &CS : CSI) {
unsigned Reg = CS.getReg();
const TargetRegisterClass *RC = RegInfo->getMinimalPhysRegClass(Reg);

int FrameIdx;
if (RegInfo->hasReservedSpillSlot(F, Reg, FrameIdx)) {
I->setFrameIdx(FrameIdx);
CS.setFrameIdx(FrameIdx);
continue;
}

Expand Down Expand Up @@ -359,7 +358,7 @@ void PEI::assignCalleeSavedSpillSlots(MachineFunction &F,
MFI->CreateFixedSpillStackObject(RC->getSize(), FixedSlot->Offset);
}

I->setFrameIdx(FrameIdx);
CS.setFrameIdx(FrameIdx);
}
}

Expand Down

0 comments on commit b6275da

Please sign in to comment.