X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=scripts%2Fir_spec.py;h=0961109710edec56cd96f920af315cc9b6722c28;hb=8bced5f492333d7ac6080e8cb313da3aeef431ff;hp=aeed4f99194f38de4cf698f64e81cf5c56a7d744;hpb=c8e1cf6a41fa2077058cce740783ab78990ac0ab;p=libfirm diff --git a/scripts/ir_spec.py b/scripts/ir_spec.py index aeed4f991..096110971 100755 --- a/scripts/ir_spec.py +++ b/scripts/ir_spec.py @@ -20,9 +20,6 @@ class Binop(Op): pinned = "no" abstract(Binop) -class Abs(Unop): - flags = [] - class Add(Binop): flags = ["commutative"] @@ -56,6 +53,7 @@ class Anchor(Op): attr_struct = "irg_attr" knownBlock = True singleton = True + noconstructor = True class And(Binop): flags = [ "commutative" ] @@ -96,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) { @@ -146,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 @@ -159,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; } ''' @@ -323,7 +313,7 @@ class Const(Op): attrs_name = "con" attrs = [ dict( - type = "tarval*", + type = "ir_tarval*", name = "tarval", ) ] @@ -428,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): @@ -548,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 = [] @@ -565,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. */ @@ -672,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" ] @@ -707,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): @@ -721,7 +713,6 @@ class Tuple(Op): mode = "mode_T" pinned = "no" flags = [ "labeled" ] - java_noconstr = True class Unknown(Op): knownBlock = True