Skip to content

Commit 7aa4726

Browse files
[CodeGen] Use range-based for loops (NFC) (#104536)
1 parent e25f6b0 commit 7aa4726

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,8 @@ static uint64_t getOffsetFromIndices(const User &U, const DataLayout &DL) {
14631463
for (auto Idx : IVI->indices())
14641464
Indices.push_back(ConstantInt::get(Int32Ty, Idx));
14651465
} else {
1466-
for (unsigned i = 1; i < U.getNumOperands(); ++i)
1467-
Indices.push_back(U.getOperand(i));
1466+
for (Value *Op : drop_begin(U.operands()))
1467+
Indices.push_back(Op);
14681468
}
14691469

14701470
return 8 * static_cast<uint64_t>(

llvm/lib/CodeGen/TypePromotion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,8 @@ void IRPromoter::Mutate() {
665665
} else if (auto *Switch = dyn_cast<SwitchInst>(I))
666666
TruncTysMap[I].push_back(Switch->getCondition()->getType());
667667
else {
668-
for (unsigned i = 0; i < I->getNumOperands(); ++i)
669-
TruncTysMap[I].push_back(I->getOperand(i)->getType());
668+
for (const Value *Op : I->operands())
669+
TruncTysMap[I].push_back(Op->getType());
670670
}
671671
}
672672
for (auto *V : Visited) {

0 commit comments

Comments
 (0)