clang: lib/Sema/SemaTemplateInstantiateDecl.cpp File Reference (original) (raw)
Go to the source code of this file.
| Macros | |
|---|---|
| #define | VISIT_CLAUSE(CLAUSE_NAME) |
| #define | CLAUSE_NOT_ON_DECLS(CLAUSE_NAME) |
| Functions | |
|---|---|
| static bool | isDeclWithinFunction (const Decl *D) |
| template | |
| static bool | SubstQualifier (Sema &SemaRef, const DeclT *OldDecl, DeclT *NewDecl, const MultiLevelTemplateArgumentList &TemplateArgs) |
| static void | instantiateDependentAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignedAttr *Aligned, Decl *New, bool IsPackExpansion) |
| static void | instantiateDependentAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignedAttr *Aligned, Decl *New) |
| static void | instantiateDependentAssumeAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AssumeAlignedAttr *Aligned, Decl *New) |
| static void | instantiateDependentAlignValueAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignValueAttr *Aligned, Decl *New) |
| static void | instantiateDependentAllocAlignAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AllocAlignAttr *Align, Decl *New) |
| static void | instantiateDependentAnnotationAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AnnotateAttr *Attr, Decl *New) |
| template<typename Attr> | |
| static void | sharedInstantiateConstructorDestructorAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const Attr *A, Decl *New, ASTContext &C) |
| static Expr * | instantiateDependentFunctionAttrCondition (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const Attr *A, Expr *OldCond, const Decl *Tmpl, FunctionDecl *New) |
| static void | instantiateDependentEnableIfAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const EnableIfAttr *EIA, const Decl *Tmpl, FunctionDecl *New) |
| static void | instantiateDependentDiagnoseIfAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const DiagnoseIfAttr *DIA, const Decl *Tmpl, FunctionDecl *New) |
| static void | instantiateDependentCUDALaunchBoundsAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const CUDALaunchBoundsAttr &Attr, Decl *New) |
| static void | instantiateDependentModeAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const ModeAttr &Attr, Decl *New) |
| static void | instantiateOMPDeclareSimdDeclAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const OMPDeclareSimdDeclAttr &Attr, Decl *New) |
| Instantiation of 'declare simd' attribute and its arguments. | |
| static void | instantiateOMPDeclareVariantAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const OMPDeclareVariantAttr &Attr, Decl *New) |
| Instantiation of 'declare variant' attribute and its arguments. | |
| static void | instantiateDependentAMDGPUFlatWorkGroupSizeAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AMDGPUFlatWorkGroupSizeAttr &Attr, Decl *New) |
| static void | instantiateDependentReqdWorkGroupSizeAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const ReqdWorkGroupSizeAttr &Attr, Decl *New) |
| static void | instantiateDependentAMDGPUWavesPerEUAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AMDGPUWavesPerEUAttr &Attr, Decl *New) |
| static void | instantiateDependentAMDGPUMaxNumWorkGroupsAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AMDGPUMaxNumWorkGroupsAttr &Attr, Decl *New) |
| static void | instantiateDependentCUDAClusterDimsAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const CUDAClusterDimsAttr &Attr, Decl *New) |
| static void | instantiateDependentSYCLKernelAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const SYCLKernelAttr &Attr, Decl *New) |
| static bool | isRelevantAttr (Sema &S, const Decl *D, const Attr *A) |
| Determine whether the attribute A might be relevant to the declaration D. | |
| static void | instantiateDependentHLSLParamModifierAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const HLSLParamModifierAttr *Attr, const Decl *Old, Decl *New) |
| static void | instantiateDependentMallocSpanAttr (Sema &S, const MallocSpanAttr *Attr, Decl *New) |
| static Sema::RetainOwnershipKind | attrToRetainOwnershipKind (const Attr *A) |
| static void | instantiateDependentOpenACCRoutineDeclAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const OpenACCRoutineDeclAttr *OldAttr, const Decl *Old, Decl *New) |
| template | |
| static DeclT * | getPreviousDeclForInstantiation (DeclT *D) |
| Get the previous declaration of a declaration for the purposes of template instantiation. | |
| static QualType | adjustFunctionTypeForInstantiation (ASTContext &Context, FunctionDecl *D, TypeSourceInfo *TInfo) |
| Adjust the given function type for an instantiation of the given declaration, to cope with modifications to the function's type that aren't reflected in the type-source information. | |
| static void | collectUnexpandedParameterPacks (Sema &S, TemplateParameterList *Params, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded) |
| static bool | isInstantiationOf (ClassTemplateDecl *Pattern, ClassTemplateDecl *Instance) |
| static bool | isInstantiationOf (FunctionTemplateDecl *Pattern, FunctionTemplateDecl *Instance) |
| static bool | isInstantiationOf (ClassTemplatePartialSpecializationDecl *Pattern, ClassTemplatePartialSpecializationDecl *Instance) |
| static bool | isInstantiationOf (CXXRecordDecl *Pattern, CXXRecordDecl *Instance) |
| static bool | isInstantiationOf (FunctionDecl *Pattern, FunctionDecl *Instance) |
| static bool | isInstantiationOf (EnumDecl *Pattern, EnumDecl *Instance) |
| static bool | isInstantiationOf (UsingShadowDecl *Pattern, UsingShadowDecl *Instance, ASTContext &C) |
| static bool | isInstantiationOf (UsingDecl *Pattern, UsingDecl *Instance, ASTContext &C) |
| template | |
| static bool | isInstantiationOfUnresolvedUsingDecl (T *Pattern, Decl *Other, ASTContext &Ctx) |
| static bool | isInstantiationOfStaticDataMember (VarDecl *Pattern, VarDecl *Instance) |
| static bool | isInstantiationOf (ASTContext &Ctx, NamedDecl *D, Decl *Other) |
| template | |
| static NamedDecl * | findInstantiationOf (ASTContext &Ctx, NamedDecl *D, ForwardIterator first, ForwardIterator last) |
| static bool | isDependentContextAtLevel (DeclContext *DC, unsigned Level) |
| Determine whether the given context is dependent on template parameters at level Level or below. |
◆ CLAUSE_NOT_ON_DECLS
| #define CLAUSE_NOT_ON_DECLS | ( | CLAUSE_NAME | ) |
|---|
Value:
void OpenACCDeclClauseInstantiator::Visit##CLAUSE_NAME##Clause( \
const OpenACC##CLAUSE_NAME##Clause &) { \
llvm_unreachable("Clause type invalid on declaration construct, or " \
"instantiation not implemented"); \
}
Definition at line 1198 of file SemaTemplateInstantiateDecl.cpp.
◆ VISIT_CLAUSE
| #define VISIT_CLAUSE | ( | CLAUSE_NAME | ) |
|---|
◆ adjustFunctionTypeForInstantiation()
◆ attrToRetainOwnershipKind()
◆ collectUnexpandedParameterPacks()
◆ findInstantiationOf()
template
◆ getPreviousDeclForInstantiation()
template
| DeclT * getPreviousDeclForInstantiation ( DeclT * D) | static |
|---|
◆ instantiateDependentAlignedAttr() [1/2]
◆ instantiateDependentAlignedAttr() [2/2]
◆ instantiateDependentAlignValueAttr()
◆ instantiateDependentAllocAlignAttr()
◆ instantiateDependentAMDGPUFlatWorkGroupSizeAttr()
◆ instantiateDependentAMDGPUMaxNumWorkGroupsAttr()
◆ instantiateDependentAMDGPUWavesPerEUAttr()
◆ instantiateDependentAnnotationAttr()
◆ instantiateDependentAssumeAlignedAttr()
◆ instantiateDependentCUDAClusterDimsAttr()
◆ instantiateDependentCUDALaunchBoundsAttr()
◆ instantiateDependentDiagnoseIfAttr()
◆ instantiateDependentEnableIfAttr()
◆ instantiateDependentFunctionAttrCondition()
Definition at line 265 of file SemaTemplateInstantiateDecl.cpp.
References clang::Cond, clang::Sema::ConstantEvaluated, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Attr::getLocation(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPotentialConstantExprUnevaluated(), clang::Expr::isValueDependent(), New, clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::SubstExpr(), and clang::Unevaluated.
Referenced by instantiateDependentDiagnoseIfAttr(), and instantiateDependentEnableIfAttr().
◆ instantiateDependentHLSLParamModifierAttr()
Definition at line 785 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::cast(), clang::Attr::clone(), clang::Sema::getASTContext(), clang::SemaHLSL::getInoutParameterType(), clang::ValueDecl::getType(), clang::Sema::HLSL(), clang::Type::isDependentType(), clang::Type::isReferenceType(), clang::QualType::isRestrictQualified(), New, and clang::ValueDecl::setType().
Referenced by clang::Sema::InstantiateAttrs().
◆ instantiateDependentMallocSpanAttr()
| void instantiateDependentMallocSpanAttr ( Sema & S, const MallocSpanAttr * Attr, Decl * New ) | static |
|---|
◆ instantiateDependentModeAttr()
◆ instantiateDependentOpenACCRoutineDeclAttr()
◆ instantiateDependentReqdWorkGroupSizeAttr()
◆ instantiateDependentSYCLKernelAttr()
◆ instantiateOMPDeclareSimdDeclAttr()
Instantiation of 'declare simd' attribute and its arguments.
Definition at line 362 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::cast(), clang::Sema::ConvertDeclToDeclGroup(), clang::Evaluated, clang::ExprEmpty(), clang::ActionResult< PtrTy, Compress >::get(), clang::AttributeCommonInfo::getRange(), clang::ActionResult< PtrTy, Compress >::isInvalid(), New, clang::Sema::OpenMP(), clang::Sema::PotentiallyEvaluated, and clang::Sema::SubstExpr().
Referenced by clang::Sema::InstantiateAttrs().
◆ instantiateOMPDeclareVariantAttr()
Instantiation of 'declare variant' attribute and its arguments.
Definition at line 445 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::SemaOpenMP::ActOnOpenMPDeclareVariantDirective(), clang::OMPTraitInfo::anyScoreOrCondition(), bool, clang::cast(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), clang::Sema::ConstantEvaluated, clang::Sema::Context, clang::Sema::ConvertDeclToDeclGroup(), clang::DeclRefExpr::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Evaluated, clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::getASTContext(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::ASTContext::getNewOMPTraitInfo(), clang::AttributeCommonInfo::getRange(), clang::Sema::InstantiateFunctionDeclaration(), clang::Sema::InstantiateFunctionDefinition(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::ASTContext::mergeFunctionTypes(), New, clang::Sema::OpenMP(), clang::Sema::PotentiallyEvaluated, clang::Sema::SubstExpr(), clang::Unevaluated, and clang::VK_PRValue.
Referenced by clang::Sema::InstantiateAttrs().
◆ isDeclWithinFunction()
| bool isDeclWithinFunction ( const Decl * D) | static |
|---|
◆ isDependentContextAtLevel()
◆ isInstantiationOf() [1/9]
Definition at line 6793 of file SemaTemplateInstantiateDecl.cpp.
References clang::cast(), clang::declaresSameEntity(), clang::Enum, clang::NamedDecl::getDeclName(), clang::ASTContext::getInstantiatedFromUnnamedFieldDecl(), clang::Decl::getKind(), isInstantiationOf(), isInstantiationOfStaticDataMember(), isInstantiationOfUnresolvedUsingDecl(), clang::VarDecl::isStaticDataMember(), and clang::Other.
◆ isInstantiationOf() [2/9]
◆ isInstantiationOf() [3/9]
◆ isInstantiationOf() [4/9]
◆ isInstantiationOf() [5/9]
◆ isInstantiationOf() [6/9]
◆ isInstantiationOf() [7/9]
◆ isInstantiationOf() [8/9]
◆ isInstantiationOf() [9/9]
◆ isInstantiationOfStaticDataMember()
◆ isInstantiationOfUnresolvedUsingDecl()
template
| bool isInstantiationOfUnresolvedUsingDecl ( T * Pattern, Decl * Other, ASTContext & Ctx ) | static |
|---|
◆ isRelevantAttr()
Determine whether the attribute A might be relevant to the declaration D.
If not, we can skip instantiating it. The attribute may or may not have been instantiated yet.
Definition at line 741 of file SemaTemplateInstantiateDecl.cpp.
References clang::cast(), clang::Sema::Context, clang::declaresSameEntity(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isLValueReferenceType(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Decl::specific_attrs(), and clang::T.
Referenced by clang::Sema::InstantiateAttrs(), and clang::Sema::InstantiateAttrsForDecl().