The s option now gives a percentage of the size of the input
authorceriel <none@none>
Thu, 9 Feb 1989 10:18:48 +0000 (10:18 +0000)
committerceriel <none@none>
Thu, 9 Feb 1989 10:18:48 +0000 (10:18 +0000)
util/ego/il/Makefile
util/ego/il/il.c
util/ego/il/il1_aux.c
util/ego/il/il1_aux.h
util/ego/il/il2_aux.c
util/ego/il/il_aux.c

index f636f5e..d364419 100644 (file)
@@ -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 \
index cd6e42b..72188de 100644 (file)
@@ -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;
index c9e4426..1d9307c 100644 (file)
@@ -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;
 
index caa47fb..f980393 100644 (file)
@@ -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.
                                 */
index 25a7a45..b4573c0 100644 (file)
@@ -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;
 
index 2275245..b619191 100644 (file)
@@ -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);