clang  3.9.0svn
Public Types | Public Member Functions
clang::TemplateDeclInstantiator Class Reference

#include <Template.h>

Inheritance diagram for clang::TemplateDeclInstantiator:
Inheritance graph
[legend]
Collaboration diagram for clang::TemplateDeclInstantiator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SmallVectorImpl
< std::pair< ClassTemplateDecl
*, ClassTemplatePartialSpecializationDecl * >
>::iterator 
delayed_partial_spec_iterator
typedef SmallVectorImpl
< std::pair< VarTemplateDecl
*, VarTemplatePartialSpecializationDecl * >
>::iterator 
delayed_var_partial_spec_iterator

Public Member Functions

 TemplateDeclInstantiator (Sema &SemaRef, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs)
DeclVisitCXXMethodDecl (CXXMethodDecl *D, TemplateParameterList *TemplateParams, bool IsClassScopeSpecialization=false)
DeclVisitFunctionDecl (FunctionDecl *D, TemplateParameterList *TemplateParams)
 Normal class members are of more specific types and therefore don't make it here.
DeclVisitDecl (Decl *D)
DeclVisitVarDecl (VarDecl *D, bool InstantiatingVarTemplate)
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).
TemplateParameterList * SubstTemplateParams (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)
DeclVisitVarTemplateSpecializationDecl (VarTemplateDecl *VarTemplate, VarDecl *FromVar, void *InsertPos, const TemplateArgumentListInfo &TemplateArgsInfo, ArrayRef< TemplateArgument > Converted)
DeclInstantiateTypedefNameDecl (TypedefNameDecl *D, bool IsTypeAlias)
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)

Detailed Description

Definition at line 371 of file Template.h.


Member Typedef Documentation

Definition at line 457 of file Template.h.

Definition at line 461 of file Template.h.


Constructor & Destructor Documentation

clang::TemplateDeclInstantiator::TemplateDeclInstantiator ( Sema SemaRef,
DeclContext Owner,
const MultiLevelTemplateArgumentList TemplateArgs 
) [inline]

Definition at line 397 of file Template.h.


Member Function Documentation

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 467 of file Template.h.

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

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 479 of file Template.h.

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

delayed_var_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_var_partial_spec_begin ( ) [inline]

Definition at line 471 of file Template.h.

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

delayed_var_partial_spec_iterator clang::TemplateDeclInstantiator::delayed_var_partial_spec_end ( ) [inline]

Definition at line 483 of file Template.h.

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

void clang::TemplateDeclInstantiator::disableLateAttributeInstantiation ( ) [inline]

Definition at line 446 of file Template.h.

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

void clang::TemplateDeclInstantiator::enableLateAttributeInstantiation ( Sema::LateInstantiatedAttrVec LA) [inline]

Definition at line 440 of file Template.h.

References clang::Sema::CurrentInstantiationScope.

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

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

Definition at line 451 of file Template.h.

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

bool TemplateDeclInstantiator::InitFunctionInstantiation ( FunctionDecl New,
FunctionDecl Tmpl 
)
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 3321 of file SemaTemplateInstantiateDecl.cpp.

References clang::Decl::getAccess(), InitFunctionInstantiation(), clang::FunctionDecl::isVirtualAsWritten(), clang::Decl::setAccess(), and clang::FunctionDecl::setVirtualAsWritten().

Referenced by VisitCXXMethodDecl().

ClassTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization ( ClassTemplateDecl ClassTemplate,
ClassTemplatePartialSpecializationDecl PartialSpec 
)
void TemplateDeclInstantiator::InstantiateEnumDefinition ( EnumDecl Enum,
EnumDecl Pattern 
)
Decl * TemplateDeclInstantiator::InstantiateTypedefNameDecl ( TypedefNameDecl D,
bool  IsTypeAlias 
)
VarTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization ( VarTemplateDecl VarTemplate,
VarTemplatePartialSpecializationDecl PartialSpec 
)

Instantiate the declaration of a variable template partial specialization.

Parameters:
VarTemplatethe (instantiated) variable template that is partially specialized by the instantiation of PartialSpec.
PartialSpecthe (uninstantiated) variable template partial specialization that we are instantiating.
Returns:
The instantiated partial specialization, if successful; otherwise, NULL to indicate an error.

Definition at line 2918 of file SemaTemplateInstantiateDecl.cpp.

References clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::Context, clang::Create(), clang::Sema::Diag(), clang::VarTemplateDecl::findPartialSpecialization(), clang::NamedDecl::getDeclName(), clang::DeclaratorDecl::getInnerLocStart(), clang::Decl::getLocation(), clang::VarDecl::getStorageClass(), clang::VarTemplatePartialSpecializationDecl::getTemplateArgsAsWritten(), clang::VarTemplatePartialSpecializationDecl::getTemplateParameters(), clang::ASTContext::getTemplateSpecializationType(), clang::ASTContext::getTemplateSpecializationTypeInfo(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::VarDecl::isStaticDataMember(), clang::VarTemplatePartialSpecializationDecl::setInstantiatedFromMember(), clang::VarTemplateSpecializationDecl::setTypeAsWritten(), clang::Sema::Subst(), SubstQualifier(), SubstTemplateParams(), and clang::Sema::SubstType().

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

TypeSourceInfo * TemplateDeclInstantiator::SubstFunctionType ( FunctionDecl D,
SmallVectorImpl< ParmVarDecl * > &  Params 
)
bool TemplateDeclInstantiator::SubstQualifier ( const DeclaratorDecl OldDecl,
DeclaratorDecl NewDecl 
)
bool TemplateDeclInstantiator::SubstQualifier ( const TagDecl OldDecl,
TagDecl NewDecl 
)

Definition at line 70 of file SemaTemplateInstantiateDecl.cpp.

References SubstQualifier().

TemplateParameterList * TemplateDeclInstantiator::SubstTemplateParams ( TemplateParameterList *  L)

Instantiates a nested template parameter list in the current instantiation context.

Parameters:
LThe parameter list to instantiate
Returns:
NULL if there was an error

Definition at line 2754 of file SemaTemplateInstantiateDecl.cpp.

References clang::Sema::Context, clang::Create(), clang::Decl::isInvalidDecl(), P, and clang::declvisitor::Base< declvisitor::make_ptr, TemplateDeclInstantiator, Decl * >::Visit().

Referenced by InstantiateClassTemplatePartialSpecialization(), InstantiateVarTemplatePartialSpecialization(), and VisitCXXMethodDecl().

Decl * TemplateDeclInstantiator::VisitCXXMethodDecl ( CXXMethodDecl D,
TemplateParameterList *  TemplateParams,
bool  IsClassScopeSpecialization = false 
)

Definition at line 1657 of file SemaTemplateInstantiateDecl.cpp.

References clang::DeclContext::addDecl(), clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::Sema::CheckFriendAccess(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckOverrideControl(), clang::Sema::CheckPureMethod(), clang::LookupResult::clear(), clang::Sema::computeDeclContext(), clang::Sema::Context, clang::Create(), clang::LookupResult::empty(), clang::Sema::FindInstantiatedContext(), clang::FunctionTemplateDecl::findSpecialization(), clang::Decl::FOK_None, clang::Sema::ForRedeclaration, clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getFriendObjectKind(), clang::DeclaratorDecl::getInnerLocStart(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::Decl::getLocEnd(), clang::FunctionDecl::getNameInfo(), clang::DeclaratorDecl::getNumTemplateParameterLists(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::DeclaratorDecl::getQualifierLoc(), clang::DeclaratorDecl::getTemplateParameterList(), I, InitMethodInstantiation(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDeletedAsWritten(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isPure(), clang::LookupResult::isSingleTagDecl(), clang::CXXMethodDecl::isStatic(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::DeclContext::makeDeclVisibleInContext(), P, Previous, clang::Sema::RequireCompleteDeclContext(), clang::SC_None, clang::SC_Static, clang::Decl::setAccess(), clang::Sema::SetDeclDefaulted(), clang::Sema::SetDeclDeleted(), clang::Decl::setLexicalDeclContext(), clang::Decl::setObjectOfFriendDecl(), clang::Sema::SubstDecl(), clang::Sema::SubstDeclarationNameInfo(), SubstFunctionType(), clang::Sema::SubstNestedNameSpecifierLoc(), and SubstTemplateParams().

Referenced by clang::ASTDeclWriter::VisitCXXMethodDecl().

Decl * TemplateDeclInstantiator::VisitDecl ( Decl D)

Definition at line 2734 of file SemaTemplateInstantiateDecl.cpp.

Decl * TemplateDeclInstantiator::VisitFunctionDecl ( FunctionDecl D,
TemplateParameterList *  TemplateParams 
)

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

This function serves two purposes: 1) instantiating function templates 2) substituting friend declarations

Definition at line 1382 of file SemaTemplateInstantiateDecl.cpp.

References clang::Sema::adjustContextForLocalExternDecl(), adjustFunctionTypeForInstantiation(), clang::CXXScopeSpec::Adopt(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::computeDeclContext(), clang::Sema::Context, clang::Create(), clang::Sema::Diag(), E, clang::Sema::FindInstantiatedContext(), clang::Sema::FindInstantiatedDecl(), clang::FunctionTemplateDecl::findSpecialization(), clang::Decl::FOK_None, clang::Sema::ForRedeclaration, clang::FunctionDecl::getCanonicalDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::Decl::getFriendObjectKind(), clang::DeclaratorDecl::getInnerLocStart(), clang::Decl::getLocation(), clang::FunctionDecl::getMemberSpecializationInfo(), clang::FunctionDecl::getNameInfo(), clang::Redeclarable< decl_type >::getPreviousDecl(), clang::DeclaratorDecl::getQualifierLoc(), clang::FunctionDecl::getSourceRange(), clang::FunctionDecl::getStorageClass(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::FunctionDecl::hasWrittenPrototype(), I, clang::Decl::IDNS_Ordinary, InitFunctionInstantiation(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDefined(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), clang::Decl::isInIdentifierNamespace(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isLocalExternDecl(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isOverloadedOperator(), clang::DeclContext::isRecord(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::Sema::LookupRedeclarationWithLinkage, clang::DeclContext::makeDeclVisibleInContext(), P, clang::Sema::PendingLocalImplicitInstantiations, Previous, clang::Redeclarable< decl_type >::redecls(), clang::FunctionDecl::setDescribedFunctionTemplate(), clang::FunctionDecl::setImplicitlyInline(), clang::RedeclarableTemplateDecl::setInstantiatedFromMemberTemplate(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::Decl::setNonMemberOperator(), clang::Decl::setObjectOfFriendDecl(), clang::DeclaratorDecl::setQualifierInfo(), clang::FunctionDecl::setRangeEnd(), clang::Sema::Subst(), SubstFunctionType(), clang::Sema::SubstNestedNameSpecifierLoc(), and clang::TSK_Undeclared.

Referenced by clang::ASTDeclWriter::VisitFunctionDecl().

Decl * TemplateDeclInstantiator::VisitVarDecl ( VarDecl D,
bool  InstantiatingVarTemplate 
)
Decl * TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl ( VarTemplateDecl VarTemplate,
VarDecl FromVar,
void *  InsertPos,
const TemplateArgumentListInfo TemplateArgsInfo,
ArrayRef< TemplateArgument Converted 
)

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