-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[clang] Use llvm::any_of (NFC) #141314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20250523_llvm_any_of_clang
May 24, 2025
Merged
[clang] Use llvm::any_of (NFC) #141314
kazutakahirata
merged 1 commit into
llvm:main
from
kazutakahirata:cleanup_20250523_llvm_any_of_clang
May 24, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-clang Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/141314.diff 3 Files Affected:
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,
|
@llvm/pr-subscribers-clang-driver Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/141314.diff 3 Files Affected:
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,
|
arsenm
approved these changes
May 24, 2025
sivan-shani
pushed a commit
to sivan-shani/llvm-project
that referenced
this pull request
Jun 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:driver
'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
clang
Clang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.