pike.git / src / treeopt.in

version» Context lines:

pike.git/src/treeopt.in:74:      // sizeof(`*(A,B)) => `*(A, sizeof(B)) if typeof(A) <= int   F_APPLY(0 = F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_sizeof],    F_APPLY(1 = F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_multiply], -  F_ARG_LIST(2 = +[pike_types_le($$->type, int_type_string)], +  F_ARG_LIST(2 = +[pike_types_le($$->type, int_type_string, 0, 0)],    3 = +[!match_types(object_type_string, $$->type)]))):    F_APPLY($1, F_ARG_LIST($2, F_APPLY($0, $3)));      // sizeof(`*(A,B)) => `*(sizeof(A), B) if typeof(B) <= int   F_APPLY(0 = F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_sizeof],    F_APPLY(1 = F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_multiply],    F_ARG_LIST(2 = +[!match_types(object_type_string, $$->type)], -  3 = +[pike_types_le($$->type, int_type_string)]))): +  3 = +[pike_types_le($$->type, int_type_string, 0, 0)]))):    F_APPLY($1, F_ARG_LIST(F_APPLY($0, $2), $3));      // search(indices(map), key) < 0) => zero_type(map[key]) if typeof(map) <= mapping   F_LT(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_search],    F_ARG_LIST(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_indices], -  0 = +[pike_types_le($$->type, mapping_type_string)]), +  0 = +[pike_types_le($$->type, mapping_type_string, 0, 0)]),    1)),    F_CONSTANT    [TYPEOF($$->u.sval) == T_INT]    [!$$->u.sval.u.integer]):   {    $$ = mkefuncallnode("zero_type",mknode(F_ARG_LIST, $0, $1));   };      // search(indices(map), key) == -1) => zero_type(map[key]) if typeof(map) <= mapping   F_EQ(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_search],    F_ARG_LIST(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_indices], -  0 = +[pike_types_le($$->type, mapping_type_string)]), +  0 = +[pike_types_le($$->type, mapping_type_string, 0, 0)]),    1)),    F_CONSTANT    [TYPEOF($$->u.sval) == T_INT]    [$$->u.sval.u.integer == -1]):   {    $$ = mkefuncallnode("zero_type",mknode(F_ARG_LIST, $0, $1));   };      // search(indices(map), key) >= 0) => !zero_type(map[key]) if typeof(map) <= mapping   F_GE(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_search],    F_ARG_LIST(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_indices], -  0 = +[pike_types_le($$->type, mapping_type_string)]), +  0 = +[pike_types_le($$->type, mapping_type_string, 0, 0)]),    1)),    F_CONSTANT    [TYPEOF($$->u.sval) == T_INT]    [!$$->u.sval.u.integer]):   {    $$ = mknode(F_NOT,mkefuncallnode("zero_type",mknode(F_ARG_LIST, $0, $1)),0);   };      // search(indices(map), key) > -1) => !zero_type(map[key]) if typeof(map) <= mapping   F_GE(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_search],    F_ARG_LIST(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_indices], -  0 = +[pike_types_le($$->type, mapping_type_string)]), +  0 = +[pike_types_le($$->type, mapping_type_string, 0, 0)]),    1)),    F_CONSTANT    [TYPEOF($$->u.sval) == T_INT]    [$$->u.sval.u.integer == -1]):   {    $$ = mknode(F_NOT,mkefuncallnode("zero_type",mknode(F_ARG_LIST, $0, $1)),0);   };      // sscanf(s[A..], "xxxx", ...)   //   // =>   //   // (sscanf(s, "%*!" + A + "s" + "xxxx", ...) || 1) - 1   F_SSCANF(F_ARG_LIST(F_RANGE(0 = +[ pike_types_le($$->type, -  string_type_string)], +  string_type_string, 0, 0)],    ':'(F_RANGE_FROM_BEG(1 = +[ pike_types_le($$->type, -  int_type_string)], -), +  int_type_string, 0, 0)], -),    F_RANGE_OPEN)),    2 = +), 3):   {    struct pike_string *percent_star_string;    struct pike_string *s_string;    MAKE_CONST_STRING(percent_star_string, "%*!");    MAKE_CONST_STRING(s_string, "s");    $$ = mkopernode("`-",    mknode(F_LOR,    mknode(F_SSCANF,
pike.git/src/treeopt.in:474:    }   };      F_RANGE(0, ':'(F_RANGE_FROM_BEG(1 = F_CONSTANT[TYPEOF($$->u.sval) == T_INT], *),    F_RANGE_FROM_BEG(F_CONSTANT[TYPEOF($$->u.sval) == T_INT]    [$$->u.sval.u.integer < $1->u.sval.u.integer], *))):   {    /* Objects may want to use the range for obscure purposes. */    if (!match_types(object_type_string, $0->type)) {    yywarning("Range is always empty."); -  if (pike_types_le($0->type, string_type_string)) { +  if (pike_types_le($0->type, string_type_string, 0, 0)) {    $$ = mkstrnode(empty_pike_string);    }    }   }   ;      F_COMMA_EXPR(-, 0):    $0;      F_COMMA_EXPR(0, -):
pike.git/src/treeopt.in:923:      '?'(0, ':'(F_COMMA_EXPR(1, 2), $2)):    F_COMMA_EXPR('?'($0, ':'($1, -)), $2);      '?'(0, ':'(1, F_COMMA_EXPR(2, $1))):    F_COMMA_EXPR('?'($0, ':'(-, $2)), $1);      '?'(0, ':'(F_COMMA_EXPR(1, 2), F_COMMA_EXPR(3, $2))):    F_COMMA_EXPR('?'($0, ':'($1, $3)), $2);    - '?'(*, ':'(0=+, +[(pike_types_le($0->type, void_type_string) != -  pike_types_le($$->type, void_type_string))])): + '?'(*, ':'(0=+, +[(pike_types_le($0->type, void_type_string, 0, 0) != +  pike_types_le($$->type, void_type_string, 0, 0))])):   {    yyerror("The arguments to ?: may not be void.");   }   ;      // Optimizations of negations.   F_NOT(-, *):    1;      // The following only work on total orders. We can't assume that,   // since it's not true for floats, and might not be true for objects. - F_NOT(F_LT(0 [pike_types_le($$->type, int_type_string)], -  1 [pike_types_le($$->type, int_type_string)]), *): + F_NOT(F_LT(0 [pike_types_le($$->type, int_type_string, 0, 0)], +  1 [pike_types_le($$->type, int_type_string, 0, 0)]), *):    F_GE($0, $1);    - F_NOT(F_GT(0 [pike_types_le($$->type, int_type_string)], -  1 [pike_types_le($$->type, int_type_string)]), *): + F_NOT(F_GT(0 [pike_types_le($$->type, int_type_string, 0, 0)], +  1 [pike_types_le($$->type, int_type_string, 0, 0)]), *):    F_LE($0, $1);    - F_NOT(F_LE(0 [pike_types_le($$->type, int_type_string)], -  1 [pike_types_le($$->type, int_type_string)]), *): + F_NOT(F_LE(0 [pike_types_le($$->type, int_type_string, 0, 0)], +  1 [pike_types_le($$->type, int_type_string, 0, 0)]), *):    F_GT($0, $1);    - F_NOT(F_GE(0 [pike_types_le($$->type, int_type_string)], -  1 [pike_types_le($$->type, int_type_string)]), *): + F_NOT(F_GE(0 [pike_types_le($$->type, int_type_string, 0, 0)], +  1 [pike_types_le($$->type, int_type_string, 0, 0)]), *):    F_LT($0, $1);      F_NOT(F_EQ(0, 1), *):    F_NE($0, $1);      F_NOT(F_NE(0, 1), *):    F_EQ($0, $1);         // a += 0 -> a
pike.git/src/treeopt.in:1088:    mknode(F_ASSIGN, $1,    mknode(F_INDEX, $0, mkintnode(-1))),    NULL)),    0);   }   ;   F_LOOP(0, -):    F_POP_VALUE($0, -);      // foreach(arr ; ; val) body; -> foreach(arr, val) body; - F_FOREACH(F_FOREACH_VAL_LVAL(0[ pike_types_le($$->type, array_type_string) ], + F_FOREACH(F_FOREACH_VAL_LVAL(0[ pike_types_le($$->type, array_type_string, 0, 0) ],    ':'(-, 1) ), 2):    F_FOREACH(F_FOREACH_VAL_LVAL($0, $1), $2);      // foreach(arr, -) body; -> loop(sizeof(arr)) body;   F_FOREACH(F_FOREACH_VAL_LVAL(0, -), 1):    {    $$ = mknode(F_LOOP, mkefuncallnode("sizeof", $0), $1);    }    ;   
pike.git/src/treeopt.in:1113:   // {   // $$ = mknode(F_LOOP, mkefuncallnode("sizeof", $0), $1);   // }   // ;      // foreach(str/"x", ...) ==> foreach(String.SplitIterator(str, 'x'), ...)   F_FOREACH(F_FOREACH_VAL_LVAL(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_divide], -  F_ARG_LIST(0[pike_types_le($$->type, string_type_string)], +  F_ARG_LIST(0[pike_types_le($$->type, string_type_string, 0, 0)],    1 = F_CONSTANT    [TYPEOF($$->u.sval) == T_STRING]    [$$->u.sval.u.string->len == 1])),    2), 3):   {    extern struct program *string_split_iterator_program;    node *vars;    p_wchar2 split = index_shared_string($1->u.sval.u.string, 0);       ADD_NODE_REF2($2,
pike.git/src/treeopt.in:1154:   // foreach(String.SplitIterator(str, 'x', 1), ...)   F_FOREACH(F_FOREACH_VAL_LVAL(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_minus],    F_ARG_LIST(    F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_divide], -  F_ARG_LIST(0[pike_types_le($$->type, string_type_string)], +  F_ARG_LIST(0[pike_types_le($$->type, string_type_string, 0, 0)],    1 = F_CONSTANT    [TYPEOF($$->u.sval) == T_STRING]    [$$->u.sval.u.string->len == 1])),    F_CONSTANT    [TYPEOF($$->u.sval) == T_ARRAY]    [$$->u.sval.u.array->size == 1]    [TYPEOF($$->u.sval.u.array->item[0]) == T_STRING]    [$$->u.sval.u.array->item[0].u.string->len == 0])),    2), 3):   {
pike.git/src/treeopt.in:1200:   // Same, but with allocate(1, "") instead of a constant ({""}).   F_FOREACH(F_FOREACH_VAL_LVAL(F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_minus],    F_ARG_LIST(    F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_divide], -  F_ARG_LIST(0[pike_types_le($$->type, string_type_string)], +  F_ARG_LIST(0[pike_types_le($$->type, string_type_string, 0, 0)],    1 = F_CONSTANT    [TYPEOF($$->u.sval) == T_STRING]    [$$->u.sval.u.string->len == 1])),    F_APPLY(F_CONSTANT    [TYPEOF($$->u.sval) == T_FUNCTION]    [SUBTYPEOF($$->u.sval) == FUNCTION_BUILTIN]    [$$->u.sval.u.efun->function == f_allocate],    F_ARG_LIST(F_CONSTANT    [TYPEOF($$->u.sval) == T_INT]    [$$->u.sval.u.integer == 1],
pike.git/src/treeopt.in:1555:   // }   // ;         // No need for the pop_value.   F_LOOP(0, F_POP_VALUE(1, -)):    F_LOOP($0, $1);      // loop(n) ++x; ==> x+=n;   F_LOOP(0 = +[ !depend_p($$, $$) ], -  F_INC [ pike_types_le($$->type, int_type_string) ] +  F_INC [ pike_types_le($$->type, int_type_string, 0, 0) ]    (1 = +[ !depend_p($$, $$) ], -)):    F_POP_VALUE(F_ADD_EQ($1, $0), -);      // loop(n) x++; ==> x+=n;   F_LOOP(0 = +[ !depend_p($$, $$) ], -  F_POST_INC [ pike_types_le($$->type, int_type_string) ] +  F_POST_INC [ pike_types_le($$->type, int_type_string, 0, 0) ]    (1 = +[ !depend_p($$, $$) ], -)):    F_POP_VALUE(F_ADD_EQ($1, $0), -);      // loop(n) --x; ==> x-=n;   F_LOOP(0 = +[ !depend_p($$, $$) ], -  F_DEC [ pike_types_le($$->type, int_type_string) ] +  F_DEC [ pike_types_le($$->type, int_type_string, 0, 0) ]    (1 = +[ !depend_p($$, $$) ], -)):    F_POP_VALUE(F_SUB_EQ($1, $0), -);      // loop(n) x--; ==> x-=n;   F_LOOP(0 = +[ !depend_p($$, $$) ], -  F_POST_DEC [ pike_types_le($$->type, int_type_string) ] +  F_POST_DEC [ pike_types_le($$->type, int_type_string, 0, 0) ]    (1 = +[ !depend_p($$, $$) ], -)):    F_POP_VALUE(F_SUB_EQ($1, $0), -);      // loop(n) x+=k; ==> if (n > 0) x += k*n;   F_LOOP(0 = +[ !depend_p($$, $$)]    [ !($$->tree_info & (OPT_SIDE_EFFECT|OPT_ASSIGNMENT|    OPT_CASE|OPT_CONTINUE|    OPT_BREAK|OPT_RETURN)) ],    F_ADD_EQ(1 = +[ !depend_p($$, $$) ],    2 = +[ !depend_p($$, $1) ][ !depend_p($$, $$) ]    [ !($$->tree_info & OPT_SIDE_EFFECT) ]    [ ((($$->type == int_type_string) &&    ($1->type == int_type_string)) || -  pike_types_le($$->type, string_type_string)) ])): +  pike_types_le($$->type, string_type_string, 0, 0)) ])):    {    $$ = mknode(F_POP_VALUE,    mknode('?',    mkefuncallnode("`>",    mknode(F_ARG_LIST,    $0, mkintnode(0))),    mknode(':',    mknode(F_ADD_EQ,    $1,    mkefuncallnode("`*",