[m-dev.] For review: Using MR_TypeCtorInfo for generated type_ctor_infos

Warwick Harvey wharvey at cs.monash.edu.au
Mon Aug 9 16:32:38 AEST 1999


Changes since last time:

- Removed uses of `USE_TYPE_LAYOUT', since they were so broken it seemed
pointless to keep them around.

- Changed the type of string constants to be `string'/`String' rather than
`data_ptr'/`Word *'.

- Removed some casts of `string_const' to `String', including some that were
there before I started making changes.

- Removed some casts of `string_const' to `const Word *' in type_ctor_info
initialisers.

- Fixed the generation of some type declarations that I missed, so that for
type_ctor_info structs they use `MR_TypeCtorInfo_struct'.

- Fixed several more hand-defined type_ctor_info structures I missed last
time (array/1, univ/0, pred/0, func/0).

I include a full diff and a relative diff at the end.


Note that some of the hand-defined type_ctor_info structures used "const"
pointers for the strings.  This constness has been lost.  In theory, one
could make all the occurrences of `string_const' come out as `ConstString'.
I tried this, and it all seems to work except for
`std_util:type_ctor_name_and_arity/4'.  This pragma c_code predicate threw
up warnings because the strings were being returned in the Mercury type
`string', which (apparently) has C type `String', and so the const was
discarded.  Of course I could add a cast to remove the warning, but that
would be lying.  But perhaps a little lie here (marked with XXX of course)
would be worth the benefit of making the strings const?  Is the constness
worth having?  Anyway, this could be a separate change if it was deemed
worth doing (I need to stop at some point and get the danged thing
committed).


Also, note that doing the stage 1 build results in many many incompatible
pointer type warnings, but none appear in the stage 2 build (or the stage 3
build, but that hardly counts since the generated C files are not compiled
;-).  I hope it is OK to have these warnings during bootstrapping as long as
they're gone afterwards?

Warwick


Estimated hours taken: 16

Changed all type_ctor_info structures to use the MR_TypeCtorInfo type.  This
is primarily to reduce the number of conflicts when merging independent
changes to the type_ctor_info structures.  As part of this, changed the type
of `string_const' to be `String' rather than `Word *'.

compiler/llds_out.m:
	Don't emit definitions for type_ctor_info structs; instead use
	`MR_TypeCtorInfo_struct'.
	Removed a couple of casts of `string_const's to type `String', since
	they are no longer necessary.

compiler/llds.m:
	Changed the entries for `string_const' and `multi_string_const' in
	llds__const_type/2 to be `string' rather than `data_ptr'.

library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
	Changed all the hand-defined type_ctor_info structures to just use
	`MR_TypeCtorInfo_struct', and added appropriate casts to the
	initialisers.  This included removing what appears to have been the
	last vestiges of `USE_TYPE_LAYOUT' conditionals since their use was
	so broken that it would probably be easier to re-implement the same
	functionality from scratch than to debug and rebuild on what was left.

runtime/mercury_type_info.h:
	Introduced `struct MR_TypeCtorInfo_struct' as the name of the
	(previously anonymous) struct which `MR_TypeCtorInfo' was a pointer
	to.

runtime/mercury_string.h:
	Changed the type of the macro `string_const/2'.  It used to cast to
	`Word *', now it casts to `String'.

cvs server: Diffing .
cvs server: Diffing bindist
cvs server: Diffing boehm_gc
cvs server: Diffing boehm_gc/Mac_files
cvs server: Diffing boehm_gc/cord
cvs server: Diffing boehm_gc/cord/private
cvs server: Diffing boehm_gc/include
cvs server: Diffing boehm_gc/include/private
cvs server: Diffing browser
cvs server: Diffing bytecode
cvs server: Diffing bytecode/test
cvs server: Diffing compiler
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.244
diff -u -r1.244 llds.m
--- llds.m	1999/07/13 08:53:05	1.244
+++ llds.m	1999/08/09 02:41:35
@@ -1006,8 +1006,8 @@
 llds__const_type(false, bool).
 llds__const_type(int_const(_), integer).
 llds__const_type(float_const(_), float).
-llds__const_type(string_const(_), data_ptr).
-llds__const_type(multi_string_const(_, _), data_ptr).
+llds__const_type(string_const(_), string).
+llds__const_type(multi_string_const(_, _), string).
 llds__const_type(code_addr_const(_), code_ptr).
 llds__const_type(data_addr_const(_), data_ptr).
 llds__const_type(label_entry(_), code_ptr).
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.115
diff -u -r1.115 llds_out.m
--- llds_out.m	1999/07/13 08:53:06	1.115
+++ llds_out.m	1999/08/09 02:41:35
@@ -2222,16 +2222,25 @@
 		[]
 	),
 	io__write_string("struct "),
-	output_decl_id(DeclId),
-	io__write_string("_struct"),
+
+	% If it's a type_ctor_info struct, use the MR_TypeCtorInfo_struct
+	% type, and don't emit a definition.
 	(
-		{ Def = yes }
+		{ decl_id_is_type_ctor_info(DeclId) }
 	->
-		io__write_string(" {\n"),
-		output_cons_arg_types(ArgVals, CreateArgTypes, "\t", 1),
-		io__write_string("} ")
+		io__write_string("MR_TypeCtorInfo_struct")
 	;
-		[]
+		output_decl_id(DeclId),
+		io__write_string("_struct"),
+		(
+			{ Def = yes }
+		->
+			io__write_string(" {\n"),
+			output_cons_arg_types(ArgVals, CreateArgTypes, "\t", 1),
+			io__write_string("} ")
+		;
+			[]
+		)
 	),
 	(
 		{ Decl = yes }
@@ -2252,6 +2261,13 @@
 		io__write_string(";\n")
 	).
 
+	% Succeed if the decl_id is for a type constructor info structure.
+
+:- pred decl_id_is_type_ctor_info(decl_id).
+:- mode decl_id_is_type_ctor_info(in) is semidet.
+
+decl_id_is_type_ctor_info(data_addr(data_addr(_, type_ctor(info, _, _)))).
+
 	% Return true if a data structure of the given type will eventually
 	% include code addresses. Note that we can't just test the data
 	% structure itself, since in the absence of code addresses the earlier
@@ -2749,8 +2765,17 @@
 		io__write_string("const ")
 	),
 	io__write_string("struct "),
-	output_data_addr(ModuleName, VarName), 
-	io__write_string("_struct\n"),
+
+	% If it's a type_ctor_info struct, use the
+	% MR_TypeCtorInfo_struct type.
+	(
+		{ VarName = type_ctor(info, _, _) }
+	->
+		io__write_string("MR_TypeCtorInfo_struct\n")
+	;
+		output_data_addr(ModuleName, VarName), 
+		io__write_string("_struct\n")
+	),
 	io__write_string(LaterIndent),
 	io__write_string("\t"),
 	output_data_addr(ModuleName, VarName), 
@@ -3732,14 +3757,14 @@
 output_rval_static_const(float_const(FloatVal)) -->
 	io__write_float(FloatVal).
 output_rval_static_const(string_const(String)) -->
-	io__write_string("(String) string_const("""),
+	io__write_string("string_const("""),
 	output_c_quoted_string(String),
 	{ string__length(String, StringLength) },
 	io__write_string(""", "),
 	io__write_int(StringLength),
 	io__write_string(")").
 output_rval_static_const(multi_string_const(Length, String)) -->
-	io__write_string("(String) string_const("""),
+	io__write_string("string_const("""),
 	output_c_quoted_multi_string(Length, String),
 	io__write_string(""", "),
 	io__write_int(Length),
cvs server: Diffing compiler/notes
cvs server: Diffing debian
cvs server: Diffing doc
cvs server: Diffing extras
cvs server: Diffing extras/aditi
cvs server: Diffing extras/cgi
cvs server: Diffing extras/complex_numbers
cvs server: Diffing extras/complex_numbers/samples
cvs server: Diffing extras/complex_numbers/tests
cvs server: Diffing extras/dynamic_linking
cvs server: Diffing extras/exceptions
cvs server: Diffing extras/graphics
cvs server: Diffing extras/graphics/mercury_opengl
cvs server: Diffing extras/graphics/mercury_tcltk
cvs server: Diffing extras/graphics/samples
cvs server: Diffing extras/graphics/samples/calc
cvs server: Diffing extras/graphics/samples/maze
cvs server: Diffing extras/graphics/samples/pent
cvs server: Diffing extras/lazy_evaluation
cvs server: Diffing extras/odbc
cvs server: Diffing extras/references
cvs server: Diffing extras/references/samples
cvs server: Diffing extras/references/tests
cvs server: Diffing extras/trailed_update
cvs server: Diffing extras/trailed_update/samples
cvs server: Diffing extras/trailed_update/tests
cvs server: Diffing library
Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.57
diff -u -r1.57 array.m
--- array.m	1999/07/07 15:19:36	1.57
+++ array.m	1999/08/09 02:41:38
@@ -281,18 +281,8 @@
 MR_MODULE_STATIC_OR_EXTERN
 const struct mercury_data_array__type_ctor_layout_array_1_struct
 	mercury_data_array__type_ctor_layout_array_1;
-MR_STATIC_CODE_CONST struct
-mercury_data_array__type_ctor_info_array_1_struct {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Word   f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-} mercury_data_array__type_ctor_info_array_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_array__type_ctor_info_array_1 = {
 	(Integer) 1,
 	ENTRY(mercury____Unify___array__array_1_0),
 	ENTRY(mercury____Index___array__array_1_0),
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.18
diff -u -r1.18 builtin.m
--- builtin.m	1999/07/19 04:50:58	1.18
+++ builtin.m	1999/08/09 02:41:38
@@ -242,8 +242,6 @@
 :- pragma c_code("
 
 
-#ifdef  USE_TYPE_LAYOUT
-
 	/* type_ctor_layout definitions */ 
 
 	/* type_ctor_layout for `int' */
@@ -465,8 +463,6 @@
 
 #endif /* NATIVE_GC */
 
-#endif /* USE_TYPE_LAYOUT */
-
 	/* type_ctor_infos definitions */
 
 	/* type_ctor_info for `int' */
@@ -474,30 +470,17 @@
 Declare_entry(mercury__builtin_unify_int_2_0);
 Declare_entry(mercury__builtin_index_int_2_0);
 Declare_entry(mercury__builtin_compare_int_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_int_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_int_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_int_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_int_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_int_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_int_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_INT,
-	(const Word *) & mercury_data___type_ctor_functors_int_0,
-	(const Word *) & mercury_data___type_ctor_layout_int_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""int"", 3)
-#endif
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_int_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_int_0,
+	string_const(""builtin"", 7),
+	string_const(""int"", 3)
 };
 
 	/* type_ctor_info for `character' */
@@ -505,31 +488,17 @@
 Declare_entry(mercury__builtin_unify_character_2_0);
 Declare_entry(mercury__builtin_index_character_2_0);
 Declare_entry(mercury__builtin_compare_character_3_0);
-MR_STATIC_CODE_CONST struct 
-mercury_data___type_ctor_info_character_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_character_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_character_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_character_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_character_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_character_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_CHAR,
-	(const Word *) & mercury_data___type_ctor_functors_character_0,
-	(const Word *) & mercury_data___type_ctor_layout_character_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""character"", 9)
-#endif
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_character_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_character_0,
+	string_const(""builtin"", 7),
+	string_const(""character"", 9)
 };
 
 	/* type_ctor_info for `string' */
@@ -537,30 +506,17 @@
 Declare_entry(mercury__builtin_unify_string_2_0);
 Declare_entry(mercury__builtin_index_string_2_0);
 Declare_entry(mercury__builtin_compare_string_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_string_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_string_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_string_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_string_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_string_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_string_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_STRING,
-	(const Word *) & mercury_data___type_ctor_functors_string_0,
-	(const Word *) & mercury_data___type_ctor_layout_string_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""string"", 6)
-#endif
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_string_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_string_0,
+	string_const(""builtin"", 7),
+	string_const(""string"", 6)
 };
 
 	/* type_ctor_info for `float' */
@@ -568,59 +524,33 @@
 Declare_entry(mercury__builtin_unify_float_2_0);
 Declare_entry(mercury__builtin_index_float_2_0);
 Declare_entry(mercury__builtin_compare_float_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_float_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_float_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_float_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_float_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_float_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_float_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_FLOAT,
-	(const Word *) & mercury_data___type_ctor_functors_float_0,
-	(const Word *) & mercury_data___type_ctor_layout_float_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""float"", 5)
-#endif
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_float_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_float_0,
+	string_const(""builtin"", 7),
+	string_const(""float"", 5)
 };
 
 	/* type_ctor_info for `void' */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_void_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_void_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_void_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_VOID,
-	(const Word *) & mercury_data___type_ctor_functors_void_0,
-	(const Word *) & mercury_data___type_ctor_layout_void_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""void"", 4)
-#endif
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_void_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_void_0,
+	string_const(""builtin"", 7),
+	string_const(""void"", 4)
 };
 
 #ifdef	NATIVE_GC
@@ -628,175 +558,97 @@
 	/* type_ctor_info for `succip' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_succip_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_succip_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_succip_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_succip_0,
 	(const Word *) & mercury_data___type_ctor_functors_succip_0,
 	(const Word *) & mercury_data___type_ctor_layout_succip_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""succip"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""succip"", 6)
 };
 
 	/* type_ctor_info for `hp' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_hp_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_hp_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_hp_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_hp_0,
 	(const Word *) & mercury_data___type_ctor_functors_hp_0,
 	(const Word *) & mercury_data___type_ctor_layout_hp_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""hp"", 2)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""hp"", 2)
 };
 
 	/* type_ctor_info for `curfr' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_curfr_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_curfr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_curfr_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_curfr_0,
 	(const Word *) & mercury_data___type_ctor_functors_curfr_0,
 	(const Word *) & mercury_data___type_ctor_layout_curfr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""curfr"", 5)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""curfr"", 5)
 };
 
 	/* type_ctor_info for `maxfr' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_maxfr_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_maxfr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_maxfr_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_maxfr_0,
 	(const Word *) & mercury_data___type_ctor_functors_maxfr_0,
 	(const Word *) & mercury_data___type_ctor_layout_maxfr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""maxfr"", 5)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""maxfr"", 5)
 };
 
 	/* type_ctor_info for `redoip' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_redoip_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_redoip_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_redoip_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_redoip_0,
 	(const Word *) & mercury_data___type_ctor_functors_redoip_0,
 	(const Word *) & mercury_data___type_ctor_layout_redoip_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""redoip"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""redoip"", 6)
 };
 
 	/* type_ctor_info for `redofr' (only used by accurate gc) */
 
 Declare_entry(mercury__unused_0_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_redofr_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-#ifdef USE_TYPE_LAYOUT
-	const Word *f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-#endif
-} mercury_data___type_ctor_info_redofr_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_redofr_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_redofr_0,
 	(const Word *) & mercury_data___type_ctor_functors_redofr_0,
 	(const Word *) & mercury_data___type_ctor_layout_redofr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""redofr"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""redofr"", 6)
 };
 
 #endif /* NATIVE_GC */
@@ -950,24 +802,15 @@
 Define_extern_entry(mercury____Compare___builtin__c_pointer_0_0);
 
 
-const struct mercury_data_builtin__type_ctor_info_c_pointer_0_struct {
-        Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Integer f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-}  mercury_data_builtin__type_ctor_info_c_pointer_0 = {
+const struct MR_TypeCtorInfo_struct
+mercury_data_builtin__type_ctor_info_c_pointer_0 = {
 	(Integer) 0,
 	ENTRY(mercury____Unify___builtin__c_pointer_0_0),
 	ENTRY(mercury____Index___builtin__c_pointer_0_0),
 	ENTRY(mercury____Compare___builtin__c_pointer_0_0),
 	MR_TYPECTOR_REP_C_POINTER,
-	(Word *) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
-	(Word *) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
+	(MR_TypeCtorFunctors) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
+	(MR_TypeCtorLayout) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
 	string_const(""builtin"", 7),
 	string_const(""c_pointer"", 9)
 };
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.27
diff -u -r1.27 private_builtin.m
--- private_builtin.m	1999/07/06 06:31:58	1.27
+++ private_builtin.m	1999/08/09 02:41:38
@@ -270,17 +270,19 @@
 
 :- pragma c_header_code("
 
-extern MR_STATIC_CODE_CONST struct
-	mercury_data___type_ctor_info_int_0_struct
+	/* These are just for bootstrapping */
+#define	mercury_data___type_ctor_info_int_0_struct	MR_TypeCtorInfo_struct
+#define	mercury_data___type_ctor_info_string_0_struct	MR_TypeCtorInfo_struct
+#define	mercury_data___type_ctor_info_float_0_struct	MR_TypeCtorInfo_struct
+#define	mercury_data___type_ctor_info_character_0_struct MR_TypeCtorInfo_struct
+
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
 	mercury_data___type_ctor_info_int_0;
-extern MR_STATIC_CODE_CONST struct
-	mercury_data___type_ctor_info_string_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
 	mercury_data___type_ctor_info_string_0;
-extern MR_STATIC_CODE_CONST struct
-	mercury_data___type_ctor_info_float_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
 	mercury_data___type_ctor_info_float_0;
-extern MR_STATIC_CODE_CONST struct
-	mercury_data___type_ctor_info_character_0_struct
+extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
 	mercury_data___type_ctor_info_character_0;
 
 ").
@@ -304,18 +306,8 @@
 	** type_ctor_infos.
 	*/
 
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_type_ctor_info_1_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_type_ctor_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_type_ctor_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__type_info_1_0)),
@@ -324,26 +316,16 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__type_info_1_0)),
 	MR_TYPECTOR_REP_TYPEINFO,
-	(const Word *) &
+	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_type_info_1,
-	(const Word *) &
+	(MR_TypeCtorLayout) &
 		mercury_data_private_builtin__type_ctor_layout_type_info_1,
-	(const Word *) string_const(""private_builtin"", 15),
-	(const Word *) string_const(""type_ctor_info"", 14)
+	string_const(""private_builtin"", 15),
+	string_const(""type_ctor_info"", 14)
 };
 
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_type_info_1_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_type_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_type_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__type_info_1_0)),
@@ -352,12 +334,12 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__type_info_1_0)),
 	MR_TYPECTOR_REP_TYPEINFO,
-	(const Word *) &
+	(MR_TypeCtorFunctors) &
 		mercury_data_private_builtin__type_ctor_functors_type_info_1,
-	(const Word *) &
+	(MR_TypeCtorLayout) &
 		mercury_data_private_builtin__type_ctor_layout_type_info_1,
-	(const Word *) string_const(""private_builtin"", 15),
-	(const Word *) string_const(""type_info"", 9)
+	string_const(""private_builtin"", 15),
+	string_const(""type_info"", 9)
 };
 
 
@@ -385,18 +367,8 @@
 	mercury_data_private_builtin__type_ctor_functors_typeclass_info_1_struct
 	mercury_data_private_builtin__type_ctor_functors_typeclass_info_1;
 
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_base_typeclass_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -405,26 +377,16 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
 	MR_TYPECTOR_REP_TYPECLASSINFO,
-	(const Word *) &
+	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
-	(const Word *) &
+	(MR_TypeCtorLayout) &
 	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
-	(const Word *) string_const(""private_builtin"", 15),
-	(const Word *) string_const(""base_typeclass_info"", 19)
+	string_const(""private_builtin"", 15),
+	string_const(""base_typeclass_info"", 19)
 };
 
-MR_STATIC_CODE_CONST struct
-mercury_data_private_builtin__type_ctor_info_typeclass_info_1_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data_private_builtin__type_ctor_info_typeclass_info_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_private_builtin__type_ctor_info_typeclass_info_1 = {
 	((Integer) 1),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Unify___private_builtin__typeclass_info_1_0)),
@@ -433,12 +395,12 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
 	MR_TYPECTOR_REP_TYPECLASSINFO,
-	(const Word *) &
+	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
-	(const Word *) &
+	(MR_TypeCtorLayout) &
 	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
-	(const Word *) string_const(""private_builtin"", 15),
-	(const Word *) string_const(""typeclass_info"", 14)
+	string_const(""private_builtin"", 15),
+	string_const(""typeclass_info"", 14)
 };
 
 const struct
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.152
diff -u -r1.152 std_util.m
--- std_util.m	1999/07/19 04:51:00	1.152
+++ std_util.m	1999/08/09 02:41:38
@@ -1070,18 +1070,8 @@
 const struct mercury_data_std_util__type_ctor_layout_univ_0_struct
 	mercury_data_std_util__type_ctor_layout_univ_0;
 
-MR_STATIC_CODE_CONST struct
-mercury_data_std_util__type_ctor_info_univ_0_struct {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Word   f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-}  mercury_data_std_util__type_ctor_info_univ_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_std_util__type_ctor_info_univ_0 = {
 	(Integer) 0,
 	ENTRY(mercury____Unify___std_util__univ_0_0),
 	ENTRY(mercury____Index___std_util__univ_0_0),
@@ -1451,8 +1441,14 @@
 	** Several predicates use these (the MR_TYPE_CTOR_INFO_IS_HO_*
 	** macros need access to these addresses).
 	*/
-MR_DECLARE_STRUCT(mercury_data___type_ctor_info_pred_0);
-MR_DECLARE_STRUCT(mercury_data___type_ctor_info_func_0);
+extern const struct MR_TypeCtorInfo_struct
+	mercury_data___type_ctor_info_pred_0;
+extern const struct MR_TypeCtorInfo_struct
+	mercury_data___type_ctor_info_func_0;
+
+	/* For bootstrapping */
+#define mercury_data___type_ctor_info_pred_0_struct MR_TypeCtorInfo_struct
+#define mercury_data___type_ctor_info_func_0_struct MR_TypeCtorInfo_struct
 
 
 ").
cvs server: Diffing lp_solve
cvs server: Diffing lp_solve/lp_examples
cvs server: Diffing profiler
cvs server: Diffing readline
cvs server: Diffing readline/doc
cvs server: Diffing readline/examples
cvs server: Diffing readline/shlib
cvs server: Diffing readline/support
cvs server: Diffing runtime
Index: runtime/mercury_bootstrap.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.c,v
retrieving revision 1.15
diff -u -r1.15 mercury_bootstrap.c
--- mercury_bootstrap.c	1999/07/19 04:51:12	1.15
+++ mercury_bootstrap.c	1999/08/09 02:41:39
@@ -45,17 +45,8 @@
 
 
 
-const struct mercury_data_std_util__type_ctor_info_type_info_0_struct_bootstrap {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Integer f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-}  mercury_data_std_util__type_ctor_info_type_info_0 = {
+const struct MR_TypeCtorInfo_struct
+mercury_data_std_util__type_ctor_info_type_info_0 = {
 	(Integer) 0,
 	ENTRY(mercury____Unify___std_util__type_info_0_0_bootstrap),
 	ENTRY(mercury____Index___std_util__type_info_0_0_bootstrap),
Index: runtime/mercury_string.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_string.h,v
retrieving revision 1.11
diff -u -r1.11 mercury_string.h
--- mercury_string.h	1999/03/10 22:05:24	1.11
+++ mercury_string.h	1999/08/09 02:41:39
@@ -36,7 +36,7 @@
 ** string_const("...", len):
 **	Given a C string literal and its length, returns a Mercury string.
 */
-#define string_const(string, len) ((Word *) string)
+#define string_const(string, len) ((String) string)
 
 /*
 ** bool string_equal(ConstString s1, ConstString s2):
Index: runtime/mercury_type_info.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.c,v
retrieving revision 1.20
diff -u -r1.20 mercury_type_info.c
--- mercury_type_info.c	1999/07/06 06:32:18	1.20
+++ mercury_type_info.c	1999/08/09 02:41:39
@@ -50,26 +50,17 @@
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_func_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word  f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data___type_ctor_info_func_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_func_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 	MR_TYPECTOR_REP_PRED,
-	(const Word *) & mercury_data___type_ctor_functors_pred_0,
-	(const Word *) & mercury_data___type_ctor_layout_pred_0,
-	(const Word *) string_const("builtin", 7),
-	(const Word *) string_const("func", 4)
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_pred_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_pred_0,
+	string_const("builtin", 7),
+	string_const("func", 4)
 };
 
 	/*
@@ -80,26 +71,17 @@
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_pred_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word  f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data___type_ctor_info_pred_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_pred_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 	MR_TYPECTOR_REP_PRED,
-	(const Word *) & mercury_data___type_ctor_functors_pred_0,
-	(const Word *) & mercury_data___type_ctor_layout_pred_0,
-	(const Word *) string_const("builtin", 7),
-	(const Word *) string_const("pred", 4)
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_pred_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_pred_0,
+	string_const("builtin", 7),
+	string_const("pred", 4)
 };
 
 Define_extern_entry(mercury__builtin_unify_pred_2_0);
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.23
diff -u -r1.23 mercury_type_info.h
--- mercury_type_info.h	1999/07/06 06:32:19	1.23
+++ mercury_type_info.h	1999/08/09 02:41:39
@@ -788,7 +788,7 @@
 	** `:- type' declaration.
 	*/
 
-typedef struct {
+struct MR_TypeCtorInfo_struct {
 	int arity;
 	Code *unify_pred;
 	Code *index_pred;
@@ -812,7 +812,8 @@
 	MR_TypeCtorLayout type_ctor_layout;
 	String type_ctor_module_name;
 	String type_ctor_name;
-} *MR_TypeCtorInfo;
+};
+typedef struct MR_TypeCtorInfo_struct *MR_TypeCtorInfo;
 
 	/* 
 	** Macros for retreiving things from type_ctor_infos.
cvs server: Diffing runtime/GETOPT
cvs server: Diffing runtime/machdeps
cvs server: Diffing samples
cvs server: Diffing samples/c_interface
cvs server: Diffing samples/c_interface/c_calls_mercury
cvs server: Diffing samples/c_interface/cplusplus_calls_mercury
cvs server: Diffing samples/c_interface/mercury_calls_c
cvs server: Diffing samples/c_interface/mercury_calls_cplusplus
cvs server: Diffing samples/c_interface/mercury_calls_fortran
cvs server: Diffing samples/c_interface/simpler_c_calls_mercury
cvs server: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs server: Diffing samples/diff
cvs server: Diffing samples/muz
cvs server: Diffing samples/rot13
cvs server: Diffing scripts
cvs server: Diffing tools
cvs server: Diffing trace
cvs server: Diffing trial
cvs server: Diffing util


------------------------------------------------------------------------
                              RELATIVE DIFF
------------------------------------------------------------------------
diff -d -u -r orig/compiler/llds.m ./compiler/llds.m
--- orig/compiler/llds.m	Tue Jul 13 18:53:05 1999
+++ ./compiler/llds.m	Mon Aug  9 16:07:36 1999
@@ -1006,8 +1006,8 @@
 llds__const_type(false, bool).
 llds__const_type(int_const(_), integer).
 llds__const_type(float_const(_), float).
-llds__const_type(string_const(_), data_ptr).
-llds__const_type(multi_string_const(_, _), data_ptr).
+llds__const_type(string_const(_), string).
+llds__const_type(multi_string_const(_, _), string).
 llds__const_type(code_addr_const(_), code_ptr).
 llds__const_type(data_addr_const(_), data_ptr).
 llds__const_type(label_entry(_), code_ptr).
diff -d -u -r orig/compiler/llds_out.m ./compiler/llds_out.m
--- orig/compiler/llds_out.m	Mon Aug  9 15:59:20 1999
+++ ./compiler/llds_out.m	Mon Aug  9 16:10:36 1999
@@ -2720,8 +2720,17 @@
 		io__write_string("const ")
 	),
 	io__write_string("struct "),
-	output_data_addr(ModuleName, VarName), 
-	io__write_string("_struct\n"),
+
+	% If it's a type_ctor_info struct, use the
+	% MR_TypeCtorInfo_struct type.
+	(
+		{ VarName = type_ctor(info, _, _) }
+	->
+		io__write_string("MR_TypeCtorInfo_struct\n")
+	;
+		output_data_addr(ModuleName, VarName), 
+		io__write_string("_struct\n")
+	),
 	io__write_string(LaterIndent),
 	io__write_string("\t"),
 	output_data_addr(ModuleName, VarName), 
@@ -3658,14 +3667,14 @@
 output_rval_static_const(float_const(FloatVal)) -->
 	io__write_float(FloatVal).
 output_rval_static_const(string_const(String)) -->
-	io__write_string("(String) string_const("""),
+	io__write_string("string_const("""),
 	output_c_quoted_string(String),
 	{ string__length(String, StringLength) },
 	io__write_string(""", "),
 	io__write_int(StringLength),
 	io__write_string(")").
 output_rval_static_const(multi_string_const(Length, String)) -->
-	io__write_string("(String) string_const("""),
+	io__write_string("string_const("""),
 	output_c_quoted_multi_string(Length, String),
 	io__write_string(""", "),
 	io__write_int(Length),
diff -d -u -r orig/library/array.m ./library/array.m
--- orig/library/array.m	Thu Jul  8 01:19:36 1999
+++ ./library/array.m	Mon Aug  9 11:32:01 1999
@@ -281,18 +281,8 @@
 MR_MODULE_STATIC_OR_EXTERN
 const struct mercury_data_array__type_ctor_layout_array_1_struct
 	mercury_data_array__type_ctor_layout_array_1;
-MR_STATIC_CODE_CONST struct
-mercury_data_array__type_ctor_info_array_1_struct {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Word   f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-} mercury_data_array__type_ctor_info_array_1 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_array__type_ctor_info_array_1 = {
 	(Integer) 1,
 	ENTRY(mercury____Unify___array__array_1_0),
 	ENTRY(mercury____Index___array__array_1_0),
diff -d -u -r orig/library/builtin.m ./library/builtin.m
--- orig/library/builtin.m	Mon Aug  9 15:59:20 1999
+++ ./library/builtin.m	Mon Aug  9 11:33:32 1999
@@ -242,8 +242,6 @@
 :- pragma c_code("
 
 
-#ifdef  USE_TYPE_LAYOUT
-
 	/* type_ctor_layout definitions */ 
 
 	/* type_ctor_layout for `int' */
@@ -465,8 +463,6 @@
 
 #endif /* NATIVE_GC */
 
-#endif /* USE_TYPE_LAYOUT */
-
 	/* type_ctor_infos definitions */
 
 	/* type_ctor_info for `int' */
@@ -480,13 +476,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_int_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_int_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_int_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_INT,
 	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_int_0,
 	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_int_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""int"", 3)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""int"", 3)
 };
 
 	/* type_ctor_info for `character' */
@@ -500,13 +494,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_character_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_character_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_character_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_CHAR,
 	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_character_0,
 	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_character_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""character"", 9)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""character"", 9)
 };
 
 	/* type_ctor_info for `string' */
@@ -520,13 +512,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_string_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_string_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_string_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_STRING,
 	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_string_0,
 	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_string_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""string"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""string"", 6)
 };
 
 	/* type_ctor_info for `float' */
@@ -540,13 +530,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_float_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_float_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_float_3_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_FLOAT,
 	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_float_0,
 	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_float_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""float"", 5)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""float"", 5)
 };
 
 	/* type_ctor_info for `void' */
@@ -558,13 +546,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_VOID,
 	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_void_0,
 	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_void_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""void"", 4)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""void"", 4)
 };
 
 #ifdef	NATIVE_GC
@@ -578,13 +564,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_succip_0,
 	(const Word *) & mercury_data___type_ctor_functors_succip_0,
 	(const Word *) & mercury_data___type_ctor_layout_succip_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""succip"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""succip"", 6)
 };
 
 	/* type_ctor_info for `hp' (only used by accurate gc) */
@@ -596,13 +580,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_hp_0,
 	(const Word *) & mercury_data___type_ctor_functors_hp_0,
 	(const Word *) & mercury_data___type_ctor_layout_hp_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""hp"", 2)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""hp"", 2)
 };
 
 	/* type_ctor_info for `curfr' (only used by accurate gc) */
@@ -614,13 +596,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_curfr_0,
 	(const Word *) & mercury_data___type_ctor_functors_curfr_0,
 	(const Word *) & mercury_data___type_ctor_layout_curfr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""curfr"", 5)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""curfr"", 5)
 };
 
 	/* type_ctor_info for `maxfr' (only used by accurate gc) */
@@ -632,13 +612,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_maxfr_0,
 	(const Word *) & mercury_data___type_ctor_functors_maxfr_0,
 	(const Word *) & mercury_data___type_ctor_layout_maxfr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""maxfr"", 5)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""maxfr"", 5)
 };
 
 	/* type_ctor_info for `redoip' (only used by accurate gc) */
@@ -650,13 +628,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_redoip_0,
 	(const Word *) & mercury_data___type_ctor_functors_redoip_0,
 	(const Word *) & mercury_data___type_ctor_layout_redoip_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""redoip"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""redoip"", 6)
 };
 
 	/* type_ctor_info for `redofr' (only used by accurate gc) */
@@ -668,13 +644,11 @@
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__unused_0_0)),
-#ifdef  USE_TYPE_LAYOUT
 	(const Word *) & mercury_data___type_ctor_layout_redofr_0,
 	(const Word *) & mercury_data___type_ctor_functors_redofr_0,
 	(const Word *) & mercury_data___type_ctor_layout_redofr_0,
-	(const Word *) string_const(""builtin"", 7),
-	(const Word *) string_const(""redofr"", 6)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""redofr"", 6)
 };
 
 #endif /* NATIVE_GC */
@@ -834,13 +808,11 @@
 	ENTRY(mercury____Unify___builtin__c_pointer_0_0),
 	ENTRY(mercury____Index___builtin__c_pointer_0_0),
 	ENTRY(mercury____Compare___builtin__c_pointer_0_0),
-#ifdef USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_C_POINTER,
 	(MR_TypeCtorFunctors) &mercury_data_builtin__type_ctor_functors_c_pointer_0,
 	(MR_TypeCtorLayout) &mercury_data_builtin__type_ctor_layout_c_pointer_0,
-	(String) string_const(""builtin"", 7),
-	(String) string_const(""c_pointer"", 9)
-#endif
+	string_const(""builtin"", 7),
+	string_const(""c_pointer"", 9)
 };
 
 
diff -d -u -r orig/library/private_builtin.m ./library/private_builtin.m
--- orig/library/private_builtin.m	Mon Aug  9 15:59:20 1999
+++ ./library/private_builtin.m	Mon Aug  9 11:34:48 1999
@@ -315,15 +315,13 @@
 		mercury____Index___private_builtin__type_info_1_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__type_info_1_0)),
-#ifdef	USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_TYPEINFO,
 	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_type_info_1,
 	(MR_TypeCtorLayout) &
 		mercury_data_private_builtin__type_ctor_layout_type_info_1,
-	(String) string_const(""private_builtin"", 15),
-	(String) string_const(""type_ctor_info"", 14)
-#endif
+	string_const(""private_builtin"", 15),
+	string_const(""type_ctor_info"", 14)
 };
 
 MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
@@ -335,15 +333,13 @@
 		mercury____Index___private_builtin__type_info_1_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__type_info_1_0)),
-#ifdef	USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_TYPEINFO,
 	(MR_TypeCtorFunctors) &
 		mercury_data_private_builtin__type_ctor_functors_type_info_1,
 	(MR_TypeCtorLayout) &
 		mercury_data_private_builtin__type_ctor_layout_type_info_1,
-	(String) string_const(""private_builtin"", 15),
-	(String) string_const(""type_info"", 9)
-#endif
+	string_const(""private_builtin"", 15),
+	string_const(""type_info"", 9)
 };
 
 
@@ -380,15 +376,13 @@
 		mercury____Index___private_builtin__typeclass_info_1_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
-#ifdef	USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_TYPECLASSINFO,
 	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
 	(MR_TypeCtorLayout) &
 	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
-	(String) string_const(""private_builtin"", 15),
-	(String) string_const(""base_typeclass_info"", 19)
-#endif
+	string_const(""private_builtin"", 15),
+	string_const(""base_typeclass_info"", 19)
 };
 
 MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
@@ -400,15 +394,13 @@
 		mercury____Index___private_builtin__typeclass_info_1_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(
 		mercury____Compare___private_builtin__typeclass_info_1_0)),
-#ifdef	USE_TYPE_LAYOUT
 	MR_TYPECTOR_REP_TYPECLASSINFO,
 	(MR_TypeCtorFunctors) &
 	    mercury_data_private_builtin__type_ctor_functors_typeclass_info_1,
 	(MR_TypeCtorLayout) &
 	    mercury_data_private_builtin__type_ctor_layout_typeclass_info_1,
-	(String) string_const(""private_builtin"", 15),
-	(String) string_const(""typeclass_info"", 14)
-#endif
+	string_const(""private_builtin"", 15),
+	string_const(""typeclass_info"", 14)
 };
 
 const struct
diff -d -u -r orig/library/std_util.m ./library/std_util.m
--- orig/library/std_util.m	Mon Jul 19 14:51:00 1999
+++ ./library/std_util.m	Mon Aug  9 16:08:37 1999
@@ -1070,18 +1070,8 @@
 const struct mercury_data_std_util__type_ctor_layout_univ_0_struct
 	mercury_data_std_util__type_ctor_layout_univ_0;
 
-MR_STATIC_CODE_CONST struct
-mercury_data_std_util__type_ctor_info_univ_0_struct {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Word   f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-}  mercury_data_std_util__type_ctor_info_univ_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data_std_util__type_ctor_info_univ_0 = {
 	(Integer) 0,
 	ENTRY(mercury____Unify___std_util__univ_0_0),
 	ENTRY(mercury____Index___std_util__univ_0_0),
@@ -1451,8 +1441,14 @@
 	** Several predicates use these (the MR_TYPE_CTOR_INFO_IS_HO_*
 	** macros need access to these addresses).
 	*/
-MR_DECLARE_STRUCT(mercury_data___type_ctor_info_pred_0);
-MR_DECLARE_STRUCT(mercury_data___type_ctor_info_func_0);
+extern const struct MR_TypeCtorInfo_struct
+	mercury_data___type_ctor_info_pred_0;
+extern const struct MR_TypeCtorInfo_struct
+	mercury_data___type_ctor_info_func_0;
+
+	/* For bootstrapping */
+#define mercury_data___type_ctor_info_pred_0_struct MR_TypeCtorInfo_struct
+#define mercury_data___type_ctor_info_func_0_struct MR_TypeCtorInfo_struct
 
 
 ").
diff -d -u -r orig/runtime/mercury_bootstrap.c ./runtime/mercury_bootstrap.c
--- orig/runtime/mercury_bootstrap.c	Mon Jul 19 14:51:12 1999
+++ ./runtime/mercury_bootstrap.c	Mon Aug  9 11:47:12 1999
@@ -45,17 +45,8 @@
 
 
 
-const struct mercury_data_std_util__type_ctor_info_type_info_0_struct_bootstrap {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Integer f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-}  mercury_data_std_util__type_ctor_info_type_info_0 = {
+const struct MR_TypeCtorInfo_struct
+mercury_data_std_util__type_ctor_info_type_info_0 = {
 	(Integer) 0,
 	ENTRY(mercury____Unify___std_util__type_info_0_0_bootstrap),
 	ENTRY(mercury____Index___std_util__type_info_0_0_bootstrap),
diff -d -u -r orig/runtime/mercury_string.h ./runtime/mercury_string.h
--- orig/runtime/mercury_string.h	Thu Mar 11 09:05:24 1999
+++ ./runtime/mercury_string.h	Mon Aug  9 16:07:52 1999
@@ -36,7 +36,7 @@
 ** string_const("...", len):
 **	Given a C string literal and its length, returns a Mercury string.
 */
-#define string_const(string, len) ((Word *) string)
+#define string_const(string, len) ((String) string)
 
 /*
 ** bool string_equal(ConstString s1, ConstString s2):
diff -d -u -r orig/runtime/mercury_type_info.c ./runtime/mercury_type_info.c
--- orig/runtime/mercury_type_info.c	Tue Jul  6 16:32:18 1999
+++ ./runtime/mercury_type_info.c	Mon Aug  9 11:38:15 1999
@@ -50,26 +50,17 @@
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_func_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word  f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data___type_ctor_info_func_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_func_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 	MR_TYPECTOR_REP_PRED,
-	(const Word *) & mercury_data___type_ctor_functors_pred_0,
-	(const Word *) & mercury_data___type_ctor_layout_pred_0,
-	(const Word *) string_const("builtin", 7),
-	(const Word *) string_const("func", 4)
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_pred_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_pred_0,
+	string_const("builtin", 7),
+	string_const("func", 4)
 };
 
 	/*
@@ -80,26 +71,17 @@
 Declare_entry(mercury__builtin_unify_pred_2_0);
 Declare_entry(mercury__builtin_index_pred_2_0);
 Declare_entry(mercury__builtin_compare_pred_3_0);
-MR_STATIC_CODE_CONST struct mercury_data___type_ctor_info_pred_0_struct {
-	Integer f1;
-	Code *f2;
-	Code *f3;
-	Code *f4;
-	Word  f5;
-	const Word *f6;
-	const Word *f7;
-	const Word *f8;
-	const Word *f9;
-} mercury_data___type_ctor_info_pred_0 = {
+MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_struct
+mercury_data___type_ctor_info_pred_0 = {
 	((Integer) 0),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_unify_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_index_pred_2_0)),
 	MR_MAYBE_STATIC_CODE(ENTRY(mercury__builtin_compare_pred_3_0)),
 	MR_TYPECTOR_REP_PRED,
-	(const Word *) & mercury_data___type_ctor_functors_pred_0,
-	(const Word *) & mercury_data___type_ctor_layout_pred_0,
-	(const Word *) string_const("builtin", 7),
-	(const Word *) string_const("pred", 4)
+	(MR_TypeCtorFunctors) & mercury_data___type_ctor_functors_pred_0,
+	(MR_TypeCtorLayout) & mercury_data___type_ctor_layout_pred_0,
+	string_const("builtin", 7),
+	string_const("pred", 4)
 };
 
 Define_extern_entry(mercury__builtin_unify_pred_2_0);
diff -d -u -r orig/runtime/mercury_type_info.h ./runtime/mercury_type_info.h
--- orig/runtime/mercury_type_info.h	Mon Aug  9 15:59:20 1999
+++ ./runtime/mercury_type_info.h	Mon Aug  9 16:05:13 1999
@@ -793,7 +793,6 @@
 	Code *unify_pred;
 	Code *index_pred;
 	Code *compare_pred;
-#ifdef USE_TYPE_LAYOUT
 		/* 
 		** The representation that is used for this
 		** constructor -- e.g. an enumeration, or a builtin
@@ -813,7 +812,6 @@
 	MR_TypeCtorLayout type_ctor_layout;
 	String type_ctor_module_name;
 	String type_ctor_name;
-#endif
 };
 typedef struct MR_TypeCtorInfo_struct *MR_TypeCtorInfo;
 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list