[clang] [SYCL] SYCL host kernel launch support for the sycl_kernel_entry_point attribute. (PR #152403)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 16:46:02 PST 2026


================
@@ -17,6 +17,22 @@
 using namespace clang;
 using namespace CodeGen;
 
+void CodeGenFunction::EmitSYCLKernelCallStmt(const SYCLKernelCallStmt &S) {
+  if (getLangOpts().SYCLIsDevice) {
+    // A definition for a sycl_kernel_entry_point attributed function should
+    // never be emitted during device compilation; a diagnostic should be
+    // issued for any such ODR-use.
+    assert(false && "Attempt to emit a sycl_kernel_entry_point function during "
----------------
tahonermann wrote:

@erichkeane, that analysis is being done elsewhere and `clang/test/SemaSYCL/sycl-kernel-entry-point-attr-device-odr-use.cpp` validates that a diagnostic is issued. The assert is intended to catch future language changes or missed checks that might somehow allow an ODR-use to escape to code generation. As indicated by the comment, this code should not be reachable, but if it were to be reached, we would definitely want to know about it.

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


More information about the cfe-commits mailing list