clang API Documentation
Provides information about a function template specialization, which is a FunctionDecl that has been explicitly specialization or instantiated from a function template. More...
#include <DeclTemplate.h>
Public Member Functions | |
FunctionTemplateDecl * | getTemplate () const |
Retrieve the template from which this function was specialized. | |
TemplateSpecializationKind | getTemplateSpecializationKind () const |
Determine what kind of template specialization this is. | |
bool | isExplicitSpecialization () const |
bool | isExplicitInstantiationOrSpecialization () const |
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition. | |
void | setTemplateSpecializationKind (TemplateSpecializationKind TSK) |
Set the template specialization kind. | |
SourceLocation | getPointOfInstantiation () const |
Retrieve the first point of instantiation of this function template specialization. | |
void | setPointOfInstantiation (SourceLocation POI) |
Set the (first) point of instantiation of this function template specialization. | |
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) |
static void | Profile (llvm::FoldingSetNodeID &ID, ArrayRef< TemplateArgument > TemplateArgs, ASTContext &Context) |
Public Attributes | |
FunctionDecl * | Function |
The function template specialization that this structure describes. | |
llvm::PointerIntPair < FunctionTemplateDecl *, 2 > | Template |
The function template from which this function template specialization was generated. | |
const TemplateArgumentList * | TemplateArguments |
The template arguments used to produce the function template specialization from the function template. | |
const ASTTemplateArgumentListInfo * | TemplateArgumentsAsWritten |
The template arguments as written in the sources, if provided. | |
SourceLocation | PointOfInstantiation |
The point at which this function template specialization was first instantiated. |
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 289 of file DeclTemplate.h.
FunctionTemplateSpecializationInfo * FunctionTemplateSpecializationInfo::Create | ( | ASTContext & | C, |
FunctionDecl * | FD, | ||
FunctionTemplateDecl * | Template, | ||
TemplateSpecializationKind | TSK, | ||
const TemplateArgumentList * | TemplateArgs, | ||
const TemplateArgumentListInfo * | TemplateArgsAsWritten, | ||
SourceLocation | POI | ||
) | [static] |
Definition at line 663 of file DeclTemplate.cpp.
References AttributeLangSupport::C.
Referenced by clang::ASTDeclReader::VisitFunctionDecl().
SourceLocation clang::FunctionTemplateSpecializationInfo::getPointOfInstantiation | ( | ) | const [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 372 of file DeclTemplate.h.
References PointOfInstantiation.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization(), and clang::ASTDeclWriter::VisitFunctionDecl().
FunctionTemplateDecl* clang::FunctionTemplateSpecializationInfo::getTemplate | ( | ) | const [inline] |
Retrieve the template from which this function was specialized.
Definition at line 332 of file DeclTemplate.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::PredefinedExpr::ComputeName(), mergeTemplateLV(), and clang::ASTDeclWriter::VisitFunctionDecl().
TemplateSpecializationKind clang::FunctionTemplateSpecializationInfo::getTemplateSpecializationKind | ( | ) | const [inline] |
Determine what kind of template specialization this is.
Definition at line 335 of file DeclTemplate.h.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization(), clang::FunctionDecl::getTemplateSpecializationKind(), isExplicitInstantiationOrSpecialization(), isExplicitSpecialization(), and clang::ASTDeclWriter::VisitFunctionDecl().
bool clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization | ( | ) | const [inline] |
True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.
Definition at line 346 of file DeclTemplate.h.
References getTemplateSpecializationKind(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by shouldConsiderTemplateVisibility().
bool clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization | ( | ) | const [inline] |
Definition at line 339 of file DeclTemplate.h.
References getTemplateSpecializationKind(), and clang::TSK_ExplicitSpecialization.
Referenced by clang::PredefinedExpr::ComputeName().
void clang::FunctionTemplateSpecializationInfo::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | [inline] |
Definition at line 382 of file DeclTemplate.h.
References clang::TemplateArgumentList::asArray(), Function, clang::Decl::getASTContext(), and TemplateArguments.
Referenced by Profile(), and clang::ASTDeclReader::VisitFunctionDecl().
static void clang::FunctionTemplateSpecializationInfo::Profile | ( | llvm::FoldingSetNodeID & | ID, |
ArrayRef< TemplateArgument > | TemplateArgs, | ||
ASTContext & | Context | ||
) | [inline, static] |
Definition at line 388 of file DeclTemplate.h.
References Profile().
void clang::FunctionTemplateSpecializationInfo::setPointOfInstantiation | ( | SourceLocation | POI | ) | [inline] |
Set the (first) point of instantiation of this function template specialization.
Definition at line 378 of file DeclTemplate.h.
References PointOfInstantiation.
void clang::FunctionTemplateSpecializationInfo::setTemplateSpecializationKind | ( | TemplateSpecializationKind | TSK | ) | [inline] |
Set the template specialization kind.
Definition at line 361 of file DeclTemplate.h.
References clang::TSK_Undeclared.
Referenced by clang::Sema::CheckFunctionTemplateSpecialization().
The function template specialization that this structure describes.
Definition at line 312 of file DeclTemplate.h.
Referenced by clang::FunctionTemplateDecl::addSpecialization(), clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getMostRecentDecl(), and Profile().
The point at which this function template specialization was first instantiated.
Definition at line 329 of file DeclTemplate.h.
Referenced by getPointOfInstantiation(), and setPointOfInstantiation().
llvm::PointerIntPair<FunctionTemplateDecl *, 2> clang::FunctionTemplateSpecializationInfo::Template |
The function template from which this function template specialization was generated.
The two bits are contain the top 4 values of TemplateSpecializationKind.
Definition at line 318 of file DeclTemplate.h.
The template arguments used to produce the function template specialization from the function template.
Definition at line 322 of file DeclTemplate.h.
Referenced by clang::PredefinedExpr::ComputeName(), mergeTemplateLV(), Profile(), and clang::ASTDeclWriter::VisitFunctionDecl().
const ASTTemplateArgumentListInfo* clang::FunctionTemplateSpecializationInfo::TemplateArgumentsAsWritten |
The template arguments as written in the sources, if provided.
Definition at line 325 of file DeclTemplate.h.
Referenced by clang::ASTDeclWriter::VisitFunctionDecl().