Added option to indicate that whole program is offered
authorceriel <none@none>
Thu, 16 Jun 1988 09:41:51 +0000 (09:41 +0000)
committerceriel <none@none>
Thu, 16 Jun 1988 09:41:51 +0000 (09:41 +0000)
util/ego/il/il.c
util/ego/il/il.h
util/ego/il/il2_aux.c

index 4d0ddd1..cd6e42b 100644 (file)
@@ -24,6 +24,7 @@
 #include "../share/go.h"
 
 int calnr;
+int complete_program;
 calcnt_p cchead;       /* call-count info of current proc */
 STATIC short space = 0;
 
@@ -277,10 +278,15 @@ Sdiagnostics()
 il_flags(p)
        char *p;
 {
-       if (*p++ == 's') {
+       switch(*p++) {
+       case 's':
                while (*p != '\0') {
                        space = 10*space +*p++ -'0';
                }
+               break;
+       case 'a':
+               complete_program = 1;
+               break;
        }
 }
 
index 083848d..95da6df 100644 (file)
@@ -88,6 +88,7 @@ struct calcnt {
 
 
 
+extern int complete_program;
 extern int calnr;
 extern calcnt_p cchead;                /* calcnt info of current proc */
 
index 0fbec72..8245521 100644 (file)
@@ -323,7 +323,7 @@ STATIC bool is_dispensable(callee,ccf)
         */
 
        if ((--callee->P_NRCALLED) == 0 &&
-           (callee->p_flags1 & PF_EXTERNAL) == 0 &&
+           (complete_program || (callee->p_flags1 & PF_EXTERNAL) == 0) &&
            (callee->p_flags1 & PF_LPI) == 0) {
                DISPENSABLE(callee);
                OUTTRACE("procedure %d can be removed",callee->p_id);
@@ -466,7 +466,8 @@ STATIC singles(cals)
                } else {
                        if (c->cl_proc->P_NRCALLED == 1 &&
                            !IS_CHANGED(c->cl_proc) &&
-                           (c->cl_proc->p_flags1 & PF_EXTERNAL) == 0 &&
+                           (complete_program || 
+                             (c->cl_proc->p_flags1 & PF_EXTERNAL) == 0) &&
                            (c->cl_proc->p_flags1 & PF_LPI) == 0) {
                                c->cl_proc->P_NRCALLED = 0;
                                SELECTED(c);