Remove unnecessary assignment, which at worst hides a panic.
[libfirm] / ir / be / becopyheur2.c
index 27127d1..217819e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -250,7 +250,7 @@ static inline bitset_t *get_adm(co2_t *env, co2_irn_t *ci)
        if (ci->adm_cache == NULL) {
                const arch_register_req_t *req;
                ci->adm_cache = bitset_obstack_alloc(phase_obst(&env->ph), env->n_regs);
-               req = arch_get_register_req_out(ci->irn);
+               req = arch_get_irn_register_req(ci->irn);
 
                if (arch_register_req_is(req, limited)) {
                        int i, n;
@@ -290,7 +290,7 @@ static inline int is_constrained(co2_t *env, co2_irn_t *ci)
 
 static void incur_constraint_costs(co2_t *env, const ir_node *irn, col_cost_pair_t *col_costs, int costs)
 {
-       const arch_register_req_t *req = arch_get_register_req_out(irn);
+       const arch_register_req_t *req = arch_get_irn_register_req(irn);
 
        if (arch_register_req_is(req, limited)) {
                unsigned n_regs   = env->co->cls->n_regs;
@@ -624,7 +624,7 @@ static void node_color_badness(co2_cloud_irn_t *ci, int *badness)
 
                admissible_colors(env, ni, bs);
                if (bitset_popcount(bs) == 1) {
-                       unsigned c = bitset_next_set(bs, 0);
+                       size_t c = bitset_next_set(bs, 0);
                        badness[c] += ci->costs;
                }
 
@@ -842,14 +842,13 @@ static void apply_coloring(co2_cloud_irn_t *ci, col_t col, int depth)
 {
        const ir_node *irn = ci->inh.irn;
        int *front   = FRONT_BASE(ci, col);
-       int i, ok;
+       int i;
        struct list_head changed;
 
        INIT_LIST_HEAD(&changed);
 
        DBG((ci->cloud->env->dbg, LEVEL_2, "%2{firm:indent}setting %+F to %d\n", depth, irn, col));
-       ok = change_color_single(ci->cloud->env, irn, col, &changed, depth);
-       // assert(ok && "Color changing may not fail while committing the coloring");
+       change_color_single(ci->cloud->env, irn, col, &changed, depth);
        materialize_coloring(&changed);
 
        for (i = 0; i < ci->mst_n_childs; ++i) {
@@ -1073,7 +1072,7 @@ static const char *get_dot_color_name(size_t col)
 
 static const char *get_dot_shape_name(co2_irn_t *ci)
 {
-       const arch_register_req_t *req = arch_get_register_req_out(ci->irn);
+       const arch_register_req_t *req = arch_get_irn_register_req(ci->irn);
 
        if (arch_register_req_is(req, limited))
                return "diamond";
@@ -1095,7 +1094,7 @@ static void ifg_dump_graph_attr(FILE *f, void *self)
 
 static int ifg_is_dump_node(void *self, ir_node *irn)
 {
-       const arch_register_req_t *req = arch_get_register_req_out(irn);
+       const arch_register_req_t *req = arch_get_irn_register_req(irn);
        (void)self;
        return !(req->type & arch_register_req_type_ignore);
 }
@@ -1132,7 +1131,7 @@ static void ifg_dump_at_end(FILE *file, void *self)
                neighb_t *n;
 
                if (ai->mst_parent != ai)
-                       fprintf(file, "\tn%d -- n%d [style=dotted color=blue arrowhead=normal];\n", idx, get_irn_idx(ai->mst_parent->inh.irn));
+                       fprintf(file, "\tn%d -- n%u [style=dotted color=blue arrowhead=normal];\n", idx, get_irn_idx(ai->mst_parent->inh.irn));
 
                co_gs_foreach_neighb(a, n) {
                        int nidx = get_irn_idx(n->irn);
@@ -1258,7 +1257,7 @@ int co_solve_heuristic_new(copy_opt_t *co)
        return 0;
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2)
 void be_init_copyheur2(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");