X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firdom.c;h=9f8bb72792e6efe32d158ace1c461a0d0e0631d3;hb=3c4872fdbca09b88b377417d58981c6e518313b4;hp=5df16de5c5d80ad13f7947c25d6ff9f15f1e15bf;hpb=59edc3a2393e2a8fffee601badfa27b159641b01;p=libfirm diff --git a/ir/ana/irdom.c b/ir/ana/irdom.c index 5df16de5c..9f8bb7279 100644 --- a/ir/ana/irdom.c +++ b/ir/ana/irdom.c @@ -27,8 +27,8 @@ #include "irnode_t.h" #include "ircons_t.h" -#define get_dom_info(bl) (&(bl)->attr.block.dom) +#define get_dom_info(bl) (&(bl)->attr.block.dom) /*--------------------------------------------------------------------*/ /** Accessing the dominator data structures **/ @@ -100,12 +100,13 @@ int block_dominates(const ir_node *a, const ir_node *b) const dom_info *ai, *bi; if (is_Block(a) && is_Block(b)) { - ai = get_dom_info(a); - bi = get_dom_info(b); - return bi->tree_pre_num - ai->tree_pre_num - <= ai->max_subtree_pre_num - ai->tree_pre_num; - } - return 0; + ai = get_dom_info(a); + bi = get_dom_info(b); + return bi->tree_pre_num - ai->tree_pre_num + <= ai->max_subtree_pre_num - ai->tree_pre_num; + } + + return 0; } ir_node *get_Block_dominated_first(const ir_node *bl) @@ -299,7 +300,7 @@ void compute_doms(ir_graph *irg) { /* We need the out datastructure. */ if (current_ir_graph->outs_state != outs_consistent) - compute_outs(current_ir_graph); + compute_irg_outs(current_ir_graph); /* this with a standard walker as passing the parent to the sons isn't simple. */ @@ -320,12 +321,10 @@ void compute_doms(ir_graph *irg) { /* Step 2 */ irn_arity = get_irn_arity(w->block); for (j = 0; j < irn_arity; j++) { - ir_node *cf_op = get_Block_cfgpred(w->block, j); - ir_node *pred = get_nodes_block(cf_op); + ir_node *pred = get_Block_cfgpred_block(w->block, j); tmp_dom_info *u; - if ((is_Bad(cf_op)) || (is_Bad(pred)) || - (get_Block_pre_num (pred) == -1)) + if (is_Bad(pred) || (get_Block_pre_num (pred) == -1)) continue; /* control-dead */ u = dom_eval (&tdi_list[get_Block_pre_num(pred)]);