X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgwalk.c;h=35abd5b48fc4facd1b4d354219141dc038db3ccd;hb=e1c33a238578342a072e1c95ff12eefe6d0acd37;hp=10ae3023ef46d1a68ecfebec1c3c5a14afc62bdd;hpb=af7e551ca6c6590d39953a0be2e46b054bfb4f47;p=libfirm diff --git a/ir/ir/irgwalk.c b/ir/ir/irgwalk.c index 10ae3023e..35abd5b48 100644 --- a/ir/ir/irgwalk.c +++ b/ir/ir/irgwalk.c @@ -238,7 +238,7 @@ static unsigned nodes_touched = 0; */ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env) { - assert(node && node->kind==k_ir_node); + assert(is_ir_node(node)); if (get_interprocedural_view()) { eset * irg_set = eset_create(); @@ -501,6 +501,22 @@ void irg_block_walk_graph(ir_graph *irg, irg_walk_func *pre, current_ir_graph = rem; } +/* + * Additionally walk over all anchors. Do NOT increase the visit flag. + */ +void irg_walk_anchors(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) { + int i; + ir_graph * rem = current_ir_graph; + current_ir_graph = irg; + + for (i = 0; i < anchor_max; ++i) { + ir_node *anchor = irg->anchors[i]; + + irg_walk_2(anchor, pre, post, env); + } + current_ir_graph = rem; +} + /********************************************************************/ typedef struct walk_env {