[llvm] dcb8369 - [Bitcode] Use range-based for loops (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 4 14:57:36 PST 2024
Author: Kazu Hirata
Date: 2024-02-04T14:57:23-08:00
New Revision: dcb83692cdeaf7fb620fd14992848b6cbc94f773
URL: https://github.com/llvm/llvm-project/commit/dcb83692cdeaf7fb620fd14992848b6cbc94f773
DIFF: https://github.com/llvm/llvm-project/commit/dcb83692cdeaf7fb620fd14992848b6cbc94f773.diff
LOG: [Bitcode] Use range-based for loops (NFC)
Added:
Modified:
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index a5fc267b1883b..13be0b0c3307f 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1615,8 +1615,8 @@ void ModuleBitcodeWriter::writeValueAsMetadata(
void ModuleBitcodeWriter::writeMDTuple(const MDTuple *N,
SmallVectorImpl<uint64_t> &Record,
unsigned Abbrev) {
- for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
- Metadata *MD = N->getOperand(i);
+ for (const MDOperand &MDO : N->operands()) {
+ Metadata *MD = MDO;
assert(!(MD && isa<LocalAsMetadata>(MD)) &&
"Unexpected function-local metadata");
Record.push_back(VE.getMetadataOrNullID(MD));
More information about the llvm-commits
mailing list