aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-08-13 23:31:40 -0700
committerGitHub <noreply@github.com>2024-08-13 23:31:40 -0700
commit74c5fa12a8417d12d9c811255ab2b81f98f87e39 (patch)
tree8b2b9f191aa2e52fef02da58c586ba642be7599b /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent0160d817c2c1bd3f32986d9cf8b938e613ac3d12 (diff)
downloadllvm-74c5fa12a8417d12d9c811255ab2b81f98f87e39.zip
llvm-74c5fa12a8417d12d9c811255ab2b81f98f87e39.tar.gz
llvm-74c5fa12a8417d12d9c811255ab2b81f98f87e39.tar.bz2
[Bitcode] Use range-based for loops (NFC) (#103628)
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp8
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: {