[m-rev.] for review: refactor mlds_to_il.m

Tyson Dowd trd at cs.mu.OZ.AU
Tue Jul 10 07:26:25 AEST 2001


On 10-Jul-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 09-Jul-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > 
> > Refactor the top level of mlds_to_il so that we only do one pass over
> > the MLDS to generate the ILDS.  As a side effect of this change nondet
> > code now works again.
> 
> Ah, fantastic.
> 
> > compiler/ml_code_util.m:
> >     Wrapper functions should be static methods not instance methods.
> >     Fix ml_gen_label_func_decl_flags to make this true.
> ...
> >  ml_gen_label_func_decl_flags = MLDS_DeclFlags :-
> >  	Access = private,  % XXX if we're using nested functions,
> >  			   % this should be `local' rather than `private'
> > -	PerInstance = per_instance,
> > +	PerInstance = one_copy,
> 
> Can you explain in more detail why this is necessary?
> I don't think this is the right fix.
> 
> "label" functions are the nested functions used as continuation labels
> for nondeterministic code.  They not "wrapper" functions.
> 
> Marking nested functions as "one_copy" is wrong,
> and will break the --gcc-nested-functions option.

This code is *also* called to generate wrapper functions.

I suspect for the case of continuations they are made one_copy when
ml_elim_nested processes them. 

But for wrapper functions they are not.

Perhaps ml_gen_label_func_decl_flags shouldn't be re-used in the case
of wrapper functions?

> Currently I think the .NET back-end completely ignores the
> MLDS access flags and just makes everything public.

No, Pete's change also fixes this.

Tyson.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list