clang
13.0.0git
|
Provides information about a function template specialization, which is a FunctionDecl that has been explicitly specialization or instantiated from a function template. More...
#include "clang/AST/DeclTemplate.h"
Public Member Functions | |
FunctionDecl * | getFunction () const |
Retrieve the declaration of the function template specialization. More... | |
FunctionTemplateDecl * | getTemplate () const |
Retrieve the template from which this function was specialized. More... | |
TemplateSpecializationKind | getTemplateSpecializationKind () const |
Determine what kind of template specialization this is. More... | |
bool | isExplicitSpecialization () const |
bool | isExplicitInstantiationOrSpecialization () const |
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition. More... | |
void | setTemplateSpecializationKind (TemplateSpecializationKind TSK) |
Set the template specialization kind. More... | |
SourceLocation | getPointOfInstantiation () const |
Retrieve the first point of instantiation of this function template specialization. More... | |
void | setPointOfInstantiation (SourceLocation POI) |
Set the (first) point of instantiation of this function template specialization. More... | |
MemberSpecializationInfo * | getMemberSpecializationInfo () const |
Get the specialization info if this function template specialization is also a member specialization: More... | |
void | Profile (llvm::FoldingSetNodeID &ID) |
Static Public Member Functions | |
static FunctionTemplateSpecializationInfo * | Create (ASTContext &C, FunctionDecl *FD, FunctionTemplateDecl *Template, TemplateSpecializationKind TSK, const TemplateArgumentList *TemplateArgs, const TemplateArgumentListInfo *TemplateArgsAsWritten, SourceLocation POI, MemberSpecializationInfo *MSInfo) |
static void | Profile (llvm::FoldingSetNodeID &ID, ArrayRef< TemplateArgument > TemplateArgs, ASTContext &Context) |
Public Attributes | |
const TemplateArgumentList * | TemplateArguments |
The template arguments used to produce the function template specialization from the function template. More... | |
const ASTTemplateArgumentListInfo * | TemplateArgumentsAsWritten |
The template arguments as written in the sources, if provided. More... | |
SourceLocation | PointOfInstantiation |
The point at which this function template specialization was first instantiated. More... | |
friend | TrailingObjects |
Provides information about a function template specialization, which is a FunctionDecl that has been explicitly specialization or instantiated from a function template.
Definition at line 466 of file DeclTemplate.h.
|
static |
Definition at line 829 of file DeclTemplate.cpp.
References clang::ASTTemplateArgumentListInfo::Create().
Referenced by clang::ASTDeclReader::VisitFunctionDecl().
|
inline |
Retrieve the declaration of the function template specialization.
Definition at line 522 of file DeclTemplate.h.
Referenced by clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getDecl(), Profile(), and clang::ASTDeclReader::VisitFunctionDecl().
|
inline |
Get the specialization info if this function template specialization is also a member specialization:
Here, A<int>::f<int> is a function template specialization that is an explicit specialization of A<int>::f, but it's also a member specialization (an implicit instantiation in this case) of A::f<int>. Further:
... declares a function template specialization that is an explicit specialization of A<int>::f, and is also an explicit member specialization of A::f<int>.
Note that the TemplateSpecializationKind of the MemberSpecializationInfo need not be the same as that returned by getTemplateSpecializationKind(), and represents the relationship between the function and the class-scope explicit specialization in the original templated class – whereas our TemplateSpecializationKind represents the relationship between the function and the function template, and should always be TSK_ExplicitSpecialization whenever we have MemberSpecializationInfo.
Definition at line 596 of file DeclTemplate.h.
Referenced by clang::ASTDeclWriter::VisitFunctionDecl().
|
inline |
Retrieve the first point of instantiation of this function template specialization.
The point of instantiation may be an invalid source location if this function has yet to be instantiated.
Definition at line 556 of file DeclTemplate.h.
References PointOfInstantiation.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization(), and clang::ASTDeclWriter::VisitFunctionDecl().
|
inline |
Retrieve the template from which this function was specialized.
Definition at line 525 of file DeclTemplate.h.
Referenced by clang::ASTDeclWriter::VisitFunctionDecl().
|
inline |
Determine what kind of template specialization this is.
Definition at line 528 of file DeclTemplate.h.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization(), isExplicitInstantiationOrSpecialization(), isExplicitSpecialization(), and clang::ASTDeclWriter::VisitFunctionDecl().
|
inline |
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.
Definition at line 539 of file DeclTemplate.h.
References getTemplateSpecializationKind(), and clang::isTemplateExplicitInstantiationOrSpecialization().
Referenced by shouldConsiderTemplateVisibility().
|
inline |
Definition at line 532 of file DeclTemplate.h.
References getTemplateSpecializationKind(), and clang::TSK_ExplicitSpecialization.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization().
|
inline |
Definition at line 602 of file DeclTemplate.h.
References clang::TemplateArgumentList::asArray(), getFunction(), and TemplateArguments.
Referenced by clang::ASTDeclReader::VisitFunctionDecl().
|
inlinestatic |
Definition at line 607 of file DeclTemplate.h.
References clang::TemplateArg.
|
inline |
Set the (first) point of instantiation of this function template specialization.
Definition at line 562 of file DeclTemplate.h.
References PointOfInstantiation.
|
inline |
Set the template specialization kind.
Definition at line 545 of file DeclTemplate.h.
References clang::TSK_Undeclared.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization().
SourceLocation clang::FunctionTemplateSpecializationInfo::PointOfInstantiation |
The point at which this function template specialization was first instantiated.
Definition at line 491 of file DeclTemplate.h.
Referenced by getPointOfInstantiation(), and setPointOfInstantiation().
const TemplateArgumentList* clang::FunctionTemplateSpecializationInfo::TemplateArguments |
The template arguments used to produce the function template specialization from the function template.
Definition at line 483 of file DeclTemplate.h.
Referenced by clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getTemplateArgs(), Profile(), and clang::ASTDeclWriter::VisitFunctionDecl().
const ASTTemplateArgumentListInfo* clang::FunctionTemplateSpecializationInfo::TemplateArgumentsAsWritten |
The template arguments as written in the sources, if provided.
FIXME: Normally null; tail-allocate this.
Definition at line 487 of file DeclTemplate.h.
Referenced by clang::ASTDeclWriter::VisitFunctionDecl().
friend clang::FunctionTemplateSpecializationInfo::TrailingObjects |
Definition at line 512 of file DeclTemplate.h.