[m-rev.] for review: use checked type, inst and mode definitions in parse_tree_int[123]

Peter Wang novalazy at gmail.com
Fri Oct 1 14:46:08 AEST 2021


On Thu, 30 Sep 2021 18:24:38 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by anyone, but I am specifically looking for
> feedback from Peter on the diff to prog_data.m.

> diff --git a/compiler/prog_data.m b/compiler/prog_data.m
> index 73e562e39..5edc6b2eb 100644
> --- a/compiler/prog_data.m
> +++ b/compiler/prog_data.m
> @@ -348,6 +348,16 @@ cons_id_is_const_struct(ConsId, ConstNum) :-
>      ;       parse_tree_abstract_type(type_details_abstract)
>      ;       parse_tree_foreign_type(type_details_foreign_generic).
>  
> +% XXX This type should be split into two.
> +%
> +% The new type type_details_sub should be for subtypes. It should have
> +% fields listing its supertype and its ctors. It should not have a
> +% du_canonical field or a du_direct_arg field, since those aspects
> +% of the subtype are decided by the supertype.
> +%
> +% The new type_details_du should be for non-subtypes, and should have
> +% no du_maybe_subtype field.
> +%
>  :- type type_details_du
>      --->    type_details_du(
>                  % Is this a subtype, and if so, of which other type?

That does make sense.

I haven't looked at the rest of the change.

Peter


More information about the reviews mailing list