X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firpass.c;h=adc75a8caf5e77fdb7209a1f74faac105200fb08;hb=b4647d67ab7885d5da32c2a30242fbc4ed93d81b;hp=130c57ca50a96c74ea271e00b3f43d3e0972ee35;hpb=baae508c4f9babb9e4f21eff36f3c3ba72816621;p=libfirm diff --git a/ir/ir/irpass.c b/ir/ir/irpass.c index 130c57ca5..adc75a8ca 100644 --- a/ir/ir/irpass.c +++ b/ir/ir/irpass.c @@ -31,7 +31,7 @@ #include "irgraph_t.h" #include "irprog_t.h" #include "irdump.h" -#include "irvrfy.h" +#include "irverify.h" #include "xmalloc.h" /*Add a graph pass to a graph pass manager. */ @@ -157,12 +157,9 @@ void ir_prog_pass_mgr_add_graph_mgr( ir_prog_pass_mgr_add(mgr, pass); } -/** - * Create a suffix for dumping. - */ -void create_suffix(char *suffix, size_t n, const char *pass_name, unsigned index) +static void create_suffix(char *suffix, size_t n, const char *pass_name) { - snprintf(suffix, n, "-%02u_%s", index, pass_name); + snprintf(suffix, n, "%s.svg", pass_name); } /* Run all passes of an ir_graph pass manager. */ @@ -194,9 +191,9 @@ int ir_graph_pass_mgr_run(ir_graph_pass_manager_t *mgr) if (pass->dump_irg) { pass->dump_irg(irg, pass->context, idx); } else { - char suffix[1024]; - create_suffix(suffix, sizeof(suffix), pass->name, idx); - dump_ir_block_graph(irg, suffix); + char buf[1024]; + create_suffix(buf, sizeof(buf), pass->name); + dump_ir_graph(irg, buf); } } ++idx; @@ -243,9 +240,9 @@ int ir_prog_pass_mgr_run(ir_prog_pass_manager_t *mgr) if (pass->dump_irprog) { pass->dump_irprog(irp, pass->context, idx); } else { - char suffix[1024]; - create_suffix(suffix, sizeof(suffix), pass->name, idx); - dump_all_ir_graphs(dump_ir_block_graph, suffix); + char buf[1024]; + create_suffix(buf, sizeof(buf), pass->name); + dump_all_ir_graphs(buf); } } if (pass->is_wrapper) { @@ -346,7 +343,8 @@ void ir_prog_pass_mgr_set_run_idx( /** * Wrapper for running void function(ir_graph *irg) as an ir_graph pass. */ -static int void_graph_wrapper(ir_graph *irg, void *context) { +static int void_graph_wrapper(ir_graph *irg, void *context) +{ void (*function)(ir_graph *irg) = context; function(irg); return 0; @@ -371,7 +369,8 @@ ir_graph_pass_t *def_graph_pass( /** * Wrapper for running void function(ir_graph *irg) as an ir_graph pass. */ -static int int_graph_wrapper(ir_graph *irg, void *context) { +static int int_graph_wrapper(ir_graph *irg, void *context) +{ int (*function)(ir_graph *irg) = context; return function(irg); } /* int_graph_wrapper */ @@ -410,11 +409,17 @@ ir_graph_pass_t *def_graph_pass_constructor( return pass; } /* def_graph_pass_constructor */ +/* set the run parallel property */ +void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag) +{ + pass->run_parallel = flag != 0; +} /* ir_graph_pass_set_parallel */ /** * Wrapper for running void function(void) as an ir_prog pass. */ -static int void_prog_wrapper(ir_prog *irp, void *context) { +static int void_prog_wrapper(ir_prog *irp, void *context) +{ void (*function)(void) = context; (void)irp; @@ -469,7 +474,8 @@ struct pass_t { /** * Wrapper for the call_function pass. */ -static int call_function_wrapper(ir_prog *irp, void *context) { +static int call_function_wrapper(ir_prog *irp, void *context) +{ struct pass_t *pass = context; (void)irp;