SgTemplateArgument¶
This class represents template argument within the use of a template to build an instantiation.
Synopsis¶
Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)
class [[visibility("default")]] SgTemplateArgument
: public SgSupport Description¶
The template argument is used for the instatiation of templates. They can also have default values and not be specified explicitly.
- Internal: Note that this is not the same as a template parameter, which appears in the template declaration as a placeholder for template argument in the declaration of the template.
- Todo: Move this be a SgLocatedNode since it should have a position in the source code.
- See also: Example of using a SgTemplateArgument object
Data members
SgTemplateArgument::p_argumentType¶
This is the type of the argument specificed to the template in the instantiation of the template.
- Internal:
SgTemplateArgument::p_isArrayBoundUnknownType¶
Template arguments can be used as array bounds, if so this this marks the arguments use as such.
SgTemplateArgument::p_type¶
This is the template argument's reference to a type (if it is a type). This pointer is valid if the argumentType is "type_argument".
SgTemplateArgument::p_expression¶
This is the template argument's reference to an expression (if it is an expression). This pointer is valid if the argumentType is "nontype_argument".
SgTemplateArgument::p_templateDeclaration¶
The exact semantic template declaration referenced by the argument.
SgTemplateArgument::p_explicitlySpecified¶
This true only if for a function template the argument is explicit in the source code (it need not always be.) For template<typename T> void foo(T t); we could specify:
-
foo(1.0); or:
-
foo<float>(1.0); only in the second case is the template argument explicit. For all instantiated member function templates the value is false.
- Internal:
Member functions
`SgTemplateArgument::SgTemplateArgument( SgType* arg, bool¶
isExplicitlySpecified)` Constructor used with types.
- Internal:
- See also: Example:create an SgTemplateArgument object
`SgTemplateArgument::SgTemplateArgument( SgExpression* arg, bool¶
isExplicitlySpecified)` Constructor used with expressions.
- Internal:
- See also: Example:create an SgTemplateArgument object
SgTemplateArgument::SgTemplateArgument(const SgTemplateArgument & X)¶
This the copy constructor (deep copy made).
- Internal: This constructor does a deep copy of all data in the SgTemplateArgument object.
- See also: Example:create an SgTemplateArgument object
`SgTemplateArgument::set_argumentType (¶
SgTemplateArgument::template_argument_enum argumentType )` This function sets argumentType.
- Return: Returns void.
`SgTemplateArgument::template_argument_enum¶
SgTemplateArgument::get_argumentType () const` This function returns argumentType.
- Return: Returns SgTemplateArgument::template_argument_enum.
`SgTemplateArgument::set_isArrayBoundUnknownType ( bool¶
isArrayBoundUnknownType )` This function sets isArrayBoundUnknownType.
- Return: Returns void.
bool SgTemplateArgument::get_isArrayBoundUnknownType () const¶
This function returns isArrayBoundUnknownType.
- Return: Returns bool.
set_type ( SgType *type )¶
This function sets the argumentType.
- Return: Returns void.
SgType* SgTemplateArgument::get_type () const¶
This function returns argumentType.
- Return: Returns SgType pointer.
set_expression ( SgExpression *exp )¶
This function sets the argumentExpression.
- Return: Returns void.
SgExpression* SgTemplateArgument::get_expression () const¶
This function returns argumentExpression.
- Return: Returns SgExpression pointer.
`SgTemplateArgument::set_explicitlySpecified ( bool explicitlySpecified¶
)` This function sets explicitlySpecified.
- Return: Returns void.
bool SgTemplateArgument::get_explicitlySpecified () const¶
This function returns explicitlySpecified.
- Return: Returns bool.
Base Classes¶
| Name | Description |
|---|---|
SgSupport | This class represents the base class of a numbr of IR nodes that don't otherwise fit |
Type Aliases¶
| Name |
|---|
base_node_type |
Enums¶
| Name | Description |
|---|---|
Unnamed enum | static variant value |
template_argument_enum | Different uses of a template argument |
Member Functions¶
| Name | Description |
|---|---|
SgTemplateArgumentSgTemplateArgument(bool explicitlySpecified); [constructor] | Constructors |
~SgTemplateArgumentvirtual ~SgTemplateArgument(); [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_argumentTypeSgTemplateArgument::template_argument_enum get_argumentType() const; | |
get_childIndexvirtual size_t get_childIndex(SgNode* child) const override; [virtual] | index-based access to traversal successors by child node |
get_explicitlySpecifiedbool get_explicitlySpecified() const; | |
get_expressionSgExpression* get_expression() const; | |
get_global_qualification_requiredbool get_global_qualification_required() const; | |
get_global_qualification_required_for_typebool get_global_qualification_required_for_type() const; | |
get_isArrayBoundUnknownTypebool get_isArrayBoundUnknownType() const; | |
get_is_pack_elementbool get_is_pack_element() const; | |
get_mangled_nameSgName get_mangled_name() const; | Returns the template argument in mangled form. |
get_name_qualification_lengthint get_name_qualification_length() const; | |
get_name_qualification_length_for_typeint get_name_qualification_length_for_type() const; | |
get_numberOfTraversalSuccessorsvirtual size_t get_numberOfTraversalSuccessors() const override; [virtual] | return number of children in the traversal successor list |
get_requiresGlobalNameQualificationOnTypebool get_requiresGlobalNameQualificationOnType() const; | |
get_scopeSgScopeStatement* get_scope() const; | Some template arguments have an associated scope (e.g. named types, and template template arguments) |
get_sourceSpelledTypeSgType* get_sourceSpelledType() const; | |
get_source_type_global_qualificationbool get_source_type_global_qualification() const; | |
get_source_type_qualification_presentbool get_source_type_qualification_present() const; | |
get_source_type_qualification_tokensSgStringList const& get_source_type_qualification_tokens() const; | |
get_templateDeclarationSgDeclarationStatement* get_templateDeclaration() 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 |
get_typeSgType* get_type() const; | |
get_type_elaboration_requiredbool get_type_elaboration_required() const; | |
get_type_elaboration_required_for_typebool get_type_elaboration_required_for_type() const; | |
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_argumentTypevoid set_argumentType(SgTemplateArgument::template_argument_enum argumentType); | |
set_explicitlySpecifiedvoid set_explicitlySpecified(bool explicitlySpecified); | |
set_expressionvoid set_expression(SgExpression* expression); | |
set_global_qualification_requiredvoid set_global_qualification_required(bool global_qualification_required); | |
set_global_qualification_required_for_typevoid set_global_qualification_required_for_type(bool global_qualification_required_for_type); | |
set_isArrayBoundUnknownTypevoid set_isArrayBoundUnknownType(bool isArrayBoundUnknownType); | |
set_is_pack_elementvoid set_is_pack_element(bool is_pack_element); | |
set_name_qualification_lengthvoid set_name_qualification_length(int name_qualification_length); | |
set_name_qualification_length_for_typevoid set_name_qualification_length_for_type(int name_qualification_length_for_type); | |
set_requiresGlobalNameQualificationOnTypevoid set_requiresGlobalNameQualificationOnType(bool requiresGlobalNameQualificationOnType); | |
set_sourceSpelledTypevoid set_sourceSpelledType(SgType* sourceSpelledType); | |
set_source_type_global_qualificationvoid set_source_type_global_qualification(bool source_type_global_qualification); | |
set_source_type_qualification_presentvoid set_source_type_qualification_present(bool source_type_qualification_present); | |
set_templateDeclarationvoid set_templateDeclaration(SgDeclarationStatement* templateDeclaration); | |
set_typevoid set_type(SgType* type); | |
set_type_elaboration_requiredvoid set_type_elaboration_required(bool type_elaboration_required); | |
set_type_elaboration_required_for_typevoid set_type_elaboration_required_for_type(bool type_elaboration_required_for_type); | |
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 |
|---|---|
isSgTemplateArgument | Casts pointer from base class to derived class (for const pointers) |
isSgTemplateArgument | Casts pointer from base class to derived class |
Created with MrDocs