clang 22.0.0git
clang::SemaSYCL Class Reference

#include "clang/Sema/SemaSYCL.h"

Inheritance diagram for clang::SemaSYCL:
[legend]

Public Member Functions

 SemaSYCL (Sema &S)
SemaDiagnosticBuilder DiagIfDeviceCode (SourceLocation Loc, unsigned DiagID)
 Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device code".
void deepTypeCheckForDevice (SourceLocation UsedAt, llvm::DenseSet< QualType > Visited, ValueDecl *DeclToCheck)
ExprResult BuildUniqueStableNameExpr (SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, TypeSourceInfo *TSI)
ExprResult ActOnUniqueStableNameExpr (SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, ParsedType ParsedTy)
void handleKernelAttr (Decl *D, const ParsedAttr &AL)
void handleKernelEntryPointAttr (Decl *D, const ParsedAttr &AL)
void CheckSYCLExternalFunctionDecl (FunctionDecl *FD)
void CheckSYCLEntryPointFunctionDecl (FunctionDecl *FD)
StmtResult BuildSYCLKernelCallStmt (FunctionDecl *FD, CompoundStmt *Body)
Public Member Functions inherited from clang::SemaBase
 SemaBase (Sema &S)
ASTContextgetASTContext () const
DiagnosticsEnginegetDiagnostics () const
const LangOptionsgetLangOpts () const
DeclContextgetCurContext () const
SemaDiagnosticBuilder Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
 Emit a diagnostic.
SemaDiagnosticBuilder Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false)
 Emit a partial diagnostic.
SemaDiagnosticBuilder DiagCompat (SourceLocation Loc, unsigned CompatDiagId, bool DeferHint=false)
 Emit a compatibility diagnostic.
PartialDiagnostic PDiag (unsigned DiagID=0)
 Build a partial diagnostic.

Additional Inherited Members

Public Attributes inherited from clang::SemaBase
SemaSemaRef

Detailed Description

Definition at line 27 of file SemaSYCL.h.

Constructor & Destructor Documentation

◆ SemaSYCL()

SemaSYCL::SemaSYCL ( Sema & S)

Definition at line 28 of file SemaSYCL.cpp.

References clang::SemaBase::SemaBase().

Member Function Documentation

◆ ActOnUniqueStableNameExpr()

◆ BuildSYCLKernelCallStmt()

◆ BuildUniqueStableNameExpr()

◆ CheckSYCLEntryPointFunctionDecl()

◆ CheckSYCLExternalFunctionDecl()

◆ deepTypeCheckForDevice()

◆ DiagIfDeviceCode()

Sema::SemaDiagnosticBuilder SemaSYCL::DiagIfDeviceCode ( SourceLocation Loc,
unsigned DiagID )

Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device code".

  • If CurLexicalContext is a kernel function or it is known that the function will be emitted for the device, emits the diagnostics immediately.
  • If CurLexicalContext is a function and we are compiling for the device, but we don't know yet that this function will be codegen'ed for the devive, creates a diagnostic which is emitted if and when we realize that the function will be codegen'ed.

Example usage:

Diagnose __float128 type usage only from SYCL device code if the current target doesn't support it if (!S.Context.getTargetInfo().hasFloat128Type() && S.getLangOpts().SYCLIsDevice) DiagIfDeviceCode(Loc, diag::err_type_unsupported) << "__float128";

Definition at line 30 of file SemaSYCL.cpp.

References clang::Sema::Emitted, clang::SemaBase::getLangOpts(), and clang::SemaBase::SemaRef.

Referenced by deepTypeCheckForDevice().

◆ handleKernelAttr()

◆ handleKernelEntryPointAttr()

void SemaSYCL::handleKernelEntryPointAttr ( Decl * D,
const ParsedAttr & AL )

The documentation for this class was generated from the following files: