diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-30 23:33:35 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-30 23:33:35 +0000 |
commit | 14a454a0056d9886a2e88c1d7feb614b33a49256 (patch) | |
tree | 32e53b48ca7be286f659ceb3044e9a852e7f3c23 /lib/CodeGen/LiveVariables.cpp | |
parent | 34f70b61181572b5183869b128aeea7d2ccbbe84 (diff) |
CodeGen: Use range-based for in LiveVariables, NFC
Avoid an implicit iterator to pointer conversion in
LiveVariables::runOnBlock by switching to a range-based for.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index e3d854a9ef3..b30d779ad51 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -575,14 +575,12 @@ void LiveVariables::runOnBlock(MachineBasicBlock *MBB, const unsigned NumRegs) { // Loop over all of the instructions, processing them. DistanceMap.clear(); unsigned Dist = 0; - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); - I != E; ++I) { - MachineInstr *MI = I; - if (MI->isDebugValue()) + for (MachineInstr &MI : *MBB) { + if (MI.isDebugValue()) continue; - DistanceMap.insert(std::make_pair(MI, Dist++)); + DistanceMap.insert(std::make_pair(&MI, Dist++)); - runOnInstr(MI, Defs); + runOnInstr(&MI, Defs); } // Handle any virtual assignments from PHI nodes which might be at the |