pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1751: Inside #if defined(PROFILING)
   dummy.opt_flags = opt_flags;   #ifdef PROFILING    dummy.self_time=0;    dummy.num_calls=0;    dummy.recur_depth=0;    dummy.total_time=0;   #endif    debug_add_to_identifiers(dummy);       if (Pike_compiler->current_annotations) { +  /* FIXME: What about annotations for eg variant functions? */    compiler_add_annotations(n, Pike_compiler->current_annotations); -  +  /* Only annotate a single identifier. */ +  free_node(Pike_compiler->current_annotations); +  Pike_compiler->current_annotations = NULL;    }       return n;   }      static int add_identifier(struct compilation *c,    struct pike_type *type,    struct pike_string *name,    unsigned int modifier_flags,    unsigned int identifier_flags,
pike.git/src/program.c:3163: Inside #if 0
  #if 0    fprintf(stderr,"Compiling class %s, depth=%d\n",    name->str, c->compilation_depth);    }else{    fprintf(stderr,"Compiling file %s, depth=%d\n",    c->lex.current_file ? c->lex.current_file->str : "-",    c->compilation_depth);   #endif    }    }else{ +  int e;    tmp.u.program=p;    add_ref(p);    if((pass != COMPILER_PASS_FIRST) && name)    {    struct identifier *i;    id=isidentifier(name);    if (id < 0)    Pike_fatal("Program constant disappeared in second pass.\n");    i=ID_FROM_INT(Pike_compiler->new_program, id);    free_type(i->type);    i->type=get_type_of_svalue(&tmp);    } -  +  +  /* Reset annotations so that they can be readded properly. */ +  for (e = 0; e < p->num_annotations; e++) { +  do_free_array(p->annotations[e]); +  p->annotations[e] = NULL;    } -  +  }    if (pass == COMPILER_PASS_FIRST) {    if(c->compilation_depth >= 1) {    add_ref(p->parent = Pike_compiler->new_program);    debug_malloc_touch (p);    }    }    p->flags &=~ PROGRAM_VIRGIN;    if(idp) *idp=id;       CDFPRINTF("th(%ld) %p low_start_new_program() %s "
pike.git/src/program.c:5913:    if(type == void_type_string)    yyerror("Variables can't be of type void.");       n = isidentifier(name);       if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE)    {    if(n==-1)    yyerror("Pass2: Variable disappeared!");    else { -  struct identifier *id=ID_FROM_INT(Pike_compiler->new_program,n); +  struct reference *ref = PTR_FROM_INT(Pike_compiler->new_program, n); +  struct identifier *id = ID_FROM_PTR(Pike_compiler->new_program, ref); +  +  if (Pike_compiler->current_annotations) { +  compiler_add_annotations(ref->identifier_offset, +  Pike_compiler->current_annotations); +  /* Only annotate a single identifier. */ +  free_node(Pike_compiler->current_annotations); +  Pike_compiler->current_annotations = NULL; +  } +     free_type(id->type);    copy_pike_type(id->type, type);    return n;    }    }      #ifdef PIKE_DEBUG    if(Pike_compiler->new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED))    Pike_fatal("Attempting to add variable to fixed program\n");   #endif
pike.git/src/program.c:6167:    if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE)    {    if(n==-1   #if 1    || !c   #endif    )    {    yyerror("Pass2: Constant disappeared!");    }else{ -  struct identifier *id; -  id=ID_FROM_INT(Pike_compiler->new_program,n); +  struct reference *ref = PTR_FROM_INT(Pike_compiler->new_program, n); +  struct identifier *id = ID_FROM_PTR(Pike_compiler->new_program, ref); +  +  if (Pike_compiler->current_annotations) { +  compiler_add_annotations(ref->identifier_offset, +  Pike_compiler->current_annotations); +  /* Only annotate a single identifier. */ +  free_node(Pike_compiler->current_annotations); +  Pike_compiler->current_annotations = NULL; +  } +     if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME: We probably ought to do something here... */    } else if(id->func.const_info.offset>=0) {    /* Update the stored constant. */    assign_svalue (&PROG_FROM_INT(Pike_compiler->new_program,n)->    constants[id->func.const_info.offset].sval, c);    } else {    id->run_time_type = (unsigned char) TYPEOF(*c);    id->func.const_info.offset = store_constant(c, 0, 0);    }
pike.git/src/program.c:6684:       funp = ID_FROM_INT(prog, i);    ref = prog->identifier_references[i];       if (funp->identifier_flags & IDENTIFIER_HAS_BODY)    /* Keep this flag. */    function_flags |= IDENTIFIER_HAS_BODY;       if(!(ref.id_flags & ID_INHERITED)) /* not inherited */    { +  if (Pike_compiler->current_annotations) { +  compiler_add_annotations(ref.identifier_offset, +  Pike_compiler->current_annotations); +  /* Only annotate a single identifier. */ +  free_node(Pike_compiler->current_annotations); +  Pike_compiler->current_annotations = NULL; +  }       if( !( IDENTIFIER_IS_FUNCTION(funp->identifier_flags) &&    ( (!func || func->offset == -1) || (funp->func.offset == -1))))    {    my_yyerror("Identifier %S defined twice.", name);       if (getter_setter != -1) {    struct identifier *id = ID_FROM_INT(prog, getter_setter);    (&id->func.gs_info.getter)[is_setter] = i;    }