Commit 406d820e authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Let co_gs_foreach_neighb() declare the iterator variable.

parent 8a5ac708
......@@ -352,8 +352,6 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co
}
if (a) {
neighb_t *n;
co_gs_foreach_neighb(a, n) {
if (color_is_fix(env, n->irn)) {
col_t col = get_col(env, n->irn);
......@@ -780,7 +778,6 @@ static void populate_cloud(co2_t *env, co2_cloud_t *cloud, affinity_node_t *a, i
be_ifg_t *ifg = env->co->cenv->ifg;
co2_cloud_irn_t *ci = get_co2_cloud_irn(env, a->irn);
int costs = 0;
neighb_t *n;
if (ci->cloud)
return;
......@@ -893,7 +890,6 @@ static void process_cloud(co2_cloud_t *cloud)
obstack_init(&cloud->obst);
for (i = 0; i < cloud->n_memb; ++i) {
co2_cloud_irn_t *ci = cloud->seq[i];
neighb_t *n;
co_gs_foreach_neighb(ci->inh.aff, n) {
co2_cloud_irn_t *ni = get_co2_cloud_irn(cloud->env, n->irn);
......@@ -1010,7 +1006,6 @@ static void process_cloud(co2_cloud_t *cloud)
static int cloud_costs(co2_cloud_t *cloud)
{
int i, costs = 0;
neighb_t *n;
for (i = 0; i < cloud->n_memb; ++i) {
co2_irn_t *ci = (co2_irn_t *) cloud->seq[i];
......
......@@ -589,7 +589,6 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
}
if (an != NULL) {
neighb_t *neigh;
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
......@@ -615,7 +614,6 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
*/
static int count_interfering_aff_neighs(co_mst_env_t *env, const affinity_node_t *an)
{
const neighb_t *neigh;
const ir_node *irn = an->irn;
const co_mst_irn_t *node = get_co_mst_irn(env, irn);
int res = 0;
......@@ -668,8 +666,6 @@ static void build_affinity_chunks(co_mst_env_t *env)
an = get_affinity_info(env->co, n);
if (an != NULL) {
neighb_t *neigh;
if (n1->int_aff_neigh < 0)
n1->int_aff_neigh = count_interfering_aff_neighs(env, an);
......@@ -760,7 +756,6 @@ static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
const ir_node *irn = chunk->n[--i];
affinity_node_t *an = get_affinity_info(env->co, irn);
int w = 0;
neighb_t *neigh;
if (arch_irn_is_ignore(irn))
continue;
......@@ -788,7 +783,6 @@ static __attribute__((unused)) void chunk_order_nodes(co_mst_env_t *env, aff_chu
while (!pqueue_empty(grow)) {
ir_node *irn = (ir_node*)pqueue_pop_front(grow);
affinity_node_t *an = get_affinity_info(env->co, irn);
neighb_t *neigh;
if (arch_irn_is_ignore(irn))
continue;
......@@ -837,7 +831,6 @@ static void expand_chunk_from(co_mst_env_t *env, co_mst_irn_t *node, bitset_t *v
/* check all affinity neighbors */
if (an != NULL) {
neighb_t *neigh;
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
int m_idx = get_irn_idx(m);
......
......@@ -360,7 +360,6 @@ static void build_clique_star_cstr(ilp_env_t *ienv)
/* for each node with affinity edges */
co_gs_foreach_aff_node(ienv->co, aff) {
struct obstack ob;
neighb_t *nbr;
const ir_node *center = aff->irn;
ir_node **nodes;
set *edges;
......@@ -476,7 +475,6 @@ static void extend_path(ilp_env_t *ienv, pdeq *path, const ir_node *irn)
int i, len;
ir_node **curr_path;
affinity_node_t *aff;
neighb_t *nbr;
/* do not walk backwards or in circles */
if (pdeq_contains(path, irn))
......
......@@ -732,7 +732,6 @@ void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
/* count affinity edges. */
co_gs_foreach_aff_node(co, an) {
neighb_t *neigh;
stat->aff_nodes += 1;
bitset_set(seen, get_irn_idx(an->irn));
co_gs_foreach_neighb(an, neigh) {
......@@ -974,8 +973,6 @@ static void co_dump_appel_graph(const copy_opt_t *co, FILE *f)
}
if (a) {
neighb_t *n;
co_gs_foreach_neighb(a, n) {
if (!arch_irn_is_ignore(n->irn)) {
int n_idx = node_map[get_irn_idx(n->irn)];
......
......@@ -150,6 +150,6 @@ static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_
}
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
#define co_gs_foreach_neighb(aff_node, neighb) for (neighb = aff_node->neighbours; neighb != NULL; neighb = neighb->next)
#define co_gs_foreach_neighb(aff_node, neighb) for (neighb_t *neighb = aff_node->neighbours; neighb; neighb = neighb->next)
#endif /* FIRM_BE_BECOPYOPT_T_H */
......@@ -85,8 +85,6 @@ static void dump_affinity_edges(FILE *F, const copy_opt_t *co,
bool dump_costs, bool dump_colors)
{
co_gs_foreach_aff_node(co, a) {
neighb_t *n;
co_gs_foreach_neighb(a, n) {
/* edges are bidirection, dumping one direction is enough */
if (get_irn_node_nr(a->irn) >= get_irn_node_nr(n->irn))
......
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