bruno added a comment.

Hi, nice to see this getting in. Comments inline!



================
Comment at: clang/lib/Sema/SemaDecl.cpp:11720
+    if (!FD->hasAttr<HLSLNumThreadsAttr>()) {
+      Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads) << "Compute";
+      FD->setInvalidDecl();
----------------
You can use `getEnvironmentTypeName` to get the name here.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:11721
+      Diag(FD->getLocation(), diag::err_hlsl_missing_numthreads) << "Compute";
+      FD->setInvalidDecl();
+    }
----------------
Since this is both checking and invalidating a decl, perhaps it should return a 
bool (maybe some asserts in the default case?) and be renamed 
`CheckAndInvalidateHLSLEntryPoint`?


================
Comment at: clang/test/SemaHLSL/entry.hlsl:2
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -x hlsl -Efoo 
-DWITH_NUM_THREADS -ast-dump -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -x hlsl -Efoo  -o - 
%s  -verify
+
----------------
Can you also add a check that rejects `-Efoo` with an error message when the 
language is not `hlsl`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124751/new/

https://reviews.llvm.org/D124751

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to