create new_tarval_from_long_double function and change argument of new_tarval_from_do...
[libfirm] / scripts / ir_spec.py
index c9f3d49..0961109 100755 (executable)
@@ -53,6 +53,7 @@ class Anchor(Op):
        attr_struct = "irg_attr"
        knownBlock  = True
        singleton   = True
+       noconstructor = True
 
 class And(Binop):
        flags    = [ "commutative" ]
@@ -93,46 +94,38 @@ class ASM(Op):
                        type = "ident*",
                ),
        ]
-       java_noconstr = True
 
 class Bad(Op):
-       mode        = "mode_Bad"
-       flags       = [ "cfopcode", "start_block", "dump_noblock" ]
-       pinned      = "yes"
-       knownBlock  = True
-       singleton   = True
-       attr_struct = "irg_attr"
+       mode          = "mode_T"
+       flags         = [ "cfopcode", "start_block", "dump_noblock" ]
+       pinned        = "yes"
+       knownBlock    = True
+       block         = "get_irg_start_block(irg)"
+       singleton     = True
+       attr_struct   = "bad_attr"
        init = '''
-       res->attr.irg.irg = irg;
+       res->attr.bad.irg.irg = irg;
        '''
 
+class Deleted(Op):
+       mode          = "mode_Bad"
+       flags         = [ ]
+       pinned        = "yes"
+       noconstructor = True
+
 class Block(Op):
        mode        = "mode_BB"
        knownBlock  = True
        block       = "NULL"
        pinned      = "yes"
-       optimize    = False
        arity       = "variable"
        flags       = [ "labeled" ]
        attr_struct = "block_attr"
-       java_noconstr = True
 
        init = '''
-       /* macroblock header */
-       res->in[0] = res;
-
-       res->attr.block.is_dead     = 0;
-       res->attr.block.is_mb_head  = 1;
        res->attr.block.irg.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.entity      = NULL;
-
        set_Block_matured(res, 1);
-       set_Block_block_visited(res, 0);
 
        /* Create and initialize array for Phi-node construction. */
        if (get_irg_phase_state(irg) == phase_building) {
@@ -143,11 +136,11 @@ class Block(Op):
 
        java_add   = '''
        public void addPred(Node node) {
-               binding_cons.add_immBlock_pred(ptr, node.ptr);
+               binding_ircons.add_immBlock_pred(ptr, node.ptr);
        }
 
        public void mature() {
-               binding_cons.mature_immBlock(ptr);
+               binding_ircons.mature_immBlock(ptr);
        }
 
        @Override
@@ -156,15 +149,15 @@ class Block(Op):
        }
 
        public boolean blockVisited() {
-               return 0 != binding.Block_block_visited(ptr);
+               return 0 != binding_irnode.Block_block_visited(ptr);
        }
 
        public void markBlockVisited() {
-               binding.mark_Block_block_visited(ptr);
+               binding_irnode.mark_Block_block_visited(ptr);
        }
 
        public boolean isBad() {
-               return binding.is_Bad(ptr) != 0;
+               return binding_irnode.is_Bad(ptr) != 0;
        }
        '''
 
@@ -320,7 +313,7 @@ class Const(Op):
        attrs_name = "con"
        attrs      = [
                dict(
-                       type = "tarval*",
+                       type = "ir_tarval*",
                        name = "tarval",
                )
        ]
@@ -425,6 +418,8 @@ class End(Op):
        pinned     = "yes"
        arity      = "dynamic"
        flags      = [ "cfopcode" ]
+       knownBlock = True
+       block      = "get_irg_end_block(irg)"
        singleton  = True
 
 class Eor(Binop):
@@ -545,11 +540,12 @@ class Mux(Op):
        pinned = "no"
 
 class NoMem(Op):
-       mode       = "mode_M"
-       flags      = [ "dump_noblock", "dump_noinput" ]
-       pinned     = "yes"
-       knownBlock = True
-       singleton  = True
+       mode          = "mode_M"
+       flags         = [ "dump_noblock", "dump_noinput" ]
+       pinned        = "yes"
+       knownBlock    = True
+       block         = "get_irg_start_block(irg)"
+       singleton     = True
 
 class Not(Unop):
        flags = []
@@ -562,7 +558,6 @@ class Phi(Op):
        arity         = "variable"
        flags         = []
        attr_struct   = "phi_attr"
-       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. */
@@ -669,6 +664,8 @@ class Start(Op):
        pinned     = "yes"
        flags      = [ "cfopcode" ]
        singleton  = True
+       knownBlock = True
+       block      = "get_irg_start_block(irg)"
 
 class Store(Op):
        ins      = [ "mem", "ptr", "value" ]
@@ -704,13 +701,11 @@ class SymConst(Op):
                )
        ]
        attr_struct = "symconst_attr"
-       java_noconstr = True
 
 class Sync(Op):
        mode     = "mode_M"
        flags    = []
        pinned   = "no"
-       optimize = False
        arity    = "dynamic"
 
 class Tuple(Op):
@@ -718,7 +713,6 @@ class Tuple(Op):
        mode   = "mode_T"
        pinned = "no"
        flags  = [ "labeled" ]
-       java_noconstr = True
 
 class Unknown(Op):
        knownBlock = True