Skip to content

SgFunctionType

This class represents a type for all functions.

Synopsis

Declared in <src/frontend/SageIII/Cxx_Grammar.h> (not stored in Git)

class [[visibility("default")]] SgFunctionType
    : public SgType

Description

  • Internal: This type is derived from to build member function types (SgMemberFunctionType).
  • See also: Example of using a SgFunctionType object

Data members

SgFunctionType::p_argument_list

This points to the SgTypes used in the function's parameter list.

SgFunctionType::p_return_type

This points to the SgType of the current function type's return type.

SgFunctionType::p_has_ellipses

This boolean variable is true if the function use the "..." type (support for variable number of parameters).

Base Classes

Name Description
SgType This class represents the base class for all types.

Type Aliases

Name
base_node_type

Enums

Name Description
Unnamed enum static variant value
exception_specification_kind_enum

Member Functions

Name Description
SgFunctionType
SgFunctionType( SgType* return_type, bool has_ellipses, SgFunctionParameterTypeList* argument_list, SgFunctionType::exception_specification_kind_enum exception_specification_kind = e_exception_none, SgExpression* exception_specification_expression = nullptr, SgTypePtrList exception_specification_types = {}, std::vector<bool> exception_specification_type_pack_expansions = {}, SgFunctionDeclaration* exception_specification_source = nullptr, SgFunctionDeclaration* exception_specification_pattern = nullptr, bool exception_specification_source_is_self = false, bool exception_specification_is_written = false, SgFunctionType* semantic_signature = nullptr, bool has_prototype = true); [constructor]
~SgFunctionType
virtual ~SgFunctionType(); [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]
get_argument_list
SgFunctionParameterTypeList* get_argument_list() const;
get_arguments
SgTypePtrList const& get_arguments() const;
Parameter types in declaration order.
get_childIndex
virtual size_t get_childIndex(SgNode* child) const override; [virtual]
index-based access to traversal successors by child node
get_exception_specification_expression
SgExpression* get_exception_specification_expression() const;
get_exception_specification_is_written
bool get_exception_specification_is_written() const;
get_exception_specification_kind
exception_specification_kind_enum get_exception_specification_kind() const;
get_exception_specification_pattern
SgFunctionDeclaration* get_exception_specification_pattern() const;
get_exception_specification_source
SgFunctionDeclaration* get_exception_specification_source() const;
get_exception_specification_source_is_self
bool get_exception_specification_source_is_self() const;
get_exception_specification_type_pack_expansions
std::vector<bool> const& get_exception_specification_type_pack_expansions() const;
get_exception_specification_types
SgTypePtrList const& get_exception_specification_types() const;
get_has_ellipses
bool get_has_ellipses() const;
get_has_prototype
bool get_has_prototype() const;
get_mangled
virtual SgName get_mangled() const override; [virtual]
get_numberOfTraversalSuccessors
virtual size_t get_numberOfTraversalSuccessors() const override; [virtual]
return number of children in the traversal successor list
get_return_type
SgType* get_return_type() const;
get_semantic_signature
SgFunctionType* get_semantic_signature() const;
get_source_trailing_return
bool get_source_trailing_return() 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
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]
Performs final initialization of data members (called by constructors)
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_argument_list
void set_argument_list(SgFunctionParameterTypeList* argument_list);
set_has_ellipses
void set_has_ellipses(bool has_ellipses);
set_return_type
void set_return_type(SgType* return_type);
set_source_trailing_return
void set_source_trailing_return(bool source_trailing_return);
variantT
virtual VariantT variantT() const override; [virtual]
returns new style SageIII enum values

Static Member Functions

Name Description
get_mangled
static SgName get_mangled( SgType* return_type, SgFunctionParameterTypeList* typeList);
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.
validate_exception_specification
static void validate_exception_specification( exception_specification_kind_enum, SgExpression*, SgTypePtrList const&, std::vector<bool> const&, SgFunctionDeclaration*, SgFunctionDeclaration*, bool, bool);
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 Member Functions

Name
get_mangled_exception_specification
SgName get_mangled_exception_specification() const;

Protected Data Members

Name
p_argument_list
p_exception_specification_expression
p_exception_specification_is_written
p_exception_specification_kind
p_exception_specification_pattern
p_exception_specification_source
p_exception_specification_source_is_self
p_exception_specification_type_pack_expansions
p_exception_specification_types
p_function_type_table
p_has_ellipses
p_has_prototype
p_return_type
p_semantic_signature
p_source_trailing_return

Friends

Name Description
isSgFunctionType Casts pointer from base class to derived class (for const pointers)
isSgFunctionType Casts pointer from base class to derived class
SgFunctionTypeTable Canonical function types indexed by semantic signatures.

Derived Classes

Name Description
SgMemberFunctionType

Created with MrDocs