[clang] [SYCL] SYCL host kernel launch support for the sycl_kernel_entry_point attribute. (PR #152403)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 16 11:19:49 PDT 2025
================
@@ -410,6 +474,36 @@ class OutlinedFunctionDeclBodyInstantiator
ParmDeclMap &MapRef;
};
+OutlinedFunctionDecl *BuildSYCLKernelEntryPointOutline(Sema &SemaRef,
+ FunctionDecl *FD,
+ CompoundStmt *Body) {
+ using ParmDeclMap = OutlinedFunctionDeclBodyInstantiator::ParmDeclMap;
+ ParmDeclMap ParmMap;
+
+ OutlinedFunctionDecl *OFD = OutlinedFunctionDecl::Create(
+ SemaRef.getASTContext(), FD, FD->getNumParams());
+ unsigned i = 0;
+ for (ParmVarDecl *PVD : FD->parameters()) {
+ ImplicitParamDecl *IPD = ImplicitParamDecl::Create(
+ SemaRef.getASTContext(), OFD, SourceLocation(), PVD->getIdentifier(),
+ PVD->getType(), ImplicitParamKind::Other);
+ OFD->setParam(i, IPD);
+ ParmMap[PVD] = IPD;
+ ++i;
+ }
+
+ // FIXME: Diagnose (implicit or explicit) use of CXXThisExpr in potentially
+ // evaluated contexts in the function body. This is not necessarily the
+ // right place to add such a diagnostic.
----------------
tahonermann wrote:
Diagnostics for use of `this` have been completed; resolving this comment.
https://github.com/llvm/llvm-project/pull/152403
More information about the cfe-commits
mailing list