]> granicus.if.org Git - llvm/commitdiff
[InstSimplify] Use llvm::all_of instead of a manual loop. NFC
authorCraig Topper <craig.topper@gmail.com>
Sun, 4 Jun 2017 22:41:56 +0000 (22:41 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 4 Jun 2017 22:41:56 +0000 (22:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304692 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InstructionSimplify.cpp

index 66ac847455cd34cde0adb9e81184c31cdd85e194..c19af1b5ff7a3d4d9c69693eb83713a3bcfe2162 100644 (file)
@@ -3896,9 +3896,8 @@ static Value *SimplifyGEPInst(Type *SrcTy, ArrayRef<Value *> Ops,
   }
 
   // Check to see if this is constant foldable.
-  for (unsigned i = 0, e = Ops.size(); i != e; ++i)
-    if (!isa<Constant>(Ops[i]))
-      return nullptr;
+  if (!all_of(Ops, [](Value *V) { return isa<Constant>(V); }))
+    return nullptr;
 
   return ConstantExpr::getGetElementPtr(SrcTy, cast<Constant>(Ops[0]),
                                         Ops.slice(1));