[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement validation of resource ranges for `RootDescriptors` (PR #140962)

Finn Plummer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 29 12:21:03 PDT 2025


================
@@ -973,6 +1076,8 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
     if (auto *SignatureDecl =
             dyn_cast<HLSLRootSignatureDecl>(R.getFoundDecl())) {
       // Perform validation of constructs here
+      if (handleRootSignatureDecl(SignatureDecl, AL.getLoc()))
+        return;
----------------
inbelic wrote:

I would like feedback here.

This will actually be invoked for each unique `RootSignatureAttr` and not for each unique `RootSignatureDecl`. So if multiple `RootSignatureAttr`s reference the same decl then it will be run redundant times.

Is there a sema "pass" of sorts that will just run on the AST declarations? This would probably be better hooked in there.

Otherwise, we could implement a simple set of Decl * to track which ones have already be validated?

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


More information about the llvm-branch-commits mailing list