pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:4452:    * further down when we have entered pass 2.    *    * Also make sure that it is marked as having side effects,    * or it will be optimized away when inherited...    */    define_function(init_name, function_type_string, ID_PROTECTED,    IDENTIFIER_PIKE_FUNCTION, NULL,    OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND);    }    } +  /* FIXME: Call end_pass() in annotations here? +  */    Pike_compiler->compiler_pass = COMPILER_PASS_LAST;    }    -  +  if (!Pike_compiler->num_parse_error) { +  prog = Pike_compiler->new_program; +  if (prog->inherits->annotations) { +  struct array *a = prog->inherits->annotations; +  for (e = 0; e < a->size; e++) { +  struct object *o; +  struct program *p; +  struct inherit *inh; +  int fun; +  if (TYPEOF(ITEM(a)[e]) != PIKE_T_OBJECT) continue; +  o = ITEM(a)[e].u.object; +  p = o->prog; +  if (!p) continue; +  inh = p->inherits + SUBTYPEOF(ITEM(a)[e]); +  p = inh->prog; +  fun = find_identifier("end_pass", p); +  if (fun < 0) continue; +  fun += inh->identifier_level; +  push_int(Pike_compiler->compiler_pass); +  ref_push_program(prog); +  ref_push_object_inherit(Pike_fp->current_object, +  Pike_fp->context - +  Pike_fp->current_program->inherits); +  safe_apply_low2(o, fun, 3, NULL); +  pop_stack(); +  } +  } +  } +     /*    * Define the __INIT function, but only if there was any code    * to initialize.    */       if(Pike_compiler->init_node)    {    /* Inhibit this_function. */    Pike_compiler->compiler_frame->current_function_number = -2;