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 \
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";
/* 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);
pass2(cnam,space)
char *cnam;
- short space;
+ long space;
{
FILE *cf, *cf2, *ccf;
call_p c,a;
while (*p != '\0') {
space = 10*space +*p++ -'0';
}
+ space = total_size * space / 100 ;
break;
case 'a':
complete_program = 1;
-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;
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.
*/
STATIC compare(x,best,space)
call_p x, *best;
- short space;
+ long space;
{
/* See if x is better than the current best choice */
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
*/
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)) {
select_calls(proclist,ccf,space)
proc_p proclist;
FILE *ccf;
- short space ;
+ long space ;
{
/* Select all calls that are to be expanded in line. */
Sstatist(list,space)
call_p list;
- short space;
+ long space;
{
call_p c;
Sstat(proclist,space)
proc_p proclist;
- short space;
+ long space;
{
proc_p p;
register bblock_p b;
bblock_p next;
Lindex pi;
- loop_p lp;
if (kind == LDATA) {
remlines(l);