[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 13:34:18 PDT 2024


================
@@ -12154,6 +12154,8 @@ def err_hlsl_missing_semantic_annotation : Error<
 def err_hlsl_init_priority_unsupported : Error<
   "initializer priorities are not supported in HLSL">;
 
+def err_hlsl_mismatching_register_resource_type_and_name: Error<"invalid register name prefix '%0' for register resource type '%1' (expected %select{'t'|'u'|'b'|'t'|'s'}2)">;
----------------
bob80905 wrote:

We need 't' twice, because both TBuffer and SRV Resource classes expect a 't' binding prefix. The diagnostic engine takes in the resource class enum as an integer value to select which binding prefix character to expect in its message, so we need 0 ( the enum val for ResourceClass::SRV) and 3 (the enum val for ResourceClass::TBuffer) to both map to 't'.

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


More information about the cfe-commits mailing list