X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fbe%2Fbeutil.c;h=04e7e1b9f463bf8e9228df7fe5bc2c1114213c2b;hb=42f34c5541c99888917aa989a9ef229a325b5d10;hp=53c868c45ec4c8b7619c787ae51e0c5aa9e57e46;hpb=ad177bc3490f7f1da426d681aaeadc2f254b0acf;p=libfirm diff --git a/ir/be/beutil.c b/ir/be/beutil.c index 53c868c45..04e7e1b9f 100644 --- a/ir/be/beutil.c +++ b/ir/be/beutil.c @@ -133,3 +133,27 @@ void dump_ir_block_graph_sched(ir_graph *irg, const char *suffix) { dump_ir_block_graph(irg, suffix); set_dump_node_edge_hook(old); } + +static void clear_link(ir_node *irn, void *data) +{ + set_irn_link(irn, NULL); +} + +static void collect_phis(ir_node *irn, void *data) +{ + if(is_Phi(irn)) { + ir_node *bl = get_nodes_block(irn); + set_irn_link(irn, get_irn_link(bl)); + set_irn_link(bl, irn); + } +} + +void be_clear_links(ir_graph *irg) +{ + irg_walk_graph(irg, clear_link, NULL, NULL); +} + +void be_collect_phis(ir_graph *irg) +{ + irg_walk_graph(irg, collect_phis, NULL, NULL); +}