Skip to content

Commit 7a6acd9

Browse files
[clang] Use llvm::is_contained (NFC) (#102720)
1 parent 0c783be commit 7a6acd9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static std::optional<llvm::Triple>
148148
getHIPOffloadTargetTriple(const Driver &D, const ArgList &Args) {
149149
if (!Args.hasArg(options::OPT_offload_EQ)) {
150150
auto OffloadArchs = Args.getAllArgValues(options::OPT_offload_arch_EQ);
151-
if (llvm::find(OffloadArchs, "amdgcnspirv") != OffloadArchs.cend()) {
151+
if (llvm::is_contained(OffloadArchs, "amdgcnspirv")) {
152152
if (OffloadArchs.size() == 1)
153153
return llvm::Triple("spirv64-amd-amdhsa");
154154
// Mixing specific & SPIR-V compilation is not supported for now.

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,7 @@ class AnnotatingParser {
10141014
// The case next is colon, it is not a operator of identifier.
10151015
if (!Tok.Next || Tok.Next->is(tok::colon))
10161016
return false;
1017-
return std::find(Opes.begin(), Opes.end(), Tok.TokenText.str()) !=
1018-
Opes.end();
1017+
return llvm::is_contained(Opes, Tok.TokenText.str());
10191018
}
10201019

10211020
// SimpleValue6 ::= "(" DagArg [DagArgList] ")"

0 commit comments

Comments
 (0)