Branch: Tag:

1999-11-14

1999-11-14 19:20:31 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added a few more rules to mknode().

Rev: src/las.c:1.107

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.106 1999/11/12 19:03:32 grubba Exp $"); + RCSID("$Id: las.c,v 1.107 1999/11/14 19:20:31 grubba Exp $");      #include "language.h"   #include "interpret.h"
508:    {    case F_CATCH:    res->node_info |= OPT_SIDE_EFFECT; +  if (a) { +  res->tree_info |= a->tree_info & ~OPT_BREAK; +  }    break;       case F_APPLY:
521:    }    break;    -  case F_MAGIC_INDEX: +     case F_MAGIC_SET_INDEX: -  +  res->node_info |= OPT_ASSIGNMENT; +  /* FALL_THROUGH */ +  case F_MAGIC_INDEX:    res->node_info |= OPT_EXTERNAL_DEPEND;    break;   
547:    res->node_info |= OPT_CASE;    break;    +  case F_INC_LOOP: +  case F_INC_NEQ_LOOP: +  case F_DEC_LOOP: +  case F_DEC_NEQ_LOOP: +  res->node_info |= OPT_ASSIGNMENT; +  if (a) { +  res->tree_info |= a->tree_info; +  } +  if (b) { +  res->tree_info |= (b->tree_info & ~(OPT_BREAK|OPT_CONTINUE)); +  } +  break; +     case F_SSCANF:    if(!b || count_args(b) == 0) break; -  /* fall through */ +  res->node_info |= OPT_ASSIGNMENT; +  break;       case F_ASSIGN: -  +  case F_MOD_EQ: +  case F_AND_EQ: +  case F_MULT_EQ: +  case F_ADD_EQ: +  case F_SUB_EQ: +  case F_DIV_EQ: +  case F_LSH_EQ: +  case F_RSH_EQ: +  case F_XOR_EQ: +  case F_OR_EQ: +  res->node_info |= OPT_ASSIGNMENT; +  if (a) { +  res->tree_info |= a->tree_info; +  } +  if (b) { +  res->tree_info |= b->tree_info; +  } +  break; +     case F_INC:    case F_DEC:    case F_POST_INC:    case F_POST_DEC:    res->node_info |= OPT_ASSIGNMENT; -  +  if (a) { +  res->tree_info |= a->tree_info; +  }    break;       default:
564:    if(token != F_ARG_LIST && (a || b))    res->node_info |= OPT_TRY_OPTIMIZE;    -  res->tree_info = res->node_info; +     if(a) res->tree_info |= a->tree_info;    if(b) res->tree_info |= b->tree_info;    }    -  +  res->tree_info |= res->node_info; +    #ifdef PIKE_DEBUG    if(d_flag > 3)    verify_shared_strings_tables();
2227: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    { -  fprintf(stderr,"Optimizing (tree info=%x):",n->tree_info); +  fprintf(stderr,"Optimizing (tree info=%04x):",n->tree_info);    print_tree(n);    }   #endif