pike.git / src / pike_compiler.cmod

version» Context lines:

pike.git/src/pike_compiler.cmod:2570:   /**    * Strap the compiler by creating the compilation program by hand.    */   static void compile_compiler(void)   {    struct program *p = low_allocate_program();    struct program *p2 = compilation_program = low_allocate_program();    struct object *co;    struct inherit *inh;    +  p->id = PROG_COMPILERENVIRONMENT_ID;    p->parent_info_storage = -1;    /* p->event_handler = compilation_env_event_handler; */    p->flags |= PROGRAM_HAS_C_METHODS;      #if 0    /* ADD_STORAGE(struct compilation_env); */    p->alignment_needed = ALIGNOF(struct compilation_env);    p->storage_needed = p->xstorage + sizeof(struct compilation_env);   #endif /* 0 */   
pike.git/src/pike_compiler.cmod:2604:       /* Force clone_object() to accept the program...    */    p->flags |= PROGRAM_PASS_1_DONE;    compilation_environment = clone_object(p, 0);    p->flags &= ~PROGRAM_PASS_1_DONE;       /* Once more, this time for p2...    */    +  p2->id = PROG_COMPILERENVIRONMENT_PIKECOMPILER_ID;    p2->parent_info_storage = 0;    p2->xstorage = sizeof(struct parent_info);    p2->event_handler = compilation_event_handler;    p2->flags |= PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT|PROGRAM_HAS_C_METHODS;       /* ADD_STORAGE(struct compilation); */    p2->alignment_needed = ALIGNOF(struct compilation);    p2->storage_needed = p2->xstorage + sizeof(struct compilation);       p2->inherits = inh = ALLOC_STRUCT(inherit);
pike.git/src/pike_compiler.cmod:2720:       ADD_FUNCTION("apply_attribute_constant",    f_compilation_apply_attribute_constant,    tFunc(tStr tMix tType(tMix) tType(tFunction),    tType(tFunction)), 0);       ADD_FUNCTION("_sprintf", f_compilation__sprintf,    tFunc(tInt tOr(tMap(tStr, tMix), tVoid), tStr), ID_PROTECTED);       start_new_program(); +  Pike_compiler->new_program->id = +  PROG_COMPILERENVIRONMENT_PIKECOMPILER_COMPILERSTATE_ID;       ADD_STORAGE(struct program_state);    Pike_compiler->new_program->event_handler = program_state_event_handler;    Pike_compiler->new_program->flags |=    PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT|PROGRAM_HAS_C_METHODS;       /* Alias for report above. */    low_define_alias(NULL, NULL, 0, 1, PC_REPORT_FUN_NUM);       end_class("CompilerState", 0);
pike.git/src/pike_compiler.cmod:2779:    tFunc(tStr tStr tOr(tObj, tVoid), tPrg(tObj)), 0);       ADD_FUNCTION("handle_import", f_compilation_env_handle_import,    tFunc(tStr tStr tOr(tObj, tVoid), tPrg(tObj)), 0);       /* Reporter */    start_new_program();    {    struct svalue type_value;    +  Pike_compiler->new_program->id = PROG_COMPILERENVIRONMENT_REPORTER_ID; +     ADD_FUNCTION("report", f_reporter_report,    tFuncV(tName("SeverityLevel", tInt03) tStr tIntPos    tStr tStr, tMix, tVoid),0);       /* enum SeverityLevel { NOTICE, WARNING, ERROR, FATAL } */    SET_SVAL(type_value, PIKE_T_TYPE, 0, type,    CONSTTYPE(tName("SeverityLevel", tInt03)));    simple_add_constant("SeverityLevel", &type_value, 0);    free_svalue(&type_value);   
pike.git/src/pike_compiler.cmod:2801:    add_integer_constant("ERROR", REPORT_ERROR, 0);    add_integer_constant("FATAL", REPORT_FATAL, 0);       reporter_program = end_program();    }    add_global_program("Reporter", reporter_program);       low_inherit(reporter_program, NULL, -1, 0, 0, 0);       start_new_program(); +  Pike_compiler->new_program->id = PROG_COMPILERENVIRONMENT_LOCK_ID;    Pike_compiler->new_program->event_handler =    compiler_environment_lock_event_handler;    Pike_compiler->new_program->flags |= PROGRAM_DESTRUCT_IMMEDIATE;    end_class("lock", 0);       init_cpp_compilerenv_classes();       compilation_env_program = end_program();       add_global_program("CompilerEnvironment", compilation_env_program);