Commit 7ad86c1b authored by Christoph Mallon's avatar Christoph Mallon
Browse files

beifg: Let be_ifg_foreach_neighbour() declare the node variable.

parent 55974aed
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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
......
......@@ -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]));
......
......@@ -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))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment