Skip to content

Commit 8323335

Browse files
[clang] Use llvm::any_of (NFC) (#141314)
1 parent ef2531b commit 8323335

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5274,9 +5274,8 @@ class InitListExpr : public Expr {
52745274

52755275
/// Determine whether this initializer list contains a designated initializer.
52765276
bool hasDesignatedInit() const {
5277-
return std::any_of(begin(), end(), [](const Stmt *S) {
5278-
return isa<DesignatedInitExpr>(S);
5279-
});
5277+
return llvm::any_of(
5278+
*this, [](const Stmt *S) { return isa<DesignatedInitExpr>(S); });
52805279
}
52815280

52825281
/// If this initializes a union, specifies which field in the

clang/lib/AST/Type.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3797,13 +3797,13 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params,
37973797
ExtraBits.EffectsHaveConditions = true;
37983798
auto *DestConds = getTrailingObjects<EffectConditionExpr>();
37993799
llvm::uninitialized_copy(SrcConds, DestConds);
3800-
assert(std::any_of(SrcConds.begin(), SrcConds.end(),
3801-
[](const EffectConditionExpr &EC) {
3802-
if (const Expr *E = EC.getCondition())
3803-
return E->isTypeDependent() ||
3804-
E->isValueDependent();
3805-
return false;
3806-
}) &&
3800+
assert(llvm::any_of(SrcConds,
3801+
[](const EffectConditionExpr &EC) {
3802+
if (const Expr *E = EC.getCondition())
3803+
return E->isTypeDependent() ||
3804+
E->isValueDependent();
3805+
return false;
3806+
}) &&
38073807
"expected a dependent expression among the conditions");
38083808
addDependence(TypeDependence::DependentInstantiation);
38093809
}

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
16121612
return pauthlr_extension.PosTargetFeature == member;
16131613
};
16141614

1615-
if (std::any_of(CmdArgs.begin(), CmdArgs.end(), isPAuthLR))
1615+
if (llvm::any_of(CmdArgs, isPAuthLR))
16161616
EnablePAuthLR = true;
16171617
}
16181618
if (!llvm::ARM::parseBranchProtection(A->getValue(), PBP, DiagMsg,

0 commit comments

Comments
 (0)