clang
3.9.0
|
Declaration of a class template. More...
#include <DeclTemplate.h>
Classes | |
struct | Common |
Data that is common to all of the declarations of a given class template. More... | |
Public Types | |
typedef SpecIterator < ClassTemplateSpecializationDecl > | spec_iterator |
typedef llvm::iterator_range < spec_iterator > | spec_range |
![]() | |
typedef redeclarable_base::redecl_range | redecl_range |
typedef redeclarable_base::redecl_iterator | redecl_iterator |
![]() | |
enum | ExplicitVisibilityKind { VisibilityForType, VisibilityForValue } |
Kinds of explicit visibility. More... | |
![]() | |
typedef llvm::iterator_range < redecl_iterator > | redecl_range |
Public Member Functions | |
void | LoadLazySpecializations () const |
Load any lazily-loaded specializations from the external source. More... | |
CXXRecordDecl * | getTemplatedDecl () const |
Get the underlying class declarations of the template. More... | |
bool | isThisDeclarationADefinition () const |
Returns whether this template declaration defines the primary class pattern. More... | |
ClassTemplateSpecializationDecl * | findSpecialization (ArrayRef< TemplateArgument > Args, void *&InsertPos) |
Return the specialization with the provided arguments if it exists, otherwise return the insertion point. More... | |
void | AddSpecialization (ClassTemplateSpecializationDecl *D, void *InsertPos) |
Insert the specified specialization knowing that it is not already in. More... | |
ClassTemplateDecl * | getCanonicalDecl () override |
const ClassTemplateDecl * | getCanonicalDecl () const |
ClassTemplateDecl * | getPreviousDecl () |
Retrieve the previous declaration of this class template, or NULL if no such declaration exists. More... | |
const ClassTemplateDecl * | getPreviousDecl () const |
Retrieve the previous declaration of this class template, or NULL if no such declaration exists. More... | |
ClassTemplateDecl * | getMostRecentDecl () |
const ClassTemplateDecl * | getMostRecentDecl () const |
ClassTemplateDecl * | getInstantiatedFromMemberTemplate () const |
ClassTemplatePartialSpecializationDecl * | findPartialSpecialization (ArrayRef< TemplateArgument > Args, void *&InsertPos) |
Return the partial specialization with the provided arguments if it exists, otherwise return the insertion point. More... | |
void | AddPartialSpecialization (ClassTemplatePartialSpecializationDecl *D, void *InsertPos) |
Insert the specified partial specialization knowing that it is not already in. More... | |
void | getPartialSpecializations (SmallVectorImpl< ClassTemplatePartialSpecializationDecl * > &PS) |
Retrieve the partial specializations as an ordered list. More... | |
ClassTemplatePartialSpecializationDecl * | findPartialSpecialization (QualType T) |
Find a class template partial specialization with the given type T. More... | |
ClassTemplatePartialSpecializationDecl * | findPartialSpecInstantiatedFromMember (ClassTemplatePartialSpecializationDecl *D) |
Find a class template partial specialization which was instantiated from the given member partial specialization. More... | |
QualType | getInjectedClassNameSpecialization () |
Retrieve the template specialization type of the injected-class-name for this class template. More... | |
spec_range | specializations () const |
spec_iterator | spec_begin () const |
spec_iterator | spec_end () const |
![]() | |
RedeclarableTemplateDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this template. More... | |
const RedeclarableTemplateDecl * | getCanonicalDecl () const |
bool | isMemberSpecialization () const |
Determines whether this template was a specialization of a member template. More... | |
void | setMemberSpecialization () |
Note that this member template is a specialization. More... | |
RedeclarableTemplateDecl * | getInstantiatedFromMemberTemplate () const |
Retrieve the member template from which this template was instantiated, or NULL if this template was not instantiated from a member template. More... | |
void | setInstantiatedFromMemberTemplate (RedeclarableTemplateDecl *TD) |
![]() | |
TemplateParameterList * | getTemplateParameters () const |
Get the list of template parameters. More... | |
NamedDecl * | getTemplatedDecl () const |
Get the underlying, templated declaration. More... | |
SourceRange | getSourceRange () const override LLVM_READONLY |
bool | isConcept () const |
Whether this is a (C++ Concepts TS) function or variable concept. More... | |
void | setConcept () |
void | init (NamedDecl *templatedDecl, TemplateParameterList *templateParams) |
Initialize the underlying templated declaration and template parameters. More... | |
![]() | |
IdentifierInfo * | getIdentifier () const |
getIdentifier - Get the identifier that names this declaration, if there is one. More... | |
StringRef | getName () const |
getName - Get the name of identifier for this declaration as a StringRef. More... | |
std::string | getNameAsString () const |
getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ constructor, Objective-C selector, etc). More... | |
void | printName (raw_ostream &os) const |
DeclarationName | getDeclName () const |
getDeclName - Get the actual, stored name of the declaration, which may be a special name. More... | |
void | setDeclName (DeclarationName N) |
Set the name of this declaration. More... | |
void | printQualifiedName (raw_ostream &OS) const |
printQualifiedName - Returns human-readable qualified name for declaration, like A::B::i, for i being member of namespace A::B. More... | |
void | printQualifiedName (raw_ostream &OS, const PrintingPolicy &Policy) const |
std::string | getQualifiedNameAsString () const |
virtual void | getNameForDiagnostic (raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const |
getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream. More... | |
bool | declarationReplaces (NamedDecl *OldD, bool IsKnownNewer=true) const |
Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. More... | |
bool | hasLinkage () const |
Determine whether this declaration has linkage. More... | |
bool | isHidden () const |
Determine whether this declaration is hidden from name lookup. More... | |
void | setHidden (bool Hide) |
Set whether this declaration is hidden from name lookup. More... | |
bool | isCXXClassMember () const |
Determine whether this declaration is a C++ class member. More... | |
bool | isCXXInstanceMember () const |
Determine whether the given declaration is an instance member of a C++ class. More... | |
Linkage | getLinkageInternal () const |
Determine what kind of linkage this entity has. More... | |
Linkage | getFormalLinkage () const |
Get the linkage from a semantic point of view. More... | |
bool | hasExternalFormalLinkage () const |
True if this decl has external linkage. More... | |
bool | isExternallyVisible () const |
Visibility | getVisibility () const |
Determines the visibility of this entity. More... | |
LinkageInfo | getLinkageAndVisibility () const |
Determines the linkage and visibility of this entity. More... | |
Optional< Visibility > | getExplicitVisibility (ExplicitVisibilityKind kind) const |
If visibility was explicitly specified for this declaration, return that visibility. More... | |
bool | isLinkageValid () const |
True if the computed linkage is valid. More... | |
bool | hasLinkageBeenComputed () const |
True if something has required us to compute the linkage of this declaration. More... | |
NamedDecl * | getUnderlyingDecl () |
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. More... | |
const NamedDecl * | getUnderlyingDecl () const |
NamedDecl * | getMostRecentDecl () |
const NamedDecl * | getMostRecentDecl () const |
ObjCStringFormatFamily | getObjCFStringFormattingFamily () const |
![]() | |
Redeclarable (const ASTContext &Ctx) | |
RedeclarableTemplateDecl * | getPreviousDecl () |
Return the previous declaration of this declaration or NULL if this is the first declaration. More... | |
const RedeclarableTemplateDecl * | getPreviousDecl () const |
RedeclarableTemplateDecl * | getFirstDecl () |
Return the first declaration of this declaration or itself if this is the only declaration. More... | |
const RedeclarableTemplateDecl * | getFirstDecl () const |
Return the first declaration of this declaration or itself if this is the only declaration. More... | |
bool | isFirstDecl () const |
True if this is the first declaration in its redeclaration chain. More... | |
RedeclarableTemplateDecl * | getMostRecentDecl () |
Returns the most recent (re)declaration of this declaration. More... | |
const RedeclarableTemplateDecl * | getMostRecentDecl () const |
Returns the most recent (re)declaration of this declaration. More... | |
void | setPreviousDecl (RedeclarableTemplateDecl *PrevDecl) |
Set the previous declaration. More... | |
redecl_range | redecls () const |
Returns an iterator range for all the redeclarations of the same decl. More... | |
redecl_iterator | redecls_begin () const |
redecl_iterator | redecls_end () const |
Static Public Member Functions | |
static ClassTemplateDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl, ClassTemplateDecl *PrevDecl) |
Create a class template node. More... | |
static ClassTemplateDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
Create an empty class template node. More... | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
![]() | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Protected Member Functions | |
llvm::FoldingSetVector < ClassTemplateSpecializationDecl > & | getSpecializations () const |
Retrieve the set of specializations of this class template. More... | |
llvm::FoldingSetVector < ClassTemplatePartialSpecializationDecl > & | getPartialSpecializations () |
Retrieve the set of partial specializations of this class template. More... | |
ClassTemplateDecl (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl) | |
CommonBase * | newCommon (ASTContext &C) const override |
Common * | getCommonPtr () const |
![]() | |
template<class EntryType > | |
SpecEntryTraits< EntryType > ::DeclType * | findSpecializationImpl (llvm::FoldingSetVector< EntryType > &Specs, ArrayRef< TemplateArgument > Args, void *&InsertPos) |
template<class Derived , class EntryType > | |
void | addSpecializationImpl (llvm::FoldingSetVector< EntryType > &Specs, EntryType *Entry, void *InsertPos) |
CommonBase * | getCommonPtr () const |
Retrieves the "common" pointer shared by all (re-)declarations of the same template. More... | |
RedeclarableTemplateDecl (Kind DK, ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl) | |
![]() | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name) | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params) | |
TemplateDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl) | |
![]() | |
NamedDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N) | |
![]() | |
RedeclarableTemplateDecl * | getNextRedeclaration () const |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
Additional Inherited Members | |
![]() | |
template<typename EntryType > | |
static SpecIterator< EntryType > | makeSpecIterator (llvm::FoldingSetVector< EntryType > &Specs, bool isEnd) |
![]() | |
static DeclLink | PreviousDeclLink (RedeclarableTemplateDecl *D) |
static DeclLink | LatestDeclLink (const ASTContext &Ctx) |
![]() | |
CommonBase * | Common |
Pointer to the common data shared by all declarations of this template. More... | |
![]() | |
llvm::PointerIntPair < NamedDecl *, 1, bool > | TemplatedDecl |
The named declaration from which this template was instantiated. More... | |
TemplateParameterList * | TemplateParams |
![]() | |
DeclLink | RedeclLink |
Points to the next redeclaration in the chain. More... | |
RedeclarableTemplateDecl * | First |
Declaration of a class template.
Definition at line 1935 of file DeclTemplate.h.
Definition at line 2108 of file DeclTemplate.h.
typedef llvm::iterator_range<spec_iterator> clang::ClassTemplateDecl::spec_range |
Definition at line 2109 of file DeclTemplate.h.
|
inlineprotected |
Definition at line 1973 of file DeclTemplate.h.
Referenced by Create(), and CreateDeserialized().
void ClassTemplateDecl::AddPartialSpecialization | ( | ClassTemplatePartialSpecializationDecl * | D, |
void * | InsertPos | ||
) |
Insert the specified partial specialization knowing that it is not already in.
InsertPos must be obtained from findPartialSpecialization.
Definition at line 394 of file DeclTemplate.cpp.
References getPartialSpecializations().
void ClassTemplateDecl::AddSpecialization | ( | ClassTemplateSpecializationDecl * | D, |
void * | InsertPos | ||
) |
Insert the specified specialization knowing that it is not already in.
InsertPos must be obtained from findSpecialization.
Definition at line 383 of file DeclTemplate.cpp.
References getSpecializations().
Definition at line 2124 of file DeclTemplate.h.
Definition at line 2125 of file DeclTemplate.h.
|
static |
Create a class template node.
Definition at line 323 of file DeclTemplate.cpp.
References AdoptTemplateParameterList(), ClassTemplateDecl(), and clang::Redeclarable< decl_type >::setPreviousDecl().
Referenced by clang::Sema::CheckClassTemplate(), and clang::ASTNodeImporter::VisitClassTemplateDecl().
|
static |
Create an empty class template node.
Definition at line 337 of file DeclTemplate.cpp.
References ClassTemplateDecl(), and ID.
ClassTemplatePartialSpecializationDecl * ClassTemplateDecl::findPartialSpecialization | ( | ArrayRef< TemplateArgument > | Args, |
void *& | InsertPos | ||
) |
Return the partial specialization with the provided arguments if it exists, otherwise return the insertion point.
Definition at line 389 of file DeclTemplate.cpp.
References clang::RedeclarableTemplateDecl::findSpecializationImpl(), and getPartialSpecializations().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), and clang::TemplateDeclInstantiator::InstantiateClassTemplatePartialSpecialization().
ClassTemplatePartialSpecializationDecl * ClassTemplateDecl::findPartialSpecialization | ( | QualType | T | ) |
Find a class template partial specialization with the given type T.
T | a dependent type that names a specialization of this class template. |
T
, or NULL if no such partial specialization exists. Definition at line 421 of file DeclTemplate.cpp.
References Context, getPartialSpecializations(), clang::ASTContext::hasSameType(), and P.
ClassTemplatePartialSpecializationDecl * ClassTemplateDecl::findPartialSpecInstantiatedFromMember | ( | ClassTemplatePartialSpecializationDecl * | D | ) |
Find a class template partial specialization which was instantiated from the given member partial specialization.
D | a member class template partial specialization. |
Definition at line 433 of file DeclTemplate.cpp.
References clang::CXXRecordDecl::getCanonicalDecl(), getPartialSpecializations(), and P.
ClassTemplateSpecializationDecl * ClassTemplateDecl::findSpecialization | ( | ArrayRef< TemplateArgument > | Args, |
void *& | InsertPos | ||
) |
Return the specialization with the provided arguments if it exists, otherwise return the insertion point.
Definition at line 378 of file DeclTemplate.cpp.
References clang::RedeclarableTemplateDecl::findSpecializationImpl(), and getSpecializations().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), and clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl().
|
inlineoverride |
Definition at line 2019 of file DeclTemplate.h.
References clang::RedeclarableTemplateDecl::getCanonicalDecl().
Referenced by clang::Sema::FindInstantiatedDecl(), isInstantiationOf(), clang::Sema::isStdInitializerList(), MatchesFriend(), and clang::ASTDeclWriter::VisitClassTemplateSpecializationDecl().
|
inline |
Definition at line 2023 of file DeclTemplate.h.
References clang::RedeclarableTemplateDecl::getCanonicalDecl().
|
inlineprotected |
Definition at line 1980 of file DeclTemplate.h.
References clang::RedeclarableTemplateDecl::getCommonPtr().
Referenced by getInjectedClassNameSpecialization(), getPartialSpecializations(), getSpecializations(), LoadLazySpecializations(), clang::ASTDeclReader::VisitClassTemplateDecl(), and clang::ASTDeclReader::VisitClassTemplateSpecializationDeclImpl().
QualType ClassTemplateDecl::getInjectedClassNameSpecialization | ( | ) |
Retrieve the template specialization type of the injected-class-name for this class template.
The injected-class-name for a class template X
is X<template-args>
, where template-args
is formed from the template arguments that correspond to the template parameters of X
. For example:
Definition at line 445 of file DeclTemplate.cpp.
References Context, GenerateInjectedTemplateArgs(), getCommonPtr(), clang::TemplateDecl::getTemplateParameters(), clang::ASTContext::getTemplateSpecializationType(), clang::ClassTemplateDecl::Common::InjectedClassNameType, clang::QualType::isNull(), and clang::TemplateParameterList::size().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::CheckClassTemplate(), and clang::ASTDeclReader::VisitClassTemplateDecl().
|
inline |
Definition at line 2051 of file DeclTemplate.h.
References clang::RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate().
Referenced by clang::Sema::CheckClassTemplate(), clang::Sema::InstantiateClassTemplateSpecialization(), and isInstantiationOf().
|
inline |
Definition at line 2043 of file DeclTemplate.h.
Referenced by LoadLazySpecializations().
|
inline |
Definition at line 2047 of file DeclTemplate.h.
|
protected |
Retrieve the set of partial specializations of this class template.
Definition at line 365 of file DeclTemplate.cpp.
References getCommonPtr(), LoadLazySpecializations(), and clang::ClassTemplateDecl::Common::PartialSpecializations.
Referenced by AddPartialSpecialization(), findPartialSpecialization(), findPartialSpecInstantiatedFromMember(), getPartialSpecializations(), and clang::Sema::InstantiateClassTemplateSpecialization().
void ClassTemplateDecl::getPartialSpecializations | ( | SmallVectorImpl< ClassTemplatePartialSpecializationDecl * > & | PS | ) |
Retrieve the partial specializations as an ordered list.
Definition at line 410 of file DeclTemplate.cpp.
References getPartialSpecializations(), and P.
|
inline |
Retrieve the previous declaration of this class template, or NULL if no such declaration exists.
Definition at line 2030 of file DeclTemplate.h.
|
inline |
Retrieve the previous declaration of this class template, or NULL if no such declaration exists.
Definition at line 2037 of file DeclTemplate.h.
|
protected |
Retrieve the set of specializations of this class template.
Definition at line 359 of file DeclTemplate.cpp.
References getCommonPtr(), LoadLazySpecializations(), and clang::ClassTemplateDecl::Common::Specializations.
Referenced by AddSpecialization(), and findSpecialization().
|
inline |
Get the underlying class declarations of the template.
Definition at line 1989 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::CheckClassTemplate(), getLVForClassMember(), clang::Sema::InstantiateClassTemplateSpecialization(), clang::Sema::isStdInitializerList(), IsStructurallyEquivalent(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTDeclReader::VisitClassTemplateDecl(), and clang::ASTDeclReader::VisitCXXRecordDeclImpl().
|
inline |
Returns whether this template declaration defines the primary class pattern.
Definition at line 1995 of file DeclTemplate.h.
void ClassTemplateDecl::LoadLazySpecializations | ( | ) | const |
Load any lazily-loaded specializations from the external source.
Definition at line 343 of file DeclTemplate.cpp.
References Context, getCommonPtr(), clang::ExternalASTSource::GetExternalDecl(), clang::ASTContext::getExternalSource(), getMostRecentDecl(), I, and clang::ClassTemplateDecl::Common::LazySpecializations.
Referenced by getPartialSpecializations(), and getSpecializations().
|
overrideprotectedvirtual |
Implements clang::RedeclarableTemplateDecl.
Definition at line 371 of file DeclTemplate.cpp.
References clang::ASTContext::AddDeallocation().
|
inline |
Definition at line 2115 of file DeclTemplate.h.
|
inline |
Definition at line 2119 of file DeclTemplate.h.
|
inline |
Definition at line 2111 of file DeclTemplate.h.
|
friend |
Definition at line 2127 of file DeclTemplate.h.
|
friend |
Definition at line 2128 of file DeclTemplate.h.