[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

Sarah Spall via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Apr 14 15:00:48 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 )
----------------
spall wrote:

I'm unfamiliar with the parsing code so this might be a dumb question, but why do you SkipUntil here? What happens after the code returns?

https://github.com/llvm/llvm-project/pull/135287


More information about the llvm-branch-commits mailing list