clang
3.9.0
|
#include <Template.h>
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) | |
Decl * | VisitCXXMethodDecl (CXXMethodDecl *D, TemplateParameterList *TemplateParams, bool IsClassScopeSpecialization=false) |
Decl * | VisitFunctionDecl (FunctionDecl *D, TemplateParameterList *TemplateParams) |
Normal class members are of more specific types and therefore don't make it here. More... | |
Decl * | VisitDecl (Decl *D) |
Decl * | VisitVarDecl (VarDecl *D, bool InstantiatingVarTemplate) |
void | enableLateAttributeInstantiation (Sema::LateInstantiatedAttrVec *LA) |
void | disableLateAttributeInstantiation () |
LocalInstantiationScope * | getStartingScope () 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. More... | |
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. More... | |
delayed_var_partial_spec_iterator | delayed_var_partial_spec_end () |
TypeSourceInfo * | SubstFunctionType (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). More... | |
bool | InitMethodInstantiation (CXXMethodDecl *New, CXXMethodDecl *Tmpl) |
Initializes common fields of an instantiated method declaration (New) from the corresponding fields of its template (Tmpl). More... | |
TemplateParameterList * | SubstTemplateParams (TemplateParameterList *List) |
Instantiates a nested template parameter list in the current instantiation context. More... | |
bool | SubstQualifier (const DeclaratorDecl *OldDecl, DeclaratorDecl *NewDecl) |
bool | SubstQualifier (const TagDecl *OldDecl, TagDecl *NewDecl) |
Decl * | VisitVarTemplateSpecializationDecl (VarTemplateDecl *VarTemplate, VarDecl *FromVar, void *InsertPos, const TemplateArgumentListInfo &TemplateArgsInfo, ArrayRef< TemplateArgument > Converted) |
Decl * | InstantiateTypedefNameDecl (TypedefNameDecl *D, bool IsTypeAlias) |
ClassTemplatePartialSpecializationDecl * | InstantiateClassTemplatePartialSpecialization (ClassTemplateDecl *ClassTemplate, ClassTemplatePartialSpecializationDecl *PartialSpec) |
Instantiate the declaration of a class template partial specialization. More... | |
VarTemplatePartialSpecializationDecl * | InstantiateVarTemplatePartialSpecialization (VarTemplateDecl *VarTemplate, VarTemplatePartialSpecializationDecl *PartialSpec) |
Instantiate the declaration of a variable template partial specialization. More... | |
void | InstantiateEnumDefinition (EnumDecl *Enum, EnumDecl *Pattern) |
![]() | |
Decl * | Visit (PTR(Decl) D) |
Decl * | VisitDecl (PTR(Decl) D) |
Definition at line 371 of file Template.h.
typedef SmallVectorImpl<std::pair<ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl *> >::iterator clang::TemplateDeclInstantiator::delayed_partial_spec_iterator |
Definition at line 457 of file Template.h.
typedef SmallVectorImpl<std::pair< VarTemplateDecl *, VarTemplatePartialSpecializationDecl *> >::iterator clang::TemplateDeclInstantiator::delayed_var_partial_spec_iterator |
Definition at line 461 of file Template.h.
|
inline |
Definition at line 397 of file Template.h.
|
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().
|
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().
|
inline |
Definition at line 471 of file Template.h.
Referenced by clang::Sema::InstantiateClass().
|
inline |
Definition at line 483 of file Template.h.
Referenced by clang::Sema::InstantiateClass().
|
inline |
Definition at line 446 of file Template.h.
Referenced by clang::Sema::InstantiateClass().
|
inline |
Definition at line 440 of file Template.h.
References clang::Sema::CurrentInstantiationScope.
Referenced by clang::Sema::InstantiateClass().
|
inline |
Definition at line 451 of file Template.h.
Referenced by clang::Sema::InstantiateClass().
bool TemplateDeclInstantiator::InitFunctionInstantiation | ( | FunctionDecl * | New, |
FunctionDecl * | Tmpl | ||
) |
Initializes the common fields of an instantiation function declaration (New) from the corresponding fields of its template (Tmpl).
Definition at line 3388 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::ActiveTemplateInstantiations, clang::Sema::Context, clang::EST_BasicNoexcept, clang::EST_DynamicNone, clang::EST_None, clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::Type::getAs(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionType(), clang::Sema::getLangOpts(), clang::ASTContext::getManglingNumber(), clang::FunctionType::getNoReturnAttr(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::FunctionProtoType::hasExceptionSpec(), clang::Sema::InstantiateAttrs(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::setDeletedAsWritten(), clang::ASTContext::setManglingNumber(), clang::ValueDecl::setType(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionProtoType::ExceptionSpecInfo::SourceTemplate, clang::Sema::SubstExceptionSpec(), and clang::FunctionProtoType::ExceptionSpecInfo::Type.
Referenced by InitMethodInstantiation(), and VisitFunctionDecl().
bool TemplateDeclInstantiator::InitMethodInstantiation | ( | CXXMethodDecl * | New, |
CXXMethodDecl * | Tmpl | ||
) |
Initializes common fields of an instantiated method declaration (New) from the corresponding fields of its template (Tmpl).
Definition at line 3472 of file SemaTemplateInstantiateDecl.cpp.
References InitFunctionInstantiation(), clang::FunctionDecl::isVirtualAsWritten(), and clang::FunctionDecl::setVirtualAsWritten().
Referenced by VisitCXXMethodDecl().
ClassTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization | ( | ClassTemplateDecl * | ClassTemplate, |
ClassTemplatePartialSpecializationDecl * | PartialSpec | ||
) |
Instantiate the declaration of a class template partial specialization.
ClassTemplate | the (instantiated) class template that is partially |
PartialSpec | the (uninstantiated) class template partial specialization that we are instantiating. |
Definition at line 2944 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::CheckTemplateArgumentList(), clang::Sema::Context, clang::ClassTemplatePartialSpecializationDecl::Create(), clang::Sema::Diag(), clang::ClassTemplateDecl::findPartialSpecialization(), clang::TypeDecl::getLocStart(), clang::TagDecl::getTagKind(), clang::ASTTemplateArgumentListInfo::getTemplateArgs(), clang::ClassTemplatePartialSpecializationDecl::getTemplateArgsAsWritten(), clang::ClassTemplatePartialSpecializationDecl::getTemplateParameters(), clang::ASTContext::getTemplateSpecializationType(), clang::ASTContext::getTemplateSpecializationTypeInfo(), clang::TypeSourceInfo::getType(), clang::ASTContext::getTypeDeclType(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::NumTemplateArgs, clang::ASTTemplateArgumentListInfo::RAngleLoc, clang::ClassTemplatePartialSpecializationDecl::setInstantiatedFromMember(), clang::ClassTemplateSpecializationDecl::setTypeAsWritten(), clang::Sema::Subst(), SubstQualifier(), and SubstTemplateParams().
Referenced by clang::Sema::InstantiateClass().
Definition at line 965 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::ActOnEnumBody(), clang::DeclContext::addDecl(), clang::Sema::CheckEnumConstant(), clang::Sema::ConstantEvaluated, clang::Sema::CurrentInstantiationScope, clang::EnumDecl::enumerators(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::TagDecl::getBraceRange(), clang::NamedDecl::getIdentifier(), clang::Sema::InstantiateAttrs(), clang::LocalInstantiationScope::InstantiatedLocal(), clang::DeclContext::isFunctionOrMethod(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), isInvalid(), clang::EnumDecl::isScoped(), clang::TagDecl::startDefinition(), and clang::Sema::SubstExpr().
Referenced by clang::Sema::InstantiateEnum().
Decl * TemplateDeclInstantiator::InstantiateTypedefNameDecl | ( | TypedefNameDecl * | D, |
bool | IsTypeAlias | ||
) |
Definition at line 469 of file SemaTemplateInstantiateDecl.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::TypedefDecl::Create(), clang::TypeAliasDecl::Create(), clang::Sema::FindInstantiatedDecl(), clang::Type::getAs(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::TypeDecl::getLocStart(), clang::QualType::getNonReferenceType(), getPreviousDeclForInstantiation(), clang::Sema::getSourceManager(), clang::Sema::getStdNamespace(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), clang::TagDecl::getTypedefNameForAnonDecl(), clang::TypedefNameDecl::getTypeSourceInfo(), clang::DecltypeType::getUnderlyingExpr(), clang::TypedefNameDecl::getUnderlyingType(), clang::TagDecl::hasNameForLinkage(), clang::Sema::InstantiateAttrs(), clang::ASTContext::IntTy, clang::Sema::isIncompatibleTypedef(), clang::Type::isInstantiationDependentType(), clang::SourceManager::isInSystemHeader(), clang::Type::isReferenceType(), clang::IdentifierInfo::isStr(), clang::Type::isVariablyModifiedType(), clang::Sema::MarkDeclarationsReferencedInType(), clang::TagDecl::setTypedefNameForAnonDecl(), and clang::Sema::SubstType().
VarTemplatePartialSpecializationDecl * TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization | ( | VarTemplateDecl * | VarTemplate, |
VarTemplatePartialSpecializationDecl * | PartialSpec | ||
) |
Instantiate the declaration of a variable template partial specialization.
VarTemplate | the (instantiated) variable template that is partially specialized by the instantiation of PartialSpec . |
PartialSpec | the (uninstantiated) variable template partial specialization that we are instantiating. |
Definition at line 3069 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::BuildVariableInstantiation(), clang::Sema::CheckTemplateArgumentList(), clang::Sema::Context, clang::VarTemplatePartialSpecializationDecl::Create(), clang::Sema::Diag(), clang::VarTemplateDecl::findPartialSpecialization(), clang::NamedDecl::getDeclName(), clang::DeclaratorDecl::getInnerLocStart(), clang::VarDecl::getStorageClass(), clang::ASTTemplateArgumentListInfo::getTemplateArgs(), clang::VarTemplatePartialSpecializationDecl::getTemplateArgsAsWritten(), clang::VarTemplatePartialSpecializationDecl::getTemplateParameters(), clang::ASTContext::getTemplateSpecializationType(), clang::ASTContext::getTemplateSpecializationTypeInfo(), clang::TypeSourceInfo::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::Type::isFunctionType(), clang::VarDecl::isStaticDataMember(), clang::ASTTemplateArgumentListInfo::LAngleLoc, clang::ASTTemplateArgumentListInfo::NumTemplateArgs, clang::ASTTemplateArgumentListInfo::RAngleLoc, 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 | ||
) |
Definition at line 3187 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::BuildParmVarDeclForTypedef(), clang::TypeLoc::castAs(), clang::Sema::CurrentInstantiationScope, clang::TypeLoc::getAs(), clang::NamedDecl::getDeclName(), clang::Sema::getNumArgumentsInExpansion(), clang::FunctionTypeLoc::getParam(), clang::FunctionProtoType::getParamType(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), I, clang::TypeLoc::IgnoreParens(), clang::LocalInstantiationScope::InstantiatedLocal(), clang::LocalInstantiationScope::InstantiatedLocalPackArg(), clang::ParmVarDecl::isParameterPack(), clang::LocalInstantiationScope::MakeInstantiatedLocalArgPack(), clang::FunctionDecl::parameters(), clang::Sema::SubstFunctionDeclType(), and clang::Sema::SubstParmTypes().
Referenced by VisitCXXMethodDecl(), and VisitFunctionDecl().
bool TemplateDeclInstantiator::SubstQualifier | ( | const DeclaratorDecl * | OldDecl, |
DeclaratorDecl * | NewDecl | ||
) |
Definition at line 65 of file SemaTemplateInstantiateDecl.cpp.
References SubstQualifier().
Referenced by InstantiateClassTemplatePartialSpecialization(), clang::Sema::InstantiateFunctionDefinition(), and InstantiateVarTemplatePartialSpecialization().
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.
L | The parameter list to instantiate |
Definition at line 2907 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::Context, clang::TemplateParameterList::Create(), P, clang::TemplateParameterList::size(), 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 1755 of file SemaTemplateInstantiateDecl.cpp.
References clang::DeclContext::addDecl(), 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::FunctionTemplateDecl::Create(), clang::CXXMethodDecl::Create(), clang::CXXConstructorDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXConversionDecl::Create(), clang::TemplateArgumentList::CreateCopy(), clang::LookupResult::empty(), clang::Sema::FindInstantiatedContext(), clang::FunctionTemplateDecl::findSpecialization(), clang::Sema::ForRedeclaration, clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::DeclaratorDecl::getInnerLocStart(), 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::Sema::SetDeclDefaulted(), clang::Sema::SetDeclDeleted(), clang::FunctionDecl::setImplicitlyInline(), clang::Sema::SubstDeclarationNameInfo(), SubstFunctionType(), clang::Sema::SubstNestedNameSpecifierLoc(), and SubstTemplateParams().
Definition at line 2887 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 1481 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::FunctionTemplateDecl::Create(), clang::FunctionDecl::Create(), clang::TemplateArgumentList::CreateCopy(), clang::Sema::Diag(), E, clang::Sema::FindInstantiatedContext(), clang::Sema::FindInstantiatedDecl(), clang::FunctionTemplateDecl::findSpecialization(), clang::Sema::ForRedeclaration, clang::FunctionDecl::getCanonicalDecl(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDependentSpecializationInfo(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::DeclaratorDecl::getInnerLocStart(), 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, InitFunctionInstantiation(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDefined(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), clang::FunctionDecl::isInlined(), clang::FunctionDecl::isInlineSpecified(), 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::DeclaratorDecl::setQualifierInfo(), clang::FunctionDecl::setRangeEnd(), clang::Sema::Subst(), SubstFunctionType(), clang::Sema::SubstNestedNameSpecifierLoc(), and clang::TSK_Undeclared.
Definition at line 601 of file SemaTemplateInstantiateDecl.cpp.
Decl * TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl | ( | VarTemplateDecl * | VarTemplate, |
VarDecl * | FromVar, | ||
void * | InsertPos, | ||
const TemplateArgumentListInfo & | TemplateArgsInfo, | ||
ArrayRef< TemplateArgument > | Converted | ||
) |
Definition at line 2799 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::CheckTemplateArgumentList(), clang::VarTemplateDecl::findSpecialization(), clang::TemplateArgumentListInfo::getArgumentArray(), clang::TemplateArgumentListInfo::getLAngleLoc(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getTemplateArgsInfo(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateArgumentListInfo::size(), and clang::Sema::Subst().