Author: Kazu Hirata
Date: 2025-05-23T23:59:38-07:00
New Revision: 8323335496c5249c97344038250ac5db48d4cdd5

URL: 
https://github.com/llvm/llvm-project/commit/8323335496c5249c97344038250ac5db48d4cdd5
DIFF: 
https://github.com/llvm/llvm-project/commit/8323335496c5249c97344038250ac5db48d4cdd5.diff

LOG: [clang] Use llvm::any_of (NFC) (#141314)

Added: 
    

Modified: 
    clang/include/clang/AST/Expr.h
    clang/lib/AST/Type.cpp
    clang/lib/Driver/ToolChains/Clang.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index e9c3c16c87598..c0f88c8cab06f 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -5274,9 +5274,8 @@ class InitListExpr : public Expr {
 
   /// Determine whether this initializer list contains a designated 
initializer.
   bool hasDesignatedInit() const {
-    return std::any_of(begin(), end(), [](const Stmt *S) {
-      return isa<DesignatedInitExpr>(S);
-    });
+    return llvm::any_of(
+        *this, [](const Stmt *S) { return isa<DesignatedInitExpr>(S); });
   }
 
   /// If this initializes a union, specifies which field in the

diff  --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index ccacaf29e001f..df084dd9149a4 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -3797,13 +3797,13 @@ FunctionProtoType::FunctionProtoType(QualType result, 
ArrayRef<QualType> params,
       ExtraBits.EffectsHaveConditions = true;
       auto *DestConds = getTrailingObjects<EffectConditionExpr>();
       llvm::uninitialized_copy(SrcConds, DestConds);
-      assert(std::any_of(SrcConds.begin(), SrcConds.end(),
-                         [](const EffectConditionExpr &EC) {
-                           if (const Expr *E = EC.getCondition())
-                             return E->isTypeDependent() ||
-                                    E->isValueDependent();
-                           return false;
-                         }) &&
+      assert(llvm::any_of(SrcConds,
+                          [](const EffectConditionExpr &EC) {
+                            if (const Expr *E = EC.getCondition())
+                              return E->isTypeDependent() ||
+                                     E->isValueDependent();
+                            return false;
+                          }) &&
              "expected a dependent expression among the conditions");
       addDependence(TypeDependence::DependentInstantiation);
     }

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 2fb6cf8ea2bdc..b0042b86ff421 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1612,7 +1612,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, 
const ArgList &Args,
         return pauthlr_extension.PosTargetFeature == member;
       };
 
-      if (std::any_of(CmdArgs.begin(), CmdArgs.end(), isPAuthLR))
+      if (llvm::any_of(CmdArgs, isPAuthLR))
         EnablePAuthLR = true;
     }
     if (!llvm::ARM::parseBranchProtection(A->getValue(), PBP, DiagMsg,


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to