25#include "llvm/ADT/SmallVector.h"
34 if (
auto *A = D->
getAttr<AttrT>())
35 return !A->isImplicit();
40 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
41 ForceHostDeviceDepth++;
45 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
46 if (ForceHostDeviceDepth == 0)
48 ForceHostDeviceDepth--;
63 SemaRef.MarkFunctionReferenced(LLLLoc, ConfigDecl);
65 return SemaRef.BuildCallExpr(S, ConfigDR, LLLLoc, ExecConfig, GGGLoc,
nullptr,
70 bool HasHostAttr =
false;
71 bool HasDeviceAttr =
false;
72 bool HasGlobalAttr =
false;
73 bool HasInvalidTargetAttr =
false;
75 switch (AL.getKind()) {
76 case ParsedAttr::AT_CUDAGlobal:
79 case ParsedAttr::AT_CUDAHost:
82 case ParsedAttr::AT_CUDADevice:
85 case ParsedAttr::AT_CUDAInvalidTarget:
86 HasInvalidTargetAttr =
true;
93 if (HasInvalidTargetAttr)
99 if (HasHostAttr && HasDeviceAttr)
111 return isa<A>(Attribute) &&
112 !(IgnoreImplicitAttr && Attribute->isImplicit());
121 auto *VD = dyn_cast_or_null<VarDecl>(D);
122 if (VD && VD->hasGlobalStorage() && !VD->isStaticLocal()) {
129 S.CurCUDATargetCtx = {
Target, K, VD};
135 bool IgnoreImplicitHDAttr) {
140 if (D->
hasAttr<CUDAInvalidTargetAttr>())
143 if (D->
hasAttr<CUDAGlobalAttr>())
156 !IgnoreImplicitHDAttr) {
167 if (Var->
hasAttr<HIPManagedAttr>())
173 Var->
hasAttr<CUDAConstantAttr>() &&
176 if (Var->
hasAttr<CUDADeviceAttr>() || Var->
hasAttr<CUDAConstantAttr>() ||
177 Var->
hasAttr<CUDASharedAttr>() ||
230 assert(Callee &&
"Callee must be valid.");
261 if (CalleeTarget == CallerTarget ||
304 llvm_unreachable(
"All cases should've been handled by now.");
310 if (
auto *A = D->
getAttr<AttrT>())
311 return A->isImplicit();
318 return IsImplicitDevAttr && IsImplicitHostAttr;
324 if (Matches.size() <= 1)
327 using Pair = std::pair<DeclAccessPair, FunctionDecl *>;
330 auto GetCFP = [&](
const Pair &
Match) {
336 GetCFP(*llvm::max_element(Matches, [&](
const Pair &M1,
const Pair &M2) {
337 return GetCFP(M1) < GetCFP(M2);
341 llvm::erase_if(Matches,
342 [&](
const Pair &
Match) {
return GetCFP(
Match) < BestCFP; });
362 *ResolvedTarget = Target2;
364 *ResolvedTarget = Target1;
365 }
else if (Target1 != Target2) {
368 *ResolvedTarget = Target1;
383 bool IsExpVDtor =
false;
385 if (
auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(ClassDecl)) {
392 SemaRef.DeclsToCheckForDeferredDiags.insert(MemberDecl);
398 bool HasH = MemberDecl->
hasAttr<CUDAHostAttr>();
399 bool HasD = MemberDecl->
hasAttr<CUDADeviceAttr>();
400 bool HasExplicitAttr =
401 (HasD && !MemberDecl->
getAttr<CUDADeviceAttr>()->isImplicit()) ||
402 (HasH && !MemberDecl->
getAttr<CUDAHostAttr>()->isImplicit());
403 if (!InClass || HasExplicitAttr)
406 std::optional<CUDAFunctionTarget> InferredTarget;
416 for (
const auto &B : ClassDecl->
bases()) {
417 if (!B.isVirtual()) {
423 llvm::append_range(Bases, llvm::make_pointer_range(ClassDecl->
vbases()));
426 for (
const auto *B : Bases) {
427 auto *BaseClassDecl = B->getType()->getAsCXXRecordDecl();
432 SemaRef.LookupSpecialMember(BaseClassDecl, CSM,
445 if (!InferredTarget) {
446 InferredTarget = BaseMethodTarget;
449 *InferredTarget, BaseMethodTarget, &*InferredTarget);
450 if (ResolutionError) {
453 diag::note_implicit_member_target_infer_collision)
454 << (
unsigned)CSM << *InferredTarget << BaseMethodTarget;
464 for (
const auto *F : ClassDecl->
fields()) {
465 if (F->isInvalidDecl()) {
475 SemaRef.LookupSpecialMember(FieldRecDecl, CSM,
476 ConstRHS && !F->isMutable(),
488 if (!InferredTarget) {
489 InferredTarget = FieldMethodTarget;
492 *InferredTarget, FieldMethodTarget, &*InferredTarget);
493 if (ResolutionError) {
496 diag::note_implicit_member_target_infer_collision)
497 << (
unsigned)CSM << *InferredTarget << FieldMethodTarget;
508 bool NeedsH =
true, NeedsD =
true;
509 if (InferredTarget) {
554 if (const CXXConstructExpr *CE =
555 dyn_cast<CXXConstructExpr>(CI->getInit()))
556 return isEmptyConstructor(Loc, CE->getConstructor());
598 if (CXXRecordDecl *RD = BS.getType()->getAsCXXRecordDecl())
599 return isEmptyDestructor(Loc, RD->getDestructor());
606 if (CXXRecordDecl *RD = Field->getType()
607 ->getBaseElementTypeUnsafe()
608 ->getAsCXXRecordDecl())
609 return isEmptyDestructor(Loc, RD->getDestructor());
618enum CUDAInitializerCheckKind {
619 CICK_DeviceOrConstant,
623bool IsDependentVar(
VarDecl *VD) {
627 return Init->isValueDependent();
640bool HasAllowedCUDADeviceStaticInitializer(
SemaCUDA &S, VarDecl *VD,
641 CUDAInitializerCheckKind CheckKind) {
643 assert(!IsDependentVar(VD) &&
"do not check dependent var");
645 auto IsEmptyInit = [&](
const Expr *
Init) {
648 if (
const auto *CE = dyn_cast<CXXConstructExpr>(
Init)) {
653 auto IsConstantInit = [&](
const Expr *
Init) {
655 ASTContext::CUDAConstantEvalContextRAII EvalCtx(S.
getASTContext(),
660 auto HasEmptyDtor = [&](VarDecl *VD) {
665 if (CheckKind == CICK_Shared)
666 return IsEmptyInit(
Init) && HasEmptyDtor(VD);
668 ((IsEmptyInit(
Init) || IsConstantInit(
Init)) && HasEmptyDtor(VD));
680 bool IsSharedVar = VD->
hasAttr<CUDASharedAttr>();
681 bool IsDeviceOrConstantVar =
683 (VD->
hasAttr<CUDADeviceAttr>() || VD->
hasAttr<CUDAConstantAttr>());
684 if ((IsSharedVar || IsDeviceOrConstantVar) &&
696 if (IsDeviceOrConstantVar || IsSharedVar) {
697 if (HasAllowedCUDADeviceStaticInitializer(
698 *
this, VD, IsSharedVar ? CICK_Shared : CICK_DeviceOrConstant))
701 IsSharedVar ? diag::err_shared_var_init : diag::err_dynamic_var_init)
702 <<
Init->getSourceRange();
709 InitFn = CE->getConstructor();
710 }
else if (
const CallExpr *CE = dyn_cast<CallExpr>(
Init)) {
711 InitFn = CE->getDirectCallee();
718 << InitFnTarget << InitFn;
719 Diag(InitFn->getLocation(), diag::note_previous_decl) << InitFn;
742 !
getASTContext().CUDAImplicitHostDeviceFunUsedByDevice.count(Caller))))
762 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
764 if (ForceHostDeviceDepth > 0) {
765 if (!NewD->
hasAttr<CUDAHostAttr>())
767 if (!NewD->
hasAttr<CUDADeviceAttr>())
774 if (
getLangOpts().OffloadImplicitHostDeviceTemplates &&
775 !NewD->
hasAttr<CUDAHostAttr>() && !NewD->
hasAttr<CUDADeviceAttr>() &&
776 !NewD->
hasAttr<CUDAGlobalAttr>() &&
786 NewD->
hasAttr<CUDADeviceAttr>() || NewD->
hasAttr<CUDAGlobalAttr>())
791 auto IsMatchingDeviceFn = [&](
NamedDecl *D) {
793 D = Using->getTargetDecl();
795 return OldD && OldD->
hasAttr<CUDADeviceAttr>() &&
796 !OldD->
hasAttr<CUDAHostAttr>() &&
797 !
SemaRef.IsOverload(NewD, OldD,
801 auto It = llvm::find_if(
Previous, IsMatchingDeviceFn);
808 if (!
SemaRef.getSourceManager().isInSystemHeader(
Match->getLocation())) {
810 diag::err_cuda_unattributed_constexpr_cannot_overload_device)
813 diag::note_cuda_conflicting_device_function_declared_here);
829 !VD->
hasAttr<CUDASharedAttr>() &&
831 !IsDependentVar(VD) &&
833 HasAllowedCUDADeviceStaticInitializer(*
this, VD,
834 CICK_DeviceOrConstant))) {
841 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
843 SemaRef.getCurFunctionDecl(
true);
844 SemaDiagnosticBuilder::Kind DiagKind = [&] {
846 return SemaDiagnosticBuilder::K_Nop;
850 return SemaDiagnosticBuilder::K_Immediate;
856 return SemaDiagnosticBuilder::K_Nop;
857 if (
SemaRef.IsLastErrorImmediate &&
859 return SemaDiagnosticBuilder::K_Immediate;
860 return (
SemaRef.getEmissionStatus(CurFunContext) ==
862 ? SemaDiagnosticBuilder::K_ImmediateWithCallStack
863 : SemaDiagnosticBuilder::K_Deferred;
865 return SemaDiagnosticBuilder::K_Nop;
873 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
875 SemaRef.getCurFunctionDecl(
true);
876 SemaDiagnosticBuilder::Kind DiagKind = [&] {
878 return SemaDiagnosticBuilder::K_Nop;
881 return SemaDiagnosticBuilder::K_Immediate;
887 return SemaDiagnosticBuilder::K_Nop;
888 if (
SemaRef.IsLastErrorImmediate &&
890 return SemaDiagnosticBuilder::K_Immediate;
891 return (
SemaRef.getEmissionStatus(CurFunContext) ==
893 ? SemaDiagnosticBuilder::K_ImmediateWithCallStack
894 : SemaDiagnosticBuilder::K_Deferred;
896 return SemaDiagnosticBuilder::K_Nop;
903 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
904 assert(Callee &&
"Callee may not be null.");
906 const auto &ExprEvalCtx =
SemaRef.currentEvaluationContext();
907 if (ExprEvalCtx.isUnevaluated() || ExprEvalCtx.isConstantEvaluated())
918 bool CallerKnownEmitted =
SemaRef.getEmissionStatus(Caller) ==
920 SemaDiagnosticBuilder::Kind DiagKind = [
this, Caller, Callee,
921 CallerKnownEmitted] {
925 assert(Caller &&
"Never/wrongSide calls require a non-null caller");
929 return CallerKnownEmitted
930 ? SemaDiagnosticBuilder::K_ImmediateWithCallStack
931 : SemaDiagnosticBuilder::K_Deferred;
933 return SemaDiagnosticBuilder::K_Nop;
937 if (DiagKind == SemaDiagnosticBuilder::K_Nop) {
940 Callee->hasAttr<CUDAGlobalAttr>() && !Callee->isDefined() &&
959 if (!Callee->getBuiltinID())
961 diag::note_previous_decl, Caller,
SemaRef)
963 return DiagKind != SemaDiagnosticBuilder::K_Immediate &&
964 DiagKind != SemaDiagnosticBuilder::K_ImmediateWithCallStack;
995 bool CalleeIsDevice = Callee->hasAttr<CUDADeviceAttr>();
997 !Caller->
hasAttr<CUDAGlobalAttr>() && !Caller->
hasAttr<CUDADeviceAttr>();
998 bool ShouldCheck = CalleeIsDevice && CallerIsHost;
1001 auto DiagKind = SemaDiagnosticBuilder::K_Deferred;
1004 diag::err_capture_bad_target, Callee,
SemaRef)
1012 diag::warn_maybe_capture_bad_target_this_ptr, Callee,
1018 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
1019 if (
Method->hasAttr<CUDAHostAttr>() ||
Method->hasAttr<CUDADeviceAttr>())
1027 assert(
getLangOpts().
CUDA &&
"Should only be called during CUDA compilation");
1040 if (NewTarget != OldTarget &&
1041 !
SemaRef.IsOverload(NewFD, OldFD,
false,
1044 !(
getLangOpts().OffloadImplicitHostDeviceTemplates &&
1048 !(
getLangOpts().OffloadImplicitHostDeviceTemplates &&
1054 << NewTarget << NewFD->
getDeclName() << OldTarget << OldFD;
1055 Diag(OldFD->getLocation(), diag::note_previous_declaration);
1064 << NewTarget << OldTarget;
1071template <
typename AttrTy>
1074 if (AttrTy *Attribute = TemplateFD.
getAttr<AttrTy>()) {
1075 AttrTy *Clone = Attribute->clone(S.
Context);
1076 Clone->setInherited(
true);
1091 return "__llvmPushCallConfiguration";
1094 return getLangOpts().HIPUseNewLaunchAPI ?
"__hipPushCallConfiguration"
1095 :
"hipConfigureCall";
1100 return "__cudaPushCallConfiguration";
1103 return "cudaConfigureCall";
1114 for (
unsigned I = 0; I < Arguments.size(); ++I) {
1115 auto *DeclRef = dyn_cast<DeclRefExpr>(Arguments[I]);
1118 auto *Variable = dyn_cast<VarDecl>(DeclRef->getDecl());
1119 if (!Variable || !Variable->isLocalVarDecl() || !Variable->isConstexpr())
1122 bool HostByValue =
false, HostByRef =
false;
1123 bool DeviceByValue =
false, DeviceByRef =
false;
1127 if (!Callee || I >= Callee->getNumParams())
1140 bool IsRef = Callee->getParamDecl(I)->getType()->isReferenceType();
1141 HostByValue |= CoversHost && !IsRef;
1142 HostByRef |= CoversHost && IsRef;
1143 DeviceByValue |= CoversDevice && !IsRef;
1144 DeviceByRef |= CoversDevice && IsRef;
1147 if ((HostByValue && DeviceByRef) || (HostByRef && DeviceByValue))
Defines the clang::ASTContext interface.
static bool hasImplicitAttr(const ValueDecl *D)
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines the clang::Preprocessor interface.
static bool resolveCalleeCUDATargetConflict(CUDAFunctionTarget Target1, CUDAFunctionTarget Target2, CUDAFunctionTarget *ResolvedTarget)
When an implicitly-declared special member has to invoke more than one base/field special member,...
static bool hasAttr(const Decl *D, bool IgnoreImplicitAttr)
static void copyAttrIfPresent(Sema &S, FunctionDecl *FD, const FunctionDecl &TemplateFD)
static bool hasExplicitAttr(const VarDecl *D)
This file declares semantic analysis for CUDA constructs.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
llvm::SetVector< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
llvm::DenseSet< const FunctionDecl * > CUDAImplicitHostDeviceFunUsedByDevice
Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.
FunctionDecl * getcudaConfigureCallDecl()
Attr - This represents one attribute.
Represents a base class of a C++ class.
Represents a call to a C++ constructor.
Represents a C++ constructor within a class.
Represents a C++ base or member initializer.
Represents a C++ destructor within a class.
Represents a static or instance method of a struct/union/class.
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
Represents a C++ struct/union/class.
base_class_range vbases()
bool isAbstract() const
Determine whether this class has a pure virtual function.
bool isDynamicClass() const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
A reference to a declared variable, function, enum, etc.
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
bool isInvalidDecl() const
SourceLocation getLocation() const
DeclContext * getDeclContext()
This represents one expression.
Represents a member of a struct/union/class.
Represents a function declaration or definition.
bool hasTrivialBody() const
Returns whether the function has a trivial body that does not require any specific codegen.
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool isVariadic() const
Whether this function is variadic.
bool isTemplateInstantiation() const
Determines if the given function was instantiated from a function template.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration.
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
bool isDefined(const FunctionDecl *&Definition, bool CheckForPendingFriendDefinition=false) const
Returns true if the function has a definition that does not need to be instantiated.
Declaration of a template function.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Represents the results of name lookup.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13....
ParsedAttr - Represents a syntactic attribute.
A (possibly-)qualified type.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isConstQualified() const
Determine whether this type is const-qualified.
LangAS getAddressSpace() const
field_range fields() const
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Scope - A scope is a transient data structure that is used while parsing the program.
A generic diagnostic builder for errors which may or may not be deferred.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
const LangOptions & getLangOpts() const
DiagnosticsEngine & getDiagnostics() const
void PushForceHostDevice()
Increments our count of the number of times we've seen a pragma forcing functions to be host device.
void checkAllowedInitializer(VarDecl *VD)
void RecordImplicitHostDeviceFuncUsedByDevice(const FunctionDecl *FD)
Record FD if it is a CUDA/HIP implicit host device function used on device side in device compilation...
std::string getConfigureFuncName() const
Returns the name of the launch configuration function.
bool PopForceHostDevice()
Decrements our count of the number of times we've seen a pragma forcing functions to be host device.
CUDAFunctionTarget IdentifyTarget(const FunctionDecl *D, bool IgnoreImplicitHDAttr=false)
Determines whether the given function is a CUDA device/host/kernel/etc.
void maybeAddHostDeviceAttrs(FunctionDecl *FD, const LookupResult &Previous)
May add implicit CUDAHostAttr and CUDADeviceAttr attributes to FD, depending on FD and the current co...
ExprResult ActOnExecConfigExpr(Scope *S, SourceLocation LLLLoc, MultiExprArg ExecConfig, SourceLocation GGGLoc)
bool isEmptyConstructor(SourceLocation Loc, CXXConstructorDecl *CD)
bool isEmptyDestructor(SourceLocation Loc, CXXDestructorDecl *CD)
void checkTargetOverload(FunctionDecl *NewFD, const LookupResult &Previous)
Check whether NewFD is a valid overload for CUDA.
CUDAFunctionTarget CurrentTarget()
Gets the CUDA target for the current context.
SemaDiagnosticBuilder DiagIfHostCode(SourceLocation Loc, unsigned DiagID)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as host cod...
bool inferTargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl, CXXSpecialMemberKind CSM, CXXMethodDecl *MemberDecl, bool ConstRHS, bool Diagnose)
Given a implicit special member, infer its CUDA target from the calls it needs to make to underlying ...
struct clang::SemaCUDA::CUDATargetContext CurCUDATargetCtx
CUDATargetContextKind
Defines kinds of CUDA global host/device context where a function may be called.
@ CTCK_InitGlobalVar
Unknown context.
SemaDiagnosticBuilder DiagIfDeviceCode(SourceLocation Loc, unsigned DiagID)
Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...
llvm::DenseSet< FunctionDeclAndLoc > LocsWithCUDACallDiags
FunctionDecls and SourceLocations for which CheckCall has emitted a (maybe deferred) "bad call" diagn...
bool CheckCall(SourceLocation Loc, FunctionDecl *Callee)
Check whether we're allowed to call Callee from the current context.
void inheritTargetAttrs(FunctionDecl *FD, const FunctionTemplateDecl &TD)
Copies target attributes from the template TD to the function FD.
static bool isImplicitHostDeviceFunction(const FunctionDecl *D)
void CheckLambdaCapture(CXXMethodDecl *D, const sema::Capture &Capture)
void MaybeAddConstantAttr(VarDecl *VD)
May add implicit CUDAConstantAttr attribute to VD, depending on VD and current compilation settings.
void EraseUnwantedMatches(const FunctionDecl *Caller, llvm::SmallVectorImpl< std::pair< DeclAccessPair, FunctionDecl * > > &Matches)
Finds a function in Matches with highest calling priority from Caller context and erases all function...
void SetLambdaAttrs(CXXMethodDecl *Method)
Set device or host device attributes on the given lambda operator() method.
CUDAFunctionPreference IdentifyPreference(const FunctionDecl *Caller, const FunctionDecl *Callee)
Identifies relative preference of a given Caller/Callee combination, based on their host/device attri...
void recordPotentialODRUsedVariable(MultiExprArg Args, OverloadCandidateSet &CandidateSet)
Record variables that are potentially ODR-used in CUDA/HIP.
@ CVT_Host
Emitted on device side with a shadow variable on host side.
@ CVT_Both
Emitted on host side only.
@ CVT_Unified
Emitted on both sides with different addresses.
SpecialMemberOverloadResult - The overloading result for a special member function.
CXXMethodDecl * getMethod() const
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isReferenceType() const
bool isCUDADeviceBuiltinSurfaceType() const
Check if the type is the CUDA device builtin surface type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isCUDADeviceBuiltinTextureType() const
Check if the type is the CUDA device builtin texture type.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represents a variable declaration or definition.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
bool isStaticDataMember() const
Determines whether this is a static data member.
bool hasGlobalStorage() const
Returns true for all variables that do not have local storage.
bool isFileVarDecl() const
Returns true for file scoped variable declaration.
const Expr * getInit() const
ValueDecl * getVariable() const
bool isVariableCapture() const
SourceLocation getLocation() const
Retrieve the location at which this variable was captured.
bool isThisCapture() const
bool isReferenceCapture() const
llvm::SmallPtrSet< VarDecl *, 4 > CUDAPotentialODRUsedVars
Variables that are potentially ODR-used in CUDA/HIP.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
@ Match
This is not an overload because the signature exactly matches an existing declaration.
bool isa(CodeGen::Address addr)
MutableArrayRef< Expr * > MultiExprArg
bool CudaFeatureEnabled(llvm::VersionTuple, CudaFeature)
CXXSpecialMemberKind
Kinds of C++ special members.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
ActionResult< Expr * > ExprResult
OverloadCandidate - A single candidate in an overload set (C++ 13.3).