aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstrBundle.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-02-15 14:46:10 -0800
committerKazu Hirata <kazu@google.com>2021-02-15 14:46:11 -0800
commit22f00f61dd5483a9fdaed3b7592d392c23b3646a (patch)
treefc5fd34098fe592c013fad4ef98334f3ac612368 /llvm/lib/CodeGen/MachineInstrBundle.cpp
parentf0d5898f939fe81e1a3e3e74cb8f04b9028f7e6b (diff)
downloadllvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.zip
llvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.tar.gz
llvm-22f00f61dd5483a9fdaed3b7592d392c23b3646a.tar.bz2
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index 50456e4..6ca9703 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -47,11 +47,9 @@ bool UnpackMachineBundles::runOnMachineFunction(MachineFunction &MF) {
return false;
bool Changed = false;
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
- MachineBasicBlock *MBB = &*I;
-
- for (MachineBasicBlock::instr_iterator MII = MBB->instr_begin(),
- MIE = MBB->instr_end(); MII != MIE; ) {
+ for (MachineBasicBlock &MBB : MF) {
+ for (MachineBasicBlock::instr_iterator MII = MBB.instr_begin(),
+ MIE = MBB.instr_end(); MII != MIE; ) {
MachineInstr *MI = &*MII;
// Remove BUNDLE instruction and the InsideBundle flags from bundled
@@ -256,8 +254,7 @@ llvm::finalizeBundle(MachineBasicBlock &MBB,
/// MachineFunction. Return true if any bundles are finalized.
bool llvm::finalizeBundles(MachineFunction &MF) {
bool Changed = false;
- for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
- MachineBasicBlock &MBB = *I;
+ for (MachineBasicBlock &MBB : MF) {
MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
if (MII == MIE)