[m-rev.] for review: module qualification of predicates in builtin modules

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 30 00:42:33 AEST 2003


This diff, besides being useful cleanup in its own right, will simplify
the macros for hand-written proc_static structures in an upcoming diff.

Zoltan.

Module qualify the names of all predicates, even those in the builtin and
private_builtin modules, in the LLDS backend. (This is already done by the MLDS
backends.)

compiler/name_mangle.m:
	Delete the code that makes predicates defined in builtin.m and
	private_builtin.m exceptions from the LLDS naming scheme.

runtime/mercury_ho_call.c:
	Provide labels with as well as without module qualification for the
	predicates in builtin.m with whose handwritten implementations are
	in the runtime. (These are the only such predicates in the two
	modules.) The labels without module qualification will be deleted
	once this change has been installed on all our machines.

runtime/mercury_grade.h:
	Since two object files are incompatible if they refer to predicates
	in these modules by different names, bump the runtime compatibility
	version number.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/name_mangle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/name_mangle.m,v
retrieving revision 1.2
diff -u -b -r1.2 name_mangle.m
--- compiler/name_mangle.m	27 May 2003 05:57:15 -0000	1.2
+++ compiler/name_mangle.m	29 May 2003 14:07:52 -0000
@@ -174,19 +174,13 @@
 	DefiningModuleName = sym_name_mangle(DefiningModule),
 	(
 		(
-			mercury_private_builtin_module(DeclaringModule)
-		;
-			mercury_public_builtin_module(DeclaringModule)
-		;
 			Name0 = "main",
 			Arity = 2
 		;
 			string__prefix(Name0, "__")
 		)
 		% The conditions above define which labels are printed without
-		% module qualification.  XXX Changes to runtime/* are necessary
-		% to allow `builtin' or `private_builtin' labels to be
-		% qualified.
+		% module qualification.
 	->
 		LabelName0 = Name0
 	;
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.47
diff -u -b -r1.47 mercury_grade.h
--- runtime/mercury_grade.h	21 Mar 2003 08:00:29 -0000	1.47
+++ runtime/mercury_grade.h	29 May 2003 08:29:06 -0000
@@ -54,7 +54,7 @@
 ** RTTI version number.
 */
 
-#define MR_GRADE_PART_0	v11_
+#define MR_GRADE_PART_0	v12_
 
 #ifdef MR_HIGHLEVEL_CODE
 
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.61
diff -u -b -r1.61 mercury_ho_call.c
--- runtime/mercury_ho_call.c	1 May 2003 15:34:13 -0000	1.61
+++ runtime/mercury_ho_call.c	29 May 2003 12:39:19 -0000
@@ -383,23 +383,39 @@
 ** These are the real implementations of unify and compare.
 */
 
+/* the entry labels in this block are for bootstrapping only */
 MR_define_extern_entry(mercury__unify_2_0);
 MR_define_extern_entry(mercury__compare_3_0);
 MR_define_extern_entry(mercury__compare_3_1);
 MR_define_extern_entry(mercury__compare_3_2);
 MR_define_extern_entry(mercury__compare_3_3);
-MR_declare_label(mercury__compare_3_0_i1);
 MR_define_extern_entry(mercury__compare_representation_3_0);
 
+MR_define_extern_entry(mercury__builtin__unify_2_0);
+MR_define_extern_entry(mercury__builtin__compare_3_0);
+MR_define_extern_entry(mercury__builtin__compare_3_1);
+MR_define_extern_entry(mercury__builtin__compare_3_2);
+MR_define_extern_entry(mercury__builtin__compare_3_3);
+MR_declare_label(mercury__builtin__compare_3_0_i1);
+MR_define_extern_entry(mercury__builtin__compare_representation_3_0);
+
 MR_BEGIN_MODULE(call_module)
 	MR_init_entry_an(mercury__do_call_closure);
 	MR_init_entry_an(mercury__do_call_class_method);
+
 	MR_init_entry_an(mercury__unify_2_0);
 	MR_init_entry_an(mercury__compare_3_0);
 	MR_init_entry_an(mercury__compare_3_1);
 	MR_init_entry_an(mercury__compare_3_2);
 	MR_init_entry_an(mercury__compare_3_3);
 	MR_init_entry_an(mercury__compare_representation_3_0);
+
+	MR_init_entry_an(mercury__builtin__unify_2_0);
+	MR_init_entry_an(mercury__builtin__compare_3_0);
+	MR_init_entry_an(mercury__builtin__compare_3_1);
+	MR_init_entry_an(mercury__builtin__compare_3_2);
+	MR_init_entry_an(mercury__builtin__compare_3_3);
+	MR_init_entry_an(mercury__builtin__compare_representation_3_0);
 MR_BEGIN_CODE
 
 /*
@@ -528,11 +544,19 @@
 }
 
 /*
-** mercury__unify_2_0 is called as `unify(TypeInfo, X, Y)'
+** mercury__builtin__unify_2_0 is called as `unify(TypeInfo, X, Y)'
 ** in the mode `unify(in, in, in) is semidet'.
 */
 
 MR_define_entry(mercury__unify_2_0);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__unify_2_0),
+		MR_LABEL(mercury__unify_2_0));
+}
+#endif
+
+MR_define_entry(mercury__builtin__unify_2_0);
 {
 
 #define	DECLARE_LOCALS							\
@@ -558,7 +582,7 @@
 
 #define	tailcall_user_pred()						\
 	MR_tailcall(type_ctor_info->MR_type_ctor_unify_pred, 		\
-		MR_LABEL(mercury__unify_2_0))
+		MR_LABEL(mercury__builtin__unify_2_0))
 
 #define	start_label		unify_start
 #define	call_user_code_label	call_unify_in_proc
@@ -581,7 +605,7 @@
 }
 
 /*
-** mercury__compare_3_3 is called as `compare(TypeInfo, Result, X, Y)'
+** mercury__builtin__compare_3_3 is called as `compare(TypeInfo, Result, X, Y)'
 ** in the mode `compare(in, out, in, in) is det'.
 **
 ** (The additional entry points replace either or both "in"s with "ui"s.)
@@ -590,22 +614,54 @@
 MR_define_entry(mercury__compare_3_0);
 #ifdef MR_MPROF_PROFILE_CALLS
 {
-	MR_tailcall(MR_ENTRY(mercury__compare_3_3), MR_LABEL(mercury__compare_3_0));
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__compare_3_0));
 }
 #endif
 MR_define_entry(mercury__compare_3_1);
 #ifdef MR_MPROF_PROFILE_CALLS
 {
-	MR_tailcall(MR_ENTRY(mercury__compare_3_3), MR_LABEL(mercury__compare_3_1));
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__compare_3_1));
 }
 #endif
 MR_define_entry(mercury__compare_3_2);
 #ifdef MR_MPROF_PROFILE_CALLS
 {
-	MR_tailcall(MR_ENTRY(mercury__compare_3_3), MR_LABEL(mercury__compare_3_2));
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__compare_3_2));
 }
 #endif
 MR_define_entry(mercury__compare_3_3);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__compare_3_3));
+}
+#endif
+
+MR_define_entry(mercury__builtin__compare_3_0);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__builtin__compare_3_0));
+}
+#endif
+MR_define_entry(mercury__builtin__compare_3_1);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__builtin__compare_3_1));
+}
+#endif
+MR_define_entry(mercury__builtin__compare_3_2);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_3_3),
+		MR_LABEL(mercury__builtin__compare_3_2));
+}
+#endif
+MR_define_entry(mercury__builtin__compare_3_3);
 {
 
 #define	DECLARE_LOCALS							\
@@ -631,7 +687,7 @@
 
 #define	tailcall_user_pred()						\
 	MR_tailcall(type_ctor_info->MR_type_ctor_compare_pred,		\
-		MR_LABEL(mercury__compare_3_3))
+		MR_LABEL(mercury__builtin__compare_3_3))
 
 #define	start_label		compare_start
 #define	call_user_code_label	call_compare_in_proc
@@ -656,12 +712,19 @@
 }
 
 /*
-** mercury__compare_representation_3_0 is called as
+** mercury__builtin__compare_representation_3_0 is called as
 ** `compare_representation(TypeInfo, Result, X, Y)' in the mode
 ** `compare_representation(in, uo, in, in) is cc_multi'.
 */
 
 MR_define_entry(mercury__compare_representation_3_0);
+#ifdef MR_MPROF_PROFILE_CALLS
+{
+	MR_tailcall(MR_ENTRY(mercury__builtin__compare_representation_3_0),
+		MR_LABEL(mercury__compare_representation_3_0));
+}
+#endif
+MR_define_entry(mercury__builtin__compare_representation_3_0);
 {
 
 #define	DECLARE_LOCALS							\
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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