[llvm] [Transforms] Use range-based for loops (NFC) (PR #145252)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 22 18:28:40 PDT 2025


================
@@ -250,10 +250,10 @@ CleanupPointerRootUsers(GlobalVariable *GV,
     }
   }
 
-  for (int i = 0, e = Dead.size(); i != e; ++i) {
-    if (IsSafeComputationToRemove(Dead[i].first, GetTLI)) {
-      Dead[i].second->eraseFromParent();
-      Instruction *I = Dead[i].first;
+  for (const auto &Pair : Dead) {
----------------
arsenm wrote:

```suggestion
  for (const auto [I, Store] : Dead) {
```

https://github.com/llvm/llvm-project/pull/145252


More information about the llvm-commits mailing list