Skip to content

Commit ba67061

Browse files
authored
[sycl-post-link][NFC] Use range-based for loop. (#3033)
1 parent 99a85db commit ba67061

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/sycl-post-link/SPIRKernelParamOptInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ SPIRKernelParamOptInfoAnalysis::run(Module &M, ModuleAnalysisManager &AM) {
3636
assert(Ins.second && "duplicate kernel?");
3737
BitVector &ParamDropped = Ins.first->second;
3838

39-
for (unsigned int I = 0; I < MD->getNumOperands(); ++I) {
40-
const auto *MDInt1 = cast<ConstantAsMetadata>(MD->getOperand(I));
39+
for (const MDOperand &MDOp : MD->operands()) {
40+
const auto *MDConst = cast<ConstantAsMetadata>(MDOp);
4141
unsigned ID = static_cast<unsigned>(
42-
cast<ConstantInt>(MDInt1->getValue())->getValue().getZExtValue());
42+
cast<ConstantInt>(MDConst->getValue())->getValue().getZExtValue());
4343
ParamDropped.push_back(ID != 0);
4444
}
4545
}

0 commit comments

Comments
 (0)