summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-06-30 23:33:35 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-06-30 23:33:35 +0000
commit07acb3e382967e47005f41cb9aa3bea684ed9da2 (patch)
treeb34bc3c7b11c9c6922c16b7899ac601dfb0b1b7d /llvm/lib/CodeGen/LiveVariables.cpp
parent2cbe52b9904ea93bc4d984279542fc10c8bdad28 (diff)
downloadbcm5719-llvm-07acb3e382967e47005f41cb9aa3bea684ed9da2.tar.gz
bcm5719-llvm-07acb3e382967e47005f41cb9aa3bea684ed9da2.zip
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. llvm-svn: 274297
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index e3d854a9ef3..b30d779ad51 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud