[m-dev.] [reuse] diff: fix problem in profile grades

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Mar 10 02:00:08 AEDT 2001


On 09-Mar-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> Branches: reuse
> 
> This change avoids generating MR_init_entry() calls for procedures which
> don't have a body.

Why?

One of the main reasons that procedures which don't have a body are
in the MLDS at all is so that we can call MR_init_entry() for them.
If you think that is wrong, please explain why ;-)

Do you have a test case for this?

> Index: compiler/ml_util.m
> @@ -267,8 +268,9 @@
>  	Defn = mlds__defn(Name, _Context, _Flags, _Body),
>  	Name = type(_, _).
>  
> -defn_is_function(Defn) :-
> -	Defn = mlds__defn(Name, _Context, _Flags, _Body),
> +defn_is_function_with_body(Defn) :-
> +	Defn = mlds__defn(Name, _Context, _Flags, Body),
> +	Body = function(_, _, yes(_)),
>  	Name = function(_, _, _, _).

If you check that `Body' is function/4, you don't need to check that `Name' is
function/4; it is an invariant of the MLDS that those two must match.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list