Skip to content

Commit 3040705

Browse files
[AsmParser] Use range-based for loops (NFC) (#140414)
1 parent 6290cc3 commit 3040705

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7468,8 +7468,8 @@ bool LLParser::parseSwitch(Instruction *&Inst, PerFunctionState &PFS) {
74687468
Lex.Lex(); // Eat the ']'.
74697469

74707470
SwitchInst *SI = SwitchInst::Create(Cond, DefaultBB, Table.size());
7471-
for (unsigned i = 0, e = Table.size(); i != e; ++i)
7472-
SI->addCase(Table[i].first, Table[i].second);
7471+
for (const auto &[OnVal, Dest] : Table)
7472+
SI->addCase(OnVal, Dest);
74737473
Inst = SI;
74747474
return false;
74757475
}
@@ -8164,8 +8164,8 @@ int LLParser::parsePHI(Instruction *&Inst, PerFunctionState &PFS) {
81648164
}
81658165

81668166
PHINode *PN = PHINode::Create(Ty, PHIVals.size());
8167-
for (unsigned i = 0, e = PHIVals.size(); i != e; ++i)
8168-
PN->addIncoming(PHIVals[i].first, PHIVals[i].second);
8167+
for (const auto &[Val, BB] : PHIVals)
8168+
PN->addIncoming(Val, BB);
81698169
Inst = PN;
81708170
return AteExtraComma ? InstExtraComma : InstNormal;
81718171
}

0 commit comments

Comments
 (0)