clang 8.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::FunctionTemplateSpecializationInfo Class Reference

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"`

Inheritance diagram for clang::FunctionTemplateSpecializationInfo:
[legend]
Collaboration diagram for clang::FunctionTemplateSpecializationInfo:
[legend]

## Public Member Functions
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...
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. More...
llvm::PointerIntPair< FunctionTemplateDecl *, 2 > | Template
| The function template from which this function template specialization was generated. More...
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...

## Detailed Description

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 508 of file DeclTemplate.h.

## Member Function Documentation

## ◆ Create()

FunctionTemplateSpecializationInfo * FunctionTemplateSpecializationInfo::Create | ( | ASTContext & | C,
|  | FunctionDecl * | FD,
|  | FunctionTemplateDecl * | Template,
|  | TemplateSpecializationKind | TSK,
|  | const TemplateArgumentList * | TemplateArgs,
|  | const TemplateArgumentListInfo * | TemplateArgsAsWritten,
|  | SourceLocation | POI
| ) |  |
| static

Definition at line 692 of file DeclTemplate.cpp.

References clang::C, clang::ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(), and clang::ASTTemplateArgumentListInfo::Create().

Referenced by clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), and clang::ASTDeclReader::VisitFunctionDecl().

## ◆ getPointOfInstantiation()

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 581 of file DeclTemplate.h.

Referenced by clang::ASTDeclWriter::VisitFunctionDecl().

## ◆ getTemplate()

FunctionTemplateDecl* clang::FunctionTemplateSpecializationInfo::getTemplate | ( |  | ) | const
| inline

Retrieve the template from which this function was specialized.

Definition at line 550 of file DeclTemplate.h.

Referenced by shouldConsiderTemplateVisibility(), and clang::ASTDeclWriter::VisitFunctionDecl().

## ◆ getTemplateSpecializationKind()

TemplateSpecializationKind clang::FunctionTemplateSpecializationInfo::getTemplateSpecializationKind | ( |  | ) | const
| inline

Determine what kind of template specialization this is.

Definition at line 553 of file DeclTemplate.h.

Referenced by clang::FunctionDecl::getTemplateSpecializationKind(), and clang::ASTDeclWriter::VisitFunctionDecl().

## ◆ isExplicitInstantiationOrSpecialization()

bool clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization | ( |  | ) | const
| inline

True if this declaration is an explicit specialization, explicit instantiation declaration, or explicit instantiation definition.

Definition at line 564 of file DeclTemplate.h.

References getTemplateSpecializationKind(), and clang::isTemplateExplicitInstantiationOrSpecialization().

Referenced by shouldConsiderTemplateVisibility().

## ◆ isExplicitSpecialization()

bool clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization | ( |  | ) | const
| inline

Definition at line 557 of file DeclTemplate.h.

References getTemplateSpecializationKind(), and clang::TSK_ExplicitSpecialization.

## ◆ Profile() [1/2]

void clang::FunctionTemplateSpecializationInfo::Profile | ( | llvm::FoldingSetNodeID & | ID | ) |
| inline

Definition at line 591 of file DeclTemplate.h.

References clang::TemplateArgumentList::asArray(), and clang::Decl::getASTContext().

Referenced by clang::ASTDeclReader::VisitFunctionDecl().

## ◆ Profile() [2/2]

static void clang::FunctionTemplateSpecializationInfo::Profile | ( | llvm::FoldingSetNodeID & | ID,
|  | ArrayRef< TemplateArgument > | TemplateArgs,
|  | ASTContext & | Context
| ) |  |
| inline static

Definition at line 597 of file DeclTemplate.h.

## ◆ setPointOfInstantiation()

void clang::FunctionTemplateSpecializationInfo::setPointOfInstantiation | ( | SourceLocation | POI | ) |
| inline

Set the (first) point of instantiation of this function template specialization.

Definition at line 587 of file DeclTemplate.h.

## ◆ setTemplateSpecializationKind()

void clang::FunctionTemplateSpecializationInfo::setTemplateSpecializationKind | ( | TemplateSpecializationKind | TSK | ) |
| inline

Set the template specialization kind.

Definition at line 570 of file DeclTemplate.h.

References clang::TSK_Undeclared.

## Member Data Documentation

## ◆ Function

FunctionDecl* clang::FunctionTemplateSpecializationInfo::Function

The function template specialization that this structure describes.

Definition at line 530 of file DeclTemplate.h.

Referenced by clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getDecl(), and clang::ASTDeclReader::VisitFunctionDecl().

## ◆ PointOfInstantiation

SourceLocation clang::FunctionTemplateSpecializationInfo::PointOfInstantiation

The point at which this function template specialization was first instantiated.

Definition at line 547 of file DeclTemplate.h.

## ◆ Template

llvm::PointerIntPair<FunctionTemplateDecl *, 2> clang::FunctionTemplateSpecializationInfo::Template

The function template from which this function template specialization was generated.

The two bits contain the top 4 values of TemplateSpecializationKind.

Definition at line 536 of file DeclTemplate.h.

## ◆ TemplateArguments

const TemplateArgumentList* clang::FunctionTemplateSpecializationInfo::TemplateArguments

The template arguments used to produce the function template specialization from the function template.

Definition at line 540 of file DeclTemplate.h.

Referenced by clang::RedeclarableTemplateDecl::SpecEntryTraits< FunctionTemplateSpecializationInfo >::getTemplateArgs(), shouldConsiderTemplateVisibility(), and clang::ASTDeclWriter::VisitFunctionDecl().

## ◆ TemplateArgumentsAsWritten

const ASTTemplateArgumentListInfo* clang::FunctionTemplateSpecializationInfo::TemplateArgumentsAsWritten

The template arguments as written in the sources, if provided.

Definition at line 543 of file DeclTemplate.h.

Referenced by clang::ASTDeclWriter::VisitFunctionDecl().

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

- include/clang/AST/DeclTemplate.h
- lib/AST/DeclTemplate.cpp