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

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 13:16:32 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:

This is not the first such case. A few existing examples are listed below. More examples can be found in Serialization.
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/AST/ExternalASTSource.cpp#L121
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/Basic/ProfileList.cpp#L62
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/Basic/SanitizerSpecialCaseList.cpp#L36
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/Basic/SourceManager.cpp#L674
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/CodeGen/CoverageMappingGen.cpp#L1030-L1031
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/CodeGen/CoverageMappingGen.cpp#L1050-L1051
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/CodeGen/LinkInModulesPass.cpp#L30
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp#L277
- https://github.com/llvm/llvm-project/blob/b1320d36339e38b073088fd45013a3c692adb301/clang/lib/Interpreter/Interpreter.cpp#L426-L428

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


More information about the cfe-commits mailing list