pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: las.c,v 1.67 1998/11/06 03:46:29 hubbe Exp $"); + RCSID("$Id: las.c,v 1.68 1998/11/07 06:32:18 hubbe Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:1044:    CAR(n)->u.sval.u.efun->function == f)    return & CDR(n);    }    return 0;   }         static void low_print_tree(node *foo,int needlval)   {    if(!foo) return; +  if(l_flag>4) +  { +  printf("/*%x*/",foo->tree_info); +  }    switch(foo->token)    {    case F_LOCAL:    if(needlval) putchar('&');    printf("$%ld",(long)foo->u.number);    break;       case '?':    printf("(");    low_print_tree(CAR(foo),0);
pike.git/src/las.c:1321:    case F_POST_INC:    case F_POST_DEC:    find_written_vars(CAR(n), p, 1);    break;       case F_ASSIGN:    find_written_vars(CAR(n), p, 0);    find_written_vars(CDR(n), p, 1);    break;    +  case F_AND_EQ: +  case F_OR_EQ: +  case F_XOR_EQ: +  case F_LSH_EQ: +  case F_RSH_EQ: +  case F_ADD_EQ: +  case F_SUB_EQ: +  case F_MULT_EQ: +  case F_MOD_EQ: +  case F_DIV_EQ: +  find_written_vars(CAR(n), p, 1); +  find_written_vars(CDR(n), p, 0); +  break; +     case F_SSCANF:    find_written_vars(CAR(n), p, 0);    find_written_vars(CDR(n), p, 1);    break;       case F_ARRAY_LVALUE:    find_written_vars(CAR(n), p, 1);    break;       case F_LVALUE_LIST:
pike.git/src/las.c:1375:    for(e=0;e<MAX_LOCAL;e++)    if(aa.locals[e]==VAR_USED && bb.locals[e]!=VAR_UNUSED)    return 1;       for(e=0;e<MAX_GLOBAL;e++)    if(aa.globals[e]==VAR_USED && bb.globals[e]!=VAR_UNUSED)    return 1;    return 0;   }    - static int depend_p(node *a,node *b) + static int depend_p3(node *a,node *b)   {    if(!b) return 0;   #if 0    if(!(b->tree_info & OPT_SIDE_EFFECT) &&    (b->tree_info & OPT_EXTERNAL_DEPEND))    return 1;   #endif       if((a->tree_info & OPT_EXTERNAL_DEPEND)) return 1;       return depend_p2(a,b);   }    -  + #ifdef DEBUG + static int depend_p(node *a,node *b) + { +  int ret; +  if(l_flag > 3) +  { +  fprintf(stderr,"Checking if: "); +  print_tree(a); +  fprintf(stderr,"Depends on: "); +  print_tree(b); +  if(depend_p3(a,b)) +  { +  fprintf(stderr,"The answer is (durumroll) : yes\n"); +  return 1; +  }else{ +  fprintf(stderr,"The answer is (durumroll) : no\n"); +  return 0; +  } +  } +  return depend_p3(a,b); + } + #else + #define depend_p depend_p3 + #endif +    static int cntargs(node *n)   {    if(!n) return 0;    switch(n->token)    {    case F_CAST:    case F_APPLY:    return n->type != void_type_string;       case F_FOREACH: