From a726f7d49eefa0b97476bada056dfcd9c9082811 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 14 Jan 1988 10:52:36 +0000 Subject: [PATCH] adapted to use new em_code module, and a minor fix --- modules/src/em_opt/main.c | 18 +++++++++++++++--- modules/src/em_opt/nopt.c | 6 +++--- modules/src/em_opt/outcalls.c | 8 ++++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/modules/src/em_opt/main.c b/modules/src/em_opt/main.c index a3f74823b..3c9a41c2d 100644 --- a/modules/src/em_opt/main.c +++ b/modules/src/em_opt/main.c @@ -15,6 +15,9 @@ static char rcsid1[] = "$Header$"; char *filename; /* Name of input file */ int errors; /* Number of errors */ +extern arith C_bsssize, C_holsize; +extern int C_bssinit, C_holinit; + main(argc,argv) char **argv; { @@ -37,7 +40,7 @@ main(argc,argv) } else if (!O_open( (char *) 0)) fatal("O_open failed"); O_magic(); - EM_mkcalls(p); + C_out(p); for(;;) { EM_getinstr(p=GETNXTPATT()); @@ -66,14 +69,23 @@ main(argc,argv) case ps_pro: case ps_end: break; + case ps_hol: + C_holsize = EM_holsize; + C_holinit = EM_holinit; + C_out(p); + OO_nxtpatt--; + continue; + case ps_bss: + C_bsssize = EM_bsssize; + C_bssinit = EM_bssinit; default: - EM_mkcalls(p); + C_out(p); OO_nxtpatt--; continue; } break; default: - EM_mkcalls(p); + C_out(p); OO_nxtpatt--; continue; case EM_EOF: diff --git a/modules/src/em_opt/nopt.c b/modules/src/em_opt/nopt.c index 90b5d0e71..55f31a1ba 100644 --- a/modules/src/em_opt/nopt.c +++ b/modules/src/em_opt/nopt.c @@ -159,9 +159,9 @@ OO_flush() register int i,n; printstate("Flush"); for(p=OO_buffer;pem_opcode!=OTHER) - EM_mkcalls(p); + C_out(p); if(OO_endbackup) { n = OO_endbackup-OO_nxtpatt; BTSCPY(p,q,i,OO_buffer,OO_nxtpatt,n); @@ -186,7 +186,7 @@ OO_halfflush() printstate("Half flush"); n = MAXBUFFER / 2; for(p=OO_buffer,i=n;i--;) - EM_mkcalls(p++); + C_out(p++); /* now copy the rest of buffer and pattern back */ BTSCPY(p,q,i,OO_buffer,OO_buffer+n,n+(OO_nxtpatt-OO_buffer)); OO_patternqueue -= n; diff --git a/modules/src/em_opt/outcalls.c b/modules/src/em_opt/outcalls.c index 29a7f4b9c..163cfaf42 100644 --- a/modules/src/em_opt/outcalls.c +++ b/modules/src/em_opt/outcalls.c @@ -34,7 +34,7 @@ outputincalls() } /* fall thru */ case CST: - fprintf(ofile,"%s\t| int:n\t|\n",s); + fprintf(ofile,"%s\t| arith:n\t|\n",s); if(op->id_used) { fprintf(ofile,"\tEM_mkcst(GETNXTPATT(),op_%s,n);\n",s); fprintf(ofile,"\tOO_dfa(op_%s);\n",s); @@ -78,7 +78,7 @@ outputincalls() } break; case EXT: - fprintf(ofile,"%s\t| int:n\t|\n",s); + fprintf(ofile,"%s\t| arith:n\t|\n",s); if(op->id_used) { fprintf(ofile,"\tEM_mkcst(GETNXTPATT(),op_%s,n);\n",s); fprintf(ofile,"\tOO_dfa(op_%s);\n",s); @@ -87,7 +87,7 @@ outputincalls() fprintf(ofile,"\tFLUSHDFA();\n"); fprintf(ofile,"\tC_%s(n);\n",s); } - fprintf(ofile,"%s_dnam\t| char *:s int:n\t|\n",s); + fprintf(ofile,"%s_dnam\t| char *:s arith:n\t|\n",s); if(op->id_used) { fprintf(ofile,"\tEM_mksof(GETNXTPATT(),op_%s,s,n);\n",s); fprintf(ofile,"\tOO_dfa(op_%s);\n",s); @@ -96,7 +96,7 @@ outputincalls() fprintf(ofile,"\tFLUSHDFA();\n"); fprintf(ofile,"\tC_%s_dnam(s,n);\n",s); } - fprintf(ofile,"%s_dlb\t| label:l int:n\t|\n",s); + fprintf(ofile,"%s_dlb\t| label:l arith:n\t|\n",s); if(op->id_used) { fprintf(ofile,"\tEM_mknof(GETNXTPATT(),op_%s,l,n);\n",s); fprintf(ofile,"\tOO_dfa(op_%s);\n",s);