[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)
Helena Kotas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Apr 21 12:30:14 PDT 2025
================
@@ -163,11 +163,16 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
SourceLocation SlotLoc = Tok.getLocation();
ArgExprs.push_back(ParseIdentifierLoc());
- // Add numeric_constant for fix-it.
- if (SlotStr.size() == 1 && Tok.is(tok::numeric_constant))
+ if (SlotStr.size() == 1) {
+ if (!Tok.is(tok::numeric_constant)) {
+ Diag(Tok.getLocation(), diag::err_expected) << tok::numeric_constant;
+ SkipUntil(tok::r_paren, StopAtSemi); // skip through )
----------------
hekota wrote:
It is for error state recovery. The SkipUntil call tells the parser to move forward until it finds a closing `)` or ';'. After the code returns the parser will resume parsing tokens of the next statement.
https://github.com/llvm/llvm-project/pull/135287
More information about the llvm-branch-commits
mailing list