[llvm] 217f580 - [Analysis] Use a range-based for loop (NFC) (#104445)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 17:59:26 PDT 2024


Author: Kazu Hirata
Date: 2024-08-15T17:59:23-07:00
New Revision: 217f5804ca7fe492910b4a001b06c420e5de1ba6

URL: https://github.com/llvm/llvm-project/commit/217f5804ca7fe492910b4a001b06c420e5de1ba6
DIFF: https://github.com/llvm/llvm-project/commit/217f5804ca7fe492910b4a001b06c420e5de1ba6.diff

LOG: [Analysis] Use a range-based for loop (NFC) (#104445)

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 014a703a000524..9bd61f2996434a 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -6035,8 +6035,8 @@ Value *llvm::isBytewiseValue(Value *V, const DataLayout &DL) {
 
   if (isa<ConstantAggregate>(C)) {
     Value *Val = UndefInt8;
-    for (unsigned I = 0, E = C->getNumOperands(); I != E; ++I)
-      if (!(Val = Merge(Val, isBytewiseValue(C->getOperand(I), DL))))
+    for (Value *Op : C->operands())
+      if (!(Val = Merge(Val, isBytewiseValue(Op, DL))))
         return nullptr;
     return Val;
   }


        


More information about the llvm-commits mailing list