clang 20.0.0git
Public Member Functions | List of all members
clang::SemaSYCL Class Reference

#include "clang/Sema/SemaSYCL.h"

Inheritance diagram for clang::SemaSYCL:
Inheritance graph
[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)
 
- Public Member Functions inherited from clang::SemaBase
 SemaBase (Sema &S)
 
ASTContextgetASTContext () const
 
DiagnosticsEnginegetDiagnostics () const
 
const LangOptionsgetLangOpts () 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.
 
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 24 of file SemaSYCL.cpp.

Member Function Documentation

◆ ActOnUniqueStableNameExpr()

ExprResult SemaSYCL::ActOnUniqueStableNameExpr ( SourceLocation  OpLoc,
SourceLocation  LParen,
SourceLocation  RParen,
ParsedType  ParsedTy 
)

◆ BuildUniqueStableNameExpr()

ExprResult SemaSYCL::BuildUniqueStableNameExpr ( SourceLocation  OpLoc,
SourceLocation  LParen,
SourceLocation  RParen,
TypeSourceInfo TSI 
)

◆ deepTypeCheckForDevice()

void SemaSYCL::deepTypeCheckForDevice ( SourceLocation  UsedAt,
llvm::DenseSet< QualType Visited,
ValueDecl DeclToCheck 
)

◆ 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 26 of file SemaSYCL.cpp.

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

Referenced by deepTypeCheckForDevice().

◆ handleKernelAttr()

void SemaSYCL::handleKernelAttr ( Decl D,
const ParsedAttr AL 
)

◆ handleKernelEntryPointAttr()

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

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