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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 09:57:48 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())
----------------
erichkeane wrote:

At this point though, you're not actually catching anything at compile-time.  All you're doing is asserting at runtime if someone forgets one of these tags, rather than just preventing us from having to worry about it.  

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


More information about the cfe-commits mailing list