[m-dev.] for review: fix array dependency problem

Peter Ross peter.ross at miscrit.be
Fri Dec 22 02:35:03 AEDT 2000


Hi,

This change bootchecks, but has one outstanding issue.

That is that there exists the following declaration in mercury.c:

static MR_UnifyFunc_1 mercury__array__do_unify__array_1_0;

and I am not sure what to do with it?

Pete


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


Estimated hours taken: 1

Avoid a dependency where the runtime depends on the library.

library/array.m:
runtime/mercury.c:
runtime/mercury.h:
    Move code for doing array comparisons and unifications into the std
    library.


Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.80
diff -u -r1.80 array.m
--- library/array.m	2000/12/13 00:00:39	1.80
+++ library/array.m	2000/12/21 15:10:28
@@ -336,19 +336,50 @@
 
 %-----------------------------------------------------------------------------%
 
+:- pragma c_header_code("
+#ifdef MR_HIGHLEVEL_CODE
+  bool MR_CALL mercury__array__do_unify__array_1_0(
+  	MR_Mercury_Type_Info type_info, MR_Box x, MR_Box y);
+  bool MR_CALL mercury__array____Unify____array_1_0(
+	MR_Mercury_Type_Info type_info, MR_Array x, MR_Array y);
+  void MR_CALL mercury__array__do_compare__array_1_0(MR_Mercury_Type_Info
+ 	 type_info, MR_Comparison_Result *result, MR_Box x, MR_Box y);
+  void MR_CALL mercury__array____Compare____array_1_0(MR_Mercury_Type_Info
+	type_info, MR_Comparison_Result *result, MR_Array x, MR_Array y);
+#endif
+").
 :- pragma c_code("
 
 #ifdef MR_HIGHLEVEL_CODE
 void sys_init_array_module_builtins(void);
 void sys_init_array_module_builtins(void) {
+	MR_init_entry(mercury__array____Unify____array_1_0);
+	MR_init_entry(mercury__array____Compare____array_1_0);
 	return;
 }
 
 bool MR_CALL
+mercury__array__do_unify__array_1_0(MR_Mercury_Type_Info type_info,
+	MR_Box x, MR_Box y)
+{
+	return mercury__array____Unify____array_1_0(
+		type_info, (MR_Array) x, (MR_Array) y);
+}
+
+bool MR_CALL
 mercury__array____Unify____array_1_0(MR_Mercury_Type_Info type_info,
 	MR_Array x, MR_Array y)
 {
 	return mercury__array__array_equal_2_p_0(type_info, x, y);
+}
+
+void MR_CALL
+mercury__array__do_compare__array_1_0(
+	MR_Mercury_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
+{
+	mercury__array____Compare____array_1_0(
+		type_info, result, (MR_Array) x, (MR_Array) y);
 }
 
 void MR_CALL
Index: runtime/mercury.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.c,v
retrieving revision 1.18
diff -u -r1.18 mercury.c
--- runtime/mercury.c	2000/12/03 02:22:51	1.18
+++ runtime/mercury.c	2000/12/21 15:10:31
@@ -742,14 +742,6 @@
 }
 
 static bool MR_CALL
-mercury__array__do_unify__array_1_0(MR_Mercury_Type_Info type_info,
-	MR_Box x, MR_Box y)
-{
-	return mercury__array____Unify____array_1_0(
-		type_info, (MR_Array) x, (MR_Array) y);
-}
-
-static bool MR_CALL
 mercury__std_util__do_unify__univ_0_0(MR_Box x, MR_Box y)
 {
 	return mercury__std_util____Unify____univ_0_0(
@@ -874,15 +866,6 @@
 }
 
 static void MR_CALL
-mercury__array__do_compare__array_1_0(
-	MR_Mercury_Type_Info type_info, MR_Comparison_Result *result,
-	MR_Box x, MR_Box y)
-{
-	mercury__array____Compare____array_1_0(
-		type_info, result, (MR_Array) x, (MR_Array) y);
-}
-
-static void MR_CALL
 mercury__std_util__do_compare__univ_0_0(
 	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
@@ -999,7 +982,6 @@
 	MR_init_entry(mercury__builtin____Unify____c_pointer_0_0);
 	MR_init_entry(mercury__builtin____Unify____func_0_0);
 	MR_init_entry(mercury__builtin____Unify____pred_0_0);
-	MR_init_entry(mercury__array____Unify____array_1_0);
 	MR_init_entry(mercury__std_util____Unify____univ_0_0);
 	MR_init_entry(mercury__std_util____Unify____type_desc_0_0);
 	MR_init_entry(mercury__private_builtin____Unify____type_ctor_info_1_0);
@@ -1015,7 +997,6 @@
 	MR_init_entry(mercury__builtin____Compare____c_pointer_0_0);
 	MR_init_entry(mercury__builtin____Compare____func_0_0);
 	MR_init_entry(mercury__builtin____Compare____pred_0_0);
-	MR_init_entry(mercury__array____Compare____array_1_0);
 	MR_init_entry(mercury__std_util____Compare____univ_0_0);
 	MR_init_entry(mercury__std_util____Compare____type_desc_0_0);
 	MR_init_entry(mercury__private_builtin____Compare____type_ctor_info_1_0);
Index: runtime/mercury.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.h,v
retrieving revision 1.29
diff -u -r1.29 mercury.h
--- runtime/mercury.h	2000/12/14 16:43:24	1.29
+++ runtime/mercury.h	2000/12/21 15:10:34
@@ -33,6 +33,7 @@
 #include "mercury_bootstrap.h"
 #include "mercury_memory.h"	/* for memory allocation routines */
 #include "mercury_type_tables.h"	/* for MR_register_type_ctor_info */
+#include "mercury_goto.h"		/* for MR_init_entry */
 
 #ifdef CONSERVATIVE_GC
   #include "gc.h"
@@ -378,8 +379,6 @@
 bool MR_CALL mercury__builtin____Unify____pred_0_0(MR_Pred x, MR_Pred y); 
 bool MR_CALL mercury__builtin____Unify____tuple_0_0(
 	MR_Mercury_Type_Info type_info, MR_Tuple x, MR_Tuple y); 
-bool MR_CALL mercury__array____Unify____array_1_0(
-	MR_Mercury_Type_Info type_info, MR_Array x, MR_Array y);
 bool MR_CALL mercury__std_util____Unify____univ_0_0(MR_Univ x, MR_Univ y); 
 bool MR_CALL mercury__std_util____Unify____type_desc_0_0(
 	MR_Type_Desc x, MR_Type_Desc y); 
@@ -415,8 +414,6 @@
 void MR_CALL mercury__builtin____Compare____tuple_0_0(
 	MR_Mercury_Type_Info type_info, MR_Comparison_Result *result,
 	MR_Tuple x, MR_Tuple y); 
-void MR_CALL mercury__array____Compare____array_1_0(MR_Mercury_Type_Info
-	type_info, MR_Comparison_Result *result, MR_Array x, MR_Array y);
 void MR_CALL mercury__std_util____Compare____univ_0_0(
 	MR_Comparison_Result *result, MR_Univ x, MR_Univ y);
 void MR_CALL mercury__std_util____Compare____type_desc_0_0(

--------------------------------------------------------------------------
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