[clang] [HLSL][RootSignature] Add basic parameter validations of Root Elements (PR #145795)

Finn Plummer via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 11 19:50:23 PDT 2025


================
@@ -1083,6 +1084,90 @@ void SemaHLSL::ActOnFinishRootSignatureDecl(
 
 bool SemaHLSL::handleRootSignatureElements(
     ArrayRef<hlsl::RootSignatureElement> Elements) {
+  // Define some common error handling functions
+  bool HadError = false;
+  auto ReportError = [this, &HadError](SourceLocation Loc, uint32_t LowerBound,
+                                       uint32_t UpperBound) {
+    HadError = true;
+    this->Diag(Loc, diag::err_hlsl_invalid_rootsig_value)
+        << LowerBound << UpperBound;
+  };
+
+  auto ReportFloatError = [this, &HadError](SourceLocation Loc,
----------------
inbelic wrote:

I could but then it would be a method on the `SemaHLSL` class, which I don't think we want to expose as such

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


More information about the cfe-commits mailing list