Replace if/else if cascade with switch(opcode)
[libfirm] / ir / ana / irlivechk.c
index 2b9038e..f3d436f 100644 (file)
@@ -22,7 +22,7 @@
  * @date    21.04.2007
  * @author  Sebastian Hack
  * @version $Id$
- * @summary
+ * @brief
  *
  * Liveness checks as developed by Benoit Boissinot, Fabrice Rastello and myself.
  *
@@ -104,7 +104,7 @@ static void *init_block_data(ir_phase *ph, const ir_node *irn, void *old)
  * @param irn A node.
  * @return    1 if the node shall be considered in liveness, 0 if not.
  */
-static INLINE int is_liveness_node(const ir_node *irn)
+static inline int is_liveness_node(const ir_node *irn)
 {
        switch (get_irn_opcode(irn)) {
        case iro_Block:
@@ -203,7 +203,7 @@ static void compute_back_edge_chain(lv_chk_t *lv, const ir_node *bl)
 }
 
 
-static INLINE void compute_back_edge_chains(lv_chk_t *lv)
+static inline void compute_back_edge_chains(lv_chk_t *lv)
 {
        bitset_pos_t elm;
        int i, n;
@@ -260,8 +260,7 @@ lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs)
        res->n_blocks      = dfs_get_n_nodes(res->dfs);
        res->back_edge_src = bitset_obstack_alloc(obst, res->n_blocks);
        res->back_edge_tgt = bitset_obstack_alloc(obst, res->n_blocks);
-       res->map           = obstack_alloc(obst, res->n_blocks * sizeof(res->map[0]));
-       memset(res->map, 0, res->n_blocks * sizeof(res->map[0]));
+       res->map           = OALLOCNZ(obst, bl_info_t*, res->n_blocks);
 
 #if 0
        {
@@ -642,7 +641,7 @@ unsigned lv_chk_bl_xxx(const lv_chk_t *lv, const ir_node *bl, const ir_node *var
                 * will be left. */
                DBG((lv->dbg, LEVEL_2, "\tbe tgt reach: %B, dom span: [%d, %d]\n", Tq, min_dom, max_dom));
                i = bitset_next_set(Tq, min_dom);
-               while(i <= max_dom) {
+               while (i <= max_dom) {
                        bl_info_t *ti = lv->map[i];
                        int use_in_current_block = bitset_is_set(uses, ti->id);