================
@@ -71,31 +82,69 @@ 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 for lookup
+ /// of SYCL runtime library functions. These are constructed at the beginning
+ /// of a function definition and later used in synthesized calls to the
+ /// SYCL runtime library. 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.
+ ///
+ /// KernelInfoType is the type to be passed as the explicit template argument
+ /// to SYCL runtime libraries.
+ ///
+ /// KernelLaunchIdExpr is an UnresolvedLookupExpr or UnresolvedMemberExpr
----------------
tahonermann wrote:
It turns out that the comment was not accurate. If lookup finds a variable
template, then the lookup will be resolved. Erich also raised some questions
about the explicit list of expression kinds, so I reworked this (and some
other) comments to avoid providing more details than required.
https://github.com/llvm/llvm-project/pull/208958
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits