[clang] 8c88a82 - [Driver] Use llvm::any_of (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 19 23:55:08 PDT 2023
Author: Kazu Hirata
Date: 2023-10-19T23:55:02-07:00
New Revision: 8c88a823985a6cb4de9d5c1bba9b03747c75c622
URL: https://github.com/llvm/llvm-project/commit/8c88a823985a6cb4de9d5c1bba9b03747c75c622
DIFF: https://github.com/llvm/llvm-project/commit/8c88a823985a6cb4de9d5c1bba9b03747c75c622.diff
LOG: [Driver] Use llvm::any_of (NFC)
Added:
Modified:
clang/lib/Driver/Multilib.cpp
clang/lib/Driver/ToolChains/Clang.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/Multilib.cpp b/clang/lib/Driver/Multilib.cpp
index ba466af39e2dcaf..48a494d9fa38db5 100644
--- a/clang/lib/Driver/Multilib.cpp
+++ b/clang/lib/Driver/Multilib.cpp
@@ -122,9 +122,8 @@ MultilibSet::expandFlags(const Multilib::flags_list &InFlags) const {
const llvm::Regex Regex(RegexString);
assert(Regex.isValid());
- if (llvm::find_if(InFlags, [&Regex](StringRef F) {
- return Regex.match(F);
- }) != InFlags.end()) {
+ if (llvm::any_of(InFlags,
+ [&Regex](StringRef F) { return Regex.match(F); })) {
Result.insert(M.Flags.begin(), M.Flags.end());
}
}
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 94c184435ae14de..3df2cb694fd918e 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5244,11 +5244,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
auto findMacroDefinition = [&](const std::string &Macro) {
auto MacroDefs = Args.getAllArgValues(options::OPT_D);
- return std::find_if(MacroDefs.begin(), MacroDefs.end(),
- [&](const std::string &M) {
- return M == Macro ||
- M.find(Macro + '=') != std::string::npos;
- }) != MacroDefs.end();
+ return llvm::any_of(MacroDefs, [&](const std::string &M) {
+ return M == Macro || M.find(Macro + '=') != std::string::npos;
+ });
};
// _UNIX03_WITHDRAWN is required for libcxx & porting.
More information about the cfe-commits
mailing list