[clang] [HLSL] Implement SV_GroupID semantic (PR #115911)

Zhengxing li via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 24 20:23:40 PST 2024


================
@@ -784,6 +785,17 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL) {
                  HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
 }
 
+void SemaHLSL::handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL) {
+  auto *VD = cast<ValueDecl>(D);
+  if (!isLegalTypeForHLSLSV_ThreadOrGroupID(VD->getType())) {
+    Diag(AL.getLoc(), diag::err_hlsl_attr_invalid_type)
+        << AL << "uint/uint2/uint3";
----------------
lizhengxing wrote:

@llvm-beanz  Done. Renamed the function name to `diagnoseInputIDType`

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


More information about the cfe-commits mailing list