use is_$KIND(n) instead of get_irn_op(n) == op_$KIND.
[libfirm] / ir / be / belive.c
index bb1f804..3129520 100644 (file)
@@ -122,7 +122,7 @@ be_lv_info_node_t *be_lv_get(const be_lv_t *li, const ir_node *bl,
        be_lv_info_node_t *res = NULL;
 
        stat_ev_tim_push();
-       irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+       irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
        if (irn_live != NULL) {
                unsigned idx = get_irn_idx(irn);
 
@@ -144,7 +144,7 @@ be_lv_info_node_t *be_lv_get(const be_lv_t *li, const ir_node *bl,
 static be_lv_info_node_t *be_lv_get_or_set(be_lv_t *li, ir_node *bl,
                                            ir_node *irn)
 {
-       be_lv_info_t *irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+       be_lv_info_t *irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
        if (irn_live == NULL) {
                irn_live = OALLOCNZ(&li->obst, be_lv_info_t, LV_STD_SIZE);
                irn_live[0].head.n_size = LV_STD_SIZE-1;
@@ -203,7 +203,7 @@ static be_lv_info_node_t *be_lv_get_or_set(be_lv_t *li, ir_node *bl,
 static int be_lv_remove(be_lv_t *li, const ir_node *bl,
                         const ir_node *irn)
 {
-       be_lv_info_t *irn_live = (be_lv_info_t*)ir_nodehashmap_get(&li->map, bl);
+       be_lv_info_t *irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
 
        if (irn_live != NULL) {
                unsigned n   = irn_live[0].head.n_members;
@@ -542,11 +542,8 @@ void be_liveness_end_of_block(const be_lv_t *lv,
                               const arch_register_class_t *cls,
                               const ir_node *block, ir_nodeset_t *live)
 {
-       int i;
-
        assert(lv->sets_valid && "live sets must be computed");
-       be_lv_foreach(lv, block, be_lv_state_end, i) {
-               ir_node *node = be_lv_get_irn(lv, block, i);
+       be_lv_foreach(lv, block, be_lv_state_end, node) {
                if (!arch_irn_consider_in_reg_alloc(cls, node))
                        continue;
 
@@ -561,7 +558,6 @@ void be_liveness_nodes_live_at(const be_lv_t *lv,
                                const ir_node *pos, ir_nodeset_t *live)
 {
        const ir_node *bl = is_Block(pos) ? pos : get_nodes_block(pos);
-       ir_node *irn;
 
        be_liveness_end_of_block(lv, cls, bl, live);
        sched_foreach_reverse(bl, irn) {