beinfo: assert() that be_get_info() is not called on Projs.
[libfirm] / ir / opt / proc_cloning.c
index c4da9ad..d61b233 100644 (file)
@@ -267,10 +267,11 @@ static void set_preds(ir_node *irn, void *env)
        irn_copy = (ir_node*)get_irn_link(irn);
 
        if (is_Block(irn)) {
+               ir_graph *const irg = get_Block_irg(irn);
                for (i = get_Block_n_cfgpreds(irn) - 1; i >= 0; --i) {
                        pred = get_Block_cfgpred(irn, i);
                        /* "End" block must be handled extra, because it is not matured.*/
-                       if (get_irg_end_block(current_ir_graph) == irn)
+                       if (get_irg_end_block(irg) == irn)
                                add_immBlock_pred(get_irg_end_block(clone_irg), (ir_node*)get_irn_link(pred));
                        else
                                set_Block_cfgpred(irn_copy, i, (ir_node*)get_irn_link(pred));
@@ -301,13 +302,12 @@ static void set_preds(ir_node *irn, void *env)
 static ir_node *get_irg_arg(ir_graph *irg, size_t pos)
 {
        ir_node *irg_args = get_irg_args(irg), *arg = NULL;
-       int i;
 
        /* Call algorithm that computes the out edges */
        assure_irg_outs(irg);
 
        /* Search the argument with the number pos.*/
-       for (i = get_irn_n_outs(irg_args) - 1; i >= 0; --i) {
+       for (unsigned i = get_irn_n_outs(irg_args); i-- > 0; ) {
                ir_node *proj = get_irn_out(irg_args, i);
                if ((int)pos == get_Proj_proj(proj)) {
                        if (arg) {
@@ -571,7 +571,6 @@ restart:
                hmap->heavy_uses = entry->next;
                entry->next      = *adr;
                *adr             = entry;
-               entry            = hmap->heavy_uses;
 
                /* we have changed the list, check the next one */
                goto restart;