clang API Documentation
Declaration of a variable template. More...
#include <DeclTemplate.h>
Classes | |
struct | Common |
Data that is common to all of the declarations of a given variable template. More... | |
Public Types | |
typedef SpecIterator < VarTemplateSpecializationDecl > | spec_iterator |
typedef llvm::iterator_range < spec_iterator > | spec_range |
Public Member Functions | |
VarDecl * | getTemplatedDecl () const |
Get the underlying variable declarations of the template. | |
bool | isThisDeclarationADefinition () const |
Returns whether this template declaration defines the primary variable pattern. | |
VarTemplateDecl * | getDefinition () |
VarTemplateSpecializationDecl * | findSpecialization (ArrayRef< TemplateArgument > Args, void *&InsertPos) |
Return the specialization with the provided arguments if it exists, otherwise return the insertion point. | |
void | AddSpecialization (VarTemplateSpecializationDecl *D, void *InsertPos) |
Insert the specified specialization knowing that it is not already in. InsertPos must be obtained from findSpecialization. | |
VarTemplateDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this template. | |
const VarTemplateDecl * | getCanonicalDecl () const |
VarTemplateDecl * | getPreviousDecl () |
Retrieve the previous declaration of this variable template, or NULL if no such declaration exists. | |
const VarTemplateDecl * | getPreviousDecl () const |
Retrieve the previous declaration of this variable template, or NULL if no such declaration exists. | |
VarTemplateDecl * | getInstantiatedFromMemberTemplate () |
VarTemplatePartialSpecializationDecl * | findPartialSpecialization (ArrayRef< TemplateArgument > Args, void *&InsertPos) |
Return the partial specialization with the provided arguments if it exists, otherwise return the insertion point. | |
void | AddPartialSpecialization (VarTemplatePartialSpecializationDecl *D, void *InsertPos) |
Insert the specified partial specialization knowing that it is not already in. InsertPos must be obtained from findPartialSpecialization. | |
void | getPartialSpecializations (SmallVectorImpl< VarTemplatePartialSpecializationDecl * > &PS) |
Retrieve the partial specializations as an ordered list. | |
VarTemplatePartialSpecializationDecl * | findPartialSpecInstantiatedFromMember (VarTemplatePartialSpecializationDecl *D) |
Find a variable template partial specialization which was instantiated from the given member partial specialization. | |
spec_range | specializations () const |
spec_iterator | spec_begin () const |
spec_iterator | spec_end () const |
Static Public Member Functions | |
static VarTemplateDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, VarDecl *Decl) |
Create a variable template node. | |
static VarTemplateDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
Create an empty variable template node. | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Protected Member Functions | |
void | LoadLazySpecializations () const |
Load any lazily-loaded specializations from the external source. | |
llvm::FoldingSetVector < VarTemplateSpecializationDecl > & | getSpecializations () const |
Retrieve the set of specializations of this variable template. | |
llvm::FoldingSetVector < VarTemplatePartialSpecializationDecl > & | getPartialSpecializations () |
Retrieve the set of partial specializations of this class template. | |
VarTemplateDecl (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl) | |
CommonBase * | newCommon (ASTContext &C) const override |
Common * | getCommonPtr () const |
Retrieves the "common" pointer shared by all (re-)declarations of the same template. Calling this routine may implicitly allocate memory for the common pointer. | |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
Declaration of a variable template.
Definition at line 2639 of file DeclTemplate.h.
Definition at line 2774 of file DeclTemplate.h.
typedef llvm::iterator_range<spec_iterator> clang::VarTemplateDecl::spec_range |
Definition at line 2775 of file DeclTemplate.h.
clang::VarTemplateDecl::VarTemplateDecl | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | Name, | ||
TemplateParameterList * | Params, | ||
NamedDecl * | Decl | ||
) | [inline, protected] |
Definition at line 2677 of file DeclTemplate.h.
Referenced by Create(), and CreateDeserialized().
void VarTemplateDecl::AddPartialSpecialization | ( | VarTemplatePartialSpecializationDecl * | D, |
void * | InsertPos | ||
) |
Insert the specified partial specialization knowing that it is not already in. InsertPos must be obtained from findPartialSpecialization.
Definition at line 1011 of file DeclTemplate.cpp.
References clang::Decl::getASTMutationListener(), getPartialSpecializations(), and clang::Decl::isCanonicalDecl().
void VarTemplateDecl::AddSpecialization | ( | VarTemplateSpecializationDecl * | D, |
void * | InsertPos | ||
) |
Insert the specified specialization knowing that it is not already in. InsertPos must be obtained from findSpecialization.
Definition at line 991 of file DeclTemplate.cpp.
References clang::Decl::getASTMutationListener(), getSpecializations(), and clang::Decl::isCanonicalDecl().
static bool clang::VarTemplateDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2790 of file DeclTemplate.h.
References classofKind(), and clang::Decl::getKind().
static bool clang::VarTemplateDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2791 of file DeclTemplate.h.
Referenced by classof().
VarTemplateDecl * VarTemplateDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | L, | ||
DeclarationName | Name, | ||
TemplateParameterList * | Params, | ||
VarDecl * | Decl | ||
) | [static] |
Create a variable template node.
Definition at line 940 of file DeclTemplate.cpp.
References AttributeLangSupport::C, and VarTemplateDecl().
Referenced by clang::Sema::ActOnVariableDeclarator(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
VarTemplateDecl * VarTemplateDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Create an empty variable template node.
Definition at line 947 of file DeclTemplate.cpp.
References AttributeLangSupport::C, and VarTemplateDecl().
VarTemplatePartialSpecializationDecl * VarTemplateDecl::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 1006 of file DeclTemplate.cpp.
References clang::RedeclarableTemplateDecl::findSpecializationImpl(), and getPartialSpecializations().
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), and clang::TemplateDeclInstantiator::InstantiateVarTemplatePartialSpecialization().
VarTemplatePartialSpecializationDecl * VarTemplateDecl::findPartialSpecInstantiatedFromMember | ( | VarTemplatePartialSpecializationDecl * | D | ) |
Find a variable template partial specialization which was instantiated from the given member partial specialization.
D | a member variable template partial specialization. |
Definition at line 1040 of file DeclTemplate.cpp.
References clang::VarDecl::getCanonicalDecl(), getPartialSpecializations(), and P.
VarTemplateSpecializationDecl * VarTemplateDecl::findSpecialization | ( | ArrayRef< TemplateArgument > | Args, |
void *& | InsertPos | ||
) |
Return the specialization with the provided arguments if it exists, otherwise return the insertion point.
Definition at line 986 of file DeclTemplate.cpp.
References clang::RedeclarableTemplateDecl::findSpecializationImpl(), and getSpecializations().
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckVarTemplateId(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().
VarTemplateDecl* clang::VarTemplateDecl::getCanonicalDecl | ( | ) | [inline, override, virtual] |
Retrieves the canonical declaration of this template.
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2720 of file DeclTemplate.h.
Referenced by clang::ASTWriter::AddedCXXTemplateSpecialization(), getCanonicalDecl(), and clang::ASTDeclWriter::VisitVarTemplateSpecializationDecl().
const VarTemplateDecl* clang::VarTemplateDecl::getCanonicalDecl | ( | ) | const [inline] |
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2723 of file DeclTemplate.h.
References getCanonicalDecl().
Common* clang::VarTemplateDecl::getCommonPtr | ( | ) | const [inline, protected] |
Retrieves the "common" pointer shared by all (re-)declarations of the same template. Calling this routine may implicitly allocate memory for the common pointer.
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2684 of file DeclTemplate.h.
Referenced by getPartialSpecializations(), getSpecializations(), LoadLazySpecializations(), clang::ASTDeclReader::VisitVarTemplateDecl(), and clang::ASTDeclReader::VisitVarTemplateSpecializationDeclImpl().
Definition at line 930 of file DeclTemplate.cpp.
References getPreviousDecl(), and isThisDeclarationADefinition().
Definition at line 2742 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnVariableDeclarator(), and clang::Sema::InstantiateVariableDefinition().
llvm::FoldingSetVector< VarTemplatePartialSpecializationDecl > & VarTemplateDecl::getPartialSpecializations | ( | ) | [protected] |
Retrieve the set of partial specializations of this class template.
Definition at line 973 of file DeclTemplate.cpp.
References getCommonPtr(), LoadLazySpecializations(), and clang::VarTemplateDecl::Common::PartialSpecializations.
Referenced by AddPartialSpecialization(), clang::Sema::CheckVarTemplateId(), findPartialSpecialization(), findPartialSpecInstantiatedFromMember(), getPartialSpecializations(), and clang::ASTDeclWriter::VisitVarTemplateDecl().
void VarTemplateDecl::getPartialSpecializations | ( | SmallVectorImpl< VarTemplatePartialSpecializationDecl * > & | PS | ) |
Retrieve the partial specializations as an ordered list.
Definition at line 1026 of file DeclTemplate.cpp.
References getPartialSpecializations(), and P.
VarTemplateDecl* clang::VarTemplateDecl::getPreviousDecl | ( | ) | [inline] |
Retrieve the previous declaration of this variable template, or NULL if no such declaration exists.
Reimplemented from clang::Redeclarable< RedeclarableTemplateDecl >.
Definition at line 2729 of file DeclTemplate.h.
Referenced by getDefinition(), and getPreviousDecl().
const VarTemplateDecl* clang::VarTemplateDecl::getPreviousDecl | ( | ) | const [inline] |
Retrieve the previous declaration of this variable template, or NULL if no such declaration exists.
Reimplemented from clang::Redeclarable< RedeclarableTemplateDecl >.
Definition at line 2736 of file DeclTemplate.h.
References getPreviousDecl().
llvm::FoldingSetVector< VarTemplateSpecializationDecl > & VarTemplateDecl::getSpecializations | ( | ) | const [protected] |
Retrieve the set of specializations of this variable template.
Definition at line 967 of file DeclTemplate.cpp.
References getCommonPtr(), LoadLazySpecializations(), and clang::VarTemplateDecl::Common::Specializations.
Referenced by AddSpecialization(), findSpecialization(), spec_begin(), spec_end(), and clang::ASTDeclWriter::VisitVarTemplateDecl().
VarDecl* clang::VarTemplateDecl::getTemplatedDecl | ( | ) | const [inline] |
Get the underlying variable declarations of the template.
Reimplemented from clang::TemplateDecl.
Definition at line 2690 of file DeclTemplate.h.
References clang::TemplateDecl::TemplatedDecl.
Referenced by clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckVarTemplateId(), clang::Sema::InstantiateVariableDefinition(), isThisDeclarationADefinition(), clang::Sema::MergeVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
bool clang::VarTemplateDecl::isThisDeclarationADefinition | ( | ) | const [inline] |
Returns whether this template declaration defines the primary variable pattern.
Definition at line 2696 of file DeclTemplate.h.
References getTemplatedDecl(), and clang::VarDecl::isThisDeclarationADefinition().
Referenced by getDefinition().
void VarTemplateDecl::LoadLazySpecializations | ( | ) | const [protected] |
Load any lazily-loaded specializations from the external source.
Definition at line 955 of file DeclTemplate.cpp.
References Context, clang::Decl::getASTContext(), getCommonPtr(), clang::ExternalASTSource::GetExternalDecl(), clang::ASTContext::getExternalSource(), and clang::VarTemplateDecl::Common::LazySpecializations.
Referenced by getPartialSpecializations(), and getSpecializations().
RedeclarableTemplateDecl::CommonBase * VarTemplateDecl::newCommon | ( | ASTContext & | C | ) | const [override, protected, virtual] |
Implements clang::RedeclarableTemplateDecl.
Definition at line 979 of file DeclTemplate.cpp.
References clang::ASTContext::AddDeallocation(), and AttributeLangSupport::C.
spec_iterator clang::VarTemplateDecl::spec_begin | ( | ) | const [inline] |
Definition at line 2781 of file DeclTemplate.h.
References getSpecializations(), and clang::RedeclarableTemplateDecl::makeSpecIterator().
Referenced by specializations().
spec_iterator clang::VarTemplateDecl::spec_end | ( | ) | const [inline] |
Definition at line 2785 of file DeclTemplate.h.
References getSpecializations(), and clang::RedeclarableTemplateDecl::makeSpecIterator().
Referenced by specializations().
spec_range clang::VarTemplateDecl::specializations | ( | ) | const [inline] |
Definition at line 2777 of file DeclTemplate.h.
References spec_begin(), and spec_end().
friend class ASTDeclReader [friend] |
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2793 of file DeclTemplate.h.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::RedeclarableTemplateDecl.
Definition at line 2794 of file DeclTemplate.h.