code was added to generate DO_RREMOVE
authorsater <none@none>
Fri, 11 Jan 1985 09:41:47 +0000 (09:41 +0000)
committersater <none@none>
Fri, 11 Jan 1985 09:41:47 +0000 (09:41 +0000)
util/ncgg/output.c

index 7dbf5f3..48ba951 100644 (file)
@@ -631,6 +631,8 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
        int vil;
        int cocono= -1;
        cost_t totcost;
+       int nremoves;
+       int removelist[100];
        static char tlab[] = "0:";
        extern int optexact,optstack,startline;
        extern char *filename;
@@ -690,6 +692,23 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
                        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 */
        deal=0;al=0;
        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_time  += instp->i_cost.ct_time ;
                        break;
+               case INSREMOVE:
+                       break;
                case INSMOVE:
                        codecoco(cocono);
                        code8(DO_MOVE);