[m-dev.] diff: remove code from mercury_bootstrap.c

Tyson Dowd trd at cs.mu.OZ.AU
Wed Nov 3 18:07:01 AEDT 1999


I don't know whether I'm supposed to tag this for bootstrapping.
Any of the previous tags for bootstrapping probably subsume this one
anyway.

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


Estimated hours taken: 1

Remove code from mercury_bootstrap.c.

library/std_util.m:
	Add type_ctor_info for type_info/0.

runtime/mercury_bootstrap.c:
	Remove type_ctor_info for type_info/0 (and other supporting
	bootstrapping stuff).


Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.169
diff -u -r1.169 std_util.m
--- std_util.m	1999/10/28 06:22:49	1.169
+++ std_util.m	1999/11/02 09:03:12
@@ -1058,6 +1058,20 @@
 	MR_TYPE_CTOR_FUNCTORS_SPECIAL
 };
 
+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),
+	ENTRY(mercury____Index___std_util__type_info_0_0),
+	ENTRY(mercury____Compare___std_util__type_info_0_0),
+	(Integer) 15,
+	(Word *) &mercury_data_std_util__type_ctor_functors_type_info_0,
+	(Word *) &mercury_data_std_util__type_ctor_layout_type_info_0,
+	string_const(""std_util"", 8),
+	string_const(""type_info"", 9),
+	MR_RTTI_VERSION
+};
+
 #ifndef	COMPACT_ARGS
 
 Declare_label(mercury____Compare___std_util__univ_0_0_i1);
@@ -1219,6 +1233,8 @@
 
 	MR_INIT_TYPE_CTOR_INFO(mercury_data_std_util__type_ctor_info_univ_0,
 		std_util__univ_0_0);
+	MR_INIT_TYPE_CTOR_INFO(mercury_data_std_util__type_ctor_info_type_info_0,
+		std_util__type_info_0_0);
 }
 
 ").
Index: runtime/mercury_bootstrap.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.c,v
retrieving revision 1.21
diff -u -r1.21 mercury_bootstrap.c
--- mercury_bootstrap.c	1999/10/20 07:03:20	1.21
+++ mercury_bootstrap.c	1999/11/02 08:59:53
@@ -21,110 +21,3 @@
 
 #include "mercury_imp.h"
 
-MR_MODULE_STATIC_OR_EXTERN
-const struct mercury_data_std_util__type_ctor_layout_type_info_0_struct_bootstrap
-{
-	TYPE_LAYOUT_FIELDS
-} mercury_data_std_util__type_ctor_layout_type_info_0_bootstrap = {
-	make_typelayout_for_all_tags(TYPE_CTOR_LAYOUT_CONST_TAG, 
-		MR_mkbody(MR_TYPE_CTOR_LAYOUT_TYPEINFO_VALUE))
-};
-
-MR_MODULE_STATIC_OR_EXTERN
-const struct
-mercury_data_std_util__type_ctor_functors_type_info_0_struct_bootstrap {
-	Integer f1;
-} mercury_data_std_util__type_ctor_functors_type_info_0_bootstrap = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
-};
-
-
-Define_extern_entry(mercury____Unify___std_util__type_info_0_0_bootstrap);
-Define_extern_entry(mercury____Index___std_util__type_info_0_0_bootstrap);
-Define_extern_entry(mercury____Compare___std_util__type_info_0_0_bootstrap);
-
-#if !defined(USE_GCC_NONLOCAL_GOTOS) || defined(USE_ASM_LABELS)
-
-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),
-	ENTRY(mercury____Compare___std_util__type_info_0_0_bootstrap),
-	(Integer) 15,
-	(Word *) &mercury_data_std_util__type_ctor_functors_type_info_0_bootstrap,
-	(Word *) &mercury_data_std_util__type_ctor_layout_type_info_0_bootstrap,
-	string_const("std_util", 8),
-	string_const("type_info", 9),
-	MR_RTTI_VERSION
-};
-
-#else /* defined(USE_GCC_NONLOCAL_GOTOS) && !defined(USE_ASM_LABELS) */
-
-/*
-** Can't use ENTRY(...) in initializers, so just don't bother;
-** backwards compatibility isn't important for these grades.
-*/
-
-#endif
-
-
-BEGIN_MODULE(unify_univ_module_bootstrap)
-	init_entry(mercury____Unify___std_util__type_info_0_0_bootstrap);
-	init_entry(mercury____Index___std_util__type_info_0_0_bootstrap);
-	init_entry(mercury____Compare___std_util__type_info_0_0_bootstrap);
-BEGIN_CODE
-Define_entry(mercury____Unify___std_util__type_info_0_0_bootstrap);
-{
-	/*
-	** Unification for type_info.
-	**
-	** The two inputs are in the registers named by unify_input[12].
-	** The success/failure indication should go in unify_output.
-	*/
-	int	comp;
-
-	save_transient_registers();
-	comp = MR_compare_type_info(r1, r2);
-	restore_transient_registers();
-	r1 = (comp == COMPARE_EQUAL);
-	proceed();
-}
-
-Define_entry(mercury____Index___std_util__type_info_0_0_bootstrap);
-	r1 = -1;
-	proceed();
-
-Define_entry(mercury____Compare___std_util__type_info_0_0_bootstrap);
-{
-	/*
-	** Comparison for type_info:
-	**
-	** The two inputs are in the registers named by compare_input[12].
-	** The result should go in compare_output.
-	*/
-	int	comp;
-
-	save_transient_registers();
-	comp = MR_compare_type_info(r1, r2);
-	restore_transient_registers();
-	r1 = comp;
-	proceed();
-}
-
-END_MODULE
-
-/* Ensure that the initialization code for the above module gets run. */
-/*
-INIT sys_init_unify_univ_module_bootstrap
-*/
-extern ModuleFunc unify_univ_module_bootstrap;
-void sys_init_unify_univ_module_bootstrap(void); /* suppress gcc -Wmissing-decl warning */
-void sys_init_unify_univ_module_bootstrap(void) {
-	unify_univ_module_bootstrap();
-}
-
-void call_engine(Code *entry_point); /* suppress gcc -Wmissing-decl warning */
-void call_engine(Code *entry_point) {
-	(void) MR_call_engine(entry_point, FALSE);
-}

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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