[m-dev.] diff: use MR_Word rather than MR_Box for pragma export

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Nov 5 23:02:14 AEDT 2000


Estimated hours taken: 1

Fix a bug in the implementation of `pragma export': map polymorphic
arguments to `MR_Word', as the Mercury language reference manual
requires, rather than to `MR_Box'.

compiler/export.m:
	Map polymorphic arguments to `MR_Word' rather than `MR_Box'.

runtime/mercury.h:
runtime/mercury_init.h:
runtime/mercury_wrapper.h:
runtime/mercury_wrapper.c:
	Use `MR_Word' rather than `MR_Box' in various type
	declarations, to match what the compiler now outputs for
	`pragma export' procedures.

library/exception.m:
	Add a comment.

Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/export.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.37
diff -u -d -r1.37 export.m
--- compiler/export.m	2000/10/02 07:44:59	1.37
+++ compiler/export.m	2000/11/05 04:53:55
@@ -579,8 +579,6 @@
 		Result = "MR_String"
 	; Type = term__functor(term__atom("character"), [], _) ->
 		Result = "MR_Char"
-	; Type = term__variable(_) ->
-		Result = "MR_Box"
 	;
 		Result = "MR_Word"
 	).
Index: library/exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.31
diff -u -d -r1.31 exception.m
--- library/exception.m	2000/10/23 15:08:24	1.31
+++ library/exception.m	2000/11/05 11:57:41
@@ -813,6 +813,9 @@
 This causes problems because the LLDS back-end
 does not let you export code with determinism `nondet'.
 Instead we hand-code it... see below.
+Hand-coding it also avoids the casting needed to use MR_Word
+(which `pragma export' procedures use for polymorphically
+typed arguments) rather than MR_Box.
 
 :- pred call_goal(pred(T), T).
 :- mode call_goal(pred(out) is det, out) is det.
Index: runtime/mercury_init.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_init.h,v
retrieving revision 1.25
diff -u -d -r1.25 mercury_init.h
--- runtime/mercury_init.h	2000/08/26 04:34:00	1.25
+++ runtime/mercury_init.h	2000/11/05 04:56:07
@@ -116,8 +116,8 @@
 extern	void	ML_io_stdout_stream(MR_Word *);
 extern	void	ML_io_stdin_stream(MR_Word *);
 
-extern	void	ML_io_print_to_stream(MR_Word, MR_Word, MR_Box);
-extern	void	ML_io_print_to_cur_stream(MR_Word, MR_Box);
+extern	void	ML_io_print_to_stream(MR_Word, MR_Word, MR_Word);
+extern	void	ML_io_print_to_cur_stream(MR_Word, MR_Word);
 
 /* in trace/mercury_trace_internal.h */
 extern	char	*MR_trace_getline(const char *, FILE *mdb_in, FILE *mdb_out);
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.75
diff -u -d -r1.75 mercury_wrapper.c
--- runtime/mercury_wrapper.c	2000/10/31 07:54:08	1.75
+++ runtime/mercury_wrapper.c	2000/11/01 13:23:16
@@ -204,8 +204,8 @@
 void	(*MR_io_stderr_stream)(MR_Word *);
 void	(*MR_io_stdout_stream)(MR_Word *);
 void	(*MR_io_stdin_stream)(MR_Word *);
-void	(*MR_io_print_to_cur_stream)(MR_Word, MR_Box);
-void	(*MR_io_print_to_stream)(MR_Word, MR_Word, MR_Box);
+void	(*MR_io_print_to_cur_stream)(MR_Word, MR_Word);
+void	(*MR_io_print_to_stream)(MR_Word, MR_Word, MR_Word);
 
 void	(*MR_DI_output_current_ptr)(MR_Integer, MR_Integer, MR_Integer, MR_Word, MR_String,
 		MR_String, MR_Integer, MR_Integer, MR_Integer, MR_Word, MR_String, MR_Word, MR_Word);
Index: runtime/mercury_wrapper.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.h,v
retrieving revision 1.36
diff -u -d -r1.36 mercury_wrapper.h
--- runtime/mercury_wrapper.h	2000/10/21 11:21:40	1.36
+++ runtime/mercury_wrapper.h	2000/11/01 13:23:10
@@ -76,8 +76,8 @@
 extern	void		(*MR_io_stderr_stream)(MR_Word *);
 extern	void		(*MR_io_stdout_stream)(MR_Word *);
 extern	void		(*MR_io_stdin_stream)(MR_Word *);
-extern	void		(*MR_io_print_to_cur_stream)(MR_Word, MR_Box);
-extern	void		(*MR_io_print_to_stream)(MR_Word, MR_Word, MR_Box);
+extern	void		(*MR_io_print_to_cur_stream)(MR_Word, MR_Word);
+extern	void		(*MR_io_print_to_stream)(MR_Word, MR_Word, MR_Word);
 
 extern	void		(*address_of_mercury_init_io)(void);
 extern	void		(*address_of_init_modules)(void);

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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