Updated Win32 version number to 1.18
[libfirm] / scripts / ir_spec.py
index 4dade90..f17703a 100755 (executable)
@@ -27,7 +27,7 @@ class Add(Binop):
        flags = ["commutative"]
 
 class Alloc(Op):
-       ins   = [ "mem", "size" ]
+       ins   = [ "mem", "count" ]
        outs  = [ "M", "X_regular", "X_except", "res" ]
        flags = [ "fragile", "uses_memory" ]
        attrs = [
@@ -61,9 +61,10 @@ class ASM(Op):
        mode          = "mode_T"
        arity         = "variable"
        flags         = [ "keep", "uses_memory" ]
-       attr_struct   = "asm_attr"
        pinned        = "memory"
        pinned_init   = "op_pin_state_pinned"
+       attr_struct   = "asm_attr"
+       attrs_name    = "assem"
        attrs = [
                dict(
                        name = "input_constraints",
@@ -72,6 +73,7 @@ class ASM(Op):
                dict(
                        name = "n_output_constraints",
                        type = "int",
+                       noprop = True,
                ),
                dict(
                        name = "output_constraints",
@@ -80,6 +82,7 @@ class ASM(Op):
                dict(
                        name = "n_clobbers",
                        type = "int",
+                       noprop = True,
                ),
                dict(
                        name = "clobbers",
@@ -130,32 +133,12 @@ class Block(Op):
 
        set_Block_matured(res, 1);
        set_Block_block_visited(res, 0);
-       '''
 
-       d_pre = '''
-       int i;
-       int has_unknown = 0;
-       '''
-
-       d_post = '''
        /* Create and initialize array for Phi-node construction. */
-       if (get_irg_phase_state(current_ir_graph) == phase_building) {
-               res->attr.block.graph_arr = NEW_ARR_D(ir_node *, current_ir_graph->obst,
-                                                     current_ir_graph->n_loc);
-               memset(res->attr.block.graph_arr, 0, sizeof(ir_node *)*current_ir_graph->n_loc);
+       if (get_irg_phase_state(irg) == phase_building) {
+               res->attr.block.graph_arr = NEW_ARR_D(ir_node *, irg->obst, irg->n_loc);
+               memset(res->attr.block.graph_arr, 0, irg->n_loc * sizeof(ir_node*));
        }
-
-       for (i = arity - 1; i >= 0; i--)
-               if (is_Unknown(in[i])) {
-                       has_unknown = 1;
-                       break;
-               }
-
-       if (!has_unknown) res = optimize_node(res);
-
-       current_ir_graph->current_block = res;
-
-       IRN_VRFY_IRG(res, current_ir_graph);
        '''
 
        java_add   = '''
@@ -195,6 +178,7 @@ class Bound(Op):
        pinned = "exception"
        pinned_init = "op_pin_state_pinned"
        attr_struct = "bound_attr"
+       attrs_name  = "bound"
        d_post = '''
        firm_alloc_frag_arr(res, op_Bound, &res->attr.bound.exc.frag_arr);
        '''
@@ -318,6 +302,7 @@ class Confirm(Op):
                ),
        ]
        attr_struct = "confirm_attr"
+       attrs_name  = "confirm"
 
 class Const(Op):
        mode       = ""
@@ -347,6 +332,7 @@ class Conv(Unop):
                )
        ]
        attr_struct = "conv_attr"
+       attrs_name  = "conv"
 
 class CopyB(Op):
        ins   = [ "mem", "dst", "src" ]
@@ -359,6 +345,7 @@ class CopyB(Op):
                )
        ]
        attr_struct = "copyb_attr"
+       attrs_name  = "copyb"
        pinned      = "memory"
        pinned_init = "op_pin_state_pinned"
        d_post = '''
@@ -455,6 +442,7 @@ class Filter(Op):
        ]
        pinned      = "yes"
        attr_struct = "filter_attr"
+       attrs_name  = "filter"
        java_noconstr = True
 
 class Free(Op):
@@ -576,11 +564,11 @@ class Or(Binop):
        flags = [ "commutative" ]
 
 class Phi(Op):
-       pinned      = "yes"
-       arity       = "variable"
-       flags       = []
-       attr_struct = "phi_attr"
-       custom_is   = True
+       pinned        = "yes"
+       arity         = "variable"
+       flags         = []
+       attr_struct   = "phi_attr"
+       custom_is     = True
        java_noconstr = True
        init = '''
        /* Memory Phis in endless loops must be kept alive.
@@ -596,14 +584,19 @@ class Pin(Op):
        pinned   = "yes"
 
 class Proj(Op):
-       ins      = [ "pred" ]
-       flags    = []
-       pinned   = "no"
-       attrs    = [
+       ins        = [ "pred" ]
+       flags      = []
+       pinned     = "no"
+       knownBlock = True
+       knownGraph = True
+       block      = "get_nodes_block(irn_pred)"
+       graph      = "get_irn_irg(irn_pred)"
+       attrs      = [
                dict(
                        type = "long",
                        name = "proj",
-                       initname = ""
+                       initname = "",
+                       noprop = False,
                )
        ]
        attr_struct = "long"
@@ -701,7 +694,8 @@ class SymConst(Op):
        attrs      = [
                dict(
                        type = "ir_entity*",
-                       name = "entity"
+                       name = "entity",
+                       noprop = True
                )
        ]
        attr_struct = "symconst_attr"