diff options
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 33ec14b..460db6f 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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: { @@ -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: { |