From: ceriel Date: Thu, 26 Oct 1989 15:41:38 +0000 (+0000) Subject: Added a command to kill a register X-Git-Tag: release-5-5~2139 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=74546bd9854d993cb111a5329648609e26331cea;p=ack.git Added a command to kill a register --- diff --git a/h/cgg_cg.h b/h/cgg_cg.h index 266d88b30..c6717da3a 100644 --- a/h/cgg_cg.h +++ b/h/cgg_cg.h @@ -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 diff --git a/mach/proto/ncg/codegen.c b/mach/proto/ncg/codegen.c index 06c7e69e7..806faeb71 100644 --- a/mach/proto/ncg/codegen.c +++ b/mach/proto/ncg/codegen.c @@ -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) diff --git a/util/ncgg/output.c b/util/ncgg/output.c index 560c4bb46..a49e3b535 100644 --- a/util/ncgg/output.c +++ b/util/ncgg/output.c @@ -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();