[m-dev.] diff: --high-level-data, part 2

Fergus Henderson fjh at cs.mu.OZ.AU
Wed May 31 22:57:39 AEST 2000


Estimated hours taken: 6

Mork work on implementing the `--high-level-data' option.
This change adds support for it to the runtime and standard library code.

runtime/mercury.h:
	Wrap `#ifndef MR_HIGHLEVEL_DATA' around out the #defines that
	work around the lack of support for `pragma export', since
	that work-around doesn't work with --high-level-data.

runtime/mercury.h:
	Define typedefs for C names corresponding to the various
	Mercury builtin / standard library types:
		from builtin.m: comparison_result, void, c_pointer, pred, func;
		from array.m: array; 
		from std_util.m: univ, type_desc;
		from private_builtin.m: type_info, type_ctor_info,
			typeclass_info, base_typeclass_info.
	For `--no-high-level-code', these typedefs are defined as `MR_Word'.
	But for `--high-level-code', they are mostly defined as pointers
	to struct types.

runtime/mercury.h:
runtime/mercury.c:
library/builtin.m:
library/exception.m:
	Use the typedefs mentioned above, rather than hard-coding `MR_Word'.

runtime/mercury.c:
	#include "mercury_heap.h", to fix a gcc warning about the
	definitions of create[1-3]().

compiler/ml_unify_gen.m:
	Add some extra casts that are needed when you use --high-level-data
	but not `--tags none'.  In particular, for `shared_local_tag' constants
	of user-defined types, where we generate a `mkword' rval,
	we need to cast the result of `mkword' to the right type.

compiler/mlds_to_c.m:
	- Declare each function parameter on a separate line.
	  For --high-level-data, this makes the generated code much
	  more readable.  Even for --no-high-level-data, it is probably
	  an improvement.
	- Avoid some redundant forward struct declarations.

Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.35
diff -u -d -r1.35 mlds_to_c.m
--- compiler/mlds_to_c.m	2000/05/31 06:04:06	1.35
+++ compiler/mlds_to_c.m	2000/05/31 09:33:43
@@ -423,8 +423,7 @@
 			{ Signature = mlds__func_params(Parameters,
 				_RetTypes) },
 			{ assoc_list__values(Parameters, ParamTypes) },
-			list__foldl(mlds_output_type_forward_decls(Indent),
-				ParamTypes)
+			mlds_output_type_forward_decls(Indent, ParamTypes)
 		;
 			[]
 		),
@@ -440,21 +439,33 @@
 			[]
 		),
 		mlds_output_decl_flags(Flags),
-		mlds_output_decl_body(Indent, qual(ModuleName, Name), DefnBody)
+		mlds_output_decl_body(Indent, qual(ModuleName, Name), Context,
+			DefnBody)
 	).
 
-:- pred mlds_output_type_forward_decls(indent, mlds__type,
+:- pred mlds_output_type_forward_decls(indent, list(mlds__type),
 		io__state, io__state).
 :- mode mlds_output_type_forward_decls(in, in, di, uo) is det.
 
-mlds_output_type_forward_decls(Indent, Type) -->
+mlds_output_type_forward_decls(Indent, ParamTypes) -->
 	%
 	% Output forward declarations for all struct types
-	% that are contained in the specified type.
+	% that are contained in the parameter types.
 	%
-	aggregate(mlds_type_contains_type(Type),
+	aggregate(mlds_type_list_contains_type(ParamTypes),
 		mlds_output_type_forward_decl(Indent)).
 
+	% mlds_type_list_contains_type(Types, SubType):
+	%	True iff the type SubType occurs (directly or indirectly)
+	%	in the specified list of Types.
+	%
+:- pred mlds_type_list_contains_type(list(mlds__type), mlds__type).
+:- mode mlds_type_list_contains_type(in, out) is nondet.
+
+mlds_type_list_contains_type(Types, SubType) :-
+	list__member(Type, Types),
+	mlds_type_contains_type(Type, SubType).
+
 	% mlds_type_contains_type(Type, SubType):
 	%	True iff the type Type contains the type SubType.
 	%
@@ -512,10 +523,10 @@
 			DefnBody).
 
 :- pred mlds_output_decl_body(indent, mlds__qualified_entity_name,
-		mlds__entity_defn, io__state, io__state).
-:- mode mlds_output_decl_body(in, in, in, di, uo) is det.
+		mlds__context, mlds__entity_defn, io__state, io__state).
+:- mode mlds_output_decl_body(in, in, in, in, di, uo) is det.
 
-mlds_output_decl_body(Indent, Name, DefnBody) -->
+mlds_output_decl_body(Indent, Name, Context, DefnBody) -->
 	(
 		{ DefnBody = mlds__data(Type, _Initializer) },
 		mlds_output_data_decl(Name, Type)
@@ -523,7 +534,7 @@
 		{ DefnBody = mlds__function(MaybePredProcId, Signature,
 			_MaybeBody) },
 		mlds_output_maybe(MaybePredProcId, mlds_output_pred_proc_id),
-		mlds_output_func_decl(Indent, Name, Signature)
+		mlds_output_func_decl(Indent, Name, Context, Signature)
 	;
 		{ DefnBody = mlds__class(ClassDefn) },
 		mlds_output_class_decl(Indent, Name, ClassDefn)
@@ -788,7 +799,7 @@
 :- mode mlds_output_func(in, in, in, in, in, di, uo) is det.
 
 mlds_output_func(Indent, Name, Context, Signature, MaybeBody) -->
-	mlds_output_func_decl(Indent, Name, Signature),
+	mlds_output_func_decl(Indent, Name, Context, Signature),
 	(
 		{ MaybeBody = no },
 		io__write_string(";\n")
@@ -858,11 +869,11 @@
 		io__write_string("}\n")	% end the function
 	).
 
-:- pred mlds_output_func_decl(indent, qualified_entity_name, func_params, 
-			io__state, io__state).
-:- mode mlds_output_func_decl(in, in, in, di, uo) is det.
+:- pred mlds_output_func_decl(indent, qualified_entity_name, mlds__context,
+		func_params, io__state, io__state).
+:- mode mlds_output_func_decl(in, in, in, in, di, uo) is det.
 
-mlds_output_func_decl(Indent, Name, Signature) -->
+mlds_output_func_decl(Indent, Name, Context, Signature) -->
 	{ Signature = mlds__func_params(Parameters, RetTypes) },
 	( { RetTypes = [] } ->
 		io__write_string("void")
@@ -873,32 +884,35 @@
 	),
 	io__write_char(' '),
 	mlds_output_fully_qualified_name(Name),
-	mlds_output_params(Indent, Name, Parameters),
+	mlds_output_params(Indent, Name, Context, Parameters),
 	( { RetTypes = [RetType2] } ->
 		mlds_output_type_suffix(RetType2)
 	;
 		[]
 	).
 
-:- pred mlds_output_params(indent, qualified_entity_name, mlds__arguments,
-		io__state, io__state).
-:- mode mlds_output_params(in, in, in, di, uo) is det.
+:- pred mlds_output_params(indent, qualified_entity_name, mlds__context,
+		mlds__arguments, io__state, io__state).
+:- mode mlds_output_params(in, in, in, in, di, uo) is det.
 
-mlds_output_params(Indent, FuncName, Parameters) -->
+mlds_output_params(Indent, FuncName, Context, Parameters) -->
 	io__write_char('('),
 	( { Parameters = [] } ->
 		io__write_string("void")
 	;
-		io__write_list(Parameters, ", ",
-			mlds_output_param(Indent, FuncName))
+		io__nl,
+		io__write_list(Parameters, ",\n",
+			mlds_output_param(Indent + 1, FuncName, Context))
 	),
 	io__write_char(')').
 
-:- pred mlds_output_param(indent, qualified_entity_name,
+:- pred mlds_output_param(indent, qualified_entity_name, mlds__context,
 		pair(mlds__entity_name, mlds__type), io__state, io__state).
-:- mode mlds_output_param(in, in, in, di, uo) is det.
+:- mode mlds_output_param(in, in, in, in, di, uo) is det.
 
-mlds_output_param(_Indent, qual(ModuleName, _FuncName), Name - Type) -->
+mlds_output_param(Indent, qual(ModuleName, _FuncName), Context,
+		Name - Type) -->
+	mlds_indent(Context, Indent),
 	mlds_output_data_decl(qual(ModuleName, Name), Type).
 
 :- pred mlds_output_func_type_prefix(func_params, io__state, io__state).
@@ -1786,7 +1800,8 @@
 			Initializer, Context) },
 		mlds_output_defn(Indent, ModuleName, TempDefn),
 
-		mlds_output_assign_args(Indent, ModuleName, Context, Rest, Args),
+		mlds_output_assign_args(Indent, ModuleName, Context, Rest,
+			Args),
 
 		mlds_indent(Context, Indent),
 		mlds_output_fully_qualified_name(qual(ModuleName, Name)),
@@ -1850,7 +1865,7 @@
 		MaybeCtorName, Args, ArgTypes) },
 	mlds_indent(Indent),
 	io__write_string("{\n"),
-	mlds_indent(Indent + 1),
+	mlds_indent(Context, Indent + 1),
 	mlds_output_lval(Target),
 	io__write_string(" = "),
 	( { MaybeTag = yes(Tag0) } ->
@@ -1897,7 +1912,7 @@
 	io__write_string(";\n"),
 	mlds_output_init_args(Args, ArgTypes, Context, 0, Target, Tag,
 		Indent + 1),
-	mlds_indent(Indent),
+	mlds_indent(Context, Indent),
 	io__write_string("}\n").
 
 mlds_output_atomic_stmt(Indent, mark_hp(Lval), _) -->
Index: compiler/ml_unify_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_unify_gen.m,v
retrieving revision 1.12
diff -u -d -r1.12 ml_unify_gen.m
--- compiler/ml_unify_gen.m	2000/05/31 06:04:15	1.12
+++ compiler/ml_unify_gen.m	2000/05/31 08:56:12
@@ -315,9 +315,10 @@
 
 ml_gen_constant(float_constant(Float), _, const(float_const(Float))) --> [].
 
-ml_gen_constant(shared_local_tag(Bits1, Num1), _, Rval) -->
-	{ Rval = mkword(Bits1,
-		unop(std_unop(mkbody), const(int_const(Num1)))) }.
+ml_gen_constant(shared_local_tag(Bits1, Num1), VarType, Rval) -->
+	ml_gen_type(VarType, MLDS_Type),
+	{ Rval = unop(cast(MLDS_Type), mkword(Bits1,
+		unop(std_unop(mkbody), const(int_const(Num1))))) }.
 
 ml_gen_constant(type_ctor_info_constant(ModuleName0, TypeName, TypeArity),
 		VarType, Rval) -->
@@ -1396,9 +1397,10 @@
 	ml_gen_var(Var, VarLval),
 	ml_variable_type(Var, Type),
 	ml_cons_id_to_tag(ConsId, Type, Tag),
+	ml_gen_type(Type, MLDS_Type),
 	=(Info),
 	{ ml_gen_info_get_module_info(Info, ModuleInfo) },
-	{ TagTestExpression = ml_gen_tag_test_rval(Tag, Type, ModuleInfo,
+	{ TagTestExpression = ml_gen_tag_test_rval(Tag, MLDS_Type, ModuleInfo,
 		lval(VarLval)) },
 	{ TagTestDecls = [] },
 	{ TagTestStatements = [] }.
@@ -1408,7 +1410,7 @@
 	%	true if VarRval has the specified Tag and false otherwise.
 	%	VarType is the type of VarRval. 
 	%
-:- func ml_gen_tag_test_rval(cons_tag, prog_type, module_info, mlds__rval)
+:- func ml_gen_tag_test_rval(cons_tag, mlds__type, module_info, mlds__rval)
 	= mlds__rval.
 
 ml_gen_tag_test_rval(string_constant(String), _, _, Rval) =
@@ -1437,7 +1439,7 @@
 ml_gen_tag_test_rval(unshared_tag(UnsharedTag), _, _, Rval) =
 	binop(eq, unop(std_unop(tag), Rval),
 		  unop(std_unop(mktag), const(int_const(UnsharedTag)))).
-ml_gen_tag_test_rval(shared_remote_tag(PrimaryTag, SecondaryTag), VarType,
+ml_gen_tag_test_rval(shared_remote_tag(PrimaryTag, SecondaryTag), MLDS_VarType,
 		ModuleInfo, Rval) = TagTest :-
 	SecondaryTagTest = binop(eq,
 		% Note: with the current low-level data representation,
@@ -1447,8 +1449,7 @@
 		unop(unbox(mlds__native_int_type),
 			lval(field(yes(PrimaryTag), Rval,
 			offset(const(int_const(0))),
-			mlds__generic_type, 
-			mercury_type_to_mlds_type(ModuleInfo, VarType)))),
+			mlds__generic_type, MLDS_VarType))),
 		const(int_const(SecondaryTag))),
 	module_info_globals(ModuleInfo, Globals),
 	globals__lookup_int_option(Globals, num_tag_bits, NumTagBits),
@@ -1461,7 +1462,8 @@
 			unop(std_unop(mktag), const(int_const(PrimaryTag)))), 
 		TagTest = binop(and, PrimaryTagTest, SecondaryTagTest)
 	).
-ml_gen_tag_test_rval(shared_local_tag(Bits, Num), _, _, Rval) =
+ml_gen_tag_test_rval(shared_local_tag(Bits, Num), MLDS_VarType, _, Rval) =
 	binop(eq, Rval,
-		  mkword(Bits, unop(std_unop(mkbody), const(int_const(Num))))).
+		  unop(cast(MLDS_VarType), mkword(Bits,
+		  	unop(std_unop(mkbody), const(int_const(Num)))))).
 
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.35
diff -u -d -r1.35 builtin.m
--- library/builtin.m	2000/05/08 16:10:58	1.35
+++ library/builtin.m	2000/05/31 08:27:01
@@ -365,8 +365,8 @@
 
 :- pragma c_header_code("
 #ifdef MR_HIGHLEVEL_CODE
-  void mercury__builtin__copy_2_p_0(MR_Word, MR_Box, MR_Box *);
-  void mercury__builtin__copy_2_p_1(MR_Word, MR_Box, MR_Box *);
+  void mercury__builtin__copy_2_p_0(MR_Type_Info, MR_Box, MR_Box *);
+  void mercury__builtin__copy_2_p_1(MR_Type_Info, MR_Box, MR_Box *);
 #endif
 ").
 
@@ -375,14 +375,15 @@
 #ifdef MR_HIGHLEVEL_CODE
 
 void
-mercury__builtin__copy_2_p_0(MR_Word type_info, MR_Box value, MR_Box * copy)
+mercury__builtin__copy_2_p_0(MR_Type_Info type_info,
+	MR_Box value, MR_Box * copy)
 {
 	MR_Word val = (MR_Word) value;
 	*copy = (MR_Box) deep_copy(&val, (MR_TypeInfo) type_info, NULL, NULL);
 }
 
 void
-mercury__builtin__copy_2_p_1(MR_Word type_info, MR_Box x, MR_Box * y)
+mercury__builtin__copy_2_p_1(MR_Type_Info type_info, MR_Box x, MR_Box * y)
 {
 	mercury__builtin__copy_2_p_0(type_info, x, y);
 }
Index: library/exception.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/exception.m,v
retrieving revision 1.22
diff -u -d -r1.22 exception.m
--- library/exception.m	2000/05/23 07:52:44	1.22
+++ library/exception.m	2000/05/31 08:40:34
@@ -503,15 +503,18 @@
 	#define mercury__exception__builtin_catch_3_p_5 \
 		mercury__exception__builtin_catch_model_non
 
-	void mercury__exception__builtin_throw_1_p_0(MR_Word);
+	void mercury__exception__builtin_throw_1_p_0(MR_Univ);
 
-	void mercury__exception__builtin_throw_1_p_0(MR_Word exception);
-	void mercury__exception__builtin_catch_model_det(MR_Word type_info,
-		MR_Word pred, MR_Word handler_pred, MR_Box *output);
-	bool mercury__exception__builtin_catch_model_semi(MR_Word type_info,
-		MR_Word pred, MR_Word handler_pred, MR_Box *output);
-	void mercury__exception__builtin_catch_model_non(MR_Word type_info,
-		MR_Word pred, MR_Word handler_pred, MR_Box *output,
+	void mercury__exception__builtin_throw_1_p_0(MR_Univ exception);
+	void mercury__exception__builtin_catch_model_det(
+		MR_Type_Info type_info, MR_Pred pred, MR_Pred handler_pred,
+		MR_Box *output);
+	bool mercury__exception__builtin_catch_model_semi(
+		MR_Type_Info type_info, MR_Pred pred, MR_Pred handler_pred,
+		MR_Box *output);
+	void mercury__exception__builtin_catch_model_non(
+		MR_Type_Info type_info, MR_Pred pred, MR_Pred handler_pred,
+		MR_Box *output,
 #ifdef MR_USE_GCC_NESTED_FUNCTIONS
 		MR_NestedCont cont
 #else
@@ -527,7 +530,7 @@
 /*---------------------------------------------------------------------------*/
 
 static void
-ML_call_goal_det(MR_Word type_info, MR_Word closure, MR_Box *result)
+ML_call_goal_det(MR_Type_Info type_info, MR_Pred closure, MR_Box *result)
 {
 	typedef void FuncType(void *, MR_Box *);
 	FuncType *code = (FuncType *)
@@ -536,7 +539,7 @@
 }
 
 static bool
-ML_call_goal_semi(MR_Word type_info, MR_Word closure, MR_Box *result)
+ML_call_goal_semi(MR_Type_Info type_info, MR_Pred closure, MR_Box *result)
 {
 	typedef bool FuncType(void *, MR_Box *);
 	FuncType *code = (FuncType *)
@@ -547,7 +550,7 @@
 #ifdef MR_USE_GCC_NESTED_FUNCTIONS
 
 static void
-ML_call_goal_non(MR_Word type_info, MR_Word closure, MR_Box *result,
+ML_call_goal_non(MR_Type_Info type_info, MR_Pred closure, MR_Box *result,
 	MR_NestedCont cont)
 {
 	typedef void FuncType(void *, MR_Box *, MR_NestedCont);
@@ -559,7 +562,7 @@
 #else
 
 static void
-ML_call_goal_non(MR_Word type_info, MR_Word closure, MR_Box *result,
+ML_call_goal_non(MR_Type_Info type_info, MR_Pred closure, MR_Box *result,
 	MR_Cont cont, void *cont_env)
 {
 	typedef void FuncType(void *, MR_Box *, MR_Cont, void *);
@@ -573,7 +576,7 @@
 /*---------------------------------------------------------------------------*/
 
 static void
-ML_call_handler_det(MR_Word type_info, MR_Word closure, MR_Word exception,
+ML_call_handler_det(MR_Type_Info type_info, MR_Pred closure, MR_Univ exception,
 	MR_Box *result)
 {
 	typedef void FuncType(void *, MR_Box, MR_Box *);
@@ -583,8 +586,8 @@
 }
 
 static bool
-ML_call_handler_semi(MR_Word type_info, MR_Word closure, MR_Word exception,
-	MR_Box *result)
+ML_call_handler_semi(MR_Type_Info type_info, MR_Pred closure,
+	MR_Univ exception, MR_Box *result)
 {
 	typedef bool FuncType(void *, MR_Box, MR_Box *);
 	FuncType *code = (FuncType *)
@@ -595,7 +598,7 @@
 #ifdef MR_USE_GCC_NESTED_FUNCTIONS
 
 static void
-ML_call_handler_non(MR_Word type_info, MR_Word closure, MR_Word exception,
+ML_call_handler_non(MR_Type_Info type_info, MR_Pred closure, MR_Univ exception,
 	MR_Box *result, MR_NestedCont cont)
 {
 	typedef void FuncType(void *, MR_Box, MR_Box *, MR_NestedCont);
@@ -607,7 +610,7 @@
 #else
 
 static void
-ML_call_handler_non(MR_Word type_info, MR_Word closure, MR_Word exception,
+ML_call_handler_non(MR_Type_Info type_info, MR_Pred closure, MR_Univ exception,
 	MR_Box *result, MR_Cont cont, void *cont_env)
 {
 	typedef void FuncType(void *, MR_Box, MR_Box *, MR_Cont, void *);
@@ -623,8 +626,6 @@
 #include <stdlib.h>
 #include <setjmp.h>
 
-typedef MR_Word MR_Univ;
-
 typedef struct ML_ExceptionHandler_struct {
 	struct ML_ExceptionHandler_struct *prev;
 	jmp_buf		handler;
@@ -637,7 +638,7 @@
 mercury__exception__builtin_throw_1_p_0(MR_Univ exception)
 {
 	if (ML_exception_handler == NULL) {
-		ML_report_uncaught_exception(exception);
+		ML_report_uncaught_exception((MR_Word) exception);
 		abort();
 	} else {
 #ifdef	MR_DEBUG_JMPBUFS
@@ -650,8 +651,8 @@
 }
 
 void
-mercury__exception__builtin_catch_model_det(MR_Word type_info,
-	MR_Word pred, MR_Word handler_pred, MR_Box *output)
+mercury__exception__builtin_catch_model_det(MR_Type_Info type_info,
+	MR_Pred pred, MR_Pred handler_pred, MR_Box *output)
 {
 	ML_ExceptionHandler this_handler;
 
@@ -678,8 +679,8 @@
 }
 
 bool
-mercury__exception__builtin_catch_model_semi(MR_Word type_info,
-	MR_Word pred, MR_Word handler_pred, MR_Box *output)
+mercury__exception__builtin_catch_model_semi(MR_Type_Info type_info,
+	MR_Pred pred, MR_Pred handler_pred, MR_Box *output)
 {
 	ML_ExceptionHandler this_handler;
 
@@ -709,8 +710,8 @@
 #ifdef MR_USE_GCC_NESTED_FUNCTIONS
 
 void
-mercury__exception__builtin_catch_model_non(MR_Word type_info,
-	MR_Word pred, MR_Word handler_pred, MR_Box *output,
+mercury__exception__builtin_catch_model_non(MR_Type_Info type_info,
+	MR_Pred pred, MR_Pred handler_pred, MR_Box *output,
 	MR_NestedCont cont)
 {
 	ML_ExceptionHandler this_handler;
@@ -788,8 +789,8 @@
 }
 
 void
-mercury__exception__builtin_catch_model_non(MR_Word type_info,
-	MR_Word pred, MR_Word handler_pred, MR_Box *output,
+mercury__exception__builtin_catch_model_non(MR_Type_Info type_info,
+	MR_Pred pred, MR_Pred handler_pred, MR_Box *output,
 	MR_Cont cont, void *cont_env)
 {
 	struct ML_catch_env locals;
Index: runtime/mercury.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.c,v
retrieving revision 1.6
diff -u -d -r1.6 mercury.c
--- runtime/mercury.c	2000/05/23 08:04:29	1.6
+++ runtime/mercury.c	2000/05/31 08:20:42
@@ -10,9 +10,14 @@
 ** (For the low-level C code, see mercury_imp.h.)
 */
 
+#ifndef MR_HIGHLEVEL_CODE
+  #include "mercury_imp.h"
+#endif
+
 #include "mercury.h"
 #include "mercury_type_info.h"	/* for MR_TYPECTOR_REP* */
 #include "mercury_misc.h"	/* for MR_fatal_error() */
+#include "mercury_heap.h"	/* for create[1-3]() prototypes */
 
 #ifdef MR_HIGHLEVEL_CODE
 
@@ -31,23 +36,28 @@
 /* Types for the wrapper versions of type-specific unify/compare procedures. */
 
 typedef bool MR_UnifyFunc_0(MR_Box, MR_Box);
-typedef bool MR_UnifyFunc_1(MR_Word, MR_Box, MR_Box);
-typedef bool MR_UnifyFunc_2(MR_Word, MR_Word, MR_Box, MR_Box);
-typedef bool MR_UnifyFunc_3(MR_Word, MR_Word, MR_Word, MR_Box, MR_Box);
-typedef bool MR_UnifyFunc_4(MR_Word, MR_Word, MR_Word, MR_Word,
-			    MR_Box, MR_Box);
-typedef bool MR_UnifyFunc_5(MR_Word, MR_Word, MR_Word, MR_Word, MR_Word,
+typedef bool MR_UnifyFunc_1(MR_Type_Info, MR_Box, MR_Box);
+typedef bool MR_UnifyFunc_2(MR_Type_Info, MR_Type_Info, MR_Box, MR_Box);
+typedef bool MR_UnifyFunc_3(MR_Type_Info, MR_Type_Info, MR_Type_Info,
 			    MR_Box, MR_Box);
+typedef bool MR_UnifyFunc_4(MR_Type_Info, MR_Type_Info, MR_Type_Info,
+			    MR_Type_Info, MR_Box, MR_Box);
+typedef bool MR_UnifyFunc_5(MR_Type_Info, MR_Type_Info, MR_Type_Info,
+			    MR_Type_Info, MR_Type_Info, MR_Box, MR_Box);
 
-typedef void MR_CompareFunc_0(MR_Word *, MR_Box, MR_Box);
-typedef void MR_CompareFunc_1(MR_Word, MR_Word *, MR_Box, MR_Box);
-typedef void MR_CompareFunc_2(MR_Word, MR_Word, MR_Word *, MR_Box, MR_Box);
-typedef void MR_CompareFunc_3(MR_Word, MR_Word, MR_Word,
-			      MR_Word *, MR_Box, MR_Box);
-typedef void MR_CompareFunc_4(MR_Word, MR_Word, MR_Word, MR_Word,
-			      MR_Word *, MR_Box, MR_Box);
-typedef void MR_CompareFunc_5(MR_Word, MR_Word, MR_Word, MR_Word, MR_Word,
-			      MR_Word *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_0(MR_Comparison_Result *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_1(MR_Type_Info,
+			      MR_Comparison_Result *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_2(MR_Type_Info, MR_Type_Info,
+			      MR_Comparison_Result *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_3(MR_Type_Info, MR_Type_Info, MR_Type_Info,
+			      MR_Comparison_Result *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_4(MR_Type_Info, MR_Type_Info, MR_Type_Info,
+			      MR_Type_Info,
+			      MR_Comparison_Result *, MR_Box, MR_Box);
+typedef void MR_CompareFunc_5(MR_Type_Info, MR_Type_Info, MR_Type_Info,
+			      MR_Type_Info, MR_Type_Info,
+			      MR_Comparison_Result *, MR_Box, MR_Box);
 
 /*---------------------------------------------------------------------------*/
 /*
@@ -185,13 +195,13 @@
 */
 
 bool
-mercury__builtin__unify_2_p_0(MR_Word ti, MR_Box x, MR_Box y)
+mercury__builtin__unify_2_p_0(MR_Type_Info ti, MR_Box x, MR_Box y)
 {
 	MR_TypeInfo		type_info;
 	MR_TypeCtorInfo		type_ctor_info;
 	int			arity;
 	MR_TypeInfoParams	params;
-	MR_Word			*args;
+	MR_Type_Info		*args;
 
 	type_info = (MR_TypeInfo) ti;
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
@@ -202,7 +212,7 @@
 		arity = type_ctor_info->arity;
 		params = MR_TYPEINFO_GET_FIRST_ORDER_ARG_VECTOR(type_info);
 	}
-	args = (MR_Word *) params;
+	args = (MR_Type_Info *) params;
 
 	switch(arity) {
 		/*
@@ -232,13 +242,14 @@
 }
 
 void
-mercury__builtin__compare_3_p_0(MR_Word ti, MR_Word *res, MR_Box x, MR_Box y)
+mercury__builtin__compare_3_p_0(MR_Type_Info ti, MR_Comparison_Result *res,
+	MR_Box x, MR_Box y)
 {
 	MR_TypeInfo		type_info;
 	MR_TypeCtorInfo		type_ctor_info;
 	int			arity;
 	MR_TypeInfoParams	params;
-	MR_Word			*args;
+	MR_Type_Info		*args;
 
 	type_info = (MR_TypeInfo) ti;
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(type_info);
@@ -249,7 +260,7 @@
 		arity = type_ctor_info->arity;
 		params = MR_TYPEINFO_GET_FIRST_ORDER_ARG_VECTOR(type_info);
 	}
-	args = (MR_Word *) params;
+	args = (MR_Type_Info *) params;
 
 	switch(arity) {
 		/*
@@ -285,21 +296,21 @@
 
 void
 mercury__builtin__compare_3_p_1(
-	MR_Word type_info, MR_Word *res, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *res, MR_Box x, MR_Box y)
 {
 	mercury__builtin__compare_3_p_0(type_info, res, x, y);
 }
 
 void
 mercury__builtin__compare_3_p_2(
-	MR_Word type_info, MR_Word *res, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *res, MR_Box x, MR_Box y)
 {
 	mercury__builtin__compare_3_p_0(type_info, res, x, y);
 }
 
 void
 mercury__builtin__compare_3_p_3(
-	MR_Word type_info, MR_Word *res, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *res, MR_Box x, MR_Box y)
 {
 	mercury__builtin__compare_3_p_0(type_info, res, x, y);
 }
@@ -349,71 +360,73 @@
 }
 
 bool
-mercury__builtin____Unify____void_0_0(MR_Word x, MR_Word y)
+mercury__builtin____Unify____void_0_0(MR_Void x, MR_Void y)
 {
 	MR_fatal_error("called unify for type `void'");
 }
 
 bool
-mercury__builtin____Unify____c_pointer_0_0(MR_Word x, MR_Word y)
+mercury__builtin____Unify____c_pointer_0_0(MR_C_Pointer x, MR_C_Pointer y)
 {
 	return (void *) x == (void *) y;
 }
 
 bool
-mercury__builtin____Unify____func_0_0(MR_Word x, MR_Word y)
+mercury__builtin____Unify____func_0_0(MR_Func x, MR_Func y)
 {
 	MR_fatal_error("called unify for `func' type");
 }
 
 bool
-mercury__builtin____Unify____pred_0_0(MR_Word x, MR_Word y)
+mercury__builtin____Unify____pred_0_0(MR_Pred x, MR_Pred y)
 {
 	MR_fatal_error("called unify for `pred' type");
 }
 
 bool
-mercury__array____Unify____array_1_0(MR_Word type_info, MR_Word x, MR_Word y)
+mercury__array____Unify____array_1_0(MR_Type_Info type_info,
+	MR_Array x, MR_Array y)
 {
 	SORRY("unify for array");
 }
 
 bool
-mercury__std_util____Unify____univ_0_0(MR_Word x, MR_Word y)
+mercury__std_util____Unify____univ_0_0(MR_Univ x, MR_Univ y)
 {
 	SORRY("unify for univ");
 }
 
 bool
-mercury__std_util____Unify____type_desc_0_0(MR_Word x, MR_Word y)
+mercury__std_util____Unify____type_desc_0_0(MR_Type_Desc x, MR_Type_Desc y)
 {
 	SORRY("unify for type_desc");
 }
 
 bool
 mercury__private_builtin____Unify____type_ctor_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Type_Ctor_Info x, MR_Type_Ctor_Info y)
 {
 	SORRY("unify for type_ctor_info");
 }
 
 bool
 mercury__private_builtin____Unify____type_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Type_Info x, MR_Type_Info y)
 {
 	SORRY("unify for type_info");
 }
 
 bool
 mercury__private_builtin____Unify____typeclass_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_TypeClass_Info x, MR_TypeClass_Info y)
 {
 	SORRY("unify for typeclass_info");
 }
 
 bool
 mercury__private_builtin____Unify____base_typeclass_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y)
+	MR_Type_Info type_info,
+	MR_Base_TypeClass_Info x, MR_Base_TypeClass_Info y)
 {
 	SORRY("unify for base_typeclass_info");
 }
@@ -425,7 +438,7 @@
 
 void
 mercury__builtin____Compare____int_0_0(
-	MR_Word *result, MR_Integer x, MR_Integer y)
+	MR_Comparison_Result *result, MR_Integer x, MR_Integer y)
 {
 	*result = (x > y ? MR_COMPARE_GREATER :
 		  x == y ? MR_COMPARE_EQUAL :
@@ -433,7 +446,7 @@
 }
 
 void
-mercury__builtin____Compare____string_0_0(MR_Word *result,
+mercury__builtin____Compare____string_0_0(MR_Comparison_Result *result,
 	MR_String x, MR_String y)
 {
 	int res = strcmp(x, y);
@@ -444,7 +457,7 @@
 
 void
 mercury__builtin____Compare____float_0_0(
-	MR_Word *result, MR_Float x, MR_Float y)
+	MR_Comparison_Result *result, MR_Float x, MR_Float y)
 {
 	/* XXX what should this function do when x and y are both NaNs? */
 	*result = (x > y ? MR_COMPARE_GREATER :
@@ -456,7 +469,7 @@
 
 void
 mercury__builtin____Compare____character_0_0(
-	MR_Word *result, MR_Char x, MR_Char y)
+	MR_Comparison_Result *result, MR_Char x, MR_Char y)
 {
 	*result = (x > y ? MR_COMPARE_GREATER :
 		  x == y ? MR_COMPARE_EQUAL :
@@ -464,14 +477,15 @@
 }
 
 void
-mercury__builtin____Compare____void_0_0(MR_Word *result, MR_Word x, MR_Word y)
+mercury__builtin____Compare____void_0_0(MR_Comparison_Result *result,
+	MR_Void x, MR_Void y)
 {
 	MR_fatal_error("called compare/3 for type `void'");
 }
 
 void
 mercury__builtin____Compare____c_pointer_0_0(
-	MR_Word *result, MR_Word x, MR_Word y)
+	MR_Comparison_Result *result, MR_C_Pointer x, MR_C_Pointer y)
 {
 	*result = 
 		( (void *) x == (void *) y ? MR_COMPARE_EQUAL
@@ -481,61 +495,68 @@
 }
 
 void
-mercury__builtin____Compare____func_0_0(MR_Word *result, MR_Word x, MR_Word y)
+mercury__builtin____Compare____func_0_0(MR_Comparison_Result *result,
+	MR_Func x, MR_Func y)
 {
 	MR_fatal_error("called compare/3 for `func' type");
 }
 
 void
-mercury__builtin____Compare____pred_0_0(MR_Word *result, MR_Word x, MR_Word y)
+mercury__builtin____Compare____pred_0_0(MR_Comparison_Result *result,
+	MR_Pred x, MR_Pred y)
 {
 	MR_fatal_error("called compare/3 for `pred' type");
 }
 
 void
 mercury__array____Compare____array_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Array x, MR_Array y)
 {
 	SORRY("compare for array");
 }
 
 void
-mercury__std_util____Compare____univ_0_0(MR_Word *result, MR_Word x, MR_Word y)
+mercury__std_util____Compare____univ_0_0(MR_Comparison_Result *result,
+	MR_Univ x, MR_Univ y)
 {
 	SORRY("compare for univ");
 }
 
 void
 mercury__std_util____Compare____type_desc_0_0(
-	MR_Word *result, MR_Word x, MR_Word y)
+	MR_Comparison_Result *result, MR_Type_Desc x, MR_Type_Desc y)
 {
 	SORRY("compare for type_desc");
 }
 
 void
 mercury__private_builtin____Compare____type_ctor_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Type_Ctor_Info x, MR_Type_Ctor_Info y)
 {
 	SORRY("compare for type_ctor_info");
 }
 
 void
 mercury__private_builtin____Compare____type_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Comparison_Result *result, MR_Type_Info x, MR_Type_Info y)
 {
 	SORRY("compare for type_info");
 }
 
 void
 mercury__private_builtin____Compare____typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_TypeClass_Info x, MR_TypeClass_Info y)
 {
 	SORRY("compare for typeclass_info");
 }
 
 void
 mercury__private_builtin____Compare____base_typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Base_TypeClass_Info x, MR_Base_TypeClass_Info y)
 {
 	SORRY("compare for base_typeclass_info");
 }
@@ -584,7 +605,7 @@
 mercury__builtin__do_unify__c_pointer_0_0(MR_Box x, MR_Box y)
 {
 	return mercury__builtin____Unify____c_pointer_0_0(
-		(MR_Word) x, (MR_Word) y);
+		(MR_C_Pointer) x, (MR_C_Pointer) y);
 }
 
 static bool
@@ -600,56 +621,57 @@
 }
 
 static bool
-mercury__array__do_unify__array_1_0(MR_Word type_info, MR_Box x, MR_Box y)
+mercury__array__do_unify__array_1_0(MR_Type_Info type_info, MR_Box x, MR_Box y)
 {
 	return mercury__array____Unify____array_1_0(
-		type_info, (MR_Word) x, (MR_Word) y);
+		type_info, (MR_Array) x, (MR_Array) y);
 }
 
 static bool
 mercury__std_util__do_unify__univ_0_0(MR_Box x, MR_Box y)
 {
 	return mercury__std_util____Unify____univ_0_0(
-		(MR_Word) x, (MR_Word) y);
+		(MR_Univ) x, (MR_Univ) y);
 }
 
 static bool
 mercury__std_util__do_unify__type_desc_0_0(MR_Box x, MR_Box y)
 {
 	return mercury__std_util____Unify____type_desc_0_0(
-		(MR_Word) x, (MR_Word) y);
+		(MR_Type_Desc) x, (MR_Type_Desc) y);
 }
 
 static bool
 mercury__private_builtin__do_unify__type_ctor_info_1_0(
-	MR_Word type_info, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Box x, MR_Box y)
 {
 	return mercury__private_builtin____Unify____type_ctor_info_1_0(
-		type_info, (MR_Word) x, (MR_Word) y);
+		type_info, (MR_Type_Ctor_Info) x, (MR_Type_Ctor_Info) y);
 }
 
 static bool
 mercury__private_builtin__do_unify__type_info_1_0(
-	MR_Word type_info, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Box x, MR_Box y)
 {
 	return mercury__private_builtin____Unify____type_info_1_0(
-		type_info, (MR_Word) x, (MR_Word) y);
+		type_info, (MR_Type_Info) x, (MR_Type_Info) y);
 }
 
 static bool
 mercury__private_builtin__do_unify__typeclass_info_1_0(
-	MR_Word type_info, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Box x, MR_Box y)
 {
 	return mercury__private_builtin____Unify____typeclass_info_1_0(
-		type_info, (MR_Word) x, (MR_Word) y);
+		type_info, (MR_TypeClass_Info) x, (MR_TypeClass_Info) y);
 }
 
 static bool
 mercury__private_builtin__do_unify__base_typeclass_info_1_0(
-	MR_Word type_info, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Box x, MR_Box y)
 {
 	return mercury__private_builtin____Unify____base_typeclass_info_1_0(
-		type_info, (MR_Word) x, (MR_Word) y);
+		type_info,
+		(MR_Base_TypeClass_Info) x, (MR_Base_TypeClass_Info) y);
 }
 
 /*---------------------------------------------------------------------------*/
@@ -659,21 +681,24 @@
 */
 
 static void
-mercury__builtin__do_compare__int_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__int_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__builtin____Compare____int_0_0(result,
 		(Integer) x, (Integer) y);
 }
 
 static void
-mercury__builtin__do_compare__string_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__string_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__builtin____Compare____string_0_0(result,
 		(MR_String) x, (MR_String) y);
 }
 
 static void
-mercury__builtin__do_compare__float_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__float_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__builtin____Compare____float_0_0(result,
 		MR_unbox_float(x), MR_unbox_float(y));
@@ -681,91 +706,103 @@
 
 static void
 mercury__builtin__do_compare__character_0_0(
-	MR_Word *result, MR_Box x, MR_Box y)
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__builtin____Compare____character_0_0(
 		result, (MR_Char) (MR_Word) x, (MR_Char) (MR_Word) y);
 }
 
 static void
-mercury__builtin__do_compare__void_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__void_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	MR_fatal_error("called compare/3 for type `void'");
 }
 
 static void
 mercury__builtin__do_compare__c_pointer_0_0(
-	MR_Word *result, MR_Box x, MR_Box y)
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__builtin____Compare____c_pointer_0_0(
-		result, (MR_Word) x, (MR_Word) y);
+		result, (MR_C_Pointer) x, (MR_C_Pointer) y);
 }
 
 static void
-mercury__builtin__do_compare__func_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__func_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	MR_fatal_error("called compare/3 for func type");
 }
 
 static void
-mercury__builtin__do_compare__pred_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__builtin__do_compare__pred_0_0(MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	MR_fatal_error("called compare/3 for pred type");
 }
 
 static void
 mercury__array__do_compare__array_1_0(
-	MR_Word type_info, MR_Word *result, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	mercury__array____Compare____array_1_0(
-		type_info, result, (MR_Word) x, (MR_Word) y);
+		type_info, result, (MR_Array) x, (MR_Array) y);
 }
 
 static void
-mercury__std_util__do_compare__univ_0_0(MR_Word *result, MR_Box x, MR_Box y)
+mercury__std_util__do_compare__univ_0_0(
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__std_util____Compare____univ_0_0(
-		result, (MR_Word) x, (MR_Word) y);
+		result, (MR_Univ) x, (MR_Univ) y);
 }
 
 static void
 mercury__std_util__do_compare__type_desc_0_0(
-	MR_Word *result, MR_Box x, MR_Box y)
+	MR_Comparison_Result *result, MR_Box x, MR_Box y)
 {
 	mercury__std_util____Compare____type_desc_0_0(
-		result, (MR_Word) x, (MR_Word) y);
+		result, (MR_Type_Desc) x, (MR_Type_Desc) y);
 }
 
 static void
 mercury__private_builtin__do_compare__type_ctor_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	mercury__private_builtin____Compare____type_ctor_info_1_0(
-		type_info, result, (MR_Word) x, (MR_Word) y);
+		type_info, result,
+		(MR_Type_Ctor_Info) x, (MR_Type_Ctor_Info) y);
 }
 
 static void
 mercury__private_builtin__do_compare__type_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	mercury__private_builtin____Compare____type_info_1_0(
-		type_info, result, (MR_Word) x, (MR_Word) y);
+		type_info, result, (MR_Type_Info) x, (MR_Type_Info) y);
 }
 
 static void
 mercury__private_builtin__do_compare__typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	mercury__private_builtin____Compare____typeclass_info_1_0(
-		type_info, result, (MR_Word) x, (MR_Word) y);
+		type_info, result,
+		(MR_TypeClass_Info) x, (MR_TypeClass_Info) y);
 }
 
 static void
 mercury__private_builtin__do_compare__base_typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Box x, MR_Box y)
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Box x, MR_Box y)
 {
 	mercury__private_builtin____Compare____base_typeclass_info_1_0(
-		type_info, result, (MR_Word) x, (MR_Word) y);
+		type_info, result,
+		(MR_Base_TypeClass_Info) x, (MR_Base_TypeClass_Info) y);
 }
 
 /*---------------------------------------------------------------------------*/
Index: runtime/mercury.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury.h,v
retrieving revision 1.11
diff -u -d -r1.11 mercury.h
--- runtime/mercury.h	2000/05/31 06:04:38	1.11
+++ runtime/mercury.h	2000/05/31 08:36:19
@@ -43,6 +43,7 @@
 ** XXX this is a hack to work-around the current lack of
 ** support for `pragma export'.
 */
+#ifndef MR_HIGHLEVEL_DATA
 #define ML_report_uncaught_exception \
 		mercury__exception__report_uncaught_exception_3_p_0
 #define ML_throw_io_error		mercury__io__throw_io_error_1_p_0
@@ -51,6 +52,7 @@
 #define ML_io_stderr_stream		mercury__io__stderr_stream_3_p_0
 #define ML_io_stdin_stream		mercury__io__stdin_stream_3_p_0
 #define ML_io_stdout_stream		mercury__io__stdout_stream_3_p_0
+#endif
 
 /*---------------------------------------------------------------------------*/
 /*
@@ -84,6 +86,41 @@
 typedef Word	MR_Word;
 
 /*
+** Define some names for types that differ depending
+** on whether --high-level-data is enabled.
+*/
+#ifdef MR_HIGHLEVEL_DATA
+  typedef MR_Integer /* really `enum mercury__builtin__comparison_result_0' */
+  	MR_Comparison_Result;
+  typedef struct mercury__builtin__void_0 * MR_Void;
+  typedef struct mercury__builtin__c_pointer_0 * MR_C_Pointer;
+  typedef MR_ClosurePtr MR_Pred;
+  typedef MR_ClosurePtr MR_Func;
+  typedef struct mercury__array__array_1 * MR_Array;
+  typedef struct mercury__std_util__univ_0 * MR_Univ;
+  typedef struct mercury__std_util__type_desc_0 * MR_Type_Desc;
+  typedef struct mercury__private_builtin__type_info_1 * MR_Type_Info;
+  typedef struct mercury__private_builtin__type_ctor_info_1 * MR_Type_Ctor_Info;
+  typedef struct mercury__private_builtin__typeclass_info_1 * MR_TypeClass_Info;
+  typedef struct mercury__private_builtin__base_typeclass_info_1 *
+  	MR_Base_TypeClass_Info;
+#else
+  /* for --no-high-level-data, they're all just `MR_Word' */
+  typedef MR_Word MR_Comparison_Result;
+  typedef MR_Word MR_Void;
+  typedef MR_Word MR_C_Pointer;
+  typedef MR_Word MR_Pred;
+  typedef MR_Word MR_Func;
+  typedef MR_Word MR_Array;
+  typedef MR_Word MR_Univ;
+  typedef MR_Word MR_Type_Desc;
+  typedef MR_Word MR_Type_Info;
+  typedef MR_Word MR_Type_Ctor_Info;
+  typedef MR_Word MR_TypeClass_Info;
+  typedef MR_Word MR_Base_TypeClass_Info;
+#endif
+
+/*
 ** Typedefs used for the types of RTTI data structures.
 ** Many of these types are defined in mercury_type_info.h,
 ** but the ones which are used only by the MLDS back-end
@@ -311,62 +348,74 @@
 ** Function declarations
 */
 
-bool mercury__builtin__unify_2_p_0(Word type_info, MR_Box, MR_Box);
-void mercury__builtin__compare_3_p_0(Word type_info, Word *, MR_Box, MR_Box);
-void mercury__builtin__compare_3_p_1(Word type_info, Word *, MR_Box, MR_Box);
-void mercury__builtin__compare_3_p_2(Word type_info, Word *, MR_Box, MR_Box);
-void mercury__builtin__compare_3_p_3(Word type_info, Word *, MR_Box, MR_Box);
+bool mercury__builtin__unify_2_p_0(MR_Type_Info, MR_Box, MR_Box);
+void mercury__builtin__compare_3_p_0(MR_Type_Info,
+	MR_Comparison_Result *, MR_Box, MR_Box);
+void mercury__builtin__compare_3_p_1(MR_Type_Info,
+	MR_Comparison_Result *, MR_Box, MR_Box);
+void mercury__builtin__compare_3_p_2(MR_Type_Info,
+	MR_Comparison_Result *, MR_Box, MR_Box);
+void mercury__builtin__compare_3_p_3(MR_Type_Info,
+	MR_Comparison_Result *, MR_Box, MR_Box);
 
 bool mercury__builtin____Unify____int_0_0(MR_Integer x, MR_Integer y); 
 bool mercury__builtin____Unify____string_0_0(MR_String x, MR_String y); 
 bool mercury__builtin____Unify____float_0_0(MR_Float x, MR_Float y); 
 bool mercury__builtin____Unify____character_0_0(MR_Char x, MR_Char); 
-bool mercury__builtin____Unify____void_0_0(MR_Word x, MR_Word y); 
-bool mercury__builtin____Unify____c_pointer_0_0(MR_Word x, MR_Word y); 
-bool mercury__builtin____Unify____func_0_0(MR_Word x, MR_Word y); 
-bool mercury__builtin____Unify____pred_0_0(MR_Word x, MR_Word y); 
-bool mercury__array____Unify____array_1_0(Word type_info, MR_Word x, MR_Word y);
-bool mercury__std_util____Unify____univ_0_0(MR_Word x, MR_Word y); 
-bool mercury__std_util____Unify____type_desc_0_0(MR_Word x, MR_Word y); 
+bool mercury__builtin____Unify____void_0_0(MR_Void x, MR_Void y); 
+bool mercury__builtin____Unify____c_pointer_0_0(
+	MR_C_Pointer x, MR_C_Pointer y); 
+bool mercury__builtin____Unify____func_0_0(MR_Func x, MR_Func y); 
+bool mercury__builtin____Unify____pred_0_0(MR_Pred x, MR_Pred y); 
+bool mercury__array____Unify____array_1_0(MR_Type_Info type_info,
+	MR_Array x, MR_Array y);
+bool mercury__std_util____Unify____univ_0_0(MR_Univ x, MR_Univ y); 
+bool mercury__std_util____Unify____type_desc_0_0(
+	MR_Type_Desc x, MR_Type_Desc y); 
 bool mercury__private_builtin____Unify____type_ctor_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y); 
+	MR_Type_Info type_info, MR_Type_Ctor_Info x, MR_Type_Ctor_Info y); 
 bool mercury__private_builtin____Unify____type_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y); 
+	MR_Type_Info type_info, MR_Type_Info x, MR_Type_Info y); 
 bool mercury__private_builtin____Unify____typeclass_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y); 
+	MR_Type_Info type_info, MR_TypeClass_Info x, MR_TypeClass_Info y); 
 bool mercury__private_builtin____Unify____base_typeclass_info_1_0(
-	MR_Word type_info, MR_Word x, MR_Word y); 
+	MR_Type_Info type_info, MR_Base_TypeClass_Info x,
+	MR_Base_TypeClass_Info y); 
 
 void mercury__builtin____Compare____int_0_0(
-	MR_Word *result, MR_Integer x, MR_Integer y);
-void mercury__builtin____Compare____string_0_0(MR_Word *result,
-	MR_String x, MR_String y);
+	MR_Comparison_Result *result, MR_Integer x, MR_Integer y);
+void mercury__builtin____Compare____string_0_0(
+	MR_Comparison_Result *result, MR_String x, MR_String y);
 void mercury__builtin____Compare____float_0_0(
-	MR_Word *result, MR_Float x, MR_Float y);
+	MR_Comparison_Result *result, MR_Float x, MR_Float y);
 void mercury__builtin____Compare____character_0_0(
-	MR_Word *result, MR_Char x, MR_Char y);
+	MR_Comparison_Result *result, MR_Char x, MR_Char y);
 void mercury__builtin____Compare____void_0_0(
-	MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_Void x, MR_Void y);
 void mercury__builtin____Compare____c_pointer_0_0(
-	MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_C_Pointer x, MR_C_Pointer y);
 void mercury__builtin____Compare____func_0_0(
-	MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_Func x, MR_Func y);
 void mercury__builtin____Compare____pred_0_0(
-	MR_Word *result, MR_Word x, MR_Word y); 
-void mercury__array____Compare____array_1_0(
-	Word type_info, MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_Pred x, MR_Pred y); 
+void mercury__array____Compare____array_1_0(MR_Type_Info type_info,
+	MR_Comparison_Result *result, MR_Array x, MR_Array y);
 void mercury__std_util____Compare____univ_0_0(
-	MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_Univ x, MR_Univ y);
 void mercury__std_util____Compare____type_desc_0_0(
-	MR_Word *result, MR_Word x, MR_Word y);
+	MR_Comparison_Result *result, MR_Type_Desc x, MR_Type_Desc y);
 void mercury__private_builtin____Compare____type_ctor_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y);
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Type_Ctor_Info x, MR_Type_Ctor_Info y);
 void mercury__private_builtin____Compare____type_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y);
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Type_Info x, MR_Type_Info y);
 void mercury__private_builtin____Compare____typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y);
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_TypeClass_Info x, MR_TypeClass_Info y);
 void mercury__private_builtin____Compare____base_typeclass_info_1_0(
-	MR_Word type_info, MR_Word *result, MR_Word x, MR_Word y);
+	MR_Type_Info type_info, MR_Comparison_Result *result,
+	MR_Base_TypeClass_Info x, MR_Base_TypeClass_Info y);
 
 /*---------------------------------------------------------------------------*/
 

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