[m-rev.] for prelim review: fix generation of type_ctor_info for unboxed types bug

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Dec 2 03:38:36 AEDT 2003


On 01-Dec-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> This is for preliminary review.  How does this look to you Fergus?

It looks good.

Don't forget to include a test case.

> +++ compiler/rtti_to_mlds.m	1 Dec 2003 16:09:58 -0000
> @@ -196,16 +196,32 @@
>  	NumPtags = type_ctor_details_num_ptags(TypeCtorDetails),
>  	NumFunctors = type_ctor_details_num_functors(TypeCtorDetails),
>  	gen_functors_layout_info(ModuleInfo, RttiTypeCtor, TypeCtorDetails,
> -		FunctorsInfo, LayoutInfo, SubDefns),
> +		FunctorsInfo, LayoutInfo, SubDefns0),
>  	FunctorsRttiId = ctor_rtti_id(RttiTypeCtor, type_functors),
>  	LayoutRttiId = ctor_rtti_id(RttiTypeCtor, type_layout),
> +
> +	some [!Defns] (
> +		!:Defns = SubDefns0,
> +		gen_init_special_pred(ModuleInfo, UnifyUniv, UnifyInit, !Defns),
> +		gen_init_special_pred(ModuleInfo, CompareUniv,
> +				CompareInit, !Defns),
> +		SubDefns = !.Defns
> +	),

Minor style issue:
I don't see the need to distinguish between "SubDefns0" and "Defns".
So I'd put "some [!SubDefns]" around the whole lot, including the
call to gen_functors_layout_info, and thus dispense with the "!:Defns =
SubDefns0" line.

> +		% XXX replaced with UnifyInit and CompareInit
> +		% Note however that this means that we will always create
> +		% an extra level of indirection.
> +		% We could be a bit smarter here and try and detect which
> +		% types need unboxing (backend dependent)

I wouldn't worry too much about this.  Correctness first.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  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