[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
Wed Mar 4 19:10:29 PST 2026


================
@@ -89,6 +93,70 @@ class SYCLKernelCallStmt : public Stmt {
   }
 };
 
+// UnresolvedSYCLKernelCallStmt represents an invocation of a SYCL kernel in
+// a dependent context for which lookup of the sycl_kernel_launch identifier
+// cannot be performed. These statements are transformed to SYCLKernelCallStmt
+// during template instantiation.
+class UnresolvedSYCLKernelCallStmt : public Stmt {
+  friend class ASTStmtReader;
+  friend class ASTStmtWriter;
+
+private:
+  Stmt *OriginalStmt = nullptr;
+  // KernelLaunchIdExpr stores an UnresolvedLookupExpr or UnresolvedMemberExpr
+  // corresponding to the SYCL kernel launch function for which a call
+  // will be synthesized during template instantiation.
+  Expr *KernelLaunchIdExpr = nullptr;
+
+  UnresolvedSYCLKernelCallStmt(CompoundStmt *CS, Expr *IdExpr)
+      : Stmt(UnresolvedSYCLKernelCallStmtClass), OriginalStmt(CS),
+        KernelLaunchIdExpr(IdExpr) {}
+
+  /// Set the original statement.
+  void setOriginalStmt(CompoundStmt *CS) { OriginalStmt = CS; }
+
+  /// Set the kernel launch ID expression.
+  void setKernelLaunchIdExpr(Expr *IdExpr) { KernelLaunchIdExpr = IdExpr; }
----------------
tahonermann wrote:

Thank you, yes. Sorry, you raised this issue before in some nearby code and I missed correcting these cases then. Fixed in commit 9fbe2e2b2dfe6d6d7e4cec35b7008b22cc58bed0.

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


More information about the cfe-commits mailing list