X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=scripts%2Fir_spec.py;h=158de80a80aadd986793b029b129be47467fc547;hb=8cc2eaff1445f70ba8a0ac8b9d8c8d6be9ed62cc;hp=18d9de535061b71c3ab94ca0c2e91df1a79825ff;hpb=853027b0e1c8a114bc25f5ba342ee5b652239ed6;p=libfirm diff --git a/scripts/ir_spec.py b/scripts/ir_spec.py index 18d9de535..158de80a8 100755 --- a/scripts/ir_spec.py +++ b/scripts/ir_spec.py @@ -1,32 +1,35 @@ -nodes = dict( +from spec_util import abstract, setnodedefaults -# -# Abstract node types -# -unop = dict( - abstract = True, +class Op(object): + "Base class for firm nodes" +abstract(Op) + +class Unop(Op): + "Unary nodes have exactly 1 input" + name = "unop" ins = [ "op" ] -), + op_index = 0 + pinned = "no" +abstract(Unop) -binop = dict( - abstract = True, +class Binop(Op): + "Binary nodes have exactly 2 inputs" + name = "binop" ins = [ "left", "right" ] -), - -# -# Real node types -# -Abs = dict( - is_a = "unop" -), - -Add = dict( - is_a = "binop" -), - -Alloc = dict( - ins = [ "mem", "size" ], - outs = [ "M", "X_regular", "X_except", "res" ], + op_index = 0 + pinned = "no" +abstract(Binop) + +class Abs(Unop): + flags = [] + +class Add(Binop): + flags = ["commutative"] + +class Alloc(Op): + ins = [ "mem", "count" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "uses_memory" ] attrs = [ dict( name = "type", @@ -37,34 +40,82 @@ Alloc = dict( type = "ir_where_alloc" ) ] -), - -Anchor = dict( - mode = "mode_ANY", - ins = [ "end_block", "start_block", "end", "start", - "end_reg", "end_except", "initial_exec", - "frame", "tls", "initial_mem", "args", - "bad", "no_mem" ], - knownBlock = True, - noconstr = True -), - -And = dict( - is_a = "binop" -), - -Bad = dict( - mode = "mode_Bad", - knownBlock = True, -), - -Block = dict( - mode = "mode_BB", - knownBlock = True, - block = "NULL", - noconstr = True, - optimize = False, - arity = "variable", + pinned = "yes" + attr_struct = "alloc_attr" + d_post = ''' + firm_alloc_frag_arr(res, op_Alloc, &res->attr.alloc.exc.frag_arr); + ''' + +class Anchor(Op): + mode = "mode_ANY" + arity = "variable" + flags = [ "dump_noblock" ] + pinned = "yes" + knownBlock = True + singleton = True + +class And(Binop): + flags = [ "commutative" ] + +class ASM(Op): + mode = "mode_T" + arity = "variable" + flags = [ "keep", "uses_memory" ] + pinned = "memory" + pinned_init = "op_pin_state_pinned" + attr_struct = "asm_attr" + attrs_name = "assem" + attrs = [ + dict( + name = "input_constraints", + type = "ir_asm_constraint*", + ), + dict( + name = "n_output_constraints", + type = "int", + noprop = True, + ), + dict( + name = "output_constraints", + type = "ir_asm_constraint*", + ), + dict( + name = "n_clobbers", + type = "int", + noprop = True, + ), + dict( + name = "clobbers", + type = "ident**", + ), + dict( + name = "text", + type = "ident*", + ), + ] + java_noconstr = True + +class Bad(Op): + mode = "mode_Bad" + flags = [ "cfopcode", "fragile", "start_block", "dump_noblock" ] + pinned = "yes" + knownBlock = True + singleton = True + attr_struct = "irg_attr" + init = ''' + res->attr.irg.irg = irg; + ''' + +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 */ @@ -72,44 +123,23 @@ 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.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.label = 0; + res->attr.block.entity = NULL; 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 = ''' public void addPred(Node node) { @@ -131,17 +161,38 @@ Block = dict( public void markBlockVisited() { binding.mark_Block_block_visited(ptr); - }''', -), + } + + public boolean isBad() { + return binding.is_Bad(ptr) != 0; + } + ''' -Borrow = dict( - is_a = "binop" -), +class Borrow(Binop): + flags = [] + +class Bound(Op): + ins = [ "mem", "index", "lower", "upper" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "highlevel" ] + 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); + ''' -Builtin = dict( - ins = [ "mem" ], - arity = "variable", - outs = [ "M_regular", "X_regular", "X_except", "T_result", "M_except", "P_value_res_base" ], +class Break(Op): + mode = "mode_X" + flags = [ "cfopcode" ] + pinned = "yes" + +class Builtin(Op): + ins = [ "mem" ] + arity = "variable" + outs = [ "M", "X_regular", "X_except", "T_result", "P_value_res_base" ] + flags = [ "uses_memory" ] attrs = [ dict( type = "ir_builtin_kind", @@ -152,64 +203,97 @@ Builtin = dict( name = "type" ) ] -), + pinned = "memory" + pinned_init = "op_pin_state_pinned" + attr_struct = "builtin_attr" + init = ''' + assert((get_unknown_type() == type) || is_Method_type(type)); + ''' -Call = dict( - ins = [ "mem", "ptr" ], - arity = "variable", - outs = [ "M_regular", "X_regular", "X_except", "T_result", "M_except", "P_value_res_base" ], +class Call(Op): + ins = [ "mem", "ptr" ] + arity = "variable" + outs = [ "M", "X_regular", "X_except", "T_result", "P_value_res_base" ] + flags = [ "fragile", "uses_memory" ] attrs = [ dict( type = "ir_type*", name = "type" ), dict( - name = "state", - type = "op_pin_state", - initname = ".exc.pin_state", - init = "op_pin_state_pinned" + type = "unsigned", + name = "tail_call", + # the tail call attribute can only be set by analysis + init = "0" ) - ], + ] + attr_struct = "call_attr" + pinned = "memory" + pinned_init = "op_pin_state_pinned" init = ''' assert((get_unknown_type() == type) || is_Method_type(type)); - ''', + ''' d_post = ''' - #if PRECISE_EXC_CONTEXT firm_alloc_frag_arr(res, op_Call, &res->attr.call.exc.frag_arr); - #endif ''' -), -Carry = dict( - is_a = "binop" -), +class CallBegin(Op): + ins = [ "ptr" ] + outs = [ "" ] # TODO + flags = [ "cfopcode", "ip_cfopcode" ] + pinned = "yes" + # TODO: attribute with call... + attr_struct = "callbegin_attr" + attrs = [ + dict( + type = "ir_node*", + name = "call" + ) + ] + java_noconstr = True + +class Carry(Binop): + flags = [ "commutative" ] -Cast = dict( - ins = [ "op" ], - mode = "get_irn_mode(irn_op)", +class Cast(Unop): + mode = "get_irn_mode(irn_op)" + flags = [ "highlevel" ] attrs = [ dict( type = "ir_type*", name = "type" ) - ], + ] + attr_struct = "cast_attr" init = "assert(is_atomic_type(type));" -), -Cmp = dict( - is_a = "binop", - outs = [ "False", "Eq", "Lt", "Le", "Gt", "Ge", "Lg", "Leg", "Uo", "Ue", "Ul", "Ule", "Ug", "Uge", "Ne", "True" ], -), +class Cmp(Binop): + outs = [ + ("False", "always false"), + ("Eq", "equal"), + ("Lt", "less"), + ("Le", "less or equal"), + ("Gt", "greater"), + ("Ge", "greater or equal"), + ("Lg", "less or greater"), + ("Leg", "less, equal or greater ('not equal' for integer numbers)"), + ("Uo", "unordered"), + ("Ue", "unordered or equal"), + ("Ul", "unordered or less"), + ("Ule", "unordered, less or equal"), + ("Ug", "unordered or greater"), + ("Uge", "onordered, greater or equal"), + ("Ne", "unordered, less, greater or equal ('not equal' for floatingpoint numbers)"), + ("True", "always true"), + ] + flags = [] -Cond = dict( - ins = [ "selector" ], - outs = [ "false", "true" ], +class Cond(Op): + ins = [ "selector" ] + outs = [ "false", "true" ] + flags = [ "cfopcode", "forking" ] + pinned = "yes" attrs = [ - dict( - name = "kind", - type = "cond_kind", - init = "dense" - ), dict( name = "default_proj", type = "long", @@ -221,33 +305,38 @@ Cond = dict( init = "COND_JMP_PRED_NONE" ) ] -), + attr_struct = "cond_attr" -Confirm = dict( - ins = [ "value", "bound" ], - mode = "get_irn_mode(irn_value)", +class Confirm(Op): + ins = [ "value", "bound" ] + mode = "get_irn_mode(irn_value)" + flags = [ "highlevel" ] + pinned = "yes" attrs = [ dict( name = "cmp", type = "pn_Cmp" ), - ], -), - -Const = dict( - mode = "", - knownBlock = True, - attrs_name = "con", + ] + attr_struct = "confirm_attr" + attrs_name = "confirm" + +class Const(Op): + mode = "" + flags = [ "constlike", "start_block" ] + knownBlock = True + pinned = "no" + attrs_name = "con" attrs = [ dict( type = "tarval*", name = "tarval", ) - ], -), + ] + attr_struct = "const_attr" -Conv = dict( - is_a = "unop", +class Conv(Unop): + flags = [] attrs = [ dict( name = "strict", @@ -259,33 +348,37 @@ Conv = dict( ) ) ] -), + attr_struct = "conv_attr" + attrs_name = "conv" -CopyB = dict( - ins = [ "mem", "dst", "src" ], - outs = [ "M", "X_regular", "X_except" ], +class CopyB(Op): + ins = [ "mem", "dst", "src" ] + outs = [ "M", "X_regular", "X_except" ] + flags = [ "fragile", "highlevel", "uses_memory" ] attrs = [ dict( name = "type", type = "ir_type*" ) ] -), + attr_struct = "copyb_attr" + attrs_name = "copyb" + pinned = "memory" + pinned_init = "op_pin_state_pinned" + d_post = ''' + firm_alloc_frag_arr(res, op_CopyB, &res->attr.copyb.exc.frag_arr); + ''' -Div = dict( - ins = [ "mem", "dividend", "divisor" ], - outs = [ "M", "X_regular", "X_except", "res" ], - attrs_name = "divmod", +class Div(Op): + ins = [ "mem", "left", "right" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "uses_memory" ] + attrs_name = "divmod" attrs = [ dict( type = "ir_mode*", name = "resmode" ), - dict( - name = "state", - type = "op_pin_state", - initname = ".exc.pin_state" - ), dict( name = "no_remainder", type = "int", @@ -295,53 +388,86 @@ Div = dict( init = "1" ) ) - ], + ] + 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); - #endif ''' -), -DivMod = dict( - ins = [ "mem", "dividend", "divisor" ], - outs = [ "M", "X_regular", "X_except", "res_div", "res_mod" ], - attrs_name = "divmod", +class DivMod(Op): + ins = [ "mem", "left", "right" ] + outs = [ "M", "X_regular", "X_except", "res_div", "res_mod" ] + flags = [ "fragile", "uses_memory" ] + attrs_name = "divmod" attrs = [ dict( type = "ir_mode*", name = "resmode" ), - dict( - name = "state", - type = "op_pin_state", - initname = ".exc.pin_state" - ) - ], + ] + 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); - #endif ''' -), - -End = dict( - mode = "mode_X", - op_flags = "cfopcode", - state = "pinned", - arity = "dynamic", - noconstr = True, - optimize = False -), - -Eor = dict( - is_a = "binop" -), - -Free = dict( - ins = [ "mem", "ptr", "size" ], - mode = "mode_M", + +class Dummy(Op): + ins = [] + flags = [ "cfopcode", "fragile", "start_block", "constlike", + "dump_noblock" ] + knownBlock = True + pinned = "yes" + block = "get_irg_start_block(irg)" + +class End(Op): + mode = "mode_X" + pinned = "yes" + arity = "dynamic" + flags = [ "cfopcode" ] + singleton = True + +class EndExcept(Op): + mode = "mode_X" + pinned = "yes" + arity = "dynamic" + flags = [ "cfopcode", "ip_cfopcode" ] + singleton = True + +class EndReg(Op): + mode = "mode_X" + pinned = "yes" + arity = "dynamic" + flags = [ "cfopcode", "ip_cfopcode" ] + singleton = True + +class Eor(Binop): + flags = [ "commutative" ] + +class Filter(Op): + ins = [ "pred" ] + flags = [] attrs = [ + dict( + name = "proj", + type = "long" + ) + ] + pinned = "yes" + attr_struct = "filter_attr" + attrs_name = "filter" + java_noconstr = True + +class Free(Op): + ins = [ "mem", "ptr", "size" ] + mode = "mode_M" + flags = [ "uses_memory" ] + pinned = "yes" + attrs = [ dict( name = "type", type = "ir_type*" @@ -351,232 +477,280 @@ Free = dict( type = "ir_where_alloc" ) ] -), - -Id = dict( - ins = [ "pred" ] -), - -IJmp = dict( - mode = "mode_X", - op_flags = "cfopcode", - state = "pinned", - ins = [ "target" ], -), - -Jmp = dict( - mode = "mode_X", - op_flags = "cfopcode", - state = "pinned", - ins = [], -), - -Load = dict( - ins = [ "mem", "ptr" ], - outs = [ "M", "X_regular", "X_except", "res" ], + attr_struct = "free_attr" + +class Id(Op): + ins = [ "pred" ] + pinned = "no" + flags = [] + +class IJmp(Op): + mode = "mode_X" + pinned = "yes" + ins = [ "target" ] + flags = [ "cfopcode", "forking", "keep" ] + +class InstOf(Op): + ins = [ "store", "obj" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "highlevel" ] + attrs = [ + dict( + name = "type", + type = "ir_type*" + ) + ] + attr_struct = "io_attr" + pinned = "memory" + pinned_init = "op_pin_state_floats" + +class Jmp(Op): + mode = "mode_X" + pinned = "yes" + ins = [] + flags = [ "cfopcode" ] + +class Load(Op): + ins = [ "mem", "ptr" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "uses_memory" ] + pinned = "exception" + pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned" attrs = [ dict( type = "ir_mode*", name = "mode", java_name = "load_mode" ), - ], + ] + attr_struct = "load_attr" constructor_args = [ dict( type = "ir_cons_flags", name = "flags", ), - ], + ] d_post = ''' -#if PRECISE_EXC_CONTEXT firm_alloc_frag_arr(res, op_Load, &res->attr.load.exc.frag_arr); -#endif ''' -), -Minus = dict( - is_a = "unop" -), +class Minus(Unop): + flags = [] -Mod = dict( - ins = [ "mem", "dividend", "divisor" ], - outs = [ "M", "X_regular", "X_except", "res" ], - attrs_name = "divmod", +class Mod(Op): + ins = [ "mem", "left", "right" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "uses_memory" ] + attrs_name = "divmod" attrs = [ dict( type = "ir_mode*", name = "resmode" ), - dict( - name = "state", - type = "op_pin_state", - initname = ".exc.pin_state" - ) - ], + ] + 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); - #endif ''' -), - -Mul = dict( - is_a = "binop" -), - -Mulh = dict( - is_a = "binop" -), - -Mux = dict( - ins = [ "sel", "false", "true" ] -), - -NoMem = dict( - mode = "mode_M", - knownBlock = True, -), - -Not = dict( - is_a = "unop" -), -Or = dict( - is_a = "binop" -), - -Phi = dict( - noconstr = True, - state = "pinned", - arity = "variable", -), +class Mul(Binop): + flags = [ "commutative" ] + +class Mulh(Binop): + flags = [ "commutative" ] + +class Mux(Op): + ins = [ "sel", "false", "true" ] + flags = [] + pinned = "no" + +class NoMem(Op): + mode = "mode_M" + flags = [ "dump_noblock", "dump_noinput" ] + pinned = "yes" + knownBlock = True + singleton = True + +class Not(Unop): + flags = [] + +class Or(Binop): + flags = [ "commutative" ] + +class Phi(Op): + 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. + 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( - ins = [ "op" ], +class Pin(Op): + ins = [ "op" ] mode = "get_irn_mode(irn_op)" -), - -Proj = dict( - ins = [ "pred" ], - attrs = [ + flags = [ "highlevel" ] + pinned = "yes" + +class Proj(Op): + 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, ) ] -), - -Quot = dict( - ins = [ "mem", "dividend", "divisor" ], - outs = [ "M", "X_regular", "X_except", "res" ], - attrs_name = "divmod", + attr_struct = "long" + custom_is = True + +class Quot(Op): + ins = [ "mem", "left", "right" ] + outs = [ "M", "X_regular", "X_except", "res" ] + flags = [ "fragile", "uses_memory" ] + attrs_name = "divmod" attrs = [ dict( type = "ir_mode*", name = "resmode" ), - dict( - name = "state", - type = "op_pin_state", - initname = ".exc.pin_state" - ) - ], + ] + 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); - #endif ''' -), -Return = dict( - ins = [ "mem" ], - arity = "variable", - mode = "mode_X" -), - -Rotl = dict( - is_a = "binop" -), +class Raise(Op): + ins = [ "mem", "exo_ptr" ] + outs = [ "M", "X" ] + flags = [ "highlevel", "cfopcode" ] + pinned = "yes" -Sel = dict( - ins = [ "mem", "ptr" ], - arity = "variable", - mode = "is_Method_type(get_entity_type(entity)) ? mode_P_code : mode_P_data", - attrs = [ +class Return(Op): + ins = [ "mem" ] + arity = "variable" + mode = "mode_X" + flags = [ "cfopcode" ] + pinned = "yes" + +class Rotl(Binop): + flags = [] + +class Sel(Op): + ins = [ "mem", "ptr" ] + arity = "variable" + flags = [] + mode = "is_Method_type(get_entity_type(entity)) ? mode_P_code : mode_P_data" + pinned = "no" + attrs = [ dict( type = "ir_entity*", name = "entity" ) ] -), - -Shl = dict( - is_a = "binop" -), - -Shr = dict( - is_a = "binop" -), - -Shrs = dict( - is_a = "binop" -), - -Start = dict( - mode = "mode_T", - op_flags = "cfopcode", - state = "pinned", - noconstr = True, - optimize = False -), - -Store = dict( - ins = [ "mem", "ptr", "value" ], - outs = [ "M", "X_regular", "X_except" ], + attr_struct = "sel_attr" + +class Shl(Binop): + flags = [] + +class Shr(Binop): + flags = [] + +class Shrs(Binop): + flags = [] + +class Start(Op): + mode = "mode_T" + pinned = "yes" + flags = [ "cfopcode" ] + singleton = True + +class Store(Op): + ins = [ "mem", "ptr", "value" ] + outs = [ "M", "X_regular", "X_except" ] + flags = [ "fragile", "uses_memory" ] + pinned = "exception" + attr_struct = "store_attr" + pinned_init = "flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned" constructor_args = [ dict( type = "ir_cons_flags", name = "flags", ), - ], + ] d_post = ''' -#if PRECISE_EXC_CONTEXT firm_alloc_frag_arr(res, op_Store, &res->attr.store.exc.frag_arr); -#endif ''' -), -Sub = dict( - is_a = "binop" -), +class Sub(Binop): + flags = [] -SymConst = dict( - mode = "mode_P", - knownBlock = True, - noconstr = True, +class SymConst(Op): + mode = "mode_P" + flags = [ "constlike", "start_block" ] + knownBlock = True + pinned = "no" attrs = [ dict( type = "ir_entity*", - name = "entity" + name = "entity", + noprop = True ) - ], -), - -Sync = dict( - mode = "mode_M", - optimize = False, + ] + attr_struct = "symconst_attr" + java_noconstr = True + +class Sync(Op): + mode = "mode_M" + flags = [] + pinned = "no" + optimize = False arity = "dynamic" -), - -Tuple = dict( - arity = "variable", - mode = "mode_T", -), - -Unknown = dict( - knownBlock = True, - block = "get_irg_start_block(irg)", - nodbginfo = True -), -) + +class Tuple(Op): + arity = "variable" + mode = "mode_T" + pinned = "no" + flags = [ "labeled" ] + java_noconstr = True + +class Unknown(Op): + knownBlock = True + pinned = "yes" + block = "get_irg_start_block(irg)" + flags = [ "cfopcode", "fragile", "start_block", "constlike", + "dump_noblock" ] + +# Prepare node list + +def getOpList(namespace): + nodes = [] + for t in namespace.values(): + if type(t) != type: + continue + + if issubclass(t, Op): + setnodedefaults(t) + nodes.append(t) + return nodes + +nodes = getOpList(globals()) +nodes = sorted(nodes, lambda x,y: cmp(x.name, y.name))