// first in the list.
MachineBasicBlock *AddedBlocks[] = {PrevStackMBB, McrMBB, GetMBB, AllocMBB,
PostStackMBB};
- const int NbAddedBlocks = sizeof(AddedBlocks) / sizeof(AddedBlocks[0]);
- for (int Idx = 0; Idx < NbAddedBlocks; ++Idx)
- BeforePrologueRegion.insert(AddedBlocks[Idx]);
+ for (MachineBasicBlock *B : AddedBlocks)
+ BeforePrologueRegion.insert(B);
for (const auto &LI : PrologueMBB.liveins()) {
for (MachineBasicBlock *PredBB : BeforePrologueRegion)
// Remove the newly added blocks from the list, since we know
// we do not have to do the following updates for them.
- for (int Idx = 0; Idx < NbAddedBlocks; ++Idx) {
- BeforePrologueRegion.erase(AddedBlocks[Idx]);
- MF.insert(PrologueMBB.getIterator(), AddedBlocks[Idx]);
+ for (MachineBasicBlock *B : AddedBlocks) {
+ BeforePrologueRegion.erase(B);
+ MF.insert(PrologueMBB.getIterator(), B);
}
for (MachineBasicBlock *MBB : BeforePrologueRegion) {