clang 22.0.0git
clang::TemplateDeclInstantiator Class Reference

#include "clang/Sema/Template.h"

Inheritance diagram for clang::TemplateDeclInstantiator:
[legend]

Public Types

enum class  RewriteKind { None , RewriteSpaceshipAsEqualEqual }
using delayed_partial_spec_iterator
using delayed_var_partial_spec_iterator

Public Member Functions

 TemplateDeclInstantiator (Sema &SemaRef, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs)
void setEvaluateConstraints (bool B)
bool getEvaluateConstraints ()
void adjustForRewrite (RewriteKind RK, FunctionDecl *Orig, QualType &T, TypeSourceInfo *&TInfo, DeclarationNameInfo &NameInfo)
DeclVisitCXXMethodDecl (CXXMethodDecl *D, TemplateParameterList *TemplateParams, RewriteKind RK=RewriteKind::None)
DeclVisitFunctionDecl (FunctionDecl *D, TemplateParameterList *TemplateParams, RewriteKind RK=RewriteKind::None)
 Normal class members are of more specific types and therefore don't make it here.
DeclVisitDecl (Decl *D)
DeclVisitVarDecl (VarDecl *D, bool InstantiatingVarTemplate, ArrayRef< BindingDecl * > *Bindings=nullptr)
DeclVisitBaseUsingDecls (BaseUsingDecl *D, BaseUsingDecl *Inst, LookupResult *Lookup)
void enableLateAttributeInstantiation (Sema::LateInstantiatedAttrVec *LA)
void disableLateAttributeInstantiation ()
LocalInstantiationScopegetStartingScope () const
delayed_partial_spec_iterator delayed_partial_spec_begin ()
 Return an iterator to the beginning of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.
delayed_var_partial_spec_iterator delayed_var_partial_spec_begin ()
delayed_partial_spec_iterator delayed_partial_spec_end ()
 Return an iterator to the end of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.
delayed_var_partial_spec_iterator delayed_var_partial_spec_end ()
TypeSourceInfoSubstFunctionType (FunctionDecl *D, SmallVectorImpl< ParmVarDecl * > &Params)
bool InitFunctionInstantiation (FunctionDecl *New, FunctionDecl *Tmpl)
 Initializes the common fields of an instantiation function declaration (New) from the corresponding fields of its template (Tmpl).
bool InitMethodInstantiation (CXXMethodDecl *New, CXXMethodDecl *Tmpl)
 Initializes common fields of an instantiated method declaration (New) from the corresponding fields of its template (Tmpl).
bool SubstDefaultedFunction (FunctionDecl *New, FunctionDecl *Tmpl)
TemplateParameterListSubstTemplateParams (TemplateParameterList *List)
 Instantiates a nested template parameter list in the current instantiation context.
bool SubstQualifier (const DeclaratorDecl *OldDecl, DeclaratorDecl *NewDecl)
bool SubstQualifier (const TagDecl *OldDecl, TagDecl *NewDecl)
VarTemplateSpecializationDeclVisitVarTemplateSpecializationDecl (VarTemplateDecl *VarTemplate, VarDecl *FromVar, ArrayRef< TemplateArgument > Converted, VarTemplateSpecializationDecl *PrevDecl=nullptr)
DeclInstantiateTypedefNameDecl (TypedefNameDecl *D, bool IsTypeAlias)
DeclInstantiateTypeAliasTemplateDecl (TypeAliasTemplateDecl *D)
ClassTemplatePartialSpecializationDeclInstantiateClassTemplatePartialSpecialization (ClassTemplateDecl *ClassTemplate, ClassTemplatePartialSpecializationDecl *PartialSpec)
 Instantiate the declaration of a class template partial specialization.
VarTemplatePartialSpecializationDeclInstantiateVarTemplatePartialSpecialization (VarTemplateDecl *VarTemplate, VarTemplatePartialSpecializationDecl *PartialSpec)
 Instantiate the declaration of a variable template partial specialization.
void InstantiateEnumDefinition (EnumDecl *Enum, EnumDecl *Pattern)
Public Member Functions inherited from clang::declvisitor::Base< std::add_pointer, TemplateDeclInstantiator, Decl * >
DeclVisit (PTR(Decl) D)
DeclVisitDecl (PTR(Decl) D)

Detailed Description

Definition at line 574 of file Template.h.

Member Typedef Documentation

◆ delayed_partial_spec_iterator

◆ delayed_var_partial_spec_iterator

Member Enumeration Documentation

◆ RewriteKind

Enumerator
None 
RewriteSpaceshipAsEqualEqual 

Definition at line 646 of file Template.h.

Constructor & Destructor Documentation

◆ TemplateDeclInstantiator()

clang::TemplateDeclInstantiator::TemplateDeclInstantiator ( Sema & SemaRef,
DeclContext * Owner,
const MultiLevelTemplateArgumentList & TemplateArgs )
inline

Definition at line 603 of file Template.h.

Member Function Documentation

◆ adjustForRewrite()

◆ delayed_partial_spec_begin()

delayed_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_partial_spec_begin ( )
inline

Return an iterator to the beginning of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.

Definition at line 690 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ delayed_partial_spec_end()

delayed_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_partial_spec_end ( )
inline

Return an iterator to the end of the set of "delayed" partial specializations, which must be passed to InstantiateClassTemplatePartialSpecialization once the class definition has been completed.

Definition at line 702 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ delayed_var_partial_spec_begin()

delayed_var_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_var_partial_spec_begin ( )
inline

Definition at line 694 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ delayed_var_partial_spec_end()

delayed_var_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_var_partial_spec_end ( )
inline

Definition at line 706 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ disableLateAttributeInstantiation()

void clang::TemplateDeclInstantiator::disableLateAttributeInstantiation ( )
inline

Definition at line 673 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ enableLateAttributeInstantiation()

void clang::TemplateDeclInstantiator::enableLateAttributeInstantiation ( Sema::LateInstantiatedAttrVec * LA)
inline

Definition at line 667 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ getEvaluateConstraints()

bool clang::TemplateDeclInstantiator::getEvaluateConstraints ( )
inline

Definition at line 611 of file Template.h.

◆ getStartingScope()

LocalInstantiationScope * clang::TemplateDeclInstantiator::getStartingScope ( ) const
inline

Definition at line 678 of file Template.h.

Referenced by clang::Sema::InstantiateClass().

◆ InitFunctionInstantiation()

◆ InitMethodInstantiation()

bool TemplateDeclInstantiator::InitMethodInstantiation ( CXXMethodDecl * New,
CXXMethodDecl * Tmpl )

Initializes common fields of an instantiated method declaration (New) from the corresponding fields of its template (Tmpl).

Returns
true if there was an error

Definition at line 5423 of file SemaTemplateInstantiateDecl.cpp.

References clang::cast(), clang::Decl::getAccess(), InitFunctionInstantiation(), clang::isa(), clang::FunctionDecl::isVirtualAsWritten(), and New.

Referenced by VisitCXXMethodDecl().

◆ InstantiateClassTemplatePartialSpecialization()

ClassTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization ( ClassTemplateDecl * ClassTemplate,
ClassTemplatePartialSpecializationDecl * PartialSpec )

◆ InstantiateEnumDefinition()

◆ InstantiateTypeAliasTemplateDecl()

◆ InstantiateTypedefNameDecl()

◆ InstantiateVarTemplatePartialSpecialization()

VarTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization ( VarTemplateDecl * VarTemplate,
VarTemplatePartialSpecializationDecl * PartialSpec )

◆ setEvaluateConstraints()

void clang::TemplateDeclInstantiator::setEvaluateConstraints ( bool B)
inline

Definition at line 608 of file Template.h.

Referenced by clang::Sema::InstantiateClass(), and clang::Sema::SubstTemplateParams().

◆ SubstDefaultedFunction()

◆ SubstFunctionType()

◆ SubstQualifier() [1/2]

bool TemplateDeclInstantiator::SubstQualifier ( const DeclaratorDecl * OldDecl,
DeclaratorDecl * NewDecl )

◆ SubstQualifier() [2/2]

bool TemplateDeclInstantiator::SubstQualifier ( const TagDecl * OldDecl,
TagDecl * NewDecl )

Definition at line 83 of file SemaTemplateInstantiateDecl.cpp.

◆ SubstTemplateParams()

◆ VisitBaseUsingDecls()

Decl * TemplateDeclInstantiator::VisitBaseUsingDecls ( BaseUsingDecl * D,
BaseUsingDecl * Inst,
LookupResult * Lookup )

◆ VisitCXXMethodDecl()

Decl * TemplateDeclInstantiator::VisitCXXMethodDecl ( CXXMethodDecl * D,
TemplateParameterList * TemplateParams,
RewriteKind RK = RewriteKind::None )

Definition at line 3040 of file SemaTemplateInstantiateDecl.cpp.

References adjustForRewrite(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::TemplateParameterList::asArray(), clang::cast(), clang::Constructor, clang::CXXConstructorDecl::Create(), clang::CXXConversionDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXMethodDecl::Create(), clang::FunctionTemplateDecl::Create(), clang::TemplateParameterList::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Destructor, clang::Decl::FOK_None, ForExternalRedeclaration, clang::FunctionTemplate, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDeletedMessage(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getEndLoc(), clang::Stmt::getEndLoc(), clang::Decl::getFriendObjectKind(), clang::ExplicitSpecifier::getFromDecl(), clang::DeclaratorDecl::getInnerLocStart(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::DeclaratorDecl::getNumTemplateParameterLists(), clang::FunctionDecl::getPreviousDecl(), clang::DeclaratorDecl::getQualifierLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), clang::DeclaratorDecl::getTemplateParameterList(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), InitMethodInstantiation(), clang::isa(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isInLocalScopeForInstantiation(), clang::isLambdaMethod(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isPureVirtual(), clang::CXXMethodDecl::isStatic(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::LookupOrdinaryName, clang::Method, None, Previous, clang::SC_None, clang::SC_Static, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::DeclaratorDecl::setTypeSourceInfo(), clang::TemplateParameterList::size(), SubstDefaultedFunction(), SubstFunctionType(), SubstTemplateParams(), clang::T, clang::TSK_ImplicitInstantiation, clang::Unresolved, and clang::FunctionDecl::UsesFPIntrin().

Referenced by clang::Sema::SubstSpaceshipAsEqualEqual().

◆ VisitDecl()

Decl * TemplateDeclInstantiator::VisitDecl ( Decl * D)

Definition at line 4681 of file SemaTemplateInstantiateDecl.cpp.

◆ VisitFunctionDecl()

Decl * TemplateDeclInstantiator::VisitFunctionDecl ( FunctionDecl * D,
TemplateParameterList * TemplateParams,
RewriteKind FunctionRewriteKind = RewriteKind::None )

Normal class members are of more specific types and therefore don't make it here.

This function serves three purposes: 1) instantiating function templates 2) substituting friend and local function declarations 3) substituting deduction guide declarations for nested class templates

Definition at line 2654 of file SemaTemplateInstantiateDecl.cpp.

References adjustForRewrite(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::TemplateParameterList::asArray(), clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, clang::cast(), clang::CXXDeductionGuideDecl::Create(), clang::FunctionDecl::Create(), clang::FunctionTemplateDecl::Create(), clang::TemplateParameterList::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Decl::FOK_None, ForExternalRedeclaration, clang::FunctionDecl::FriendConstraintRefersToEnclosingTemplate(), clang::Function, clang::FunctionTemplate, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getCanonicalDecl(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDeletedMessage(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::Stmt::getEndLoc(), clang::Decl::getFriendObjectKind(), clang::DeclaratorDecl::getInnerLocStart(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getNameInfo(), clang::DeclaratorDecl::getQualifierLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::DeclContext::getRedeclContext(), clang::TemplateParameterList::getRequiresClause(), clang::FunctionDecl::getSourceRange(), clang::FunctionDecl::getStorageClass(), clang::TemplateParameterList::getTemplateLoc(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Expr::getType(), clang::FunctionDecl::hasBody(), clang::NestedNameSpecifierLoc::hasQualifier(), clang::FunctionDecl::hasWrittenPrototype(), clang::Decl::IDNS_Ordinary, InitFunctionInstantiation(), clang::isa(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::DeclContext::isFileContext(), clang::Decl::isInIdentifierNamespace(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::ExplicitSpecifier::isInvalid(), clang::Decl::isLocalExternDecl(), clang::FunctionDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isTypeAwareOperatorNewOrDelete(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupRedeclarationWithLinkage, clang::DeclContext::makeDeclVisibleInContext(), None, Previous, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::Decl::setNonMemberOperator(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateParameterList::size(), SubstDefaultedFunction(), SubstFunctionType(), clang::T, clang::Sema::TPC_FriendFunctionTemplate, clang::Sema::TPC_FriendFunctionTemplateDefinition, clang::TSK_ImplicitInstantiation, and clang::FunctionDecl::UsesFPIntrin().

Referenced by clang::Sema::SubstSpaceshipAsEqualEqual().

◆ VisitVarDecl()

Decl * TemplateDeclInstantiator::VisitVarDecl ( VarDecl * D,
bool InstantiatingVarTemplate,
ArrayRef< BindingDecl * > * Bindings = nullptr )

Definition at line 1681 of file SemaTemplateInstantiateDecl.cpp.

References VisitVarDecl().

Referenced by VisitVarDecl().

◆ VisitVarTemplateSpecializationDecl()


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