- fixed warning
[libfirm] / scripts / ir_spec.py
index 77444d2..ac7e0bd 100755 (executable)
@@ -128,14 +128,13 @@ Block = dict(
 
        res->attr.block.is_dead     = 0;
        res->attr.block.is_mb_head  = 1;
-       res->attr.block.has_label   = 0;
        res->attr.block.irg         = irg;
        res->attr.block.backedge    = new_backedge_arr(irg->obst, arity);
        res->attr.block.in_cg       = NULL;
        res->attr.block.cg_backedge = NULL;
        res->attr.block.extblk      = NULL;
        res->attr.block.mb_depth    = 0;
-       res->attr.block.label       = 0;
+       res->attr.block.entity      = NULL;
 
        set_Block_matured(res, 1);
        set_Block_block_visited(res, 0);
@@ -276,10 +275,13 @@ CallBegin = dict(
        pinned        = "yes",
        # TODO: attribute with call...
        attr_struct   = "callbegin_attr",
+       attrs         = [
+               dict(
+                       type = "ir_node*",
+                       name = "call"
+               )
+       ],
        java_noconstr = True,
-       init = '''
-       res->attr.callbegin.call = call;
-       ''',
 ),
 
 Carry = dict(
@@ -422,6 +424,7 @@ Div = dict(
        attr_struct = "divmod_attr",
        pinned      = "exception",
        op_index    = 1,
+       arity_override = "oparity_binary",
        d_post = '''
        #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Div, &res->attr.except.frag_arr);
@@ -443,6 +446,7 @@ DivMod = dict(
        attr_struct = "divmod_attr",
        pinned      = "exception",
        op_index    = 1,
+       arity_override = "oparity_binary",
        d_post = '''
        #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_DivMod, &res->attr.except.frag_arr);
@@ -604,6 +608,7 @@ Mod = dict(
        attr_struct = "divmod_attr",
        pinned      = "exception",
        op_index    = 1,
+       arity_override = "oparity_binary",
        d_post = '''
        #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Mod, &res->attr.except.frag_arr);
@@ -652,6 +657,13 @@ Phi = dict(
        attr_struct = "phi_attr",
        custom_is   = True,
        java_noconstr = True,
+
+       init = '''
+       /* Memory Phis in endless loops must be kept alive.
+          As we can't distinguish these easily we keep all of them alive. */
+       if (is_Phi(res) && mode == mode_M)
+               add_End_keepalive(get_irg_end(irg), res);
+       '''
 ),
 
 Pin = dict(
@@ -690,6 +702,7 @@ Quot = dict(
        attr_struct = "divmod_attr",
        pinned      = "exception",
        op_index    = 1,
+       arity_override = "oparity_binary",
        d_post = '''
        #if PRECISE_EXC_CONTEXT
        firm_alloc_frag_arr(res, op_Quot, &res->attr.except.frag_arr);