Skip to content

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:

  1. foo(1.0); or:

  2. 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
SgTemplateArgument
SgTemplateArgument(bool explicitlySpecified); [constructor]
Constructors
~SgTemplateArgument
virtual ~SgTemplateArgument(); [destructor] [virtual]
Destructor
accept
virtual void accept(ROSE_VisitorPattern& visitor) override; [virtual]
support for the classic visitor pattern done in GoF
appendDestructorOwnedNodes
virtual void appendDestructorOwnedNodes(std::vector<SgNode*>& nodes) const override; [virtual]
class_name
virtual std::string class_name() const override; [virtual]
returns a string representing the class name
copy
virtual SgNode* copy(SgCopyHelp& help) const override; [virtual]
fixupCopy_references
virtual void fixupCopy_references( SgNode* copy, SgCopyHelp& help) const override; [virtual]
fixupCopy_scopes
virtual void fixupCopy_scopes( SgNode* copy, SgCopyHelp& help) const override; [virtual]
fixupCopy_symbols
virtual void fixupCopy_symbols( SgNode* copy, SgCopyHelp& help) const override; [virtual]
get_argumentType
SgTemplateArgument::template_argument_enum get_argumentType() const;
get_childIndex
virtual size_t get_childIndex(SgNode* child) const override; [virtual]
index-based access to traversal successors by child node
get_explicitlySpecified
bool get_explicitlySpecified() const;
get_expression
SgExpression* get_expression() const;
get_global_qualification_required
bool get_global_qualification_required() const;
get_global_qualification_required_for_type
bool get_global_qualification_required_for_type() const;
get_isArrayBoundUnknownType
bool get_isArrayBoundUnknownType() const;
get_is_pack_element
bool get_is_pack_element() const;
get_mangled_name
SgName get_mangled_name() const;
Returns the template argument in mangled form.
get_name_qualification_length
int get_name_qualification_length() const;
get_name_qualification_length_for_type
int get_name_qualification_length_for_type() const;
get_numberOfTraversalSuccessors
virtual size_t get_numberOfTraversalSuccessors() const override; [virtual]
return number of children in the traversal successor list
get_requiresGlobalNameQualificationOnType
bool get_requiresGlobalNameQualificationOnType() const;
get_scope
SgScopeStatement* get_scope() const;
Some template arguments have an associated scope (e.g. named types, and template template arguments)
get_sourceSpelledType
SgType* get_sourceSpelledType() const;
get_source_type_global_qualification
bool get_source_type_global_qualification() const;
get_source_type_qualification_present
bool get_source_type_qualification_present() const;
get_source_type_qualification_tokens
SgStringList const& get_source_type_qualification_tokens() const;
get_templateDeclaration
SgDeclarationStatement* get_templateDeclaration() const;
get_traversalSuccessorByIndex
virtual SgNode* get_traversalSuccessorByIndex(size_t idx) const override; [virtual]
index-based access to traversal successors by index number
get_traversalSuccessorContainer
virtual 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_traversalSuccessorIsListElement
virtual std::vector<bool> get_traversalSuccessorIsListElement() const override; [virtual]
get_traversalSuccessorNamesContainer
virtual 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_type
SgType* get_type() const;
get_type_elaboration_required
bool get_type_elaboration_required() const;
get_type_elaboration_required_for_type
bool get_type_elaboration_required_for_type() const;
operator delete
void operator delete( void* pointer, size_t size);
deallocated memory for IR node (returns memory to memory pool for reuse)
operator new
void* operator new(size_t size);
returns pointer to newly allocated IR node
post_construction_initialization
virtual void post_construction_initialization() override; [virtual]
processDataMemberReferenceToPointers
virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler*) override; [virtual]
Pass references to stored node pointers to a handler.
returnDataMemberPointers
virtual std::vector<std::pair<SgNode*, std::string>> returnDataMemberPointers() const override; [virtual]
Return the node pointers stored in this node's data members.
roseRTI
virtual RTIReturnType roseRTI() override; [virtual]
return C++ Runtime-Time-Information
sage_class_name
virtual char const* sage_class_name() const override; [virtual]
returns a C style string (char*) representing the class name
set_argumentType
void set_argumentType(SgTemplateArgument::template_argument_enum argumentType);
set_explicitlySpecified
void set_explicitlySpecified(bool explicitlySpecified);
set_expression
void set_expression(SgExpression* expression);
set_global_qualification_required
void set_global_qualification_required(bool global_qualification_required);
set_global_qualification_required_for_type
void set_global_qualification_required_for_type(bool global_qualification_required_for_type);
set_isArrayBoundUnknownType
void set_isArrayBoundUnknownType(bool isArrayBoundUnknownType);
set_is_pack_element
void set_is_pack_element(bool is_pack_element);
set_name_qualification_length
void set_name_qualification_length(int name_qualification_length);
set_name_qualification_length_for_type
void set_name_qualification_length_for_type(int name_qualification_length_for_type);
set_requiresGlobalNameQualificationOnType
void set_requiresGlobalNameQualificationOnType(bool requiresGlobalNameQualificationOnType);
set_sourceSpelledType
void set_sourceSpelledType(SgType* sourceSpelledType);
set_source_type_global_qualification
void set_source_type_global_qualification(bool source_type_global_qualification);
set_source_type_qualification_present
void set_source_type_qualification_present(bool source_type_qualification_present);
set_templateDeclaration
void set_templateDeclaration(SgDeclarationStatement* templateDeclaration);
set_type
void set_type(SgType* type);
set_type_elaboration_required
void set_type_elaboration_required(bool type_elaboration_required);
set_type_elaboration_required_for_type
void set_type_elaboration_required_for_type(bool type_elaboration_required_for_type);
variantT
virtual VariantT variantT() const override; [virtual]
returns new style SageIII enum values

Static Member Functions

Name Description
memoryUsage
static size_t memoryUsage();
Returns the size in bytes of the total memory allocated for all IR nodes of this type
numberOfNodes
static size_t numberOfNodes();
Returns the total number of IR nodes of this type
traverseMemoryPoolNodes
static void traverseMemoryPoolNodes(ROSE_VisitTraversal& visit);
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
traverseMemoryPoolVisitorPattern
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern& visitor);
FOR INTERNAL USE Support for visitor pattern.
visitRepresentativeNode
static 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

Name
p_argumentType
p_explicitlySpecified
p_expression
p_global_qualification_required
p_global_qualification_required_for_type
p_isArrayBoundUnknownType
p_is_pack_element
p_name_qualification_length
p_name_qualification_length_for_type
p_requiresGlobalNameQualificationOnType
p_sourceSpelledType
p_source_type_global_qualification
p_source_type_qualification_present
p_source_type_qualification_tokens
p_templateDeclaration
p_type
p_type_elaboration_required
p_type_elaboration_required_for_type

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