Added a command to kill a register
authorceriel <none@none>
Thu, 26 Oct 1989 15:41:38 +0000 (15:41 +0000)
committerceriel <none@none>
Thu, 26 Oct 1989 15:41:38 +0000 (15:41 +0000)
h/cgg_cg.h
mach/proto/ncg/codegen.c
util/ncgg/output.c

index 266d88b..c6717da 100644 (file)
@@ -37,6 +37,7 @@
 #define DO_DLINE       21
 #define DO_SETCC       22
 #define DO_TOSTACK     23
+#define DO_KILLREG     24
 
 #ifndef MAXATT
 #define MAXATT TOKENSIZE
index 06c7e69..806faeb 100644 (file)
@@ -482,12 +482,14 @@ normalfailed:     if (stackpad!=tokpatlen) {
                        rp->r_contents.t_token=0;
        break;
     }
+    case DO_KILLREG:
     case DO_RREMOVE: { /* register remove */
        register i;
        int nodeno;
        token_p tp;
        tkdef_p tdp;
        result_t result;
+       int dokill = (codep[-1] & 037) == DO_KILLREG;
 
        DEBUG("RREMOVE");
        getint(nodeno,codep);
@@ -495,6 +497,7 @@ normalfailed:       if (stackpad!=tokpatlen) {
        if (result.e_typ!=EV_REG)
                break;
        if ( in_stack(result.e_v.e_reg) ) BROKE() ; /* Check aside-stack */
+       if (dokill) machregs[result.e_v.e_reg].r_contents.t_token = 0;
        for (tp= &fakestack[stackheight-tokpatlen-1];tp>=&fakestack[0];tp--)
                if (tp->t_token==-1) {
                        if(tp->t_att[0].ar==result.e_v.e_reg)
index 560c4bb..a49e3b5 100644 (file)
@@ -716,7 +716,7 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
                        code53(DO_REMOVE,0);
                        codeint(vp->vi_int[0]);
                } else {
-                       code8(DO_RREMOVE);
+                       code8(DO_KILLREG);
                        codeint(-vp->vi_int[0] - 1);
                }
                codenl();