From 5badcb4296364e06c6fdc5add5d29a65587f1607 Mon Sep 17 00:00:00 2001 From: eck Date: Tue, 4 Sep 1990 17:16:00 +0000 Subject: [PATCH] changed stackheight computation to top element size computation --- mach/proto/ncg/codegen.c | 2 +- mach/proto/ncg/compute.c | 15 +++++++-------- mach/proto/ncg/fillem.c | 18 +++++++++--------- mach/proto/ncg/gencode.c | 4 ++-- mach/proto/ncg/label.c | 13 ++++++------- mach/proto/ncg/nextem.c | 2 +- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/mach/proto/ncg/codegen.c b/mach/proto/ncg/codegen.c index cac27869f..ff02718f6 100644 --- a/mach/proto/ncg/codegen.c +++ b/mach/proto/ncg/codegen.c @@ -858,7 +858,7 @@ normalfailed: if (stackpad!=tokpatlen) { level--; #endif return(totalcost); -#ifdef USE_SHC +#ifdef USE_TES case DO_LABDEF: { int index; diff --git a/mach/proto/ncg/compute.c b/mach/proto/ncg/compute.c index eea29221d..e6c6de530 100644 --- a/mach/proto/ncg/compute.c +++ b/mach/proto/ncg/compute.c @@ -11,8 +11,7 @@ static char rcsid[] = "$Header$"; #include "result.h" #include "glosym.h" #include "extern.h" -#ifdef USE_SHC -#include +#ifdef USE_TES #include "label.h" #endif @@ -76,8 +75,8 @@ char opdesc[] = { LLDEF|RLDEF, /* EX_XOR */ LLDEF|RLDEF, /* EX_AND */ 0, /* EX_ISROM */ -#ifdef USE_SHC - 0, /* EX_STACKHEIGHT */ +#ifdef USE_TES + 0, /* EX_TOPELTSIZE */ 0, /* EX_FALLTHROUGH */ #endif }; @@ -384,12 +383,12 @@ result_t compute(node) register node_p node; { assert(leaf1.e_typ == EV_INT); result.e_v.e_con = -leaf1.e_v.e_con; return(result); -#ifdef USE_SHC - case EX_STACKHEIGHT: /* Hans, new */ +#ifdef USE_TES + case EX_TOPELTSIZE: /* Hans, new */ { register label_p lbl; lbl = get_label(saveemp[node->ex_lnode].em_u.em_ioper); - if (lbl != NULL) { + if (lbl != (label_p)0) { result.e_v.e_con = lbl->lb_height; } else { result.e_v.e_con = 0; @@ -400,7 +399,7 @@ result_t compute(node) register node_p node; { { register label_p lbl; lbl = get_label(saveemp[node->ex_lnode].em_u.em_ioper); - if (lbl != NULL) { + if (lbl != (label_p)0) { result.e_v.e_con = lbl->lb_fallthrough; } else result.e_v.e_con = 0; return(result); diff --git a/mach/proto/ncg/fillem.c b/mach/proto/ncg/fillem.c index 98ba4107c..5fb1d393a 100644 --- a/mach/proto/ncg/fillem.c +++ b/mach/proto/ncg/fillem.c @@ -128,7 +128,7 @@ fillemlines() { error("unknown instruction byte"); case sp_ilb1: case sp_ilb2: -#ifdef USE_SHC +#ifdef USE_TES lp->em_instr = op_lab; lp->em_optyp = OPSYMBOL; lp->em_soper = strarg(t); @@ -177,7 +177,7 @@ fillemlines() { continue; case PAR_B: t = sp_ilb2; -#ifdef USE_SHC +#ifdef USE_TES lp->em_optyp = OPSYMBOL; lp->em_u.em_loper = argval; lp->em_soper = strarg(t); @@ -214,7 +214,7 @@ dopseudo() { error("No table entry for %d",emlines[0].em_instr); nextispseu=0; switch(savetab1) { -#ifndef USE_SHC +#ifndef USE_TES case sp_ilb1: case sp_ilb2: swtxt(); @@ -311,15 +311,15 @@ dopseudo() { fatal("bad pointer size"); if ( getarg(any_ptyp)!=sp_cend ) fatal("too many parameters"); -#ifdef USE_SHC - } else if (argval == ms_sth) { - int lbl, height, flthr; +#ifdef USE_TES + } else if (argval == ms_tes) { + int lbl, size, flthr; getarg(ptyp(sp_cst2)); lbl = argval; - getarg(ptyp(sp_cst2)); height = argval; + getarg(ptyp(sp_cst2)); size = argval; getarg(ptyp(sp_cst2)); flthr = argval; if ( getarg(any_ptyp)!=sp_cend ) fatal("too many parameters"); - add_label(lbl,height, flthr); + add_label(lbl,size, flthr); #endif #ifdef REGVARS } else if (argval == ms_gto) { @@ -390,7 +390,7 @@ dopseudo() { break; case ps_end: getarg(cst_ptyp | ptyp(sp_cend)); -#ifdef USE_SHC +#ifdef USE_TES kill_labels(); #endif cleanregs(); diff --git a/mach/proto/ncg/gencode.c b/mach/proto/ncg/gencode.c index 270ee1837..aba4bc9f5 100644 --- a/mach/proto/ncg/gencode.c +++ b/mach/proto/ncg/gencode.c @@ -11,7 +11,7 @@ static char rcsid[] = "$Header$"; #include "data.h" #include "result.h" #include "extern.h" -#ifdef USE_SHC +#ifdef USE_TES #include "mach.h" #endif @@ -143,7 +143,7 @@ prtoken(tp,leadingchar) token_p tp; { } } -#ifdef USE_SHC +#ifdef USE_TES printlabel(labnum) int labnum; { diff --git a/mach/proto/ncg/label.c b/mach/proto/ncg/label.c index 7a0c21f3e..9c8c9726f 100644 --- a/mach/proto/ncg/label.c +++ b/mach/proto/ncg/label.c @@ -1,16 +1,15 @@ #include "tables.h" -#ifdef USE_SHC -#include +#ifdef USE_TES #include "types.h" #include "param.h" #include "label.h" -static label_p label_list = NULL; +static label_p label_list = (label_p)0; extern char *myalloc(); add_label(num, height, flth) { - register label_p lbl = NULL; + register label_p lbl = (label_p)0; if (height <= 0) return; if (flth != TRUE && flth != FALSE) @@ -29,18 +28,18 @@ register word num; { register label_p tmp = label_list; - while (tmp != NULL) { + while (tmp != (label_p)0) { if (tmp->lb_number == num) return tmp; tmp = tmp->lb_next; } - return NULL; + return (label_p)0; } kill_labels() { label_p tmp; - while((tmp = label_list) != NULL) { + while((tmp = label_list) != (label_p)0) { label_list = label_list->lb_next; myfree((char *)tmp); } diff --git a/mach/proto/ncg/nextem.c b/mach/proto/ncg/nextem.c index 0603a1db7..b9adcfc87 100644 --- a/mach/proto/ncg/nextem.c +++ b/mach/proto/ncg/nextem.c @@ -64,7 +64,7 @@ byte *trypat(bp,len) register byte *bp; { if (Debug) { fprintf(stderr,"Matched:"); for (i=0;i