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"
|
#include "../share/go.h"
|
||||||
|
|
||||||
int calnr;
|
int calnr;
|
||||||
|
int complete_program;
|
||||||
calcnt_p cchead; /* call-count info of current proc */
|
calcnt_p cchead; /* call-count info of current proc */
|
||||||
STATIC short space = 0;
|
STATIC short space = 0;
|
||||||
|
|
||||||
|
@ -277,10 +278,15 @@ Sdiagnostics()
|
||||||
il_flags(p)
|
il_flags(p)
|
||||||
char *p;
|
char *p;
|
||||||
{
|
{
|
||||||
if (*p++ == 's') {
|
switch(*p++) {
|
||||||
|
case 's':
|
||||||
while (*p != '\0') {
|
while (*p != '\0') {
|
||||||
space = 10*space +*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 int calnr;
|
||||||
extern calcnt_p cchead; /* calcnt info of current proc */
|
extern calcnt_p cchead; /* calcnt info of current proc */
|
||||||
|
|
||||||
|
|
|
@ -323,7 +323,7 @@ STATIC bool is_dispensable(callee,ccf)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((--callee->P_NRCALLED) == 0 &&
|
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) {
|
(callee->p_flags1 & PF_LPI) == 0) {
|
||||||
DISPENSABLE(callee);
|
DISPENSABLE(callee);
|
||||||
OUTTRACE("procedure %d can be removed",callee->p_id);
|
OUTTRACE("procedure %d can be removed",callee->p_id);
|
||||||
|
@ -466,7 +466,8 @@ STATIC singles(cals)
|
||||||
} else {
|
} else {
|
||||||
if (c->cl_proc->P_NRCALLED == 1 &&
|
if (c->cl_proc->P_NRCALLED == 1 &&
|
||||||
!IS_CHANGED(c->cl_proc) &&
|
!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_flags1 & PF_LPI) == 0) {
|
||||||
c->cl_proc->P_NRCALLED = 0;
|
c->cl_proc->P_NRCALLED = 0;
|
||||||
SELECTED(c);
|
SELECTED(c);
|
||||||
|
|
Loading…
Reference in a new issue