X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Freturn.c;h=426f7e691d323dba77c8889d348ba5620c68a793;hb=c1c777ab401f028f3bfef31836da00c3f3fc5e0c;hp=7ffd2b27ad45f4842c10ff8972219fabe917d4b6;hpb=384e2aaec53d5d2f7571e819f5ba96e9edab6d88;p=libfirm diff --git a/ir/opt/return.c b/ir/opt/return.c index 7ffd2b27a..426f7e691 100644 --- a/ir/opt/return.c +++ b/ir/opt/return.c @@ -30,7 +30,7 @@ #include "ircons_t.h" #include "irnode_t.h" #include "irgmod.h" -#include "irtools.h" +#include "irpass.h" #define set_bit(n) (returns[(n) >> 3] |= 1 << ((n) & 7)) #define get_bit(n) (returns[(n) >> 3] & (1 << ((n) & 7))) @@ -58,7 +58,8 @@ * res = c; * return res; */ -void normalize_one_return(ir_graph *irg) { +void normalize_one_return(ir_graph *irg) +{ ir_node *endbl = get_irg_end_block(irg); int i, j, k, n, last_idx, n_rets, n_ret_vals = -1; unsigned char *returns; @@ -189,7 +190,8 @@ ir_graph_pass_t *normalize_one_return_pass(const char *name) * All predecessors of the Return block must be Jmp's of course, or we * cannot move it up, so we add blocks if needed. */ -static int can_move_ret(ir_node *ret) { +static int can_move_ret(ir_node *ret) +{ ir_node *retbl = get_nodes_block(ret); int i, n = get_irn_arity(ret); @@ -243,7 +245,8 @@ static int can_move_ret(ir_node *ret) { * else * return c; */ -void normalize_n_returns(ir_graph *irg) { +void normalize_n_returns(ir_graph *irg) +{ int i, j, n, n_rets, n_finals, n_ret_vals; ir_node *list = NULL; ir_node *final = NULL; @@ -294,7 +297,7 @@ void normalize_n_returns(ir_graph *irg) { dbg_info *dbgi = get_irn_dbg_info(ret); ir_node *phiM; - list = get_irn_link(ret); + list = (ir_node*)get_irn_link(ret); --n_rets; n = get_Block_n_cfgpreds(block); @@ -363,7 +366,7 @@ void normalize_n_returns(ir_graph *irg) { */ in = ALLOCAN(ir_node*, n_finals); - for (i = 0; final; ++i, final = get_irn_link(final)) + for (i = 0; final != NULL; ++i, final = (ir_node*)get_irn_link(final)) in[i] = final; exchange(endbl, new_r_Block(irg, n_finals, in)); @@ -378,7 +381,7 @@ void normalize_n_returns(ir_graph *irg) { set_irg_doms_inconsistent(irg); set_irg_extblk_inconsistent(irg); /* may not be needed */ set_irg_outs_inconsistent(irg); - set_irg_loopinfo_inconsistent(current_ir_graph); + set_irg_loopinfo_inconsistent(irg); } /* Create a graph pass. */