aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/AsmParser/LLLexer.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-10-18 17:29:04 -0700
committerKazu Hirata <kazu@google.com>2023-10-18 17:29:04 -0700
commit5b83bd133d705b024bfb34e4941941689456ba8c (patch)
tree983104ba1d192a3e5cdef582ca86658ac425d89e /llvm/lib/AsmParser/LLLexer.cpp
parentcfbf0a500f173b532f64fcb856af2fb0cb7ba725 (diff)
downloadllvm-5b83bd133d705b024bfb34e4941941689456ba8c.zip
llvm-5b83bd133d705b024bfb34e4941941689456ba8c.tar.gz
llvm-5b83bd133d705b024bfb34e4941941689456ba8c.tar.bz2
[llvm] Use StringRef::contains (NFC)
Diffstat (limited to 'llvm/lib/AsmParser/LLLexer.cpp')
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 1402c15..ae46209b 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -279,7 +279,7 @@ lltok::Kind LLLexer::LexDollar() {
if (CurChar == '"') {
StrVal.assign(TokStart + 2, CurPtr - 1);
UnEscapeLexed(StrVal);
- if (StringRef(StrVal).find_first_of(0) != StringRef::npos) {
+ if (StringRef(StrVal).contains(0)) {
Error("Null bytes are not allowed in names");
return lltok::Error;
}
@@ -362,7 +362,7 @@ lltok::Kind LLLexer::LexVar(lltok::Kind Var, lltok::Kind VarID) {
if (CurChar == '"') {
StrVal.assign(TokStart+2, CurPtr-1);
UnEscapeLexed(StrVal);
- if (StringRef(StrVal).find_first_of(0) != StringRef::npos) {
+ if (StringRef(StrVal).contains(0)) {
Error("Null bytes are not allowed in names");
return lltok::Error;
}
@@ -397,7 +397,7 @@ lltok::Kind LLLexer::LexQuote() {
if (CurPtr[0] == ':') {
++CurPtr;
- if (StringRef(StrVal).find_first_of(0) != StringRef::npos) {
+ if (StringRef(StrVal).contains(0)) {
Error("Null bytes are not allowed in names");
kind = lltok::Error;
} else {