diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-18 20:30:12 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:11:55 +0000 |
commit | 5f757f3ff9144b609b3c433dfd370cc6bdc191ad (patch) | |
tree | 1b4e980b866cd26a00af34c0a653eb640bd09caf /contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp | |
parent | 3e1c8a35f741a5d114d0ba670b15191355711fe9 (diff) | |
parent | 312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp b/contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp index 466bdebc001f..c8da3efbb68a 100644 --- a/contrib/llvm-project/llvm/lib/AsmParser/LLLexer.cpp +++ b/contrib/llvm-project/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 { @@ -564,11 +564,14 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(nuw); KEYWORD(nsw); KEYWORD(exact); + KEYWORD(disjoint); KEYWORD(inbounds); + KEYWORD(nneg); KEYWORD(inrange); KEYWORD(addrspace); KEYWORD(section); KEYWORD(partition); + KEYWORD(code_model); KEYWORD(alias); KEYWORD(ifunc); KEYWORD(module); @@ -609,7 +612,6 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(x86_64_sysvcc); KEYWORD(win64cc); KEYWORD(x86_regcallcc); - KEYWORD(webkit_jscc); KEYWORD(swiftcc); KEYWORD(swifttailcc); KEYWORD(anyregcc); @@ -632,6 +634,8 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(amdgpu_kernel); KEYWORD(amdgpu_gfx); KEYWORD(tailcc); + KEYWORD(m68k_rtdcc); + KEYWORD(graalcc); KEYWORD(cc); KEYWORD(c); @@ -694,6 +698,7 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(uinc_wrap); KEYWORD(udec_wrap); + KEYWORD(splat); KEYWORD(vscale); KEYWORD(x); KEYWORD(blockaddress); @@ -901,7 +906,7 @@ lltok::Kind LLLexer::LexIdentifier() { #define DWKEYWORD(TYPE, TOKEN) \ do { \ - if (Keyword.startswith("DW_" #TYPE "_")) { \ + if (Keyword.starts_with("DW_" #TYPE "_")) { \ StrVal.assign(Keyword.begin(), Keyword.end()); \ return lltok::TOKEN; \ } \ @@ -917,17 +922,17 @@ lltok::Kind LLLexer::LexIdentifier() { #undef DWKEYWORD - if (Keyword.startswith("DIFlag")) { + if (Keyword.starts_with("DIFlag")) { StrVal.assign(Keyword.begin(), Keyword.end()); return lltok::DIFlag; } - if (Keyword.startswith("DISPFlag")) { + if (Keyword.starts_with("DISPFlag")) { StrVal.assign(Keyword.begin(), Keyword.end()); return lltok::DISPFlag; } - if (Keyword.startswith("CSK_")) { + if (Keyword.starts_with("CSK_")) { StrVal.assign(Keyword.begin(), Keyword.end()); return lltok::ChecksumKind; } |