// Bail out if the contents of the macro are containing keywords that are
// making the macro too complex.
- if (std::find_if(
- MI->tokens().begin(), MI->tokens().end(), [](const Token &T) {
- return T.isOneOf(tok::kw_if, tok::kw_else, tok::kw_switch,
- tok::kw_case, tok::kw_break, tok::kw_while,
- tok::kw_do, tok::kw_for, tok::kw_continue,
- tok::kw_goto, tok::kw_return);
- }) != MI->tokens().end())
+ if (llvm::any_of(MI->tokens(), [](const Token &T) {
+ return T.isOneOf(tok::kw_if, tok::kw_else, tok::kw_switch, tok::kw_case,
+ tok::kw_break, tok::kw_while, tok::kw_do, tok::kw_for,
+ tok::kw_continue, tok::kw_goto, tok::kw_return);
+ }))
return;
for (unsigned ArgNo = 0U; ArgNo < MI->getNumParams(); ++ArgNo) {
std::vector<ClangTidyError> Errors =
runClangTidy(Context, OptionsParser->getCompilations(), PathList, BaseFS,
FixNotes, EnableCheckProfile, ProfilePrefix);
- bool FoundErrors = llvm::find_if(Errors, [](const ClangTidyError &E) {
- return E.DiagLevel == ClangTidyError::Error;
- }) != Errors.end();
+ bool FoundErrors = llvm::any_of(Errors, [](const ClangTidyError &E) {
+ return E.DiagLevel == ClangTidyError::Error;
+ });
// --fix-errors and --fix-notes imply --fix.
FixBehaviour Behaviour = FixNotes ? FB_FixNotes
return true;
auto HasCodeGenSuffix = [](const SymbolLocation &Loc) {
constexpr static const char *CodegenSuffixes[] = {".proto"};
- return std::any_of(std::begin(CodegenSuffixes), std::end(CodegenSuffixes),
- [&](llvm::StringRef Suffix) {
- return llvm::StringRef(Loc.FileURI).endswith(Suffix);
- });
+ return llvm::any_of(CodegenSuffixes, [&](llvm::StringRef Suffix) {
+ return llvm::StringRef(Loc.FileURI).endswith(Suffix);
+ });
};
return HasCodeGenSuffix(L) && !HasCodeGenSuffix(R);
}
&Header.getModule()->Headers[Module::HK_Private],
&Header.getModule()->Headers[Module::HK_PrivateTextual]};
for (auto *Hs : HeaderList)
- IsPrivate |=
- std::find_if(Hs->begin(), Hs->end(), [&](const Module::Header &H) {
- return H.Entry == IncFileEnt;
- }) != Hs->end();
+ IsPrivate |= llvm::any_of(
+ *Hs, [&](const Module::Header &H) { return H.Entry == IncFileEnt; });
assert(IsPrivate && "inconsistent headers and roles");
}
#endif
pty->getKind() == BuiltinType::Overload)) {
auto *OE = dyn_cast<OverloadExpr>(LHSExpr);
if (OE && !OE->hasTemplateKeyword() && !OE->hasExplicitTemplateArgs() &&
- std::any_of(OE->decls_begin(), OE->decls_end(), [](NamedDecl *ND) {
+ llvm::any_of(OE->decls(), [](NamedDecl *ND) {
return isa<FunctionTemplateDecl>(ND);
})) {
Diag(OE->getQualifier() ? OE->getQualifierLoc().getBeginLoc()
continue;
// Cannot make a deduction guide when unparsed arguments are present.
- if (std::any_of(CD->param_begin(), CD->param_end(), [](ParmVarDecl *P) {
+ if (llvm::any_of(CD->parameters(), [](ParmVarDecl *P) {
return !P || P->hasUnparsedDefaultArg();
}))
continue;
bool needsRelocations() {
if (config->extendedConst)
return false;
- return llvm::find_if(internalGotSymbols, [=](Symbol *sym) {
- return !sym->isTLS();
- }) != internalGotSymbols.end();
+ return llvm::any_of(internalGotSymbols,
+ [=](Symbol *sym) { return !sym->isTLS(); });
}
bool needsTLSRelocations() {
- return llvm::find_if(internalGotSymbols, [=](Symbol *sym) {
- return sym->isTLS();
- }) != internalGotSymbols.end();
+ return llvm::any_of(internalGotSymbols,
+ [=](Symbol *sym) { return sym->isTLS(); });
}
void generateRelocationCode(raw_ostream &os, bool TLS) const;
}
bool isPoisoned() const {
- return BBGuards &&
- std::any_of(BBGuards->begin(), BBGuards->end(),
- [](const auto &BB) { return BB.second.isPoisoned(); });
+ return BBGuards && llvm::any_of(*BBGuards, [](const auto &BB) {
+ return BB.second.isPoisoned();
+ });
}
static void printDiff(raw_ostream &out, const CFG &Before,
}
bool FlatAffineValueConstraints::hasValues() const {
- return llvm::find_if(values, [](Optional<Value> var) {
- return var.has_value();
- }) != values.end();
+ return llvm::any_of(
+ values, [](const Optional<Value> &var) { return var.has_value(); });
}
/// Checks if two constraint systems are in the same space, i.e., if they are
// If the predecessor is in a region we used for propagation we can skip it.
auto PredBBInRegion = [PredBB](Region *PR) { return PR->contains(PredBB); };
- if (std::any_of(PropagatedRegions.begin(), PropagatedRegions.end(),
- PredBBInRegion)) {
+ if (llvm::any_of(PropagatedRegions, PredBBInRegion)) {
continue;
}