Calls of which the actual and formal parameters do not match
authorbal <none@none>
Wed, 20 Feb 1985 15:01:02 +0000 (15:01 +0000)
committerbal <none@none>
Wed, 20 Feb 1985 15:01:02 +0000 (15:01 +0000)
are no longer substituted inline.

util/ego/il/il.c
util/ego/il/il2_aux.c
util/ego/il/il2_aux.h

index 0a5ab62..13ab88a 100644 (file)
@@ -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 */
index 0d393c7..1a82a0a 100644 (file)
@@ -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;
 }
 
 
index 8ef3552..73bded6 100644 (file)
@@ -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,