aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-07-03 12:53:06 -0700
committerGitHub <noreply@github.com>2024-07-03 12:53:06 -0700
commita379b2260fc3bada0c11a6a1cd7891a1a6e1fb99 (patch)
tree224d2dedfee1587ee932d41ef82f3593fd55c384 /llvm/lib/IR/DIBuilder.cpp
parenta1bc606b5fb9a91eb16fc0c012aa785323788c90 (diff)
downloadllvm-a379b2260fc3bada0c11a6a1cd7891a1a6e1fb99.zip
llvm-a379b2260fc3bada0c11a6a1cd7891a1a6e1fb99.tar.gz
llvm-a379b2260fc3bada0c11a6a1cd7891a1a6e1fb99.tar.bz2
[IR] Use range-based for loops (NFC) (#97575)
Diffstat (limited to 'llvm/lib/IR/DIBuilder.cpp')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index f39149a..30b79b6 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -79,9 +79,9 @@ void DIBuilder::finalize() {
// list. Use a set to remove the duplicates while we transform the
// TrackingVHs back into Values.
SmallPtrSet<Metadata *, 16> RetainSet;
- for (unsigned I = 0, E = AllRetainTypes.size(); I < E; I++)
- if (RetainSet.insert(AllRetainTypes[I]).second)
- RetainValues.push_back(AllRetainTypes[I]);
+ for (const TrackingMDNodeRef &N : AllRetainTypes)
+ if (RetainSet.insert(N).second)
+ RetainValues.push_back(N);
if (!RetainValues.empty())
CUNode->replaceRetainedTypes(MDTuple::get(VMContext, RetainValues));