[clang] [SYCL] The sycl_kernel_entry_point attribute. (PR #111389)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 09:51:39 PDT 2024


================
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
   if (LangOpts.OpenMP)
     OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
 
+  if (LangOpts.isSYCL() && NewFD->hasAttr<SYCLKernelEntryPointAttr>() &&
+      !NewFD->isInvalidDecl() && !NewFD->isDependentContext())
----------------
tahonermann wrote:

That is exactly my concern and why I want such mistakes to be caught at compile-time. This is the motivation for ensuring that an incorrect registration fails compilation even if a check or diagnostic is missed somewhere.

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


More information about the cfe-commits mailing list