[m-dev.] diff: move type_ctor_infos out of mercury_bootstrap.

Tyson Dowd trd at cs.mu.OZ.AU
Wed Jun 2 15:09:33 AEST 1999


Hi,

This one needs to be committed soon.  Munta hasn't bootstrapped this
yet -- it will have to be done by hand (sorry about that).

===================================================================


Estimated hours taken: 0.5

Move the type_ctor_infos for array and univ into their proper places.
This change has bootstrapped on most of our platforms, but actually
causes trouble linking small programs (because it creates runtime ->
library dependencies).  So we should move it as soon as possible.


library/array.m:
library/std_util.m:
	Add type_ctor_info for array and univ.

runtime/mercury_bootstrap.c:
	Remove type_ctor_info for array and univ.


Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.53
diff -u -r1.53 array.m
--- array.m	1999/03/31 04:42:49	1.53
+++ array.m	1999/06/01 13:23:53
@@ -269,7 +269,34 @@
 Define_extern_entry(mercury____Index___array__array_1_0);
 Define_extern_entry(mercury____Compare___array__array_1_0);
 
-#ifdef  USE_TYPE_LAYOUT
+MR_MODULE_STATIC_OR_EXTERN 
+const struct mercury_data_array__type_ctor_functors_array_1_struct
+	mercury_data_array__type_ctor_functors_array_1;
+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;
+	Code * f5;
+	Word * f6;
+	Word * f7;
+	Word * f8;
+	Word * f9;
+} mercury_data_array__type_ctor_info_array_1 = {
+	(Integer) 1,
+	ENTRY(mercury____Unify___array__array_1_0),
+	ENTRY(mercury____Index___array__array_1_0),
+	ENTRY(mercury____Compare___array__array_1_0),
+	(Word *) &mercury_data_array__type_ctor_layout_array_1,
+	(Word *) &mercury_data_array__type_ctor_functors_array_1,
+	(Word *) &mercury_data_array__type_ctor_layout_array_1,
+	string_const(""array"", 5),
+	string_const(""array"", 5)
+};
 
 MR_MODULE_STATIC_OR_EXTERN
 const struct mercury_data_array__type_ctor_layout_array_1_struct {
@@ -285,8 +312,6 @@
 } mercury_data_array__type_ctor_functors_array_1 = {
 	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
-
-#endif
 
 Declare_entry(mercury__array__array_equal_2_0);
 Declare_entry(mercury__array__array_compare_3_0);
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.147
diff -u -r1.147 std_util.m
--- std_util.m	1999/04/30 06:21:06	1.147
+++ std_util.m	1999/06/02 03:30:40
@@ -1062,9 +1062,43 @@
  * the representation of data of type `univ'.
  */
 
-#ifdef  USE_TYPE_LAYOUT
+Declare_entry(mercury____Unify___std_util__univ_0_0);
+Declare_entry(mercury____Index___std_util__univ_0_0);
+Declare_entry(mercury____Compare___std_util__univ_0_0);
 
 MR_MODULE_STATIC_OR_EXTERN
+const struct mercury_data_std_util__type_ctor_functors_univ_0_struct
+	mercury_data_std_util__type_ctor_functors_univ_0;
+
+MR_MODULE_STATIC_OR_EXTERN
+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 = {
+	(Integer) 0,
+	ENTRY(mercury____Unify___std_util__univ_0_0),
+	ENTRY(mercury____Index___std_util__univ_0_0),
+	ENTRY(mercury____Compare___std_util__univ_0_0),
+	(Word *) &mercury_data_std_util__type_ctor_layout_univ_0,
+	(Word *) &mercury_data_std_util__type_ctor_functors_univ_0,
+	(Word *) &mercury_data_std_util__type_ctor_layout_univ_0,
+	string_const(""std_util"", 8),
+	string_const(""univ"", 4)
+};
+
+
+MR_MODULE_STATIC_OR_EXTERN
 const struct mercury_data_std_util__type_ctor_layout_univ_0_struct {
 	TYPE_LAYOUT_FIELDS
 } mercury_data_std_util__type_ctor_layout_univ_0 = {
@@ -1095,12 +1129,6 @@
 } mercury_data_std_util__type_ctor_functors_type_info_0 = {
 	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
-
-#endif
-
-Define_extern_entry(mercury____Unify___std_util__univ_0_0);
-Define_extern_entry(mercury____Index___std_util__univ_0_0);
-Define_extern_entry(mercury____Compare___std_util__univ_0_0);
 
 #ifndef	COMPACT_ARGS
 
Index: runtime/mercury_bootstrap.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.c,v
retrieving revision 1.10
diff -u -r1.10 mercury_bootstrap.c
--- mercury_bootstrap.c	1999/05/31 09:32:10	1.10
+++ mercury_bootstrap.c	1999/06/02 03:31:50
@@ -22,106 +22,3 @@
 #include "mercury_imp.h"
 
 
-/*
-** We define these type_ctor_infos here until the compiler stops
-** generating them.  They should then move into array.m and std_util.m.
-**
-** There is no need to move the type_ctor_functors and type_ctor_layouts
-** back those files, because they are already defined in those files.
-** Be sure to remove the _bootstrap suffix on the references to them
-** in the type_ctor_info.
-*/
-
-
-Declare_entry(mercury____Unify___array__array_1_0);
-Declare_entry(mercury____Index___array__array_1_0);
-Declare_entry(mercury____Compare___array__array_1_0);
-extern const struct mercury_data_array__type_ctor_functors_array_1_struct
-	mercury_data_array__type_ctor_functors_array_1_bootstrap;
-extern const struct mercury_data_array__type_ctor_layout_array_1_struct
-	mercury_data_array__type_ctor_layout_array_1_bootstrap;
-MR_STATIC_CODE_CONST struct
-mercury_data_array__type_ctor_info_array_1_struct {
-	Integer f1;
-	Code * f2;
-	Code * f3;
-	Code * f4;
-	Code * f5;
-	Word * f6;
-	Word * f7;
-	Word * f8;
-	Word * f9;
-} mercury_data_array__type_ctor_info_array_1 = {
-	(Integer) 1,
-	ENTRY(mercury____Unify___array__array_1_0),
-	ENTRY(mercury____Index___array__array_1_0),
-	ENTRY(mercury____Compare___array__array_1_0),
-	(Word *) &mercury_data_array__type_ctor_layout_array_1_bootstrap,
-	(Word *) &mercury_data_array__type_ctor_functors_array_1_bootstrap,
-	(Word *) &mercury_data_array__type_ctor_layout_array_1_bootstrap,
-	string_const("array", 5),
-	string_const("array", 5)
-};
-
-
-MR_MODULE_STATIC_OR_EXTERN 
-const struct mercury_data_array__type_ctor_layout_array_1_struct {
-	TYPE_LAYOUT_FIELDS
-} mercury_data_array__type_ctor_layout_array_1_bootstrap = {
-	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
-		mkbody(MR_TYPE_CTOR_LAYOUT_ARRAY_VALUE))
-};
-
-MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_array__type_ctor_functors_array_1_struct {
-	Integer f1;
-} mercury_data_array__type_ctor_functors_array_1_bootstrap = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
-};
-
-Declare_entry(mercury____Unify___std_util__univ_0_0);
-Declare_entry(mercury____Index___std_util__univ_0_0);
-Declare_entry(mercury____Compare___std_util__univ_0_0);
-extern const struct mercury_data_std_util__type_ctor_functors_univ_0_struct
-	mercury_data_std_util__type_ctor_functors_univ_0_bootstrap;
-extern const struct mercury_data_std_util__type_ctor_layout_univ_0_struct
-	mercury_data_std_util__type_ctor_layout_univ_0_bootstrap;
-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 = {
-	(Integer) 0,
-	ENTRY(mercury____Unify___std_util__univ_0_0),
-	ENTRY(mercury____Index___std_util__univ_0_0),
-	ENTRY(mercury____Compare___std_util__univ_0_0),
-	(Word *) &mercury_data_std_util__type_ctor_layout_univ_0_bootstrap,
-	(Word *) &mercury_data_std_util__type_ctor_functors_univ_0_bootstrap,
-	(Word *) &mercury_data_std_util__type_ctor_layout_univ_0_bootstrap,
-	string_const("std_util", 8),
-	string_const("univ", 4)
-};
-
-
-MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__type_ctor_layout_univ_0_struct {
-	TYPE_LAYOUT_FIELDS
-} mercury_data_std_util__type_ctor_layout_univ_0_bootstrap = {
-	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
-		mkbody(MR_TYPE_CTOR_LAYOUT_UNIV_VALUE))
-};
-
-MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__type_ctor_functors_univ_0_struct {
-	Integer f1;
-} mercury_data_std_util__type_ctor_functors_univ_0_bootstrap = {
-	MR_TYPE_CTOR_FUNCTORS_UNIV
-};
-


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.
--------------------------------------------------------------------------
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