[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 20:53:21 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:
The following code doesn't attempt to recover; it ensures that in a non-asserts-enabled build that execution won't continue and potentially run off the end of the function where it could potentially be used in an exploit. The assert is present to increase the likelihood of the problem being found before someone has to debug where a mysterious UD2 (or similar) instruction came from.
https://github.com/llvm/llvm-project/pull/152403
More information about the cfe-commits
mailing list