[m-rev.] diff: box value classes on IL backend

Tyson Dowd trd at cs.mu.OZ.AU
Sun Jan 20 17:28:14 AEDT 2002


On 16-Jan-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> On Mon, Jan 14, 2002 at 10:35:24PM +1100, Tyson Dowd wrote:
> > On 14-Jan-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> > > Hi,
> > > 
> > > 
> > > ===================================================================
> > > 
> > > 
> > > Estimated hours taken: 12
> > > Branches: main
> > > 
> > > Fix a bug where value classes introduced by pragma foreign type's were
> > > not being boxed.  Note that we don't detect all possible value classes
> > > just the ones which are represented specially by the .NET backend.
> > > 
> > > ilasm.m:
> > >     Move name_to_simple_type to the interface.
> > > 
> > > mlds_to_il.m:
> > >     Check whether a class is a value class before deciding whether or
> > >     not it has been already boxed.
> > 
> > 
> > I don't see how this code can be buggy, or that this is a fix for the
> > code.
> > 
> How about the following, I have checked it in, but would still
> appreciate review comments.

Shouldn't checking changes that are publically visible before review.
This changes the docs and therefore is publically visible straight away.

> 
> ===================================================================
> 
> 
> Estimated hours taken: 4
> Branches: main
> 
> Allow the foreign_type declaration to accept value types.
> 
> compiler/prog_data.m:
>     Add an indicator to il foreign types whether or not they are
>     reference or value types.
> 
> compiler/prog_io_pragma.m:
>     Parse whether or not the foreign type is a reference or a value type.
> 
> compiler/make_hlds.m:
>     Decide whether or not a foreign_type is already boxed.
> 
> compiler/hlds_data.m:
> compiler/mlds.m:
>     Add to the foreign_type an indicator of whether or not it is already
>     boxed.
> 
> compiler/mlds_to_il.m:
>     Remove code which attempted to determine when a value type was
>     incorrectly defined as a reference type.
>     Unboxed types on the .NET backend are value types.
>     Fix a bug where converting a value_class to a value_class was
>     failing.
> 
> compiler/ilasm.m:
>     Remove name_to_simple_type from the interface as it is no longer
>     needed in mlds_to_il.
> 
> compiler/mercury_to_mercury.m:
>     Output the new foreign_type format.
> 
> compiler/foreign.m:
> compiler/hlds_out.m:
> compiler/intermod.m:
> compiler/magic_util.m:
> compiler/ml_code_gen.m:
> compiler/ml_code_util.m:
> compiler/ml_type_gen.m:
> compiler/mlds_to_c.m:
> compiler/mlds_to_gcc.m:
> compiler/mlds_to_java.m:
> compiler/recompilation_usage.m:
> compiler/term_util.m:
> compiler/type_ctor_info.m:
> compiler/unify_proc.m:
>     Changes to handle the boxed indicator.
> 
> 
> doc/reference_manual.texi:
>     Document how to specify a value type.
> 


The change is pretty good, I had a few comments but it is easier to
propose them in diff format, so I will post a change for review in a few
minutes.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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