X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeabihelper.h;h=7a018f859d79f96707c65899e747ec63fa5715ce;hb=b151d11c50d89b9dffadfb63f7ccfd81ea8db44f;hp=09f8a86ea549105f2c1e0dbfc44662ad08244408;hpb=6d0764bb31c3b05471dba739a08427a736e551a7;p=libfirm diff --git a/ir/be/beabihelper.h b/ir/be/beabihelper.h index 09f8a86ea..7a018f859 100644 --- a/ir/be/beabihelper.h +++ b/ir/be/beabihelper.h @@ -29,11 +29,18 @@ #include "firm_types.h" #include "be_types.h" +#include "bearch.h" typedef struct beabi_helper_env_t beabi_helper_env_t; +/** + * Creates a helper object for the ABI constraint handling. + */ beabi_helper_env_t *be_abihelper_prepare(ir_graph *irg); +/** + * Terminates a helper object for the ABI constraint handling. + */ void be_abihelper_finish(beabi_helper_env_t *env); /** @@ -42,11 +49,11 @@ void be_abihelper_finish(beabi_helper_env_t *env); * - Callee-Save registers (we need to restore that value at the end) * - Parameters passed in registers * - stack pointer, base pointer, ... - * It is possible to specify additional irn flags (usefull to mark a value + * It is possible to specify additional irn flags (useful to mark a value * as ignore or produces_sp). */ void be_prolog_add_reg(beabi_helper_env_t *env, const arch_register_t *reg, - arch_irn_flags_t flags); + arch_register_req_type_t flags); /** * Creates a start node. @@ -55,15 +62,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, @@ -86,7 +87,7 @@ void be_prolog_set_memory(beabi_helper_env_t *env, ir_node *value); * - stack pointer, base pointer */ void be_epilog_add_reg(beabi_helper_env_t *env, const arch_register_t *reg, - arch_irn_flags_t flags, ir_node *value); + arch_register_req_type_t flags, ir_node *value); void be_epilog_set_reg_value(beabi_helper_env_t *env, const arch_register_t *reg, ir_node *value); @@ -100,18 +101,27 @@ 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 */ ir_node *be_epilog_create_return(beabi_helper_env_t *env, dbg_info *dbgi, ir_node *block); - /** * Adds a X->Proj->Keep for each output value of X which has no Proj yet */ 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. + */ +void be_collect_stacknodes(beabi_helper_env_t *env); + +/** + * 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); + #endif