beifg: Let be_ifg_foreach_neighbour() declare the node variable.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 7 Dec 2012 10:20:18 +0000 (11:20 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 7 Dec 2012 10:20:18 +0000 (11:20 +0100)
ir/be/becopyheur.c
ir/be/becopyheur2.c
ir/be/becopyheur4.c
ir/be/becopyilp.c
ir/be/becopyopt.c
ir/be/bedump.c
ir/be/beifg.c
ir/be/beifg.h

index 519f521..66acb72 100644 (file)
@@ -257,7 +257,6 @@ static ir_node *qnode_color_irn(const qnode_t *qn, ir_node *irn, int col, const
        const be_chordal_env_t *chordal_env = co->cenv;
        const arch_register_class_t *cls = co->cls;
        int irn_col = qnode_get_new_color(qn, irn);
-       ir_node *sub_res, *curr;
        be_ifg_t *ifg = chordal_env->ifg;
        neighbours_iter_t iter;
        const arch_register_req_t *req;
@@ -283,7 +282,6 @@ static ir_node *qnode_color_irn(const qnode_t *qn, ir_node *irn, int col, const
         */
        if (irn != trigger) {
                bitset_t *free_cols = bitset_alloca(cls->n_regs);
-               ir_node *curr;
                int free_col;
 
                /* Get all possible colors */
@@ -325,7 +323,7 @@ static ir_node *qnode_color_irn(const qnode_t *qn, ir_node *irn, int col, const
        be_ifg_foreach_neighbour(ifg, &iter, irn, curr) {
                DBG((dbg, LEVEL_3, "\t      Confl %+F(%d)\n", curr, qnode_get_new_color(qn, curr)));
                if (qnode_get_new_color(qn, curr) == col && curr != trigger) {
-                       sub_res = qnode_color_irn(qn, curr, irn_col, irn);
+                       ir_node *const sub_res = qnode_color_irn(qn, curr, irn_col, irn);
                        if (sub_res != CHANGE_SAVE) {
                                be_ifg_neighbours_break(&iter);
                                return sub_res;
index 1d727c0..beaf177 100644 (file)
@@ -335,7 +335,6 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co
        int n_regs         = env->co->cls->n_regs;
        affinity_node_t *a = ci->aff;
 
-       const ir_node *pos;
        neighbours_iter_t it;
        int i;
 
@@ -429,7 +428,6 @@ static int recolor(co2_t *env, const ir_node *irn, col_cost_pair_t *col_list, st
                int neigh_ok   = 1;
 
                struct list_head changed;
-               const ir_node *n;
                neighbours_iter_t it;
 
                DBG((env->dbg, LEVEL_3, "\t\t%2{firm:indent}trying color %d(%d) on %+F\n", depth, tgt_col, costs, irn));
@@ -613,7 +611,6 @@ static void node_color_badness(co2_cloud_irn_t *ci, int *badness)
        be_ifg_t *ifg  = env->co->cenv->ifg;
        bitset_t *bs   = bitset_alloca(n_regs);
 
-       const ir_node *irn;
        neighbours_iter_t it;
 
        admissible_colors(env, &ci->inh, bs);
index 40105fc..a98ea3c 100644 (file)
@@ -145,7 +145,6 @@ static co_mst_irn_t *co_mst_irn_init(co_mst_env_t *env, const ir_node *irn)
 
        const arch_register_req_t *req;
        neighbours_iter_t nodes_it;
-       ir_node  *neigh;
        unsigned len;
 
        res->irn           = irn;
index 340d97d..c2a7437 100644 (file)
@@ -110,7 +110,6 @@ static inline bool sr_is_simplicial(size_red_t *sr, const ir_node *ifn)
        be_ifg_t *ifg  = sr->co->cenv->ifg;
        neighbours_iter_t iter;
        ir_node **all  = ALLOCAN(ir_node*, be_ifg_degree(ifg, ifn));
-       ir_node  *curr;
        int       size = 0;
        int       i;
        int       o;
@@ -178,7 +177,6 @@ void sr_reinsert(size_red_t *sr)
        /* color the removed nodes in right order */
        for (cs = sr->col_suff; cs; cs = cs->next) {
                unsigned free_col;
-               ir_node *other;
                ir_node *irn = cs->irn;
 
                rbitset_copy(possible_cols, allocatable_cols, n_regs);
index 9b78136..f046d96 100644 (file)
@@ -936,7 +936,6 @@ static void co_dump_appel_graph(const copy_opt_t *co, FILE *f)
 
                int              idx = node_map[get_irn_idx(irn)];
                affinity_node_t *a   = get_affinity_info(co, irn);
-               ir_node         *adj;
 
                if (arch_register_req_is(req, limited)) {
                        for (i = 0; i < co->cls->n_regs; ++i) {
index 9c216ed..1c2dc18 100644 (file)
@@ -48,7 +48,6 @@ static void dump_ifg_edges(FILE *F, const be_ifg_t *ifg)
 
        be_ifg_foreach_node(ifg, &ifg_iter, node) {
                neighbours_iter_t neigh_iter;
-               ir_node          *neighbour;
 
                be_ifg_foreach_neighbour(ifg, &neigh_iter, node, neighbour) {
                        /* interference is bidirectional, but it's enough to dump 1
index 9220441..609bcea 100644 (file)
@@ -315,7 +315,6 @@ be_ifg_t *be_create_ifg(const be_chordal_env_t *env)
 static void int_comp_rec(be_ifg_t *ifg, ir_node *n, bitset_t *seen)
 {
        neighbours_iter_t neigh_it;
-       ir_node *m;
 
        be_ifg_foreach_neighbour(ifg, &neigh_it, n, m) {
                if (bitset_is_set(seen, get_irn_idx(m)))
@@ -361,7 +360,7 @@ void be_ifg_stat(ir_graph *irg, be_ifg_t *ifg, be_ifg_stat_t *stat)
        nodes_iter_t      nodes_it;
        neighbours_iter_t neigh_it;
        bitset_t         *nodes    = bitset_malloc(get_irg_last_idx(irg));
-       ir_node          *n, *m;
+       ir_node          *n;
 
        memset(stat, 0, sizeof(stat[0]));
 
index 0fc3ccf..c866f02 100644 (file)
@@ -78,7 +78,7 @@ void     be_ifg_cliques_break(cliques_iter_t *iter);
 int      be_ifg_degree(const be_ifg_t *ifg, const ir_node *irn);
 
 #define be_ifg_foreach_neighbour(ifg, iter, irn, pos) \
-       for(pos = be_ifg_neighbours_begin(ifg, iter, irn); pos != NULL; pos = be_ifg_neighbours_next(iter))
+       for (ir_node *pos = be_ifg_neighbours_begin(ifg, iter, irn); pos; pos = be_ifg_neighbours_next(iter))
 
 #define be_ifg_foreach_node(ifg, iter, pos) \
        for(pos = be_ifg_nodes_begin(ifg, iter); pos != NULL; pos = be_ifg_nodes_next(iter))