================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to