X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeabihelper.h;h=b5441eb7c5290d5992cb0b7325ce963fa9b41d24;hb=df4c51eeaf2d8fef85c97c284595087a4d11e0af;hp=166f6f60584fd728db78e64b3e09f65559a1650d;hpb=5833f687cf585b130fca4cc77d472955b62c1f59;p=libfirm diff --git a/ir/be/beabihelper.h b/ir/be/beabihelper.h index 166f6f605..b5441eb7c 100644 --- a/ir/be/beabihelper.h +++ b/ir/be/beabihelper.h @@ -32,6 +32,7 @@ #include "bearch.h" typedef struct beabi_helper_env_t beabi_helper_env_t; +typedef struct be_stackorder_t be_stackorder_t; /** * Creates a helper object for the ABI constraint handling. @@ -62,15 +63,9 @@ void be_prolog_add_reg(beabi_helper_env_t *env, const arch_register_t *reg, ir_node *be_prolog_create_start(beabi_helper_env_t *env, dbg_info *dbgi, ir_node *block); -/** - * Creates a barrier node which lets all registers specified by prolog_add_reg - * pass through - */ -ir_node *be_prolog_create_barrier(beabi_helper_env_t *env, ir_node *block); - /** * Get "value" of a register. - * This usually creates a Proj node for the start-node or barrier-node. + * This usually creates a Proj node for the start-node. * Or returns the value set by a abi_helper_set_reg_value call */ ir_node *be_prolog_get_reg_value(beabi_helper_env_t *env, @@ -107,8 +102,6 @@ ir_node *be_epilog_get_memory(beabi_helper_env_t *env); void be_epilog_begin(beabi_helper_env_t *env); -ir_node *be_epilog_create_barrier(beabi_helper_env_t *env, ir_node *block); - /** * Create return node and finishes epilog handling */ @@ -121,15 +114,34 @@ ir_node *be_epilog_create_return(beabi_helper_env_t *env, dbg_info *dbgi, void be_add_missing_keeps(ir_graph *irg); /** - * Collect firm nodes that will probably modify the stack. - * Put them into an order that respects all their dependencies. + * In the normal firm representation some nodes like pure calls, builtins + * have no memory inputs+outputs. However in the backend these sometimes have to + * access the stack to work and therefore suddenly need to be enqueued into the + * memory edge again. + * This API creates a possible order to enqueue them so we can be sure to create + * a legal dependency graph when transforming them. */ -void be_collect_stacknodes(beabi_helper_env_t *env); +be_stackorder_t *be_collect_stacknodes(ir_graph *irg); /** * return node that should produce the predecessor stack node in a block. * returns NULL if there's no predecessor in the current block. */ -ir_node *be_get_stack_pred(const beabi_helper_env_t *env, const ir_node *node); +ir_node *be_get_stack_pred(const be_stackorder_t *env, const ir_node *node); + +/** + * free memory associated with a stackorder structure + */ +void be_free_stackorder(be_stackorder_t *env); + +/** + * In case where a parameter is transmitted via register but someone takes its + * address a store to the frame which can be references is necessary. + * This function can be used as a preprocessing phase before transformation to + * do this. The assumption is that all parameter_entities which are passed + * through the stack are already moved to the arg_type and all remaining + * parameter_entities on the frame type need stores. + */ +void be_add_parameter_entity_stores(ir_graph *irg); #endif