[llvm] [Linker] Use a range-based for loop (NFC) (PR #97656)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 16:46:26 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/97656

None

>From 9c588fa3f1ac336271d4f67757c6e8f29670e229 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 3 Jul 2024 06:46:54 -0700
Subject: [PATCH] [Linker] Use a range-based for loop (NFC)

---
 llvm/lib/Linker/IRMover.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index 7a5aa0c8047821..ba8f371127764b 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -1489,8 +1489,7 @@ Error IRLinker::linkModuleFlagsMetadata() {
   }
 
   // Check all of the requirements.
-  for (unsigned I = 0, E = Requirements.size(); I != E; ++I) {
-    MDNode *Requirement = Requirements[I];
+  for (MDNode *Requirement : Requirements) {
     MDString *Flag = cast<MDString>(Requirement->getOperand(0));
     Metadata *ReqValue = Requirement->getOperand(1);
 



More information about the llvm-commits mailing list