Skip to content

[Bitcode] Use range-based for loops (NFC) #103628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3008,8 +3008,8 @@ void ModuleBitcodeWriter::writeInstruction(const Instruction &I,
auto &GEPInst = cast<GetElementPtrInst>(I);
Vals.push_back(getOptimizationFlags(&I));
Vals.push_back(VE.getTypeID(GEPInst.getSourceElementType()));
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i)
pushValueAndType(I.getOperand(i), InstID, Vals);
for (const Value *Op : I.operands())
pushValueAndType(Op, InstID, Vals);
break;
}
case Instruction::ExtractValue: {
Expand Down Expand Up @@ -3112,8 +3112,8 @@ void ModuleBitcodeWriter::writeInstruction(const Instruction &I,
Vals.push_back(VE.getTypeID(I.getOperand(0)->getType()));
// Encode the address operand as relative, but not the basic blocks.
pushValue(I.getOperand(0), InstID, Vals);
for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i)
Vals.push_back(VE.getValueID(I.getOperand(i)));
for (const Value *Op : drop_begin(I.operands()))
Vals.push_back(VE.getValueID(Op));
break;

case Instruction::Invoke: {
Expand Down
Loading