https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/102720
None >From 4f216905a659d4cd323721d9457f19d646b07f9e Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Fri, 9 Aug 2024 21:51:04 -0700 Subject: [PATCH] [clang] Use llvm::is_contained (NFC) --- clang/lib/Driver/Driver.cpp | 2 +- clang/lib/Format/TokenAnnotator.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 8a5f83edfe081e..f4e909b79389bc 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -148,7 +148,7 @@ static std::optional<llvm::Triple> getHIPOffloadTargetTriple(const Driver &D, const ArgList &Args) { if (!Args.hasArg(options::OPT_offload_EQ)) { auto OffloadArchs = Args.getAllArgValues(options::OPT_offload_arch_EQ); - if (llvm::find(OffloadArchs, "amdgcnspirv") != OffloadArchs.cend()) { + if (llvm::is_contained(OffloadArchs, "amdgcnspirv")) { if (OffloadArchs.size() == 1) return llvm::Triple("spirv64-amd-amdhsa"); // Mixing specific & SPIR-V compilation is not supported for now. diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index e1c9f37c6e8dc2..7529c2e77950c5 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1014,8 +1014,7 @@ class AnnotatingParser { // The case next is colon, it is not a operator of identifier. if (!Tok.Next || Tok.Next->is(tok::colon)) return false; - return std::find(Opes.begin(), Opes.end(), Tok.TokenText.str()) != - Opes.end(); + return llvm::is_contained(Opes, Tok.TokenText.str()); } // SimpleValue6 ::= "(" DagArg [DagArgList] ")" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits