Skip to content

SgFunctionDeclaration

Synopsis

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

class [[visibility("default")]] SgFunctionDeclaration
    : public SgDeclarationStatement

Base Classes

Name Description
SgDeclarationStatement This class represents the concept of a declaration statement.

Type Aliases

Name
base_node_type

Enums

Name Description
Unnamed enum static variant value
constexpr_specifier_enum
frontend_declaration_origin_enum
frontend_source_ownership_enum
source_return_type_elaboration_kind_enum

Member Functions

Name Description
SgFunctionDeclaration
SgFunctionDeclaration( SgName name, SgFunctionType* type, SgFunctionDefinition* definition, SgFunctionType* declared_exception_signature); [constructor]
Constructors
~SgFunctionDeclaration
virtual ~SgFunctionDeclaration(); [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]
append_arg
virtual void append_arg(SgInitializedName* element); [virtual]
cfgInEdges
virtual std::vector<VirtualCFG::CFGEdge> cfgInEdges(unsigned int index) override; [virtual]
cfgIndexForEnd
virtual unsigned int cfgIndexForEnd() const override; [virtual]
cfgOutEdges
virtual std::vector<VirtualCFG::CFGEdge> cfgOutEdges(unsigned int index) 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_args
SgInitializedNamePtrList& get_args();
get_asm_name
std::string get_asm_name() const;
get_childIndex
virtual size_t get_childIndex(SgNode* child) const override; [virtual]
index-based access to traversal successors by child node
get_constexpr_specifier
SgFunctionDeclaration::constexpr_specifier_enum get_constexpr_specifier() const;
get_cuda_launch_bounds_expression
SgExpression* get_cuda_launch_bounds_expression() const;
get_declared_exception_signature
SgFunctionType* get_declared_exception_signature() const;
get_definition
SgFunctionDefinition* get_definition() const;
get_explicit_specifier_expression
SgExpression* get_explicit_specifier_expression() const;
get_fortran_anonymous_program_unit_symbol_key
SgName const& get_fortran_anonymous_program_unit_symbol_key() const;
Exact internal symbol-table key for an implicit PROGRAM or unnamed BLOCK DATA. Only the frontend producer may initialize it, exactly once.
get_frontend_declaration_origin
frontend_declaration_origin_enum get_frontend_declaration_origin() const;
get_frontend_source_ownership
frontend_source_ownership_enum get_frontend_source_ownership() const;
get_functionModifier
SgFunctionModifier const& get_functionModifier() const;
get_functionParameterScope
SgFunctionParameterScope* get_functionParameterScope() const;
get_function_declarator_scope
SgDeclarationScope* get_function_declarator_scope() const;
get_global_qualification_required
bool get_global_qualification_required() const;
get_global_qualification_required_for_return_type
bool get_global_qualification_required_for_return_type() const;
get_gnu_extension_alias
std::string get_gnu_extension_alias() const;
get_gnu_extension_section
std::string get_gnu_extension_section() const;
get_gnu_regparm_attribute
int get_gnu_regparm_attribute() const;
get_is_constexpr
bool get_is_constexpr() const;
get_is_deduction_guide
bool get_is_deduction_guide() const;
get_is_implicit_function
bool get_is_implicit_function() const;
get_mangled_name
virtual SgName get_mangled_name() const override; [virtual]
get_marked_as_frontend_normalization
bool get_marked_as_frontend_normalization() const;
get_name
SgName get_name() const;
get_name_qualification_length
int get_name_qualification_length() const;
get_name_qualification_length_for_return_type
int get_name_qualification_length_for_return_type() const;
get_named_in_end_statement
bool get_named_in_end_statement() const;
get_numberOfTraversalSuccessors
virtual size_t get_numberOfTraversalSuccessors() const override; [virtual]
return number of children in the traversal successor list
get_oldStyleDefinition
bool get_oldStyleDefinition() const;
get_omp_declare_variant_region_ordinal
std::optional<unsigned int> get_omp_declare_variant_region_ordinal() const;
get_omp_declare_variant_source_name
SgName get_omp_declare_variant_source_name() const;
get_orig_return_type
SgType* get_orig_return_type() const;
Convenience function to access the return type as written in source; may be different from type()->get_return_type()
get_parameterList
SgFunctionParameterList* get_parameterList() const;
get_parameterList_syntax
SgFunctionParameterList* get_parameterList_syntax() const;
get_prototypeIsWithoutParameters
bool get_prototypeIsWithoutParameters() const;
get_qualified_name
virtual SgName get_qualified_name() const; [virtual]
get_requiresNameQualificationOnReturnType
bool get_requiresNameQualificationOnReturnType() const;
get_scope
virtual SgScopeStatement* get_scope() const override; [virtual]
get_sourceSpelledTemplateHeaders
SgTemplateParameterListPtrList const& get_sourceSpelledTemplateHeaders() const;
get_source_declarator_uses_wrapped_function_type
bool get_source_declarator_uses_wrapped_function_type() const;
get_source_name_parenthesized_for_macro
bool get_source_name_parenthesized_for_macro() const;
get_source_return_type_elaboration_kind
SgFunctionDeclaration::source_return_type_elaboration_kind_enum get_source_return_type_elaboration_kind() const;
get_source_return_type_global_qualification
bool get_source_return_type_global_qualification() const;
get_source_return_type_qualification_present
bool get_source_return_type_qualification_present() const;
get_source_return_type_qualification_tokens
SgStringList const& get_source_return_type_qualification_tokens() const;
get_specialFunctionModifier
SgSpecialFunctionModifier const& get_specialFunctionModifier() const;
get_specialization
SgDeclarationStatement::template_specialization_enum get_specialization() const;
get_symbol_from_symbol_table
virtual SgSymbol* get_symbol_from_symbol_table() const override; [virtual]
get_symbol_table_key
SgName get_symbol_table_key() const;
Return this declaration's exact semantic symbol-table key.
get_templateInstantiationPattern
SgFunctionDeclaration* get_templateInstantiationPattern() const;
get_trailingRequiresClause
SgExpression* get_trailingRequiresClause() 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
SgFunctionType* get_type() const;
get_type_elaboration_required
bool get_type_elaboration_required() const;
get_type_elaboration_required_for_return_type
bool get_type_elaboration_required_for_return_type() const;
get_type_syntax
SgFunctionType* get_type_syntax() const;
get_type_syntax_is_available
bool get_type_syntax_is_available() const;
get_using_C11_Noreturn_keyword
bool get_using_C11_Noreturn_keyword() const;
get_using_new_function_return_type_syntax
bool get_using_new_function_return_type_syntax() const;
hasExplicitScope
virtual bool hasExplicitScope() const override; [virtual]
Support for where the scope is explicitly required
initialize_fortran_anonymous_program_unit_symbol_key
void initialize_fortran_anonymous_program_unit_symbol_key(SgName const& key);
initialize_frontend_declaration_origin
void initialize_frontend_declaration_origin(frontend_declaration_origin_enum origin);
initialize_frontend_source_ownership
void initialize_frontend_source_ownership(frontend_source_ownership_enum ownership);
isPartialSpecialization
bool isPartialSpecialization() const;
isSpecialization
bool isSpecialization() const;
isTemplateFunction
bool isTemplateFunction() 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]
prepend_arg
virtual void prepend_arg(SgInitializedName* element); [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_asm_name
void set_asm_name(std::string asm_name);
set_constexpr_specifier
void set_constexpr_specifier(SgFunctionDeclaration::constexpr_specifier_enum constexpr_specifier);
set_cuda_launch_bounds_expression
void set_cuda_launch_bounds_expression(SgExpression* cuda_launch_bounds_expression);
set_definition
void set_definition(SgFunctionDefinition* definition);
set_explicit_specifier_expression
void set_explicit_specifier_expression(SgExpression* explicit_specifier_expression);
set_functionParameterScope
void set_functionParameterScope(SgFunctionParameterScope* functionParameterScope);
set_function_declarator_scope
void set_function_declarator_scope(SgDeclarationScope* function_declarator_scope);
set_global_qualification_required
void set_global_qualification_required(bool global_qualification_required);
set_global_qualification_required_for_return_type
void set_global_qualification_required_for_return_type(bool global_qualification_required_for_return_type);
set_gnu_extension_alias
void set_gnu_extension_alias(std::string gnu_extension_alias);
set_gnu_extension_section
void set_gnu_extension_section(std::string gnu_extension_section);
set_gnu_regparm_attribute
void set_gnu_regparm_attribute(int gnu_regparm_attribute);
set_is_deduction_guide
void set_is_deduction_guide(bool is_deduction_guide);
set_is_implicit_function
void set_is_implicit_function(bool is_implicit_function);
set_marked_as_frontend_normalization
void set_marked_as_frontend_normalization(bool marked_as_frontend_normalization);
set_name
void set_name(SgName name);
set_name_qualification_length
void set_name_qualification_length(int name_qualification_length);
set_name_qualification_length_for_return_type
void set_name_qualification_length_for_return_type(int name_qualification_length_for_return_type);
set_named_in_end_statement
void set_named_in_end_statement(bool named_in_end_statement);
set_oldStyleDefinition
void set_oldStyleDefinition(bool oldStyleDefinition);
set_omp_declare_variant_region_ordinal
void set_omp_declare_variant_region_ordinal(std::optional<unsigned int> omp_declare_variant_region_ordinal);
set_omp_declare_variant_source_name
void set_omp_declare_variant_source_name(SgName omp_declare_variant_source_name);
set_parameterList
void set_parameterList(SgFunctionParameterList* parameterList);
set_parameterList_syntax
void set_parameterList_syntax(SgFunctionParameterList* parameterList_syntax);
set_prototypeIsWithoutParameters
void set_prototypeIsWithoutParameters(bool prototypeIsWithoutParameters);
set_requiresNameQualificationOnReturnType
void set_requiresNameQualificationOnReturnType(bool requiresNameQualificationOnReturnType);
set_scope
virtual void set_scope(SgScopeStatement* scope) override; [virtual]
set_source_declarator_uses_wrapped_function_type
void set_source_declarator_uses_wrapped_function_type(bool source_declarator_uses_wrapped_function_type);
set_source_name_parenthesized_for_macro
void set_source_name_parenthesized_for_macro(bool source_name_parenthesized_for_macro);
set_source_return_type_elaboration_kind
void set_source_return_type_elaboration_kind(SgFunctionDeclaration::source_return_type_elaboration_kind_enum source_return_type_elaboration_kind);
set_source_return_type_global_qualification
void set_source_return_type_global_qualification(bool source_return_type_global_qualification);
set_source_return_type_qualification_present
void set_source_return_type_qualification_present(bool source_return_type_qualification_present);
set_specialization
void set_specialization(SgDeclarationStatement::template_specialization_enum specialization);
set_templateInstantiationPattern
void set_templateInstantiationPattern(SgFunctionDeclaration* templateInstantiationPattern);
set_trailingRequiresClause
void set_trailingRequiresClause(SgExpression* trailingRequiresClause);
set_type
void set_type(SgFunctionType* type);
set_type_elaboration_required
void set_type_elaboration_required(bool type_elaboration_required);
set_type_elaboration_required_for_return_type
void set_type_elaboration_required_for_return_type(bool type_elaboration_required_for_return_type);
set_type_syntax
void set_type_syntax(SgFunctionType* type_syntax);
set_type_syntax_is_available
void set_type_syntax_is_available(bool type_syntax_is_available);
set_using_C11_Noreturn_keyword
void set_using_C11_Noreturn_keyword(bool using_C11_Noreturn_keyword);
set_using_new_function_return_type_syntax
void set_using_new_function_return_type_syntax(bool using_new_function_return_type_syntax);
validate_cuda_launch_bounds_expression
void validate_cuda_launch_bounds_expression() const;
validate_explicit_specifier
void validate_explicit_specifier() const;
validate_source_declarator_form
void validate_source_declarator_form() const;
Validate the source-only function declarator form that omits parentheses.
variantT
virtual VariantT variantT() const override; [virtual]
returns new style SageIII enum values

Static Member Functions

Name Description
cuda_launch_bounds_operands_are_valid
static bool cuda_launch_bounds_operands_are_valid(SgExpression* expression);
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 Member Functions

Name
replace_child
virtual bool replace_child( SgStatement*, SgStatement*, bool extractListFromBasicBlock = false) override; [virtual]

Protected Data Members

Name
p_asm_name
p_constexpr_specifier
p_cuda_launch_bounds_expression
p_declared_exception_signature
p_definition
p_explicit_specifier_expression
p_fortran_anonymous_program_unit_symbol_key
p_frontend_declaration_origin
p_frontend_source_ownership
p_functionModifier
p_functionParameterScope
p_function_declarator_scope
p_global_qualification_required
p_global_qualification_required_for_return_type
p_gnu_extension_alias
p_gnu_extension_section
p_gnu_regparm_attribute
p_is_deduction_guide
p_is_implicit_function
p_marked_as_frontend_normalization
p_name
p_name_qualification_length
p_name_qualification_length_for_return_type
p_named_in_end_statement
p_oldStyleDefinition
p_omp_declare_variant_region_ordinal
p_omp_declare_variant_source_name
p_parameterList
p_parameterList_syntax
p_prototypeIsWithoutParameters
p_requiresNameQualificationOnReturnType
p_scope
p_sourceSpelledTemplateHeaders
p_source_declarator_uses_wrapped_function_type
p_source_name_parenthesized_for_macro
p_source_return_type_elaboration_kind
p_source_return_type_global_qualification
p_source_return_type_qualification_present
p_source_return_type_qualification_tokens
p_specialFunctionModifier
p_specialization
p_templateInstantiationPattern
p_trailingRequiresClause
p_type
p_type_elaboration_required
p_type_elaboration_required_for_return_type
p_type_syntax
p_type_syntax_is_available
p_using_C11_Noreturn_keyword
p_using_new_function_return_type_syntax

Friends

Name Description
isSgFunctionDeclaration Casts pointer from base class to derived class (for const pointers)
isSgFunctionDeclaration Casts pointer from base class to derived class

Derived Classes

Name Description
SgEntryStatement
SgMemberFunctionDeclaration This class represents the concept of a member function declaration statement.
SgProcedureHeaderStatement
SgProgramHeaderStatement
SgTemplateFunctionDeclaration
SgTemplateInstantiationFunctionDecl This class represents the concept of an instantiation of function template.

Created with MrDocs