Skip to content

Commit a379b22

Browse files
[IR] Use range-based for loops (NFC) (#97575)
1 parent a1bc606 commit a379b22

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/lib/IR/DIBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ void DIBuilder::finalize() {
7979
// list. Use a set to remove the duplicates while we transform the
8080
// TrackingVHs back into Values.
8181
SmallPtrSet<Metadata *, 16> RetainSet;
82-
for (unsigned I = 0, E = AllRetainTypes.size(); I < E; I++)
83-
if (RetainSet.insert(AllRetainTypes[I]).second)
84-
RetainValues.push_back(AllRetainTypes[I]);
82+
for (const TrackingMDNodeRef &N : AllRetainTypes)
83+
if (RetainSet.insert(N).second)
84+
RetainValues.push_back(N);
8585

8686
if (!RetainValues.empty())
8787
CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));

llvm/lib/IR/LegacyPassManager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,8 @@ void PMTopLevelManager::dumpPasses() const {
823823
return;
824824

825825
// Print out the immutable passes
826-
for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) {
827-
ImmutablePasses[i]->dumpPassStructure(0);
828-
}
826+
for (ImmutablePass *Pass : ImmutablePasses)
827+
Pass->dumpPassStructure(0);
829828

830829
// Every class that derives from PMDataManager also derives from Pass
831830
// (sometimes indirectly), but there's no inheritance relationship

0 commit comments

Comments
 (0)