Instantiator
Generate c++ template instantiations
|
Struct for the collection of all relevant data for a template function which can provide a definition for an explicit instantiation from a different translation unit. More...
#include <Template.hpp>
Public Types | |
typedef std::string | StringType |
Public Member Functions | |
bool | isTemplateFor (const Injection &candidate) const |
Static Public Member Functions | |
static Template | createFromMFS (const clang::CXXMethodDecl *MFS, clang::PrintingPolicy pp) |
static Template | createFromFS (const clang::FunctionDecl *FS, clang::PrintingPolicy pp) |
Public Attributes | |
StringType | func_name = "" |
StringType | nested_namespace = "" |
StringType | class_name = "" |
std::vector< Param > | params |
std::vector< Instantiator::TemplateArgument > | class_Targs |
bool | is_const = false |
bool | is_member = false |
bool | is_constructor = false |
Struct for the collection of all relevant data for a template function which can provide a definition for an explicit instantiation from a different translation unit.
Definition at line 17 of file Template.hpp.
typedef std::string Template::StringType |
Definition at line 19 of file Template.hpp.
|
static |
Function to load all needed data from a clang::FunctionDecl.
FS | Pointer to a clang::FunctionDecl . |
pp | clang::PrintingPolicy which controls how strings are created. |
The following data is parsed:
Definition at line 18 of file Template.cpp.
|
static |
Function to load all needed data from a clang::CXXMethodDecl.
MFS | Pointer to a clang::CXXMethodDecl . |
pp | clang::PrintingPolicy which controls how strings are created. |
Calls createFromFS() and loads the following member function information:
Definition at line 33 of file Template.cpp.
bool Template::isTemplateFor | ( | const Injection & | candidate | ) | const |
Checks whether this
is a matching template for the Injection candidate
. I.e. the following is checked:
candidate
with function parameters of the templateDefinition at line 82 of file Template.cpp.
StringType Template::class_name = "" |
For member functions, this is the name of the parent class. For free functions it is empty. E.g.
the class name would be "Bar"
.
Definition at line 37 of file Template.hpp.
std::vector<Instantiator::TemplateArgument> Template::class_Targs |
The class template parameters. These can either unresolved or concrete types/values. In case of unresolved parameters, just the kind is stored (type, nontype, pack, template). In case of a concrete type/value, the type/value is stored. This happens in case of partial specializations. E.g.
it would be {"unresolved__type", "int"}
Definition at line 53 of file Template.hpp.
StringType Template::func_name = "" |
Name of the function without namespace and template parameters. For
the name would be "Foo"
.
Definition at line 24 of file Template.hpp.
bool Template::is_const = false |
Whether this member function is const qualified.
Definition at line 56 of file Template.hpp.
bool Template::is_constructor = false |
Whether this a class constructor.
Definition at line 65 of file Template.hpp.
bool Template::is_member = false |
Whether this is a member function of some class.
Definition at line 59 of file Template.hpp.
StringType Template::nested_namespace = "" |
Nested namespace of the function. For For
the nested namespace would be "My::Nested::Namespace"
.
Definition at line 31 of file Template.hpp.
std::vector<Param> Template::params |
A vector of the function parameters.
Definition at line 45 of file Template.hpp.