34 "Device diagnostics Should only be issued during device compilation");
35 SemaDiagnosticBuilder::Kind DiagKind = SemaDiagnosticBuilder::K_Nop;
41 DiagKind = SemaDiagnosticBuilder::K_ImmediateWithCallStack;
45 DiagKind = SemaDiagnosticBuilder::K_Deferred;
48 llvm_unreachable(
"OMPDiscarded unexpected in SYCL device compilation");
50 llvm_unreachable(
"CUDADiscarded unexpected in SYCL device compilation");
58 return CAT->isZeroSize();
63 llvm::DenseSet<QualType> Visited,
66 "Should only be called during SYCL compilation");
69 bool NeedToEmitNotes =
true;
72 bool ErrorFound =
false;
79 if (NeedToEmitNotes) {
80 if (
auto *FD = dyn_cast<FieldDecl>(D))
82 diag::note_illegal_field_declared_here)
83 << FD->getType()->isPointerType() << FD->getType();
94 StackForRecursion.push_back(DeclToCheck);
98 History.push_back(
nullptr);
103 assert(!History.empty());
110 if (!Visited.insert(NextTy).second)
113 auto EmitHistory = [&]() {
115 for (uint64_t Index = 1; Index < History.size(); ++Index) {
117 diag::note_within_field_of_type)
118 << History[Index]->getType();
122 if (Check(NextTy,
Next)) {
125 NeedToEmitNotes =
false;
136 if (Check(NextTy,
Next)) {
139 NeedToEmitNotes =
false;
144 if (
auto *NextFD = dyn_cast<FieldDecl>(
Next))
145 History.push_back(NextFD);
148 StackForRecursion.push_back(
nullptr);
149 llvm::append_range(StackForRecursion, RecDecl->fields());
151 }
while (!StackForRecursion.empty());
181 assert(FT &&
"Function template is expected");
185 if (TL->
size() < 2) {
186 Diag(FT->
getLocation(), diag::warn_sycl_kernel_num_of_template_params);
191 for (
unsigned I = 0; I < 2; ++I) {
195 diag::warn_sycl_kernel_invalid_template_param_type);
202 Diag(FT->
getLocation(), diag::warn_sycl_kernel_num_of_function_params);
219 (void)
SemaRef.GetTypeFromParser(PT, &TSI);
220 assert(TSI &&
"no type source info for attribute argument");
222 SYCLKernelEntryPointAttr(
SemaRef.Context, AL, TSI));
227 "Should only be called during SYCL device compilation");
232 if (
const auto *SKEPAttr = FD->getAttr<SYCLKernelEntryPointAttr>()) {
233 if (
SemaRef.currentEvaluationContext().isPotentiallyEvaluated()) {
251 if (
const TagType *TT = dyn_cast<TagType>(T))
252 Loc = TT->getDecl()->getLocation();
253 else if (
const auto *ObjCIT = dyn_cast<ObjCInterfaceType>(T))
254 Loc = ObjCIT->getDecl()->getLocation();
271 S.
Diag(Loc, diag::warn_sycl_kernel_name_not_a_class_type) << KernelName;
274 S.
Diag(DeclTypeLoc, diag::note_entity_declared_at) << KernelName;
282 const auto *SEAttr = FD->
getAttr<SYCLExternalAttr>();
283 assert(SEAttr &&
"Missing sycl_external attribute");
288 Diag(SEAttr->getLocation(), diag::err_sycl_external_invalid_linkage)
292 Diag(SEAttr->getLocation(),
293 diag::err_sycl_external_invalid_deleted_function)
301 SYCLKernelEntryPointAttr *SKEPAttr =
nullptr;
302 for (
auto *SAI : FD->
specific_attrs<SYCLKernelEntryPointAttr>()) {
308 SKEPAttr->getKernelName())) {
309 Diag(SAI->getLocation(), diag::err_sycl_entry_point_invalid_redeclaration)
310 << SKEPAttr << SAI->getKernelName() << SKEPAttr->getKernelName();
311 Diag(SKEPAttr->getLocation(), diag::note_previous_attribute);
312 SAI->setInvalidAttr();
314 Diag(SAI->getLocation(),
315 diag::warn_sycl_entry_point_redundant_declaration)
317 Diag(SKEPAttr->getLocation(), diag::note_previous_attribute);
320 assert(SKEPAttr &&
"Missing sycl_kernel_entry_point attribute");
323 if (!SKEPAttr->getKernelName()->isDependentType() &&
325 SKEPAttr->getKernelName()))
326 SKEPAttr->setInvalidAttr();
332 const auto *PrevSKEPAttr = PrevFD->
getAttr<SYCLKernelEntryPointAttr>();
333 if (PrevSKEPAttr && !PrevSKEPAttr->isInvalidAttr()) {
335 PrevSKEPAttr->getKernelName())) {
336 Diag(SKEPAttr->getLocation(),
337 diag::err_sycl_entry_point_invalid_redeclaration)
338 << SKEPAttr << SKEPAttr->getKernelName()
339 << PrevSKEPAttr->getKernelName();
340 Diag(PrevSKEPAttr->getLocation(), diag::note_previous_decl) << PrevFD;
341 SKEPAttr->setInvalidAttr();
347 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
348 << SKEPAttr << diag::InvalidSKEPReason::Constructor;
349 SKEPAttr->setInvalidAttr();
352 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
353 << SKEPAttr << diag::InvalidSKEPReason::Destructor;
354 SKEPAttr->setInvalidAttr();
356 if (
const auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
357 if (MD->isExplicitObjectMemberFunction()) {
358 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
359 << SKEPAttr << diag::InvalidSKEPReason::ExplicitObjectFn;
360 SKEPAttr->setInvalidAttr();
365 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
366 << SKEPAttr << diag::InvalidSKEPReason::VariadicFn;
367 SKEPAttr->setInvalidAttr();
371 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
372 << SKEPAttr << diag::InvalidSKEPReason::DefaultedFn;
373 SKEPAttr->setInvalidAttr();
375 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
376 << SKEPAttr << diag::InvalidSKEPReason::DeletedFn;
377 SKEPAttr->setInvalidAttr();
381 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
382 << SKEPAttr << diag::InvalidSKEPReason::ConstevalFn;
383 SKEPAttr->setInvalidAttr();
385 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
386 << SKEPAttr << diag::InvalidSKEPReason::ConstexprFn;
387 SKEPAttr->setInvalidAttr();
391 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
392 << SKEPAttr << diag::InvalidSKEPReason::NoreturnFn;
393 SKEPAttr->setInvalidAttr();
397 Diag(SKEPAttr->getLocation(),
398 diag::err_sycl_entry_point_deduced_return_type)
400 SKEPAttr->setInvalidAttr();
403 Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_return_type)
405 SKEPAttr->setInvalidAttr();
409 !SKEPAttr->isInvalidAttr()) {
419 diag::note_previous_declaration);
420 SKEPAttr->setInvalidAttr();
432 assert(
SemaRef.CurContext == FD &&
"The current declaration context does not "
433 "match the requested function context");
444 Ctx.
Idents.
get(
"sycl_kernel_launch", tok::TokenKind::identifier);
479 IdExpr =
SemaRef.BuildPossibleImplicitMemberExpr(
508 assert(SemaRef.
CurContext == FD &&
"The current declaration context does not "
509 "match the requested function context");
516 KernelName.size() + 1);
519 Expr *KernelNameExpr =
521 false, KernelNameArrayTy, Loc);
522 Args.push_back(KernelNameExpr);
527 QualType ParamType = PVD->getOriginalType().getNonReferenceType();
531 if (!PVD->getType()->isLValueReferenceType())
537 Args.push_back(E.
get());
560 if (BuildSYCLKernelLaunchCallArgs(SemaRef, FD, SKI, Args, Loc))
592class OutlinedFunctionDeclBodyInstantiator
593 :
public TreeTransform<OutlinedFunctionDeclBodyInstantiator> {
595 using ParmDeclMap = llvm::DenseMap<ParmVarDecl *, VarDecl *>;
597 OutlinedFunctionDeclBodyInstantiator(Sema &S, ParmDeclMap &M,
599 : TreeTransform<OutlinedFunctionDeclBodyInstantiator>(S), SemaRef(S),
603 bool AlwaysRebuild() {
return true; }
606 ExprResult TransformDeclRefExpr(DeclRefExpr *DRE) {
607 const ParmVarDecl *PVD = dyn_cast<ParmVarDecl>(DRE->
getDecl());
609 ParmDeclMap::iterator I = MapRef.find(PVD);
610 if (I != MapRef.end()) {
611 VarDecl *VD = I->second;
627 ExprResult TransformCXXThisExpr(CXXThisExpr *CTE) {
629 SemaRef.
Diag(CTE->
getExprLoc(), diag::err_sycl_entry_point_invalid_this)
631 << FD->
getAttr<SYCLKernelEntryPointAttr>();
645 using ParmDeclMap = OutlinedFunctionDeclBodyInstantiator::ParmDeclMap;
660 OutlinedFunctionDeclBodyInstantiator OFDBodyInstantiator(SemaRef, ParmMap,
662 Stmt *OFDBody = OFDBodyInstantiator.TransformStmt(Body).get();
670 SemaSYCL &SemaSYCLRef;
673 llvm::PointerUnion<
const ParmVarDecl *,
const CXXBaseSpecifier *,
675 SmallVector<ObjectAccess, 4> ObjectAccessPath;
677 void emitObjectAccessPathNotes() {
678 for (
auto Parent : llvm::reverse(ObjectAccessPath)) {
679 if (
auto *FD = Parent.dyn_cast<
const FieldDecl *>()) {
686 diag::note_within_field_of_type)
689 }
else if (
auto *BS = Parent.dyn_cast<
const CXXBaseSpecifier *>()) {
690 CXXRecordDecl *RD = BS->getType()->getAsCXXRecordDecl();
692 SemaSYCLRef.
Diag(BS->getBeginLoc(), diag::note_within_base_of_type)
696 SemaSYCLRef.
Diag(Param->getBeginLoc(), diag::note_within_param_of_type)
697 << Param << Param->getType();
703 KernelParamsChecker(SemaSYCL &SR, SourceLocation Loc)
704 : ConstSubobjectVisitor<KernelParamsChecker>(SR.getASTContext()),
707 void checkParameter(
const ParmVarDecl *PVD) {
708 ObjectAccessPath.push_back(PVD);
710 if (checkType(PVD->
getType())) {
715 ObjectAccessPath.pop_back();
716 assert(ObjectAccessPath.empty());
719 bool visitBaseSpecifierPre(
const CXXBaseSpecifier *BS) {
720 ObjectAccessPath.push_back(BS);
721 return checkType(BS->
getType());
724 bool visitFieldDeclPre(
const FieldDecl *FD) {
725 ObjectAccessPath.push_back(FD);
726 return checkType(FD->
getType());
730 bool checkType(QualType Ty) {
732 auto DirectParent = ObjectAccessPath.back();
742 SemaSYCLRef.
Diag(DirectFieldParent->getLocation(),
743 diag::err_bad_kernel_param_type)
744 << DirectFieldParent->getType();
745 emitObjectAccessPathNotes();
757 void visitFieldDeclPost(
const FieldDecl *FD) { ObjectAccessPath.pop_back(); }
758 void visitBaseSpecifierPost(
const CXXBaseSpecifier *BS) {
759 ObjectAccessPath.pop_back();
766 KernelParamsChecker KAC(SemaSYCLRef, FD->
getLocation());
768 KAC.checkParameter(Param);
769 return KAC.isInvalid();
776 Expr *LaunchIdExpr) {
783 assert(
SemaRef.CurContext == FD &&
"The current declaration context does not "
784 "match the requested function context");
786 const auto *SKEPAttr = FD->
getAttr<SYCLKernelEntryPointAttr>();
787 assert(SKEPAttr &&
"Missing sycl_kernel_entry_point attribute");
788 assert(!SKEPAttr->isInvalidAttr() &&
789 "sycl_kernel_entry_point attribute is invalid");
796 "SYCL kernel name conflict");
797 if (verifyKernelParams(FD, *
this))
802 BuildSYCLKernelEntryPointOutline(
SemaRef, FD, Body);
809 BuildSYCLKernelLaunchCallStmt(
SemaRef, FD, &SKI, LaunchIdExpr, Loc);
820 Expr *LaunchIdExpr) {
Defines the Diagnostic-related interfaces.
This file declares types used to describe SYCL kernels.
static bool isZeroSizedArray(const ConstantArrayType *CAT)
static SourceLocation SourceLocationForUserDeclaredType(QualType QT)
static bool CheckSYCLKernelName(Sema &S, SourceLocation Loc, QualType KernelName)
This file declares semantic analysis for SYCL constructs.
static bool isInvalid(LocType Loc, bool *Invalid)
This file defines SYCL AST classes used to represent calls to SYCL kernels.
Allows QualTypes to be sorted and hence used in maps and sets.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, const Expr *SizeExpr, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type.
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
void registerSYCLEntryPointFunction(FunctionDecl *FD)
Generates and stores SYCL kernel metadata for the provided SYCL kernel entry point function.
const SYCLKernelInfo & getSYCLKernelInfo(QualType T) const
Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corre...
QualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
static bool hasSameUnqualifiedType(QualType T1, QualType T2)
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
const SYCLKernelInfo * findSYCLKernelInfo(QualType T) const
Returns a pointer to the metadata generated from the corresponding SYCLkernel entry point if the prov...
QualType getType() const
Retrieves the type of the base class.
bool isLambda() const
Determine whether this class describes a lambda function object.
const LambdaCapture * getCapture(unsigned I) const
Represents a C++ nested-name-specifier or a global scope specifier.
QualType withConst() const
Retrieves a version of this type with const applied.
CompoundStmt - This represents a group of statements like { stmt stmt }.
SourceLocation getLBracLoc() const
static CompoundStmt * Create(const ASTContext &C, ArrayRef< Stmt * > Stmts, FPOptionsOverride FPFeatures, SourceLocation LB, SourceLocation RB)
DeclContext * getParent()
getParent - Returns the containing DeclContext.
DeclarationNameInfo getNameInfo() const
SourceLocation getTemplateKeywordLoc() const
Retrieve the location of the template keyword preceding this name, if any.
static DeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *D, bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc, QualType T, ExprValueKind VK, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr, NonOdrUseReason NOUR=NOUR_None)
NestedNameSpecifierLoc getQualifierLoc() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name,...
Decl - This represents one declaration (or definition), e.g.
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
bool isInvalidDecl() const
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
SourceLocation getLocation() const
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
This represents one expression.
bool isImplicitCXXThis() const
Whether this expression is an implicit reference to 'this' in C++.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Represents difference between two FPOptions values.
Represents a function declaration or definition.
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
bool isNoReturn() const
Determines whether this function is known to be 'noreturn', through an attribute on its declaration o...
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
bool hasPrototype() const
Whether this function has a prototype, either because one was explicitly written or because it was "i...
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool isVariadic() const
Whether this function is variadic.
bool isDeleted() const
Whether this function has been deleted.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
bool isDeletedAsWritten() const
bool isDefaulted() const
Whether this function is defaulted.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
FunctionDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Declaration of a template function.
bool isExplicitSpecialization() const
One of these records is kept for each identifier that is lexed.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat, FPOptionsOverride FPO)
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
ValueDecl * getCapturedVar() const
Retrieve the declaration of the local variable being captured.
Represents the results of name lookup.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
bool isExternallyVisible() const
Represents a partial function definition.
static OutlinedFunctionDecl * Create(ASTContext &C, DeclContext *DC, unsigned NumParams)
void setNothrow(bool Nothrow=true)
void setParam(unsigned i, ImplicitParamDecl *P)
Represents a parameter to a function.
ParsedAttr - Represents a syntactic attribute.
const ParsedType & getTypeArg() const
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
bool isMoreQualifiedThan(QualType Other, const ASTContext &Ctx) const
Determine whether this type is more qualified than the other given type, requiring exact equality for...
SYCLKernelCallStmt represents the transformation that is applied to the body of a function declared w...
const std::string & GetKernelName() const
const FunctionDecl * getKernelEntryPointDecl() const
static SYCLUniqueStableNameExpr * Create(const ASTContext &Ctx, SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, TypeSourceInfo *TSI)
A generic diagnostic builder for errors which may or may not be deferred.
ASTContext & getASTContext() const
const LangOptions & getLangOpts() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
StmtResult BuildUnresolvedSYCLKernelCallStmt(CompoundStmt *Body, Expr *LaunchIdExpr)
Builds an UnresolvedSYCLKernelCallStmt to wrap 'Body'.
StmtResult BuildSYCLKernelCallStmt(FunctionDecl *FD, CompoundStmt *Body, Expr *LaunchIdExpr)
Builds a SYCLKernelCallStmt to wrap 'Body' and to be used as the body of 'FD'.
SemaDiagnosticBuilder DiagIfDeviceCode(SourceLocation Loc, unsigned DiagID)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...
void CheckSYCLExternalFunctionDecl(FunctionDecl *FD)
ExprResult BuildUniqueStableNameExpr(SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, TypeSourceInfo *TSI)
void handleKernelEntryPointAttr(Decl *D, const ParsedAttr &AL)
void deepTypeCheckForDevice(SourceLocation UsedAt, llvm::DenseSet< QualType > Visited, ValueDecl *DeclToCheck)
void handleKernelAttr(Decl *D, const ParsedAttr &AL)
void CheckSYCLEntryPointFunctionDecl(FunctionDecl *FD)
void CheckDeviceUseOfDecl(NamedDecl *ND, SourceLocation Loc)
Issues a deferred diagnostic if use of the declaration designated by 'ND' is invalid in a device cont...
ExprResult BuildSYCLKernelLaunchIdExpr(FunctionDecl *FD, QualType KernelName)
Builds an expression for the lookup of a 'sycl_kernel_launch' template with 'KernelName' as an explic...
ExprResult ActOnUniqueStableNameExpr(SourceLocation OpLoc, SourceLocation LParen, SourceLocation RParen, ParsedType ParsedTy)
RAII object to ensure that a code synthesis context is popped on scope exit.
Sema - This implements semantic analysis and AST building for C.
Scope * getCurScope() const
Retrieve the parser's current scope.
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
FunctionEmissionStatus
Status of the function emission on the CUDA/HIP/OpenMP host/device attrs.
const ExpressionEvaluationContextRecord & currentEvaluationContext() const
ASTContext & getASTContext() const
DeclRefExpr * BuildDeclRefExpr(ValueDecl *D, QualType Ty, ExprValueKind VK, SourceLocation Loc, const CXXScopeSpec *SS=nullptr)
ExprResult BuildCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr, bool IsExecConfig=false, bool AllowRecovery=false)
BuildCallExpr - Handle a call to Fn with the specified array of arguments.
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
Expr * MaybeCreateExprWithCleanups(Expr *SubExpr)
MaybeCreateExprWithCleanups - If the current full-expression requires any cleanups,...
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
Stmt - This represents one statement.
static StringLiteral * Create(const ASTContext &Ctx, StringRef Str, StringLiteralKind Kind, bool Pascal, QualType Ty, ArrayRef< SourceLocation > Locs)
This is the "fully general" constructor that allows representation of strings formed from one or more...
A convenient class for passing around template argument information.
void addArgument(const TemplateArgumentLoc &Loc)
Location wrapper for a TemplateArgument.
Represents a template argument.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Stores a list of template parameters for a TemplateDecl and its derived classes.
NamedDecl * getParam(unsigned Idx)
A container of type source information.
The base class of the type hierarchy.
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
bool isReferenceType() const
const Type * getArrayElementTypeNoTypeQual() const
If this is an array type, return the element type of the array, potentially with type qualifiers miss...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isUndeducedType() const
Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' typ...
bool isStructureOrClassType() const
bool isAnyPointerType() const
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs,...
static UnresolvedSYCLKernelCallStmt * Create(const ASTContext &C, CompoundStmt *CS, Expr *IdExpr)
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
QualType getFunctionOrMethodResultType(const Decl *D)
@ Result
The result type of a method or function.
void handleSimpleAttribute(SemaBase &S, Decl *D, const AttributeCommonInfo &CI)
Applies the given attribute to the Decl without performing any additional semantic checking.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
unsigned getFunctionOrMethodNumParams(const Decl *D)
getFunctionOrMethodNumParams - Return number of function or method parameters.
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
U cast(CodeGen::Address addr)
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
ActionResult< Expr * > ExprResult
@ Other
Other implicit parameter.
ActionResult< Stmt * > StmtResult
A context in which code is being synthesized (where a source location alone is not sufficient to iden...
enum clang::Sema::CodeSynthesisContext::SynthesisKind Kind
unsigned NumCallArgs
The number of expressions in CallArgs.
const Expr *const * CallArgs
The list of argument expressions in a synthesized call.
@ SYCLKernelLaunchOverloadResolution
We are performing overload resolution for a call to a function template or variable template named 's...
@ SYCLKernelLaunchLookup
We are performing name lookup for a function template or variable template named 'sycl_kernel_launch'...
Decl * Entity
The entity that is being synthesized.
bool isPotentiallyEvaluated() const