code was added to generate DO_RREMOVE

This commit is contained in:
sater 1985-01-11 09:41:47 +00:00
parent 3534869cb5
commit 3a528a7324

View file

@ -631,6 +631,8 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
int vil; int vil;
int cocono= -1; int cocono= -1;
cost_t totcost; cost_t totcost;
int nremoves;
int removelist[100];
static char tlab[] = "0:"; static char tlab[] = "0:";
extern int optexact,optstack,startline; extern int optexact,optstack,startline;
extern char *filename; extern char *filename;
@ -690,6 +692,23 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
codenl(); codenl();
} }
} }
nremoves=0;
for(vp=generates;vp!=0;vp=vp->vi_next) {
if (vp->vi_int[0] != INSREMOVE)
continue;
for(i=0;i<nremoves;i++)
if (vp->vi_int[1]==removelist[i])
break;
if (i==nremoves) {
assert(nremoves<(sizeof(removelist)/sizeof(int)));
removelist[nremoves++] = vp->vi_int[1];
}
}
for(i=0;i<nremoves;i++) {
code8(DO_RREMOVE);
codeint(removelist[i]);
codenl();
}
/* allocate part */ /* allocate part */
deal=0;al=0; deal=0;al=0;
for (vp=allocates;vp!=0;vp=vp->vi_next) { for (vp=allocates;vp!=0;vp=vp->vi_next) {
@ -740,6 +759,8 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
totcost.ct_space += instp->i_cost.ct_space; totcost.ct_space += instp->i_cost.ct_space;
totcost.ct_time += instp->i_cost.ct_time ; totcost.ct_time += instp->i_cost.ct_time ;
break; break;
case INSREMOVE:
break;
case INSMOVE: case INSMOVE:
codecoco(cocono); codecoco(cocono);
code8(DO_MOVE); code8(DO_MOVE);