================
@@ -12816,6 +12816,15 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
     if (!FD->doesThisDeclarationHaveABody())
       return FD->doesDeclarationForceExternallyVisibleDefinition();
 
+    // Function definitions with the sycl_kernel_entry_point attribute are
+    // required during device compilation so that SYCL kernel caller offload
+    // entry points are emitted.
+    if (LangOpts.SYCLIsDevice && FD->hasAttr<SYCLKernelEntryPointAttr>())
+      return true;
+
+    // FIXME: Functions declared with SYCL_EXTERNAL are required during
----------------
tahonermann wrote:

Such a test will have to wait. Filtering to prevent symbols from being emitted 
is not yet in place and there are a few existing tests that are dependent on 
such symbols being emitted during device compilation; presumably 
unintentionally. One of the next two PRs will add such filtering and remove/fix 
such tests. Additionally, an attribute to support `SYCL_EXTERNAL` does not yet 
exist upstream, so there is no syntax that can currently be used to write such 
a test.

https://github.com/llvm/llvm-project/pull/133030
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to