X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgwalk.c;h=dd986323b55df24ef61182b83146ce5b75033deb;hb=ecf4d3aa8c62642835511e1f7b8a329078161fe1;hp=e34402d587528d3da2551122512b4f3f9aa5e9b4;hpb=854a5a30a1ba1336f4ef037ad1f239077c6d2a6e;p=libfirm diff --git a/ir/ir/irgwalk.c b/ir/ir/irgwalk.c index e34402d58..dd986323b 100644 --- a/ir/ir/irgwalk.c +++ b/ir/ir/irgwalk.c @@ -11,24 +11,28 @@ */ /** -* traverse an ir graph -* - execute the pre function before recursion -* - execute the post function after recursion -*/ + * @file irgwalk.c + * + * traverse an ir graph + * - execute the pre function before recursion + * - execute the post function after recursion + */ #ifdef HAVE_CONFIG_H -# include +# include "config.h" #endif -#include +#ifdef HAVE_STDLIB_H +# include +#endif #include "irnode_t.h" #include "irgraph_t.h" /* visited flag */ #include "irprog.h" #include "irgwalk.h" #include "typewalk.h" -#include "firmstat.h" +#include "irhooks.h" #include "ircgcons.h" #include "eset.h" @@ -38,7 +42,7 @@ * Walk over an interprocedural graph (callgraph). * Visits only graphs in irg_set. */ -static void irg_walk_cg(ir_node * node, int visited, eset * irg_set, +static void irg_walk_cg(ir_node * node, unsigned long visited, eset * irg_set, irg_walk_func *pre, irg_walk_func *post, void * env) { int i; ir_graph * rem = current_ir_graph; @@ -215,7 +219,7 @@ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env) if (get_interprocedural_view()) { eset * irg_set = eset_create(); - int visited; + unsigned long visited; ir_graph * irg; assert(get_irp_ip_view_state() == ip_view_valid); @@ -242,7 +246,7 @@ void irg_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void *env) void irg_walk_graph(ir_graph *irg, irg_walk_func *pre, irg_walk_func *post, void *env) { ir_graph * rem = current_ir_graph; - stat_irg_walk(irg, (void *)pre, (void *)post); + hook_irg_walk(irg, (void *)pre, (void *)post); current_ir_graph = irg; irg_walk(get_irg_end(irg), pre, post, env); current_ir_graph = rem; @@ -426,7 +430,7 @@ void irg_block_walk(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void ir_node *block, *pred; int i; - stat_irg_block_walk(current_ir_graph, node, (void *)pre, (void *)post); + hook_irg_block_walk(current_ir_graph, node, (void *)pre, (void *)post); assert(node); assert(!get_interprocedural_view()); /* interprocedural_view not implemented, because it @@ -522,7 +526,7 @@ void walk_const_code(irg_walk_func *pre, irg_walk_func *post, void *env) { /* Walk constant array bounds. */ for (i = 0; i < get_irp_n_types(); i++) { type *tp = get_irp_type(i); - if (is_array_type(tp)) { + if (is_Array_type(tp)) { for (j = 0; j < get_array_n_dimensions(tp); j++) { ir_node *n = get_array_lower_bound(tp, j); if (n) irg_walk(n, pre, post, env);