Skip to content

Commit 5f01fda

Browse files
[Bitcode] Use range-based for loops (NFC) (#104534)
1 parent c20e7b6 commit 5f01fda

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2820,9 +2820,9 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal,
28202820
Code = bitc::CST_CODE_CE_GEP_WITH_INRANGE;
28212821
emitConstantRange(Record, *Range, /*EmitBitWidth=*/true);
28222822
}
2823-
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
2824-
Record.push_back(VE.getTypeID(C->getOperand(i)->getType()));
2825-
Record.push_back(VE.getValueID(C->getOperand(i)));
2823+
for (const Value *Op : CE->operands()) {
2824+
Record.push_back(VE.getTypeID(Op->getType()));
2825+
Record.push_back(VE.getValueID(Op));
28262826
}
28272827
break;
28282828
}
@@ -3078,8 +3078,8 @@ void ModuleBitcodeWriter::writeInstruction(const Instruction &I,
30783078
if (!pushValueAndType(I.getOperand(0), InstID, Vals))
30793079
AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV;
30803080
} else {
3081-
for (unsigned i = 0, e = NumOperands; i != e; ++i)
3082-
pushValueAndType(I.getOperand(i), InstID, Vals);
3081+
for (const Value *Op : I.operands())
3082+
pushValueAndType(Op, InstID, Vals);
30833083
}
30843084
}
30853085
break;

0 commit comments

Comments
 (0)