From 469d075e77fff84d03de8fb1368fdc153663d3af Mon Sep 17 00:00:00 2001 From: bal Date: Wed, 20 Feb 1985 15:01:02 +0000 Subject: [PATCH] Calls of which the actual and formal parameters do not match are no longer substituted inline. --- util/ego/il/il.c | 3 +-- util/ego/il/il2_aux.c | 8 +++++--- util/ego/il/il2_aux.h | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/util/ego/il/il.c b/util/ego/il/il.c index 0a5ab629b..13ab88ade 100644 --- a/util/ego/il/il.c +++ b/util/ego/il/il.c @@ -124,9 +124,8 @@ pass2(cnam,space) ccf = openfile(ccname,"r"); while ((c = getcall(cf)) != (call_p) 0) { /* process all calls */ - if (SUITABLE(c->cl_proc)) { + if (SUITABLE(c->cl_proc) && anal_params(c)) { /* called proc. may be put in line */ - anal_params(c); /* see which parameters may be put in line */ assign_ratio(c); /* assign a rank */ a = abstract(c); /* abstract essential info */ diff --git a/util/ego/il/il2_aux.c b/util/ego/il/il2_aux.c index 0d393c747..1a82a0aea 100644 --- a/util/ego/il/il2_aux.c +++ b/util/ego/il/il2_aux.c @@ -131,7 +131,7 @@ STATIC bool too_expensive(fm,act) return (OFTEN_USED(fm) && !is_simple(act->ac_exp)); } -anal_params(c) +bool anal_params(c) call_p c; { /* Determine which of the actual parameters of a @@ -144,12 +144,13 @@ anal_params(c) int inlpars = 0; p = c->cl_proc; /* the called procedure */ - if (!INLINE_PARS(p) || !match_pars(p->P_FORMALS, c->cl_actuals)) { + if (!match_pars(p->P_FORMALS, c->cl_actuals)) return FALSE; + if (!INLINE_PARS(p)) { for (act = c->cl_actuals; act != (actual_p) 0; act = act->ac_next) { NOT_INLINE(act); } - return; /* "# of inline pars." field in cl_flags remains 0 */ + return TRUE; /* "# of inline pars." field in cl_flags remains 0 */ } for (act = c->cl_actuals, form = p->P_FORMALS; act != (actual_p) 0; act = act->ac_next, form = form->f_next) { @@ -163,6 +164,7 @@ anal_params(c) } if (inlpars > 15) inlpars = 15; /* We've only got 4 bits! */ c->cl_flags |= inlpars; /* number of inline parameters */ + return TRUE; } diff --git a/util/ego/il/il2_aux.h b/util/ego/il/il2_aux.h index 8ef35527c..73bded6dc 100644 --- a/util/ego/il/il2_aux.h +++ b/util/ego/il/il2_aux.h @@ -1,6 +1,8 @@ -extern anal_params(); /* (call_p c) +extern bool anal_params(); /* (call_p c) * See which parameters of the call * may be expanded in line. + * If the formals and actuals do not + * match, return FALSE */ extern assign_ratio(); /* (call_p c) * Assigna ratio number to the call, -- 2.34.1