X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fcommon%2Fstatistics.c;h=5a488dc0531948dff21cbdb7394485a777718f77;hb=98ca7e71bc79bb2a3b2ccb039df78000fc48e70a;hp=1af3281dcb35760944479a8c18d9643fa4e12bde;hpb=20ca6997bf08d796a3c17a6ce149b9d58b6c5754;p=libfirm diff --git a/ir/common/statistics.c b/ir/common/statistics.c index 1af3281dc..5a488dc05 100644 --- a/ir/common/statistics.c +++ b/ir/common/statistics.c @@ -10,9 +10,13 @@ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "statistics.h" -#include "irgraph.h" -#include "irnode.h" +#include "irgraph_t.h" +#include "irnode_t.h" #include "irprog.h" #include "irgwalk.h" @@ -29,10 +33,11 @@ static void count_nodes(ir_node *n, void *env) { * totals. */ void print_graph_counts(int verbosity) { int i, counter, total = 0; - int view = interprocedural_view; - interprocedural_view = 0; + int view = get_interprocedural_view(); ir_graph *old = current_ir_graph; + set_interprocedural_view(0); + for (i = 0; i < get_irp_n_irgs(); i++) { counter = 0; irg_walk_graph(get_irp_irg(i), count_nodes, NULL, &counter); @@ -43,7 +48,7 @@ void print_graph_counts(int verbosity) { printf(" +++ There are %d graphs with total %d nodes.\n", get_irp_n_irgs(), total); current_ir_graph = old; - interprocedural_view = view; + set_interprocedural_view(view); } /** Prints number of types, number of entities and totals. @@ -53,18 +58,18 @@ void print_type_counts(int verbosity) { for (i = 0; i < get_irp_n_types(); i++) { type *tp = get_irp_type(i); counter = -1; - if (is_class_type(tp)) counter = get_class_n_members(tp); - if (is_struct_type(tp)) counter = get_struct_n_members(tp); - if (is_union_type(tp)) counter = get_union_n_members(tp); + if (is_Class_type(tp)) counter = get_class_n_members(tp); + if (is_Struct_type(tp)) counter = get_struct_n_members(tp); + if (is_Union_type(tp)) counter = get_union_n_members(tp); if (counter > -1) { if (verbosity == 1) - printf(" +%3d entities in %s type %s.\n", counter, get_type_tpop_name(tp), get_type_name(tp)); + printf(" +%3d entities in %s type %s.\n", counter, get_type_tpop_name(tp), get_type_name(tp)); total += counter; } } printf(" +++ There are %d types with total %d entities.\n", get_irp_n_types(), total); printf(" +++ Global type has %d entities\n", - get_class_n_members(get_glob_type())); + get_class_n_members(get_glob_type())); }