diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index d1f407259cb6..16384969f68e 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1926,9 +1926,9 @@ def NonNull : InheritableParamAttr { bool isNonNull(unsigned IdxAST) const { if (!args_size()) return true; - return args_end() != std::find_if( - args_begin(), args_end(), - [=](const ParamIdx &Idx) { return Idx.getASTIndex() == IdxAST; }); + return llvm::any_of(args(), [=](const ParamIdx &Idx) { + return Idx.getASTIndex() == IdxAST; + }); } }]; // FIXME: We should merge duplicates into a single nonnull attribute. diff --git a/clang/lib/ExtractAPI/ExtractAPIConsumer.cpp b/clang/lib/ExtractAPI/ExtractAPIConsumer.cpp index a7b0a1ac98a7..bffa66c2d944 100644 --- a/clang/lib/ExtractAPI/ExtractAPIConsumer.cpp +++ b/clang/lib/ExtractAPI/ExtractAPIConsumer.cpp @@ -199,11 +199,11 @@ struct LocationFileChecker { // Try to reduce the include name the same way we tried to include it. bool IsQuoted = false; if (auto IncludeName = getRelativeIncludeName(CI, FileName, &IsQuoted)) - if (llvm::find_if(KnownFiles, - [&IsQuoted, &IncludeName](const auto &KnownFile) { - return KnownFile.first.equals(*IncludeName) && - KnownFile.second == IsQuoted; - }) != KnownFiles.end()) { + if (llvm::any_of(KnownFiles, + [&IsQuoted, &IncludeName](const auto &KnownFile) { + return KnownFile.first.equals(*IncludeName) && + KnownFile.second == IsQuoted; + })) { KnownFileEntries.insert(File); return true; } diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 569b226da923..214332e53c0f 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -8617,10 +8617,10 @@ bool Sema::CheckExplicitlyDefaultedComparison(Scope *S, FunctionDecl *FD, int(1))) return true; - if (llvm::find_if(RD->friends(), [&](const FriendDecl *F) { + if (llvm::none_of(RD->friends(), [&](const FriendDecl *F) { return FD->getCanonicalDecl() == F->getFriendDecl()->getCanonicalDecl(); - }) == RD->friends().end()) { + })) { Diag(FD->getLocation(), diag::err_defaulted_comparison_not_friend) << int(DCK) << int(0) << RD; Diag(RD->getCanonicalDecl()->getLocation(), diag::note_declared_at); diff --git a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp index 528284ca8985..9ee6ef4f9519 100644 --- a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp @@ -480,9 +480,7 @@ static void isOptionContainedIn(const CmdLineOptionList &OptionList, return Opt.OptionName == SuppliedOption; }; - const auto *OptionIt = llvm::find_if(OptionList, SameOptName); - - if (OptionIt == OptionList.end()) { + if (llvm::none_of(OptionList, SameOptName)) { Diags.Report(diag::err_analyzer_checker_option_unknown) << SuppliedChecker << SuppliedOption; return;