forbid to set current_block to Bad
authorMatthias Braun <matthias.braun@kit.edu>
Thu, 10 May 2012 19:36:44 +0000 (21:36 +0200)
committerMatthias Braun <matthias.braun@kit.edu>
Thu, 10 May 2012 19:40:19 +0000 (21:40 +0200)
This was used as a hack to mark unreachable code by some people, but it
is prefered to simply use a new Block without predecessors, or set NULL
if you have to.

ir/ir/ircons.c

index 29683a4..91577ab 100644 (file)
@@ -528,8 +528,8 @@ void set_cur_block(ir_node *target)
 void set_r_cur_block(ir_graph *irg, ir_node *target)
 {
        assert(get_irg_phase_state(irg) == phase_building);
-       assert(target == NULL || get_irn_mode(target) == mode_BB);
-       assert(target == NULL || get_irn_irg(target)  == irg);
+       assert(target == NULL || is_Block(target));
+       assert(target == NULL || get_irn_irg(target) == irg);
        irg->current_block = target;
 }