[llvm] r266472 - [mips] More range-based for loops. NFC.
Vasileios Kalintiris via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 15 13:43:18 PDT 2016
Author: vkalintiris
Date: Fri Apr 15 15:43:17 2016
New Revision: 266472
URL: http://llvm.org/viewvc/llvm-project?rev=266472&view=rev
Log:
[mips] More range-based for loops. NFC.
There are still a couple more inside the MIPS target. I opted for a single
commit in order to avoid spamming the list.
Modified:
llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=266472&r1=266471&r2=266472&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Fri Apr 15 15:43:17 2016
@@ -1053,10 +1053,9 @@ void MipsAsmPrinter::NaClAlignIndirectJu
}
// 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);
}
}
Modified: llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp?rev=266472&r1=266471&r2=266472&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp Fri Apr 15 15:43:17 2016
@@ -165,8 +165,8 @@ void MipsLongBranch::splitMBB(MachineBas
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();
Modified: llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp?rev=266472&r1=266471&r2=266472&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSEFrameLowering.cpp Fri Apr 15 15:43:17 2016
@@ -86,10 +86,10 @@ ExpandPseudo::ExpandPseudo(MachineFuncti
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;
}
More information about the llvm-commits
mailing list