Added option to indicate that whole program is offered

This commit is contained in:
ceriel 1988-06-16 09:41:51 +00:00
parent ec551e2f36
commit dea600f9bf
3 changed files with 11 additions and 3 deletions

View 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;
}
}

View file

@ -88,6 +88,7 @@ struct calcnt {
extern int complete_program;
extern int calnr;
extern calcnt_p cchead; /* calcnt info of current proc */

View 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);