Author: Kazu Hirata
Date: 2024-08-09T22:39:19-07:00
New Revision: 7a6acd9844d61e48cbfecbdd1cbbb53080fc7059

URL: 
https://github.com/llvm/llvm-project/commit/7a6acd9844d61e48cbfecbdd1cbbb53080fc7059
DIFF: 
https://github.com/llvm/llvm-project/commit/7a6acd9844d61e48cbfecbdd1cbbb53080fc7059.diff

LOG: [clang] Use llvm::is_contained (NFC) (#102720)

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp
    clang/lib/Format/TokenAnnotator.cpp

Removed: 
    


################################################################################
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

Reply via email to