X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Ffirmstat.c;h=38c777457f94fa70ff3394d283ba7e8218f4ded7;hb=4b0d2820179bbbf6b2dc06223ed9d7ebfa547402;hp=1b1666097418b329a8240bd87c906fac0304a56f;hpb=8fbb177a7b72bf1508cf689017c2dbdc98530331;p=libfirm diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c index 1b1666097..38c777457 100644 --- a/ir/stat/firmstat.c +++ b/ir/stat/firmstat.c @@ -777,7 +777,7 @@ static void update_graph_stat(graph_entry_t *global, graph_entry_t *graph) ir_graph *rem = current_ir_graph; if (get_irg_outs_state(graph->irg) != outs_consistent) - compute_outs(graph->irg); + compute_irg_outs(graph->irg); /* Must be done an the outs graph */ current_ir_graph = graph->irg; @@ -1084,7 +1084,7 @@ static void stat_free_graph(void *ctx, ir_graph *irg) * @param pre the pre walker * @param post the post walker */ -static void stat_irg_walk(void *ctx, ir_graph *irg, void *pre, void *post) +static void stat_irg_walk(void *ctx, ir_graph *irg, generic_func *pre, generic_func *post) { if (! status->stat_options) return; @@ -1106,7 +1106,7 @@ static void stat_irg_walk(void *ctx, ir_graph *irg, void *pre, void *post) * @param pre the pre walker * @param post the post walker */ -static void stat_irg_walk_blkwise(void *ctx, ir_graph *irg, void *pre, void *post) +static void stat_irg_walk_blkwise(void *ctx, ir_graph *irg, generic_func *pre, generic_func *post) { /* for now, do NOT differentiate between blockwise and normal */ stat_irg_walk(ctx, irg, pre, post); @@ -1121,7 +1121,7 @@ static void stat_irg_walk_blkwise(void *ctx, ir_graph *irg, void *pre, void *pos * @param pre the pre walker * @param post the post walker */ -static void stat_irg_block_walk(void *ctx, ir_graph *irg, ir_node *node, void *pre, void *post) +static void stat_irg_block_walk(void *ctx, ir_graph *irg, ir_node *node, generic_func *pre, generic_func *post) { if (! status->stat_options) return; @@ -1435,8 +1435,12 @@ static void stat_arch_dep_replace_DivMod_by_const(void *ctx, ir_node *divmod) } /* Dumps a statistics snapshot */ -void stat_dump_snapshot(const char *name) +void stat_dump_snapshot(const char *name, const char *phase) { + char fname[2048]; + const char *p; + int l; + if (! status->stat_options) return; @@ -1447,13 +1451,45 @@ void stat_dump_snapshot(const char *name) /* * The constant counter is only global, so we clear it here. - * Note that it does NOT contain teh constants in DELETED + * Note that it does NOT contain the constants in DELETED * graphs due to this. */ if (status->stat_options & FIRMSTAT_COUNT_CONSTS) stat_const_clear(status); - stat_dump_init(name); + /* build the name */ + p = strrchr(name, '/'); +#ifdef _WIN32 + { + const char *q; + + q = strrchr(name, '\\'); + + /* NULL might be not the smallest pointer */ + if (q && (!p || q > p)) + p = q; + } +#endif + if (p) { + ++p; + l = p - name; + + if (l > sizeof(fname) - 1) + l = sizeof(fname) - 1; + + memcpy(fname, name, l); + fname[l] = '\0'; + } + else { + fname[0] = '\0'; + p = name; + } + strncat(fname, "firmstat-", sizeof(fname)); + strncat(fname, phase, sizeof(fname)); + strncat(fname, "-", sizeof(fname)); + strncat(fname, p, sizeof(fname)); + + stat_dump_init(fname); /* calculate the graph statistics */ for (entry = pset_first(status->irg_hash); entry; entry = pset_next(status->irg_hash)) { @@ -1659,9 +1695,9 @@ void stat_term(void) { void init_stat(unsigned enable_options) {} /* Dumps a statistics snapshot */ -void stat_dump_snapshot(const char *name) {} +void stat_dump_snapshot(const char *name, const char *phase) {} -/* terminates the statustics module, frees all memory */ +/* terminates the statistics module, frees all memory */ void stat_term(void); #endif /* FIRM_STATISTICS */