================
@@ -72,31 +83,73 @@ class SemaSYCL : public SemaBase {
   void CheckSYCLExternalFunctionDecl(FunctionDecl *FD);
   void CheckSYCLEntryPointFunctionDecl(FunctionDecl *FD);
 
-  /// Builds an expression for the lookup of a 'sycl_kernel_launch' template
-  /// with 'KernelName' as an explicit template argument. Lookup is performed
-  /// as if from the first statement of the body of 'FD' and thus requires
-  /// searching the scopes that exist at parse time. This function therefore
-  /// requires the current semantic context to be the definition of 'FD'. In a
-  /// dependent context, the returned expression will be an 
UnresolvedLookupExpr
-  /// or an UnresolvedMemberExpr. In a non-dependent context, the returned
-  /// expression will be a DeclRefExpr or MemberExpr. If lookup fails, a null
-  /// error result is returned. The resulting expression is intended to be
-  /// passed as the 'LaunchIdExpr' argument in a call to either
-  /// BuildSYCLKernelCallStmt() or BuildUnresolvedSYCLKernelCallStmt() after
-  /// the function body has been parsed.
-  ExprResult BuildSYCLKernelLaunchIdExpr(FunctionDecl *FD, QualType 
KernelName);
-
-  /// Builds a SYCLKernelCallStmt to wrap 'Body' and to be used as the body of
-  /// 'FD'. 'LaunchIdExpr' specifies the lookup result returned by a previous
-  /// call to BuildSYCLKernelLaunchIdExpr().
-  StmtResult BuildSYCLKernelCallStmt(FunctionDecl *FD, CompoundStmt *Body,
-                                     Expr *LaunchIdExpr);
-
-  /// Builds an UnresolvedSYCLKernelCallStmt to wrap 'Body'. 'LaunchIdExpr'
-  /// specifies the lookup result returned by a previous call to
-  /// BuildSYCLKernelLaunchIdExpr().
-  StmtResult BuildUnresolvedSYCLKernelCallStmt(CompoundStmt *Body,
-                                               Expr *LaunchIdExpr);
+  /// GetSYCLKernelInfoClassTemplate builds a class template used to pass SYCL
+  /// kernel information in synthesized calls to SYCL runtime library 
functions.
+  /// The class template has an unspecified name, is an incomplete class
+  /// (explicit specializations are synthesized as needed), built on first 
call,
+  /// and cached for return in subsequent calls.
+  ClassTemplateDecl *GetSYCLKernelInfoClassTemplate();
+
+  /// GetSYCLKernelInfoClassSpecializationType returns a type for the class
+  /// template returned by GetSYCLKernelInfoClassTemplate() specialized for
+  /// 'KNT'. 'KNT' may be a dependent type. If 'KNT' is not a dependent type,
+  /// an explicit specialization declaration for the specialization is
+  /// synthesized and a canonical type returned. A definition for the explicit
+  /// specialization is synthesized when SYCLKernelCallStmt is constructed for
+  /// 'KNT'.
+  QualType GetSYCLKernelInfoClassSpecializationType(QualType KNT);
+
+  /// SYCLKernelCallStmtASTFragments holds portions of the AST used to resolve
+  /// SYCL runtime library functions. In a dependent context, these are used to
+  /// construct an UnresolvedSYCLKernelCallStmt. During template instantiation,
+  /// or in a non-dependent context, these are used to construct a
+  /// SYCLKernelCallStmt.
+  ///
+  /// Implicit calls to the SYCL runtime library may resolve to a function
+  /// template, a member function template, or a call operator of a variable
+  /// template depending on the results of unqualified lookup as performed at
+  /// the beginning of the function body of a sycl_kernel_entry_point 
attributed
+  /// function. Performing that lookup requires the stack of parsing scopes
+  /// active when the definition is parsed. For that reason, these AST portions
+  /// are constructed at the beginning of a function definition and cached in
+  /// Sema::FunctionScopeInfo for later use in synthesized calls to the
+  /// SYCL runtime library after the function body has been parsed.
+  ///
+  /// KernelLaunchIdExpr is an UnresolvedLookupExpr or UnresolvedMemberExpr
+  /// for the SYCL kernel launch function.
+  struct SYCLKernelCallStmtASTFragments {
+    Expr *KernelLaunchIdExpr;
----------------
tahonermann wrote:

There is no actual dependency on the expression being one of the ones mentioned 
in the comment, so I modified the comment (here and in a few other places) to 
avoid mentioning specific expression kinds; the ones that were mentioned 
weren't even a complete list. Done in 
https://github.com/llvm/llvm-project/pull/208958/changes/1b5c185b8fe602ba9677c676b752a8b775231aa9.

https://github.com/llvm/llvm-project/pull/208958
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to