From: ceriel Date: Thu, 9 Feb 1989 10:18:48 +0000 (+0000) Subject: The s option now gives a percentage of the size of the input X-Git-Tag: release-5-5~2601 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6fc4ca1ae03caf783451693757e60eb5c8b6cbf2;p=ack.git The s option now gives a percentage of the size of the input --- diff --git a/util/ego/il/Makefile b/util/ego/il/Makefile index f636f5e5e..d36441976 100644 --- a/util/ego/il/Makefile +++ b/util/ego/il/Makefile @@ -7,7 +7,7 @@ SHR=../share LDFLAGS=-i CPPFLAGS=-DVERBOSE -DNOTCOMPACT CFLAGS=$(CPPFLAGS) -O -LINTFLAGS=-phbac +LINTFLAGS=-hbac CFILES=\ il.c il1_anal.c il1_cal.c il1_formal.c il1_aux.c il2_aux.c \ diff --git a/util/ego/il/il.c b/util/ego/il/il.c index cd6e42b38..72188dec6 100644 --- a/util/ego/il/il.c +++ b/util/ego/il/il.c @@ -26,7 +26,8 @@ int calnr; int complete_program; calcnt_p cchead; /* call-count info of current proc */ -STATIC short space = 0; +STATIC long space = 0; +STATIC long total_size = 0; STATIC char cname[] = "/usr/tmp/ego.i1.XXXXXX"; STATIC char ccname[] = "/usr/tmp/ego.i2.XXXXXX"; @@ -87,6 +88,7 @@ pass1(lnam,bnam,cnam) /* address of em text in em-file */ /* address of graph in basic block file */ curproc->P_SIZE = proclength(curproc); /* #instructions */ + total_size += curproc->P_SIZE; if (BIG_PROC(curproc)) { /* curproc is too large to be expanded in line */ UNSUITABLE(curproc); @@ -120,7 +122,7 @@ STATIC char cname2[] = "/usr/tmp/ego.i4.XXXXXX"; pass2(cnam,space) char *cnam; - short space; + long space; { FILE *cf, *cf2, *ccf; call_p c,a; @@ -283,6 +285,7 @@ il_flags(p) while (*p != '\0') { space = 10*space +*p++ -'0'; } + space = total_size * space / 100 ; break; case 'a': complete_program = 1; diff --git a/util/ego/il/il1_aux.c b/util/ego/il/il1_aux.c index c9e4426b2..1d9307cd6 100644 --- a/util/ego/il/il1_aux.c +++ b/util/ego/il/il1_aux.c @@ -164,12 +164,12 @@ short looplevel(b) -short proclength(p) +int proclength(p) proc_p p; { /* count the number of EM instructions of p */ - register short cnt; + register int cnt; register bblock_p b; register line_p l; diff --git a/util/ego/il/il1_aux.h b/util/ego/il/il1_aux.h index caa47fb33..f98039396 100644 --- a/util/ego/il/il1_aux.h +++ b/util/ego/il/il1_aux.h @@ -30,7 +30,7 @@ extern bool par_overlap(); /* (offset off1, int t1, offset off2, int t2) extern short looplevel(); /* (bblock_p b) * Determine the loop nesting level of b. */ -extern short proclength(); /* (proc_p p) +extern int proclength(); /* (proc_p p) * Determine the number of EM instructions * in p. Do not count pseudos. */ diff --git a/util/ego/il/il2_aux.c b/util/ego/il/il2_aux.c index 25a7a4502..b4573c0cd 100644 --- a/util/ego/il/il2_aux.c +++ b/util/ego/il/il2_aux.c @@ -410,7 +410,7 @@ STATIC selected(a) STATIC compare(x,best,space) call_p x, *best; - short space; + long space; { /* See if x is better than the current best choice */ @@ -428,7 +428,7 @@ STATIC compare(x,best,space) STATIC call_p best_one(list,space) call_p list; - short space; + long space; { /* Find the best candidate of the list * that has not already been selected. The @@ -438,7 +438,7 @@ STATIC call_p best_one(list,space) */ call_p best = (call_p) 0; - call_p x,c; + call_p c; for (c = list; c != (call_p) 0; c = c->cl_cdr) { if (IS_SELECTED(c)) { @@ -510,7 +510,7 @@ STATIC single_calls(proclist) select_calls(proclist,ccf,space) proc_p proclist; FILE *ccf; - short space ; + long space ; { /* Select all calls that are to be expanded in line. */ @@ -699,7 +699,7 @@ append_abstract(a,p) Sstatist(list,space) call_p list; - short space; + long space; { call_p c; @@ -718,7 +718,7 @@ Sstatist(list,space) Sstat(proclist,space) proc_p proclist; - short space; + long space; { proc_p p; diff --git a/util/ego/il/il_aux.c b/util/ego/il/il_aux.c index 227524544..b619191d3 100644 --- a/util/ego/il/il_aux.c +++ b/util/ego/il/il_aux.c @@ -156,7 +156,6 @@ remunit(kind,p,l) register bblock_p b; bblock_p next; Lindex pi; - loop_p lp; if (kind == LDATA) { remlines(l);