From: Christoph Mallon Date: Fri, 7 Dec 2012 10:20:18 +0000 (+0100) Subject: beifg: Let be_ifg_foreach_neighbour() declare the node variable. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7ad86c1baab2fdceae2aa610bb584b30538cc5c6;p=libfirm beifg: Let be_ifg_foreach_neighbour() declare the node variable. --- diff --git a/ir/be/becopyheur.c b/ir/be/becopyheur.c index 519f521bd..66acb7240 100644 --- a/ir/be/becopyheur.c +++ b/ir/be/becopyheur.c @@ -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; diff --git a/ir/be/becopyheur2.c b/ir/be/becopyheur2.c index 1d727c010..beaf1772a 100644 --- a/ir/be/becopyheur2.c +++ b/ir/be/becopyheur2.c @@ -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); diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c index 40105fc15..a98ea3c3b 100644 --- a/ir/be/becopyheur4.c +++ b/ir/be/becopyheur4.c @@ -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; diff --git a/ir/be/becopyilp.c b/ir/be/becopyilp.c index 340d97de5..c2a7437ab 100644 --- a/ir/be/becopyilp.c +++ b/ir/be/becopyilp.c @@ -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); diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index 9b78136e6..f046d9677 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -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) { diff --git a/ir/be/bedump.c b/ir/be/bedump.c index 9c216ed8a..1c2dc1862 100644 --- a/ir/be/bedump.c +++ b/ir/be/bedump.c @@ -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 diff --git a/ir/be/beifg.c b/ir/be/beifg.c index 9220441c8..609bcea46 100644 --- a/ir/be/beifg.c +++ b/ir/be/beifg.c @@ -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])); diff --git a/ir/be/beifg.h b/ir/be/beifg.h index 0fc3ccf46..c866f02d0 100644 --- a/ir/be/beifg.h +++ b/ir/be/beifg.h @@ -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))