Let sched_foreach_from() and sched_foreach_reverse_from() declare their iterator...
[libfirm] / ir / be / bechordal_common.c
index 0bffe02..c6dce09 100644 (file)
@@ -22,7 +22,6 @@
  * @brief       Common functions for chordal register allocation.
  * @author      Sebastian Hack
  * @date        08.12.2004
- * @version     $Id: bechordal.c 26750 2009-11-27 09:37:43Z bersch $
  */
 #include "config.h"
 
@@ -78,8 +77,8 @@ static inline border_t *border_add(be_chordal_env_t *env, struct list_head *head
                 */
                set_irn_link(irn, def);
 
-               DEBUG_ONLY(b->magic = BORDER_FOURCC);
-               DEBUG_ONLY(def->magic = BORDER_FOURCC);
+               DEBUG_ONLY(b->magic = BORDER_FOURCC;)
+               DEBUG_ONLY(def->magic = BORDER_FOURCC;)
        } else {
                /*
                 * If the def is encountered, the use was made and so was the
@@ -88,7 +87,7 @@ static inline border_t *border_add(be_chordal_env_t *env, struct list_head *head
                 */
                b = (border_t*)get_irn_link(irn);
 
-               DEBUG_ONLY(assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered"));
+               DEBUG_ONLY(assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered");)
        }
 
        b->pressure = pressure;
@@ -113,10 +112,9 @@ void create_borders(ir_node *block, void *env_ptr)
 #define border_use(irn, step, real) \
        border_add(env, head, irn, step, ++pressure, 0, real)
 
-       be_chordal_env_t *env             = (be_chordal_env_t*)env_ptr;
-       bitset_t *live                    = bitset_malloc(get_irg_last_idx(env->irg));
-       ir_node *irn;
-       be_lv_t *lv                       = be_get_irg_liveness(env->irg);
+       be_chordal_env_t *env  = (be_chordal_env_t*)env_ptr;
+       bitset_t         *live = bitset_malloc(get_irg_last_idx(env->irg));
+       be_lv_t          *lv   = be_get_irg_liveness(env->irg);
 
        int i, n;
        size_t elm;
@@ -129,7 +127,7 @@ void create_borders(ir_node *block, void *env_ptr)
        /* Set up the border list in the block info */
        head = OALLOC(env->obst, struct list_head);
        INIT_LIST_HEAD(head);
-       assert(pmap_get(env->border_heads, block) == NULL);
+       assert(pmap_get(struct list_head, env->border_heads, block) == NULL);
        pmap_insert(env->border_heads, block, head);
 
        /*
@@ -155,8 +153,6 @@ void create_borders(ir_node *block, void *env_ptr)
                DBG((dbg, LEVEL_2, "\tlive: %B\n", live));
 
                if (get_irn_mode(irn) == mode_T) {
-                       const ir_edge_t *edge;
-
                        foreach_out_edge(irn, edge) {
                                ir_node *proj = get_edge_src_irn(edge);
 
@@ -230,11 +226,10 @@ be_insn_t *chordal_scan_insn(be_chordal_env_t *env, ir_node *irn)
 
 ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
 {
-       be_insn_t *insn             = *the_insn;
-       ir_node *perm               = NULL;
-       bitset_t *out_constr        = bitset_alloca(env->cls->n_regs);
-       const ir_edge_t *edge;
-       int i;
+       be_insn_t *insn       = *the_insn;
+       ir_node   *perm       = NULL;
+       bitset_t  *out_constr = bitset_alloca(env->cls->n_regs);
+       int        i;
 
        assert(insn->has_constraints && "only do this for constrained nodes");
 
@@ -293,7 +288,7 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
        return perm;
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common)
 void be_init_chordal_common(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.chordal_common");