X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fcommon%2Fstatistics.c;h=4dcfc02a7f8552d2554e8bc091940d312bfb2fbe;hb=0887d4a59b29ff9c398d2961dce95977fd7efe9c;hp=89c2e05691b140151d5d75af6aca9c45d40ad78a;hpb=077b749d5960a27f04ff64024b3edc05f0fd0c77;p=libfirm diff --git a/ir/common/statistics.c b/ir/common/statistics.c index 89c2e0569..4dcfc02a7 100644 --- a/ir/common/statistics.c +++ b/ir/common/statistics.c @@ -1,15 +1,28 @@ /* - * Project: libFIRM - * File name: ir/common/statistics.c - * Purpose: Compute statistics about firm library. - * Author: Goetz Lindenmaier - * Modified by: - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 2004 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. */ +/** + * @file + * @brief Compute statistics about firm library. + * @author Goetz Lindenmaier + * @version $Id$ + */ #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -24,8 +37,9 @@ /* Statistics about allocated datastructures: counts. */ static void count_nodes(ir_node *n, void *env) { - int * counter_ptr = (int *)env; - (*counter_ptr)++; + int * counter_ptr = (int *)env; + (void) n; + (*counter_ptr)++; } @@ -33,10 +47,12 @@ static void count_nodes(ir_node *n, void *env) { * totals. */ void print_graph_counts(int verbosity) { int i, counter, total = 0; - int view = get_interprocedural_view(); ir_graph *old = current_ir_graph; +#ifdef INTERPROCEDURAL_VIEW + int view = get_interprocedural_view(); set_interprocedural_view(0); +#endif for (i = 0; i < get_irp_n_irgs(); i++) { counter = 0; @@ -48,7 +64,9 @@ 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; +#ifdef INTERPROCEDURAL_VIEW set_interprocedural_view(view); +#endif } /** Prints number of types, number of entities and totals. @@ -56,11 +74,11 @@ void print_graph_counts(int verbosity) { void print_type_counts(int verbosity) { int i, counter, total = 0; for (i = 0; i < get_irp_n_types(); i++) { - type *tp = get_irp_type(i); + ir_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)); @@ -76,12 +94,14 @@ void print_type_counts(int verbosity) { /** Prints number of tarvals. * */ void print_tarval_counts(int verbosity) { + (void) verbosity; printf("tarval count not implemented.\n\n"); } /** Prints number of idents. * */ void print_ident_counts(int verbosity) { + (void) verbosity; printf("ident count not implemented.\n\n"); }