Added option to indicate that whole program is offered
This commit is contained in:
parent
ec551e2f36
commit
dea600f9bf
3 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ struct calcnt {
|
|||
|
||||
|
||||
|
||||
extern int complete_program;
|
||||
extern int calnr;
|
||||
extern calcnt_p cchead; /* calcnt info of current proc */
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue