From c32ece6aeeebc96102353a655e46c92f620cbaa3 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 29 Dec 2015 17:15:22 +0000 Subject: [PATCH] use range-based for-loops; NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256566 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ExecutionDepsFix.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp index deacb233f17..c550008da02 100644 --- a/lib/CodeGen/ExecutionDepsFix.cpp +++ b/lib/CodeGen/ExecutionDepsFix.cpp @@ -760,22 +760,19 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) { enterBasicBlock(MBB); if (SeenUnknownBackEdge) Loops.push_back(MBB); - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; - ++I) - visitInstr(I); + for (MachineInstr &MI : *MBB) + visitInstr(&MI); processUndefReads(MBB); leaveBasicBlock(MBB); } // Visit all the loop blocks again in order to merge DomainValues from // back-edges. - for (unsigned i = 0, e = Loops.size(); i != e; ++i) { - MachineBasicBlock *MBB = Loops[i]; + for (MachineBasicBlock *MBB : Loops) { enterBasicBlock(MBB); - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; - ++I) - if (!I->isDebugValue()) - processDefs(I, false); + for (MachineInstr &MI : *MBB) + if (!MI.isDebugValue()) + processDefs(&MI, false); processUndefReads(MBB); leaveBasicBlock(MBB); } -- 2.34.1