Branch: Tag:

2000-09-11

2000-09-11 22:10:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Made note of the functions that recurse on the parse-tree.

Rev: src/las.c:1.205

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.204 2000/09/09 19:39:44 hubbe Exp $"); + RCSID("$Id: las.c,v 1.205 2000/09/11 22:10:38 grubba Exp $");      #include "language.h"   #include "interpret.h"
94:   }      #ifdef PIKE_DEBUG + /* FIXME: Ought to use parent pointer to avoid recursion. */   void check_tree(node *n, int depth)   {    if(!d_flag) return;
139: Inside #if defined(PIKE_DEBUG)
      if(d_flag<2) return;    +  if (!(depth & 63)) { +  /* 512 bytes/stack frame should be enough... */ +  check_c_stack(32768); +     if(!(depth & 1023))    {    node *q;
146: Inside #if defined(PIKE_DEBUG)
   if(q->parent==n)    fatal("Cyclic node structure found.\n");    } +  }    depth++;       if(car_is_node(n))
170:   }   #endif    + /* FIXME: Ought to use parent pointer to avoid recursion. */   INT32 count_args(node *n)   {    int a,b;
235:    }   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   struct pike_string *find_return_type(node *n)   {    struct pike_string *a,*b;
370: Inside #if defined(SHARED_NODES)
   if ((n->hash == hash) &&    !MEMCMP(&(n->token), &(orig->token),    sizeof(node) - OFFSETOF(node_s, token))) { +  if (orig->type && (orig->type != n->type)) { +  if (n->type) { +  /* Use the new type if it's stricter. */ +  if (pike_types_le(orig->type, n->type)) { +  free_string(n->type); +  copy_shared_string(n->type, orig->type); +  } +  } else { +  /* This probably doesn't happen, but... */ +  copy_shared_string(n->type, orig->type); +  } +  }    free_node(dmalloc_touch(node *, orig));    n->refs++;    return check_node_hash(dmalloc_touch(node *, n));
478:    }   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   void debug_free_node(node *n)   {    if(!n) return;
1416:   }       + /* FIXME: Ought to use parent pointer to avoid recursion. */   int node_is_eq(node *a,node *b)   {    check_tree(a,0);
1546: Inside #if 1 /* DEAD_CODE - I need this /Hubbe */
     #if 1 /* DEAD_CODE - I need this /Hubbe */    + /* FIXME: Ought to use parent pointer to avoid recursion. +  * In the SHARED_NODES case there's no need of course. +  */   node *copy_node(node *n)   {    node *b;
1714:    return 0;   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static node **low_get_arg(node **a,int *nr)   {    node **n;
1754:   }       + /* FIXME: Ought to use parent pointer to avoid recursion. */   static void low_print_tree(node *foo,int needlval)   {    if(!foo) return;
2138:    return new->vars + num;   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   /* Find the variables that are used in the tree n. */   static int find_used_variables(node *n,    struct used_vars *p,
2264:    return 0;   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   /* no subtility needed */   static void find_written_vars(node *n,    struct used_vars *p,
2535:   #define depend_p depend_p3   #endif    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static int cntargs(node *n)   {    if(!n) return 0;
2565:      static int function_type_max=0;    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static void low_build_function_type(node *n)   {    if(!n) return;
3172:   #endif /* PIKE_DEBUG */   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static void zapp_try_optimize(node *n)   {    if(!n) return;
3182:   }      #if defined(SHARED_NODES) && !defined(IN_TPIKE) + /* FIXME: Ought to use parent pointer to avoid recursion. */   static void find_usage(node *n, unsigned char *usage,    unsigned char *switch_u,    const unsigned char *cont_u,
4279:      INT32 last_function_opt_info;    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static int stupid_args(node *n, int expected,int vargs)   {    if(!n) return expected;
4302:    }   }    + /* FIXME: Ought to use parent pointer to avoid recursion. */   static int is_null_branch(node *n)   {    if(!n) return 1;