X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fstat%2Fdags.c;h=c9e283dd8ca026f431d27fd79d363fe09bacf1b0;hb=ecb5fc89b37112b0866ad752562aaec70ed1b650;hp=debb813bc731fd183de0b1c0226dbbfebdd7e67b;hpb=060aa4c91666063f9bb70aaa76f5c819d256a15f;p=libfirm diff --git a/ir/stat/dags.c b/ir/stat/dags.c index debb813bc..c9e283dd8 100644 --- a/ir/stat/dags.c +++ b/ir/stat/dags.c @@ -21,7 +21,6 @@ * @file * @brief Statistics for Firm. DAG's in graphs. * @author Michael Beck - * @version $Id$ */ #include "config.h" @@ -31,6 +30,7 @@ #include "irdump.h" #include "dags.h" #include "irtools.h" +#include "ircons.h" enum dag_counting_options_t { FIRMSTAT_COPY_CONSTANTS = 0x00000001, /**< if set, constants will be treated as they are in @@ -40,12 +40,12 @@ enum dag_counting_options_t { FIRMSTAT_ARGS_ARE_ROOTS = 0x00000008, /**< arguments (Proj(Proj(Start)) are roots */ }; -typedef struct _dag_entry_t dag_entry_t; +typedef struct dag_entry_t dag_entry_t; /** * Environment for connecting DAG's */ -typedef struct _dag_env_t { +typedef struct dag_env_t { struct obstack obst; unsigned num_of_dags; /**< Number of found DAGs so far. */ dag_entry_t *list_of_dags; /**< List of found DAGs. */ @@ -55,7 +55,7 @@ typedef struct _dag_env_t { /** * a DAG Entry */ -struct _dag_entry_t { +struct dag_entry_t { unsigned id; /**< assigned ID for this DAG */ ir_node *root; /**< one root of the DAG */ unsigned num_roots; /**< number of root nodes in the DAG */ @@ -71,9 +71,9 @@ struct _dag_entry_t { /** * return an DAG entry for the node n */ -static dag_entry_t *get_irn_dag_entry(ir_node *n) +static dag_entry_t *get_irn_dag_entry(const ir_node *n) { - dag_entry_t *p = get_irn_link(n); + dag_entry_t *p = (dag_entry_t*)get_irn_link(n); if (p) { /* skip any dead links */ @@ -81,7 +81,8 @@ static dag_entry_t *get_irn_dag_entry(ir_node *n) do { p = p->link; } while (p->link != NULL); - set_irn_link(n, p); + /* hacky cast to ir_node* */ + set_irn_link((ir_node*)n, p); } } /* if */ return p; @@ -134,7 +135,7 @@ static dag_entry_t *new_dag_entry(dag_env_t *dag_env, ir_node *node) */ static void find_dag_roots(ir_node *node, void *env) { - dag_env_t *dag_env = env; + dag_env_t *dag_env = (dag_env_t*)env; int i, arity; dag_entry_t *entry; ir_node *block; @@ -209,7 +210,7 @@ static void find_dag_roots(ir_node *node, void *env) */ static void connect_dags(ir_node *node, void *env) { - dag_env_t *dag_env = env; + dag_env_t *dag_env = (dag_env_t*)env; int i, arity; ir_node *block; dag_entry_t *entry; @@ -316,7 +317,7 @@ static unsigned mark_options; /** * a vcg attribute hook */ -static int stat_dag_mark_hook(FILE *F, ir_node *n, ir_node *l) +static int stat_dag_mark_hook(FILE *F, const ir_node *n, const ir_node *l) { static const char *colors[] = { "purple", "pink", "lightblue", "orange", "khaki", "orchid", "lilac", "turquoise" }; dag_entry_t *entry; @@ -391,7 +392,7 @@ void count_dags_in_graph(graph_entry_t *global, graph_entry_t *graph) entry->num_roots, entry->num_nodes, entry->num_inner_nodes, - entry->is_tree, + (unsigned)entry->is_tree, get_irn_node_nr(entry->root)); } /* for */