There are still a couple more inside the MIPS target. I opted for a single
commit in order to avoid spamming the list.
llvm-svn: 266472
}
// If basic block address is taken, block can be target of indirect branch.
- for (MachineFunction::iterator MBB = MF.begin(), E = MF.end();
- MBB != E; ++MBB) {
- if (MBB->hasAddressTaken())
- MBB->setAlignment(MIPS_NACL_BUNDLE_ALIGN);
+ for (auto &MBB : MF) {
+ if (MBB.hasAddressTaken())
+ MBB.setAlignment(MIPS_NACL_BUNDLE_ALIGN);
}
}
void MipsLongBranch::initMBBInfo() {
// Split the MBBs if they have two branches. Each basic block should have at
// most one branch after this loop is executed.
- for (MachineFunction::iterator I = MF->begin(), E = MF->end(); I != E;)
- splitMBB(&*I++);
+ for (auto &MBB : *MF)
+ splitMBB(&MBB);
MF->RenumberBlocks();
MBBInfos.clear();
bool ExpandPseudo::expand() {
bool Expanded = false;
- for (MachineFunction::iterator BB = MF.begin(), BBEnd = MF.end();
- BB != BBEnd; ++BB)
- for (Iter I = BB->begin(), End = BB->end(); I != End;)
- Expanded |= expandInstr(*BB, I++);
+ for (auto &MBB : MF) {
+ for (Iter I = MBB.begin(), End = MBB.end(); I != End;)
+ Expanded |= expandInstr(MBB, I++);
+ }
return Expanded;
}