Skip to content

Commit b4eafbc

Browse files
[Bitcode] Use range-based for loops (NFC) (#139421)
1 parent b181f66 commit b4eafbc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,9 +2659,9 @@ void ModuleBitcodeWriter::writeFunctionMetadataAttachment(const Function &F) {
26592659

26602660
Record.push_back(VE.getInstructionID(&I));
26612661

2662-
for (unsigned i = 0, e = MDs.size(); i != e; ++i) {
2663-
Record.push_back(MDs[i].first);
2664-
Record.push_back(VE.getMetadataID(MDs[i].second));
2662+
for (const auto &[ID, MD] : MDs) {
2663+
Record.push_back(ID);
2664+
Record.push_back(VE.getMetadataID(MD));
26652665
}
26662666
Stream.EmitRecord(bitc::METADATA_ATTACHMENT, Record, 0);
26672667
Record.clear();

llvm/lib/Bitcode/Writer/ValueEnumerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ ValueEnumerator::ValueEnumerator(const Module &M,
485485
// Enumerate metadata attached with this instruction.
486486
MDs.clear();
487487
I.getAllMetadataOtherThanDebugLoc(MDs);
488-
for (unsigned i = 0, e = MDs.size(); i != e; ++i)
489-
EnumerateMetadata(&F, MDs[i].second);
488+
for (const auto &MD : MDs)
489+
EnumerateMetadata(&F, MD.second);
490490

491491
// Don't enumerate the location directly -- it has a special record
492492
// type -- but enumerate its operands.

0 commit comments

Comments
 (0)