[m-rev.] for review: automatically generate all type_ctor_infos on non C backends

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Nov 23 22:53:06 AEDT 2003

On 21-Nov-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> compiler/type_util.m:
> 	s/builtin_type_ctors/builtin_type_ctors_with_no_type_defn/
> 	which better reflects which type ctors this function returns.
> compiler/type_ctor_info.m:
> 	Improve the documentation of how the code determines whether
> 	or not a type_ctor_info needs to be generated.
> compiler/typecheck.m:
> 	Use builtin_type_ctors_with_no_type_defn and make the documentation
> 	more explicit.

> Index: compiler/type_ctor_info.m
> @@ -114,26 +114,28 @@
>  		ModuleName, ModuleInfo, TypeCtorGenInfos1),
>  	TypeCtor = SymName - TypeArity,
>  	(
> +	    % Check if we should generate a type_ctor_info for this type.
> +	    % There are three cases that we have to check
> +	    % 	- the builtin types which have no type defn
> +	    % 	- the builtin types which are declared abstract
> +	    % 	- all the rest of the types

Huh?  What's the difference between the first two cases?

Did you mean to say "no type declaration" instead of "no type defn"?

Also, what about builtin types which are declared abstract,
but which are also defined? (e.g. array(T).)
Which category do they fall in?

> Index: compiler/type_util.m
> +	% The list of type_ctors which are builtins which do not have a
> +	% hlds_type_defn, ie. those builtin type which are not declared as
> +	% abstract types in the standard library.
> +:- func builtin_type_ctors_with_no_type_defn = list(type_ctor).

The comment here seems wrong, since e.g. array/1 is declared as an
abstract type in the standard library, but is not included in this list.

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