[llvm] Use range-based for loops (NFC)

This commit is contained in:
Kazu Hirata
2021-11-20 18:42:10 -08:00
parent 6cc820a3e2
commit f6bce30cf9
9 changed files with 49 additions and 58 deletions

View File

@@ -3996,8 +3996,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
// See if anything took the address of blocks in this function.
auto BBFRI = BasicBlockFwdRefs.find(F);
if (BBFRI == BasicBlockFwdRefs.end()) {
for (unsigned i = 0, e = FunctionBBs.size(); i != e; ++i)
FunctionBBs[i] = BasicBlock::Create(Context, "", F);
for (BasicBlock *&BB : FunctionBBs)
BB = BasicBlock::Create(Context, "", F);
} else {
auto &BBRefs = BBFRI->second;
// Check for invalid basic block references.
@@ -4605,9 +4605,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
CaseVals.push_back(ConstantInt::get(Context, Low));
}
BasicBlock *DestBB = getBasicBlock(Record[CurIdx++]);
for (SmallVector<ConstantInt*, 1>::iterator cvi = CaseVals.begin(),
cve = CaseVals.end(); cvi != cve; ++cvi)
SI->addCase(*cvi, DestBB);
for (ConstantInt *Cst : CaseVals)
SI->addCase(Cst, DestBB);
}
I = SI;
break;