clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
clang::VarTemplateDecl Class Reference

Declaration of a variable template. More...

#include <DeclTemplate.h>

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

List of all members.

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

VarDeclgetTemplatedDecl () const
 Get the underlying variable declarations of the template.
bool isThisDeclarationADefinition () const
 Returns whether this template declaration defines the primary variable pattern.
VarTemplateDeclgetDefinition ()
VarTemplateSpecializationDeclfindSpecialization (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.
VarTemplateDeclgetCanonicalDecl () override
 Retrieves the canonical declaration of this template.
const VarTemplateDeclgetCanonicalDecl () const
VarTemplateDeclgetPreviousDecl ()
 Retrieve the previous declaration of this variable template, or NULL if no such declaration exists.
const VarTemplateDeclgetPreviousDecl () const
 Retrieve the previous declaration of this variable template, or NULL if no such declaration exists.
VarTemplateDeclgetInstantiatedFromMemberTemplate ()
VarTemplatePartialSpecializationDeclfindPartialSpecialization (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.
VarTemplatePartialSpecializationDeclfindPartialSpecInstantiatedFromMember (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 VarTemplateDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, VarDecl *Decl)
 Create a variable template node.
static VarTemplateDeclCreateDeserialized (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)
CommonBasenewCommon (ASTContext &C) const override
CommongetCommonPtr () 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

Detailed Description

Declaration of a variable template.

Definition at line 2639 of file DeclTemplate.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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().


Member Function Documentation

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().

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().

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().

Create an empty variable template node.

Definition at line 947 of file DeclTemplate.cpp.

References AttributeLangSupport::C, and VarTemplateDecl().

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().

Find a variable template partial specialization which was instantiated from the given member partial specialization.

Parameters:
Da member variable template partial specialization.
Returns:
the variable template partial specialization which was instantiated from the given member partial specialization, or NULL if no such partial specialization exists.

Definition at line 1040 of file DeclTemplate.cpp.

References clang::VarDecl::getCanonicalDecl(), getPartialSpecializations(), and P.

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().

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().

Retrieve the partial specializations as an ordered list.

Definition at line 1026 of file DeclTemplate.cpp.

References getPartialSpecializations(), and P.

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().

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().

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]
RedeclarableTemplateDecl::CommonBase * VarTemplateDecl::newCommon ( ASTContext C) const [override, protected, virtual]

Definition at line 2777 of file DeclTemplate.h.

References spec_begin(), and spec_end().


Friends And Related Function Documentation

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.


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