pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.330 2003/03/14 15:50:44 grubba Exp $ + || $Id: las.c,v 1.331 2003/03/20 21:26:31 grubba Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.330 2003/03/14 15:50:44 grubba Exp $"); + RCSID("$Id: las.c,v 1.331 2003/03/20 21:26:31 grubba 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:3064:    *find_q(&(p->externals), n->u.id.number,    Pike_compiler->new_program->id) = VAR_USED;    }    break;       case F_APPLY:    case F_AUTO_MAP:    if(n->tree_info & OPT_SIDE_EFFECT) {    p->ext_flags = VAR_USED;    } +  find_written_vars(CAR(n), p, 0); +  find_written_vars(CDR(n), p, 0);    break;       case F_AUTO_MAP_MARKER:    find_written_vars(CAR(n), p, lvalue);    break;       case F_INDEX:    case F_ARROW:   #ifdef PARANOID_INDEXING    /* Be paranoid and assume aliasing. */
pike.git/src/las.c:3185:    bb.externals = NULL;       SET_ONERROR(free_aa, free_vars, &aa);    SET_ONERROR(free_bb, free_vars, &bb);       /* A depends on B if A uses stuff that is written to by B. */       find_used_variables(a, &aa, 0, 0);    find_written_vars(b, &bb, 0);    + #ifdef PIKE_DEBUG +  if (l_flag > 2) { +  struct scope_info *aaa = aa.locals; +  while (aaa) { +  fprintf(stderr, "Used locals:\n"); +  for (e = 0; e < MAX_VAR; e++) { +  if (aaa->vars[e] == VAR_USED) { +  fprintf(stderr, "\t%d:%d\n", aaa->scope_id, e); +  } +  } +  aaa = aaa->next; +  } +  aaa = bb.locals; +  while (aaa) { +  fprintf(stderr, "Written locals:\n"); +  for (e = 0; e < MAX_VAR; e++) { +  if (aaa->vars[e] != VAR_UNUSED) { +  fprintf(stderr, "\t%d:%d\n", aaa->scope_id, e); +  } +  } +  aaa = aaa->next; +  } +  } + #endif /* PIKE_DEBUG */ +     UNSET_ONERROR(free_bb);    UNSET_ONERROR(free_aa);       /* If there was an error or    * If A has external dependencies due to indexing, we won't    * investigate further.    */    if(aa.err || bb.err || aa.ext_flags == VAR_USED) {    free_vars(&aa);    free_vars(&bb);