[m-rev.] diff: C# interface for .NET backend.

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 3 05:32:44 AEST 2001


On 03-May-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 03-May-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 01-May-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > mlds.m:
> > > +	;	outline_target_code(
> > > +				foreign_language,
> > > +					% the foreign language of this code
> > > +				list(mlds__lval),
> > > +					% where to store return value(s)
> > > +				string
> > > +					% the user's foreign language code
> > > +		)
> > > +			% Do whatever is specified by the string, which
> > > +			% can be any piece of code in the specified
> > > +			% foreign language (C#, managed C++, or
> > > +			% whatever).
> > > +			% This is implemented by calling an externally
> > > +			% defined function, which the backend must
> > > +			% generate the definition for (in some other
> > > +			% file perhaps) and calling it.
> > 
> > Why does this have a list of where to store the return values?
> 
> Because otherwise you can't generate a fowarding call correctly -- in
> the same way that a call has to have a list of lvals to store the return
> values, so does this operation.
> 
> > And why doesn't it have a list of the input argument rvals (or their names)?
> 
> Well in general it will need the rvals in future, but in this particular
> backend we don't need them.
> 
> It might be arguably more correct to generate the code using input
> argument rvals instead of generating ldarg.0 ldarg.1 ldarg.2 all the way
> up to the arity of the signature.

Yes, definitely.  Otherwise this will cause trouble when we start doing
MLDS->MLDS optimizations, such as MLDS inlining.

-- 
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-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