SgTemplateInstantiationDecl¶
This class represents the concept of an instantiated class template.
Synopsis¶
Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)
class [[visibility("default")]] SgTemplateInstantiationDecl
: public SgClassDeclaration Description¶
- Internal: Objects of this class are marked as compiler-generated if they are instantiated by the compiler, but not if they are generated from a specialization (where the user has in effect generated it). A few details:
- Currently multple declaration have a valid pointer to the SgTemplateInstantiationDefn object even though there is only one defining declaration. This is different from functions declarations where only one declaration has a valid pointer to the SgFunctionDefinition. This needs to be made consistant at some point.
- Todo: Make the "*PtrList" typed objects non-pointer data members (lists) instead of pointer to lists.
- See also: Example of using a SgTemplateInstantiationDecl object
Data members
SgTemplateInstantiationDecl::p_templateName¶
This is the name of the templated class (excludes template arguments) The frontend publishes the template's identifier and its typed argument list during construction. Unparsing renders the arguments from their AST nodes.
SgTemplateInstantiationDecl::p_templateHeader¶
This data field is not used (or is used internally). I forget what this name includes.
SgTemplateInstantiationDecl::p_templateDeclaration¶
This is the template declarations (SgTemplateDeclaration) from which this template instantiation is constructed. This can be NULL, as I recall, for nested classes.
SgTemplateInstantiationDecl::p_templateArguments¶
This is a pointer to a list of pointers to SgTemplateArgument objects (used with the SgTemplateDeclaration to construct this instantiation). Not all arguments are output in the generated code (see SgTemplateArgument for details).
- Note: Template arguments are found in the instantiations, and template parameters are found in the SgTemplateDeclaration (arguments are not the same a parameters, same as for descriptions for functions).
Member functions
`SgTemplateInstantiationDecl::SgTemplateInstantiationDecl (¶
Sg_File_Info* startOfConstruct = NULL,` SgName name = SgdefaultName, int class_type = 0, SgClassType *type=NULL, SgClassDefinition *definition=NULL) This is the only constructor. This constructor builds the SgTemplateInstantiationDecl base class. but has some specific side-effects (some of which have been removed in the latest work). It is however still that case that if the definition is provided then it's declaration will be changed to the declaration being constructed (a warning message it output if this happens and this side-effect will be removed soon).
- Param
startOfConstruct: represents the position in the source code - See also: Example:create an SgTemplateInstantiationDecl object
SgTemplateInstantiationDecl::get_templateName() const¶
Returns name of class template, the name excludes template arguments. For the template name with arguments, e.g. "class_template<int>" the user should call get_name() (defined in the SgClassDeclaration base class).
- Note: The SgClassSymbol used to hold a reference to this declaration in the symbol table is placed into the symbol table using the get_name(); includes template arguments.
- Internal: There are cases where the arguments should not be unparse and then this version of the name is required. Also in generating mangled names, this is a more useful name to have separately from the name which inclused arguments. However in these case it still seems that we could get it from the template declaration (if it is available, member fucntions of a templated class may not have an explicit or separate template declaration).
- Return: returns SgName by value.
SgTemplateInstantiationDecl::set_templateName(SgName name)¶
sets name of instantiated class template, name excludes template arguments.
- Return: returns void.
SgTemplateInstantiationDecl::get_templateDeclaration() const¶
Returns pointer to SgTemplateDeclaration from which instantiation is generated.
- Return: returns pointer to SgTemplateDeclaration.
`SgTemplateInstantiationDecl::set_templateDeclaration(SgTemplateDeclaration* templateDeclaration)` Access function for p_templateDeclaration.¶
- Return: returns void.
SgTemplateInstantiationDecl::get_templateArguments() const¶
Returns the declaration's list of template arguments by reference.
Base Classes¶
| Name | Description |
|---|---|
SgClassDeclaration | This class represents the concept of a class declaration statement. It includes the |
Type Aliases¶
| Name |
|---|
base_node_type |
template_kind_t |
Enums¶
| Name | Description |
|---|---|
Unnamed enum | static variant value |
Member Functions¶
| Name | Description |
|---|---|
SgTemplateInstantiationDeclSgTemplateInstantiationDecl( SgName name, SgClassDeclaration::class_types class_type, SgClassType* type, SgClassDefinition* definition, SgTemplateClassDeclaration* templateDeclaration, SgTemplateArgumentPtrList templateArguments, SgTemplateArgumentPtrList semanticTemplateArguments, bool sourceSpellsInjectedClassName, SgTemplateArgumentPtrList deducedTemplateArguments); [constructor] | Constructors |
~SgTemplateInstantiationDeclvirtual ~SgTemplateInstantiationDecl(); [destructor] [virtual] | Destructor |
acceptvirtual void accept(ROSE_VisitorPattern& visitor) override; [virtual] | support for the classic visitor pattern done in GoF |
appendDestructorOwnedNodesvirtual void appendDestructorOwnedNodes(std::vector<SgNode*>& nodes) const override; [virtual] | |
class_namevirtual std::string class_name() const override; [virtual] | returns a string representing the class name |
copyvirtual SgNode* copy(SgCopyHelp& help) const override; [virtual] | |
fixupCopy_referencesvirtual void fixupCopy_references( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_scopesvirtual void fixupCopy_scopes( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
fixupCopy_symbolsvirtual void fixupCopy_symbols( SgNode* copy, SgCopyHelp& help) const override; [virtual] | |
get_childIndexvirtual size_t get_childIndex(SgNode* child) const override; [virtual] | index-based access to traversal successors by child node |
get_constraintSatisfactionContainsErrorsbool get_constraintSatisfactionContainsErrors() const; | |
get_constraintSatisfactionEvaluatedbool get_constraintSatisfactionEvaluated() const; | |
get_constraintSatisfactionSatisfiedbool get_constraintSatisfactionSatisfied() const; | |
get_constraintSatisfactionSubstitutionFailurebool get_constraintSatisfactionSubstitutionFailure() const; | |
get_constraintSatisfactionSummarystd::string get_constraintSatisfactionSummary() const; | |
get_deducedTemplateArgumentsSgTemplateArgumentPtrList const& get_deducedTemplateArguments() const; | |
get_mangled_namevirtual SgName get_mangled_name() const override; [virtual] | |
get_numberOfTraversalSuccessorsvirtual size_t get_numberOfTraversalSuccessors() const override; [virtual] | return number of children in the traversal successor list |
get_qualified_namevirtual SgName get_qualified_name() const override; [virtual] | |
get_semanticTemplateArgumentsSgTemplateArgumentPtrList const& get_semanticTemplateArguments() const; | |
get_sfinaeEvaluatedbool get_sfinaeEvaluated() const; | |
get_sfinaeSubstitutionFailurebool get_sfinaeSubstitutionFailure() const; | |
get_sfinaeSummarystd::string get_sfinaeSummary() const; | |
get_sourceSpellsInjectedClassNamebool get_sourceSpellsInjectedClassName() const; | |
get_specializedTemplateDeclarationSgDeclarationStatement* get_specializedTemplateDeclaration() const; | |
get_templateArgumentsSgTemplateArgumentPtrList const& get_templateArguments() const; | |
get_templateDeclarationSgTemplateClassDeclaration* get_templateDeclaration() const; | |
get_templateHeaderSgName get_templateHeader() const; | |
get_templateNameSgName get_templateName() const; | |
get_traversalSuccessorByIndexvirtual SgNode* get_traversalSuccessorByIndex(size_t idx) const override; [virtual] | index-based access to traversal successors by index number |
get_traversalSuccessorContainervirtual std::vector<SgNode*> get_traversalSuccessorContainer() const override; [virtual] | container of pointers to AST successor nodes used in the traversal overridden in every class by generated implementation |
get_traversalSuccessorIsListElementvirtual std::vector<bool> get_traversalSuccessorIsListElement() const override; [virtual] | |
get_traversalSuccessorNamesContainervirtual std::vector<std::string> get_traversalSuccessorNamesContainer() const override; [virtual] | container of names of variables or container indices used used in the traversal to access AST successor nodes overridden in every class by generated implementation |
operator deletevoid operator delete( void* pointer, size_t size); | deallocated memory for IR node (returns memory to memory pool for reuse) |
operator newvoid* operator new(size_t size); | returns pointer to newly allocated IR node |
post_construction_initializationvirtual void post_construction_initialization() override; [virtual] | |
processDataMemberReferenceToPointersvirtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler*) override; [virtual] | Pass references to stored node pointers to a handler. |
returnDataMemberPointersvirtual std::vector<std::pair<SgNode*, std::string>> returnDataMemberPointers() const override; [virtual] | Return the node pointers stored in this node's data members. |
roseRTIvirtual RTIReturnType roseRTI() override; [virtual] | return C++ Runtime-Time-Information |
sage_class_namevirtual char const* sage_class_name() const override; [virtual] | returns a C style string (char*) representing the class name |
set_constraintSatisfactionContainsErrorsvoid set_constraintSatisfactionContainsErrors(bool constraintSatisfactionContainsErrors); | |
set_constraintSatisfactionEvaluatedvoid set_constraintSatisfactionEvaluated(bool constraintSatisfactionEvaluated); | |
set_constraintSatisfactionSatisfiedvoid set_constraintSatisfactionSatisfied(bool constraintSatisfactionSatisfied); | |
set_constraintSatisfactionSubstitutionFailurevoid set_constraintSatisfactionSubstitutionFailure(bool constraintSatisfactionSubstitutionFailure); | |
set_constraintSatisfactionSummaryvoid set_constraintSatisfactionSummary(std::string constraintSatisfactionSummary); | |
set_definitionvoid set_definition(SgClassDefinition* definition); | |
set_sfinaeEvaluatedvoid set_sfinaeEvaluated(bool sfinaeEvaluated); | |
set_sfinaeSubstitutionFailurevoid set_sfinaeSubstitutionFailure(bool sfinaeSubstitutionFailure); | |
set_sfinaeSummaryvoid set_sfinaeSummary(std::string sfinaeSummary); | |
set_sourceSpellsInjectedClassNamevoid set_sourceSpellsInjectedClassName(bool sourceSpellsInjectedClassName); | |
set_specializedTemplateDeclarationvoid set_specializedTemplateDeclaration(SgDeclarationStatement* specializedTemplateDeclaration); | |
set_templateDeclarationvoid set_templateDeclaration(SgTemplateClassDeclaration* templateDeclaration); | |
set_templateHeadervoid set_templateHeader(SgName templateHeader); | |
set_templateNamevoid set_templateName(SgName templateName); | |
variantTvirtual VariantT variantT() const override; [virtual] | returns new style SageIII enum values |
Static Member Functions¶
| Name | Description |
|---|---|
memoryUsagestatic size_t memoryUsage(); | Returns the size in bytes of the total memory allocated for all IR nodes of this type |
numberOfNodesstatic size_t numberOfNodes(); | Returns the total number of IR nodes of this type |
traverseMemoryPoolNodesstatic void traverseMemoryPoolNodes(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node. |
traverseMemoryPoolVisitorPatternstatic void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern& visitor); | FOR INTERNAL USE Support for visitor pattern. |
visitRepresentativeNodestatic void visitRepresentativeNode(ROSE_VisitTraversal& visit); | FOR INTERNAL USE Support for type-based traversal. |
Static Data Members¶
| Name | Description |
|---|---|
free_slots | Free slots, each numbered pool_index * pool_size + slot_index. The last entry is allocated next. |
pool_live_flags | |
pool_size | |
pools |
Protected Data Members¶
Friends¶
| Name | Description |
|---|---|
isSgTemplateInstantiationDecl | Casts pointer from base class to derived class (for const pointers) |
isSgTemplateInstantiationDecl | Casts pointer from base class to derived class |
Created with MrDocs