[llvm] 71ca5c5 - [CodeGen] Use a range-based for loop with llvm::predecessors (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 22:24:25 PST 2024


Author: Kazu Hirata
Date: 2024-01-19T22:24:11-08:00
New Revision: 71ca5c54a2af47fd9c1caab95fe5decd0a0a06d1

URL: https://github.com/llvm/llvm-project/commit/71ca5c54a2af47fd9c1caab95fe5decd0a0a06d1
DIFF: https://github.com/llvm/llvm-project/commit/71ca5c54a2af47fd9c1caab95fe5decd0a0a06d1.diff

LOG: [CodeGen] Use a range-based for loop with llvm::predecessors (NFC)

Added: 
    

Modified: 
    llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index eb372655e5f165..5ed7b020862a7c 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -1851,8 +1851,7 @@ bool AssignmentTrackingLowering::join(
   // invalidated later, we will remove it when we revisit this block. This
   // is essentially the same as initialising all LocKinds and Assignments to
   // an implicit ⊥ value which is the identity value for the join operation.
-  for (auto I = pred_begin(&BB), E = pred_end(&BB); I != E; I++) {
-    const BasicBlock *Pred = *I;
+  for (const BasicBlock *Pred : predecessors(&BB)) {
     if (Visited.count(Pred))
       VisitedPreds.push_back(Pred);
   }


        


More information about the llvm-commits mailing list