21 #ifndef LOCAL_STORAGE_ALLOCATION_H
22 #define LOCAL_STORAGE_ALLOCATION_H
25 #include "ast_visitor.h"
38 static const int VREG_RETVAL = 0;
41 static const int VREG_FIRST_ARG = 1;
44 static const int VREG_FIRST_LOCAL = 10;
47 std::shared_ptr<Function> m_function;
49 unsigned m_total_local_storage;
56 void allocate_storage(
const std::shared_ptr<Function> &
function);
68 void visit_scope(
Node *n);
69 void allocate_storage(
Node *n);
Base class for AST visitors.
Definition: ast_visitor.h:7
Definition: local_storage_allocation.h:35
virtual void visit_declarator_list(Node *n)
Visit a Node with the AST_DECLARATOR_LIST tag value.
Definition: local_storage_allocation.cpp:42
virtual void visit_function_parameter(Node *n)
Visit a Node with the AST_FUNCTION_PARAMETER tag value.
Definition: local_storage_allocation.cpp:91
virtual void visit_function_definition(Node *n)
Visit a Node with the AST_FUNCTION_DEFINITION tag value.
Definition: local_storage_allocation.cpp:51
virtual void visit_struct_type_definition(Node *n)
Visit a Node with the AST_STRUCT_TYPE_DEFINITION tag value.
Definition: local_storage_allocation.cpp:107
virtual void visit_statement_list(Node *n)
Visit a Node with the AST_STATEMENT_LIST tag value.
Definition: local_storage_allocation.cpp:99