remove unnecessary members from be_abi_irg_t structure, cleanup beabi a bit
[libfirm] / ir / be / becopyheur4.c
index b266159..a2ae60d 100644 (file)
@@ -171,10 +171,10 @@ static void dbg_aff_chunk(const co_mst_env_t *env, const aff_chunk_t *c)
  */
 static void dbg_admissible_colors(const co_mst_env_t *env, const co_mst_irn_t *node)
 {
-       bitset_pos_t idx;
+       unsigned idx;
        (void) env;
 
-       if (bitset_popcnt(node->adm_colors) < 1)
+       if (bitset_popcount(node->adm_colors) < 1)
                fprintf(stderr, "no admissible colors?!?");
        else {
                bitset_foreach(node->adm_colors, idx) {
@@ -375,7 +375,7 @@ static void *co_mst_irn_init(ir_phase *ph, const ir_node *irn, void *old)
 
        if (!old) {
                const arch_register_req_t *req;
-               void     *nodes_it = be_ifg_nodes_iter_alloca(env->ifg);
+               neighbours_iter_t nodes_it;
                ir_node  *neigh;
                unsigned len;
 
@@ -405,14 +405,14 @@ static void *co_mst_irn_init(ir_phase *ph, const ir_node *irn, void *old)
                bitset_andnot(res->adm_colors, env->ignore_regs);
 
                /* compute the constraint factor */
-               res->constr_factor = (real_t) (1 + env->n_regs - bitset_popcnt(res->adm_colors)) / env->n_regs;
+               res->constr_factor = (real_t) (1 + env->n_regs - bitset_popcount(res->adm_colors)) / env->n_regs;
 
                /* set the number of interfering affinity neighbours to -1, they are calculated later */
                res->int_aff_neigh = -1;
 
                /* build list of interfering neighbours */
                len = 0;
-               be_ifg_foreach_neighbour(env->ifg, nodes_it, irn, neigh) {
+               be_ifg_foreach_neighbour(env->ifg, &nodes_it, irn, neigh) {
                        if (!arch_irn_is_ignore(neigh)) {
                                obstack_ptr_grow(phase_obst(ph), neigh);
                                ++len;
@@ -566,7 +566,7 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
 
                        node->chunk = c;
                        if (node->constr_factor > REAL(0.0)) {
-                               bitset_pos_t col;
+                               unsigned col;
                                bitset_foreach (node->adm_colors, col)
                                        c->color_affinity[col].cost += node->constr_factor;
                        }
@@ -588,7 +588,7 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
                        c->color_affinity[i].cost *= (REAL(1.0) / ARR_LEN(c->n));
 
                c->weight            = w;
-               // c->weight            = bitset_popcnt(c->nodes);
+               // c->weight            = bitset_popcount(c->nodes);
                c->weight_consistent = 1;
        }
 }
@@ -631,14 +631,14 @@ static int count_interfering_aff_neighs(co_mst_env_t *env, const affinity_node_t
  */
 static void build_affinity_chunks(co_mst_env_t *env)
 {
-       void        *nodes_it = be_ifg_nodes_iter_alloca(env->ifg);
+       nodes_iter_t nodes_it;
        aff_edge_t  *edges    = NEW_ARR_F(aff_edge_t, 0);
        ir_node     *n;
        int         i, len;
        aff_chunk_t *curr_chunk;
 
        /* at first we create the affinity edge objects */
-       be_ifg_foreach_node(env->ifg, nodes_it, n) {
+       be_ifg_foreach_node(env->ifg, &nodes_it, n) {
                int             n_idx = get_irn_idx(n);
                co_mst_irn_t    *n1;
                affinity_node_t *an;
@@ -1428,7 +1428,7 @@ static int co_solve_heuristic_mst(copy_opt_t *co)
        phase_init(&mst_env.ph, co->irg, co_mst_irn_init);
        phase_set_private(&mst_env.ph, &mst_env);
 
-       k = be_put_ignore_regs(co->cenv->birg, co->cls, ignore_regs);
+       k = be_put_ignore_regs(co->cenv->irg, co->cls, ignore_regs);
        k = n_regs - k;
 
        mst_env.n_regs        = n_regs;