[m-rev.] for review: fix Mantus bug #44

Peter Wang novalazy at gmail.com
Mon Feb 11 11:36:26 AEDT 2008


On 2008-02-08, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> Index: compiler/ctgc.selector.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/ctgc.selector.m,v
> retrieving revision 1.8
> diff -u -b -r1.8 ctgc.selector.m
> --- compiler/ctgc.selector.m	17 Jan 2008 01:34:51 -0000	1.8
> +++ compiler/ctgc.selector.m	8 Feb 2008 08:42:12 -0000
> @@ -308,8 +308,10 @@
>          SelectorAcc0, !Selector) :-
>      (
>          !.Selector = [UnitSelector | SelRest],
> -        Class = classify_type(ModuleInfo, VarType),
> -        ( Class = type_cat_user_ctor ->
> +        CtorCat = classify_type(ModuleInfo, VarType),
> +        % XXX This test seems to be a bug: it shouldn't succeed for either
> +        % notag types or dummy types.
> +        ( CtorCat = ctor_cat_user(_) ->
>              % If it is either a term-selector of a non-existentially typed
>              % functor or is a type-selector, construct the branch map and
>              % proceed with normalization. If it is a term-selector of an

Not really sure what that predicate does, to be honest, so I'll have to
run it on a test case and see.

> Index: compiler/ctgc.util.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/ctgc.util.m,v
> retrieving revision 1.16
> diff -u -b -r1.16 ctgc.util.m
> --- compiler/ctgc.util.m	29 Jan 2008 03:03:33 -0000	1.16
> +++ compiler/ctgc.util.m	8 Feb 2008 06:44:49 -0000
...
> +type_category_is_reusable(CtorCat) = Reusable :-
> +    (
> +        ( CtorCat = ctor_cat_builtin(_)
> +        ; CtorCat = ctor_cat_higher_order
> +        ; CtorCat = ctor_cat_enum(_)
> +        ; CtorCat = ctor_cat_builtin_dummy
> +        ; CtorCat = ctor_cat_variable
> +        ; CtorCat = ctor_cat_void
> +        ; CtorCat = ctor_cat_system(_)
> +        ),
> +        Reusable = no
> +    ;
> +        % XXX I don't think notag user types should be reusable.
> +        ( CtorCat = ctor_cat_tuple
> +        ; CtorCat = ctor_cat_user(_)
> +        ),
> +        Reusable = yes
> +    ).
>  
>  %-----------------------------------------------------------------------------%
>  

I think two concepts got conflated here: types for which cells are
reusable (doesn't include notag types) and types for which we have to
consider sharing (does include notag types).

I will check and fix the XXXs post commit.

Peter

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list