diff options
author | Kazu Hirata <kazu@google.com> | 2024-08-15 20:17:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 20:17:40 -0700 |
commit | 5f01fda4acae211fcf67b603a7c90bc557bc2aff (patch) | |
tree | c69a6d941680a6d11a9e8e2508b543e0b4b74d95 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | c20e7b6fe105e4dffc8ecff77b03a049d327c567 (diff) | |
download | llvm-5f01fda4acae211fcf67b603a7c90bc557bc2aff.zip llvm-5f01fda4acae211fcf67b603a7c90bc557bc2aff.tar.gz llvm-5f01fda4acae211fcf67b603a7c90bc557bc2aff.tar.bz2 |
[Bitcode] Use range-based for loops (NFC) (#104534)
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 460db6f..03d0537 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2820,9 +2820,9 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal, Code = bitc::CST_CODE_CE_GEP_WITH_INRANGE; emitConstantRange(Record, *Range, /*EmitBitWidth=*/true); } - for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) { - Record.push_back(VE.getTypeID(C->getOperand(i)->getType())); - Record.push_back(VE.getValueID(C->getOperand(i))); + for (const Value *Op : CE->operands()) { + Record.push_back(VE.getTypeID(Op->getType())); + Record.push_back(VE.getValueID(Op)); } break; } @@ -3078,8 +3078,8 @@ void ModuleBitcodeWriter::writeInstruction(const Instruction &I, if (!pushValueAndType(I.getOperand(0), InstID, Vals)) AbbrevToUse = FUNCTION_INST_RET_VAL_ABBREV; } else { - for (unsigned i = 0, e = NumOperands; i != e; ++i) - pushValueAndType(I.getOperand(i), InstID, Vals); + for (const Value *Op : I.operands()) + pushValueAndType(Op, InstID, Vals); } } break; |