X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=scripts%2Fir_spec.py;h=f264b82cec92440f0b1e43f49b5927f59111e4e8;hb=6b45fde8adadc605dfe4c3a181c7fd8f78ac227c;hp=e4b0a5d712601f1e8c2586e7b7769fe3f814a7fa;hpb=6f068af98daa4725d60e5d23a8f98ec2841cfa44;p=libfirm diff --git a/scripts/ir_spec.py b/scripts/ir_spec.py index e4b0a5d71..f264b82ce 100755 --- a/scripts/ir_spec.py +++ b/scripts/ir_spec.py @@ -38,10 +38,10 @@ class Alloc(Op): ("count", "number of objects to allocate" ), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "pointer to newly allocated memory", "pn_Generic_other"), + ("M", "memory result"), + ("res", "pointer to newly allocated memory"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] attrs = [ dict( @@ -56,7 +56,9 @@ class Alloc(Op): ) ] flags = [ "fragile", "uses_memory" ] - pinned = "yes" + pinned = "exception" + throws_init = "false" + pinned_init = "op_pin_state_pinned" attr_struct = "alloc_attr" class Anchor(Op): @@ -146,7 +148,7 @@ class Bad(Op): they are set to Bad, and the actual removal is left to the control flow optimisation phase. Block, Phi, Tuple with only Bad inputs however are replaced by Bad right away.""" - flags = [ "cfopcode", "start_block", "dump_noblock" ] + flags = [ "start_block", "dump_noblock" ] pinned = "yes" knownBlock = True block = "get_irg_start_block(irg)" @@ -201,14 +203,15 @@ class Bound(Op): ("upper", "upper bound (exclusive)"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "the checked index", "pn_Generic_other"), + ("M", "memory result"), + ("res", "the checked index"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "highlevel" ] pinned = "exception" pinned_init = "op_pin_state_pinned" + throws_init = "false" attr_struct = "bound_attr" attrs_name = "bound" @@ -219,8 +222,8 @@ class Builtin(Op): ] arity = "variable" outs = [ - ("M", "memory result", "pn_Generic_M"), - ("1_result", "first result", "pn_Generic_other"), + ("M", "memory result"), + ("1_result", "first result"), ] flags = [ "uses_memory" ] attrs = [ @@ -253,10 +256,10 @@ class Call(Op): ] arity = "variable" outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("T_result", "tuple containing all results", "pn_Generic_other"), + ("M", "memory result"), + ("T_result", "tuple containing all results"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] attrs = [ @@ -275,6 +278,7 @@ class Call(Op): attr_struct = "call_attr" pinned = "memory" pinned_init = "op_pin_state_pinned" + throws_init = "false" init = ''' assert((get_unknown_type() == type) || is_Method_type(type)); ''' @@ -417,9 +421,9 @@ class CopyB(Op): ("src", "source address"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), + ("M", "memory result"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] attrs = [ @@ -433,6 +437,7 @@ class CopyB(Op): attrs_name = "copyb" pinned = "memory" pinned_init = "op_pin_state_pinned" + throws_init = "false" class Div(Op): """returns the quotient of its 2 operands""" @@ -442,10 +447,10 @@ class Div(Op): ("right", "second operand"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "result of computation", "pn_Generic_other"), + ("M", "memory result"), + ("res", "result of computation"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] attrs_name = "div" @@ -463,6 +468,7 @@ class Div(Op): ] attr_struct = "div_attr" pinned = "exception" + throws_init = "false" op_index = 1 arity_override = "oparity_binary" @@ -542,10 +548,10 @@ class InstOf(Op): ("obj", "pointer to object being queried") ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "checked object pointer", "pn_Generic_other"), + ("M", "memory result"), + ("res", "checked object pointer"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "highlevel" ] attrs = [ @@ -573,10 +579,10 @@ class Load(Op): ("ptr", "address to load from"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "result of load operation", "pn_Generic_other"), + ("M", "memory result"), + ("res", "result of load operation"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] pinned = "exception" @@ -608,6 +614,7 @@ class Load(Op): ), ] pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned" + throws_init = "(flags & cons_throws_exception) != 0" class Minus(Unop): """returns the difference between its operands""" @@ -628,10 +635,10 @@ class Mod(Op): ("right", "second operand"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), - ("res", "result of computation", "pn_Generic_other"), + ("M", "memory result"), + ("res", "result of computation"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] attrs_name = "mod" @@ -644,6 +651,7 @@ class Mod(Op): ] attr_struct = "mod_attr" pinned = "exception" + throws_init = "false" op_index = 1 arity_override = "oparity_binary" @@ -743,8 +751,8 @@ class Raise(Op): ("exo_ptr", "pointer to exception object to be thrown"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X", "control flow to exception handler", "pn_Generic_X_regular"), + ("M", "memory result"), + ("X", "control flow to exception handler"), ] flags = [ "highlevel", "cfopcode" ] pinned = "yes" @@ -825,14 +833,15 @@ class Store(Op): ("value", "value to store"), ] outs = [ - ("M", "memory result", "pn_Generic_M"), - ("X_regular", "control flow when no exception occurs", "pn_Generic_X_regular"), - ("X_except", "control flow when exception occured", "pn_Generic_X_except"), + ("M", "memory result"), + ("X_regular", "control flow when no exception occurs"), + ("X_except", "control flow when exception occured"), ] flags = [ "fragile", "uses_memory" ] pinned = "exception" attr_struct = "store_attr" pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned" + throws_init = "(flags & cons_throws_exception) != 0" attrs = [ dict( type = "ir_volatility", @@ -926,7 +935,7 @@ class Unknown(Op): knownBlock = True pinned = "yes" block = "get_irg_start_block(irg)" - flags = [ "cfopcode", "start_block", "constlike", "dump_noblock" ] + flags = [ "start_block", "constlike", "dump_noblock" ] # Prepare node list