fix: IL sometimes removed procedures that could be called indirectly

This commit is contained in:
ceriel 1990-05-30 11:31:32 +00:00
parent ab0d3bf876
commit 82b0ef795d

View file

@ -115,6 +115,26 @@ STATIC short kind(lnp)
} }
STATIC line_p doread_line(p_out)
proc_p *p_out;
{
/* read a line, and check pseudos for procedure addresses */
register line_p lnp = read_line(p_out);
if (lnp && TYPE(lnp) == OPLIST && INSTR(lnp) != ps_mes) {
register arg_p arg = ARG(lnp);
while (arg) {
if (arg->a_type == ARGPROC) {
Cadd(arg->a_a.a_proc->p_id, &lpi_set);
arg->a_a.a_proc->p_flags1 |= PF_LPI;
}
arg = arg->a_next;
}
}
return lnp;
}
STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out) STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out)
FILE *fp; FILE *fp;
@ -149,7 +169,7 @@ STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out)
/* The lbmap table contains for each /* The lbmap table contains for each
* label_id the basic block of that label. * label_id the basic block of that label.
*/ */
lnp = read_line(&curproc); lnp = doread_line(&curproc);
state = kind(lnp); state = kind(lnp);
if (state != END) { if (state != END) {
*lp = lnp; *lp = lnp;
@ -157,7 +177,7 @@ STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out)
} }
break; break;
case NORMAL: case NORMAL:
lnp = read_line(&curproc); lnp = doread_line(&curproc);
if ( (state = kind(lnp)) == LABEL) { if ( (state = kind(lnp)) == LABEL) {
/* If we come accross a label /* If we come accross a label
* here, it must be the beginning * here, it must be the beginning
@ -172,7 +192,7 @@ STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out)
} }
break; break;
case JUMP: case JUMP:
lnp = read_line(&curproc); lnp = doread_line(&curproc);
/* fall through ... */ /* fall through ... */
case AFTERPRO: case AFTERPRO:
switch(state = kind(lnp)) { switch(state = kind(lnp)) {
@ -201,7 +221,7 @@ STATIC bool getbblocks(fp,kind_out,n_out,g_out,l_out)
} }
return TRUE; return TRUE;
case INIT: case INIT:
lnp = read_line(&curproc); lnp = doread_line(&curproc);
if (feof(curinp)) return FALSE; if (feof(curinp)) return FALSE;
if (INSTR(lnp) == ps_pro) { if (INSTR(lnp) == ps_pro) {
state = AFTERPRO; state = AFTERPRO;