https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/141314
None >From e86781db12cfd119fb4c00267bba4a57b27a7c9b Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Thu, 22 May 2025 21:10:06 -0700 Subject: [PATCH] [clang] Use llvm::any_of (NFC) --- clang/include/clang/AST/Expr.h | 5 ++--- clang/lib/AST/Type.cpp | 14 +++++++------- clang/lib/Driver/ToolChains/Clang.cpp | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) 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