From: Peep P. <so...@us...> - 2004-03-15 18:56:14
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2745 Modified Files: compile.c Log Message: Some tinkering around. Index: compile.c =================================================================== RCS file: /cvsroot/agd/server/src/compile.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** compile.c 12 Mar 2004 16:03:10 -0000 1.11 --- compile.c 15 Mar 2004 18:46:59 -0000 1.12 *************** *** 59,63 **** #ifdef DEBUG ! debug("define_id", "%s base_scope %d\n", idp->name, idp->base_scope); #endif --- 59,63 ---- #ifdef DEBUG ! debug("define_id", "%s base_scope %d index %d\n", idp->name, idp->base_scope, idp->index); #endif *************** *** 94,98 **** { def_id_t *id = p; ! xfree(id->name); if(id->args) xfree(id->args); --- 94,98 ---- { def_id_t *id = p; ! /* xfree(id->name);*/ if(id->args) xfree(id->args); *************** *** 282,288 **** curr_f->code = *code; curr_f->lineno = lineno; ! array_push(&cob->prog->functions, curr_f); ! /* This removes the need to generate a fun_table. */ ! array_push(&cob->prog->fun_table, idp->name); curr_f = NULL; } --- 282,302 ---- curr_f->code = *code; curr_f->lineno = lineno; ! #if 0 ! if(idp->index == cob->prog->functions.length) { ! #endif ! array_push(&cob->prog->functions, curr_f); ! /* This removes the need to generate a fun_table. */ ! array_push(&cob->prog->fun_table, idp->name); ! #if 0 ! } else { /* index > length */ ! cob->prog->functions.length = idp->index + 1; ! alloc_array(&cob->prog->functions); ! cob->prog->functions.data[idp->index] = curr_f; ! ! cob->prog->fun_table.length = idp->index + 1; ! alloc_array(&cob->prog->fun_table); ! cob->prog->fun_table.data[idp->index] = idp->name; ! } ! #endif curr_f = NULL; } *************** *** 332,336 **** init_var(var); if(type == ID_GVAR) { ! array_push(&cob->prog->variables, var); } else /* LVAR */{ switch(var->type) { --- 346,350 ---- init_var(var); if(type == ID_GVAR) { ! array_push(&cob/*->prog*/->variables, var); } else /* LVAR */{ switch(var->type) { *************** *** 500,504 **** init_array(&cob->prog->functions); init_array(&cob->prog->fun_table); ! init_array(&cob->prog->variables); numlvars = numgvars = 0; --- 514,518 ---- init_array(&cob->prog->functions); init_array(&cob->prog->fun_table); ! init_array(&cob/*->prog*/->variables); numlvars = numgvars = 0; *************** *** 626,629 **** --- 640,644 ---- /*nametable_sort(&cob->prog->nametable);*/ + ref_prog(ob->prog); list_push(&all_objects, ob); |