use range-based for-loops; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjay Patel 2015-05-21 17:43:26 +00:00
parent 090f1dedf0
commit 430cdabf46

View File

@ -131,8 +131,7 @@ MachineCombiner::getDepth(SmallVectorImpl<MachineInstr *> &InsInstrs,
for (auto *InstrPtr : InsInstrs) { // for each Use
unsigned IDepth = 0;
DEBUG(dbgs() << "NEW INSTR "; InstrPtr->dump(); dbgs() << "\n";);
for (unsigned i = 0, e = InstrPtr->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = InstrPtr->getOperand(i);
for (const MachineOperand &MO : InstrPtr->operands()) {
// Check for virtual register operand.
if (!(MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg())))
continue;
@ -186,8 +185,7 @@ unsigned MachineCombiner::getLatency(MachineInstr *Root, MachineInstr *NewRoot,
// Check each definition in NewRoot and compute the latency
unsigned NewRootLatency = 0;
for (unsigned i = 0, e = NewRoot->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = NewRoot->getOperand(i);
for (const MachineOperand &MO : NewRoot->operands()) {
// Check for virtual register operand.
if (!(MO.isReg() && TargetRegisterInfo::isVirtualRegister(MO.getReg())))
continue;