[llvm] r255171 - use range-based for loops; NFCI
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 14:45:45 PST 2015
Author: spatel
Date: Wed Dec 9 16:45:45 2015
New Revision: 255171
URL: http://llvm.org/viewvc/llvm-project?rev=255171&view=rev
Log:
use range-based for loops; NFCI
Modified:
llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
Modified: llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp?rev=255171&r1=255170&r2=255171&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineTraceMetrics.cpp Wed Dec 9 16:45:45 2015
@@ -724,13 +724,12 @@ static void updatePhysDepsDownwards(cons
// Update RegUnits to reflect live registers after UseMI.
// First kills.
- for (unsigned i = 0, e = Kills.size(); i != e; ++i)
- for (MCRegUnitIterator Units(Kills[i], TRI); Units.isValid(); ++Units)
+ for (unsigned Kill : Kills)
+ for (MCRegUnitIterator Units(Kill, TRI); Units.isValid(); ++Units)
RegUnits.erase(*Units);
// Second, live defs.
- for (unsigned i = 0, e = LiveDefOps.size(); i != e; ++i) {
- unsigned DefOp = LiveDefOps[i];
+ for (unsigned DefOp : LiveDefOps) {
for (MCRegUnitIterator Units(UseMI->getOperand(DefOp).getReg(), TRI);
Units.isValid(); ++Units) {
LiveRegUnit &LRU = RegUnits[*Units];
@@ -756,8 +755,7 @@ computeCrossBlockCriticalPath(const Trac
assert(TBI.HasValidInstrDepths && "Missing depth info");
assert(TBI.HasValidInstrHeights && "Missing height info");
unsigned MaxLen = 0;
- for (unsigned i = 0, e = TBI.LiveIns.size(); i != e; ++i) {
- const LiveInReg &LIR = TBI.LiveIns[i];
+ for (const LiveInReg &LIR : TBI.LiveIns) {
if (!TargetRegisterInfo::isVirtualRegister(LIR.Reg))
continue;
const MachineInstr *DefMI = MTM.MRI->getVRegDef(LIR.Reg);
More information about the llvm-commits
mailing list