[m-dev.] for review: add type_ctor_reps for user-defined equality

Tyson Dowd trd at cs.mu.OZ.AU
Thu Oct 28 13:59:51 AEST 1999


On 26-Oct-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 26-Oct-1999, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > 
> > Estimated hours taken: 4
> > 
> > Add support for distinguishing types with user defined equality from 
> > system defined equality.  This information is encoded in the
> > type_ctor_rep.
> > 
> > It is intended to be used for implementing RTTI driven compare and unify
> > procedures.
> > 
> > This change uses the version number in the type_ctor_info to allow 
> > Easy Bootstrapping(TM).
> > 
> > compiler/base_type_info.m:
> > 	Add new alternatives for user defined equality types.
> > 	Update RTTI version number.
> > 	Change `type_ctor_info_version' to `type_ctor_info_rtti_version'.
> > 
> > runtime/mercury_type_info.c:
> > 	Define MR_get_new_type_ctor_rep which gets the type_ctor_rep,
> > 	automatically converting older versions.
> > 	(this change is just for bootstrapping).
> 
> It would be a good idea to add a comment pointing to here from
> the definition of MR_GRADE_PART_0 in runtime/mercury_grade.h,
> e.g.
> 
> 	/*
> 	** Note: next time the binary compatibility version
> 	** number is increased, we should remove the
> 	** MR_get_new_type_ctor_rep() function in
> 	** runtime/mercury_type_info.c.
> 	*/
> 
> so that we don't forget to remove this "bootstrapping only" code
> when the time comes.

Done.  I've also added better checks for sanity of the version number
(in case you are using older generated code that doesn't even have a
version number).

> 
> > library/std_util.m:
> > runtime/mercury_deep_copy_body.h:
> > runtime/mercury_ho_call.c:
> > runtime/mercury_tabling.c:
> > runtime/mercury_type_info.h:
> > runtime/mercury_wrapper.c:
> > 	Use MR_get_new_type_ctor_rep to get the type_ctor_rep.
> > 	(this change is just for bootstrapping).
> > 
> > 	Add new alternatives to code that uses type_ctor_rep (at the
> > 	moment they just fall through).
> 
> I just noticed that the code in runtime/mercury_ho_call.c that Zoltan
> added recently does not handle enums with user-defined equality
> correctly; it compares them using structural equality, rather than
> by calling the user-defined equality predicate.  Your change preserves
> this bug.  Instead, you should fix the bug by treating ENUM_USEREQ the
> same as DU_USEREQ, i.e. calling the unify/compare/index pred,
> rather than treating it the same as ENUM.

Done.

I've fixed the missing cases of *_USEREQ, and deleted the unused
MR_OldTypeCtorRepresentation and the typo.

Here is an updated diff.

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


Estimated hours taken: 5

Add support for distinguishing types with user defined equality from 
system defined equality.  This information is encoded in the
type_ctor_rep.

It is intended to be used for implementing RTTI driven compare and unify
procedures.

This change uses the version number in the type_ctor_info to allow 
Easy Bootstrapping(TM).

compiler/base_type_info.m:
	Add new alternatives for user defined equality types.
	Update RTTI version number.
	Change `type_ctor_info_version' to `type_ctor_info_rtti_version'.

runtime/mercury_type_info.c:
	Define MR_get_new_type_ctor_rep which gets the type_ctor_rep,
	automatically converting older versions.
	(this change is just for bootstrapping).

runtime/mercury_grade.h:
	Note that MR_get_new_type_ctor_rep should be removed when binary
	compatibility number is increased.  
	Also suggest inspecting code for RTTI version number checks in
	general.

runtime/mercury_type_info.h:
	Add a macro for checking sane values for RTTI version.

library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_wrapper.c:
	Use MR_get_new_type_ctor_rep to get the type_ctor_rep.
	(this change is just for bootstrapping).

	Add new alternatives to code that uses type_ctor_rep (at the
	moment they just fall through).

runtime/mercury_ho_call.c:
	Use MR_get_new_type_ctor_rep and also fix a bug Zoltan
	introduced when specializing the unification code.  Handle
	enums with user defined equality differently to normal enums.


Index: compiler/base_type_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_type_info.m,v
retrieving revision 1.27
diff -u -r1.27 base_type_info.m
--- base_type_info.m	1999/10/20 07:02:55	1.27
+++ base_type_info.m	1999/10/25 17:35:22
@@ -135,8 +135,8 @@
 	% runtime that uses RTTI to conform to whatever changes the new
 	% version introduces.
 
-:- func type_ctor_info_version = int.
-type_ctor_info_version = 2.
+:- func type_ctor_info_rtti_version = int.
+type_ctor_info_rtti_version = 3.
 
 base_type_info__generate_llds(ModuleInfo, CModules) :-
 	module_info_base_gen_infos(ModuleInfo, BaseGenInfos),
@@ -182,7 +182,8 @@
 		prog_out__sym_name_to_string(ModuleName, ModuleNameString),
 		NameArg = yes(const(string_const(TypeName))),
 		ModuleArg = yes(const(string_const(ModuleNameString))),
-		VersionArg = yes(const(int_const(type_ctor_info_version))),
+		VersionArg = yes(const(int_const(
+			type_ctor_info_rtti_version))),
 		list__append(PredAddrArgs, [TypeCtorArg, FunctorsArg, LayoutArg,
 			ModuleArg, NameArg, VersionArg], FinalArgs)
 	;
@@ -258,8 +259,11 @@
 
 :- type type_ctor_representation 
 	--->	enum
+	;	enum_usereq
 	;	du
+	;	du_usereq
 	;	notag
+	;	notag_usereq
 	;	equiv
 	;	equiv_var
 	;	int
@@ -277,23 +281,26 @@
 
 :- pred base_type_info__type_ctor_rep_to_int(type_ctor_representation::in,
 	int::out) is det.
-base_type_info__type_ctor_rep_to_int(enum, 0).
-base_type_info__type_ctor_rep_to_int(du, 1).
-base_type_info__type_ctor_rep_to_int(notag, 2).
-base_type_info__type_ctor_rep_to_int(equiv, 3).
-base_type_info__type_ctor_rep_to_int(equiv_var, 4).
-base_type_info__type_ctor_rep_to_int(int, 5).
-base_type_info__type_ctor_rep_to_int(char, 6).
-base_type_info__type_ctor_rep_to_int(float, 7).
-base_type_info__type_ctor_rep_to_int(string, 8).
-base_type_info__type_ctor_rep_to_int(pred, 9).
-base_type_info__type_ctor_rep_to_int(univ, 10).
-base_type_info__type_ctor_rep_to_int(void, 11).
-base_type_info__type_ctor_rep_to_int(c_pointer, 12).
-base_type_info__type_ctor_rep_to_int(typeinfo, 13).
-base_type_info__type_ctor_rep_to_int(typeclassinfo, 14).
-base_type_info__type_ctor_rep_to_int(array, 15).
-base_type_info__type_ctor_rep_to_int(unknown, 16).
+base_type_info__type_ctor_rep_to_int(enum, 		0).
+base_type_info__type_ctor_rep_to_int(enum_usereq,	1).
+base_type_info__type_ctor_rep_to_int(du,		2).
+base_type_info__type_ctor_rep_to_int(du_usereq,		3).
+base_type_info__type_ctor_rep_to_int(notag,		4).
+base_type_info__type_ctor_rep_to_int(notag_usereq,	5).
+base_type_info__type_ctor_rep_to_int(equiv,		6).
+base_type_info__type_ctor_rep_to_int(equiv_var,		7).
+base_type_info__type_ctor_rep_to_int(int,		8).
+base_type_info__type_ctor_rep_to_int(char,		9).
+base_type_info__type_ctor_rep_to_int(float,	 	10).
+base_type_info__type_ctor_rep_to_int(string,		11).
+base_type_info__type_ctor_rep_to_int(pred,		12).
+base_type_info__type_ctor_rep_to_int(univ,		13).
+base_type_info__type_ctor_rep_to_int(void,		14).
+base_type_info__type_ctor_rep_to_int(c_pointer,		15).
+base_type_info__type_ctor_rep_to_int(typeinfo,		16).
+base_type_info__type_ctor_rep_to_int(typeclassinfo,	17).
+base_type_info__type_ctor_rep_to_int(array,		18).
+base_type_info__type_ctor_rep_to_int(unknown,		19).
 
 
 :- pred base_type_info__construct_type_ctor_representation(hlds_type_defn,
@@ -312,18 +319,36 @@
 		TypeBody = abstract_type,
 		TypeCtorRep = unknown
 	;
-		TypeBody = du_type(Ctors, _ConsTagMap, Enum, _EqualityPred),
+		TypeBody = du_type(Ctors, _ConsTagMap, Enum, EqualityPred),
 		(
 			Enum = yes,
-			TypeCtorRep = enum
+			(
+				EqualityPred = yes(_),
+				TypeCtorRep = enum_usereq
+			;
+				EqualityPred = no,
+				TypeCtorRep = enum
+			)
 		;
 			Enum = no,
 			( 
 				type_is_no_tag_type(Ctors, _Name, _TypeArg)
 			->
-				TypeCtorRep = notag
+				(
+					EqualityPred = yes(_),
+					TypeCtorRep = notag_usereq
+				;
+					EqualityPred = no,
+					TypeCtorRep = notag
+				)
 			;
-				TypeCtorRep = du
+				(
+					EqualityPred = yes(_),
+					TypeCtorRep = du_usereq
+				;
+					EqualityPred = no,
+					TypeCtorRep = du
+				)
 			)
 		)
 	),
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.168
diff -u -r1.168 std_util.m
--- std_util.m	1999/10/20 07:03:13	1.168
+++ std_util.m	1999/10/25 08:35:18
@@ -2177,9 +2177,10 @@
     layout_for_tag = type_ctor_layout[data_tag];
     layout_vector_for_tag = MR_strip_tag(layout_for_tag);
 
-    switch(type_ctor_info->type_ctor_rep) {
+    switch(MR_get_new_type_ctor_rep(type_ctor_info)) {
 
         case MR_TYPECTOR_REP_ENUM:
+        case MR_TYPECTOR_REP_ENUM_USEREQ:
             info->functor = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
                 layout_vector_for_tag, data_word);
             info->arity = 0;
@@ -2188,6 +2189,7 @@
             break;
 
         case MR_TYPECTOR_REP_DU:
+        case MR_TYPECTOR_REP_DU_USEREQ:
             tag_rep = MR_get_tag_representation((Word) layout_for_tag);
             switch (tag_rep) {
             case MR_DISCUNIONTAG_SHARED_LOCAL:
@@ -2252,6 +2254,7 @@
 	break;
 
         case MR_TYPECTOR_REP_NOTAG:
+        case MR_TYPECTOR_REP_NOTAG_USEREQ:
         {
             int i;
 	    Word * functor_descriptor = (Word *) layout_vector_for_tag;
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_deep_copy_body.h
--- mercury_deep_copy_body.h	1999/10/19 04:11:40	1.13
+++ mercury_deep_copy_body.h	1999/10/27 06:27:04
@@ -31,7 +31,6 @@
 
     Word functors_indicator;
     Word layout_entry, *entry_value, *data_value;
-    MR_TypeCtorRepresentation type_ctor_rep;
     MR_DiscUnionTagRepresentation tag_rep;
     int data_tag; 
     Word new_data, data;
@@ -45,12 +44,14 @@
     layout_entry = type_ctor_info->type_ctor_layout[data_tag];
     entry_value = (Word *) MR_strip_tag(layout_entry);
 
-    switch (type_ctor_info->type_ctor_rep) {
+    switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
         case MR_TYPECTOR_REP_ENUM:
+        case MR_TYPECTOR_REP_ENUM_USEREQ:
             new_data = data;    /* just a copy of the actual item */
             break;
 
         case MR_TYPECTOR_REP_DU:
+        case MR_TYPECTOR_REP_DU_USEREQ:
             tag_rep = MR_get_tag_representation(layout_entry);
             switch (tag_rep) {
 
@@ -135,6 +136,7 @@
         }
         break;
         case MR_TYPECTOR_REP_NOTAG:
+        case MR_TYPECTOR_REP_NOTAG_USEREQ:
             new_data = copy_arg(data_ptr, type_info, 
                     (Word *) *MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
                      entry_value), lower_limit, upper_limit);
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.21
diff -u -r1.21 mercury_grade.h
--- mercury_grade.h	1999/09/23 11:25:19	1.21
+++ mercury_grade.h	1999/10/27 05:52:33
@@ -49,7 +49,17 @@
 ** binary backwards compatibility.
 ** Note that the binary compatibility version number has no direct
 ** relationship with the source release number (which is in ../VERSION).
+**
+** Note: next time the binary compatibility version number is increased,
+** we should remove the MR_get_new_type_ctor_rep() function in
+** runtime/mercury_type_info.c.  
+**
+** It is a good idea to inspect all code for RTTI version number checks
+** and remove them when increasing the binary compatibility version number.   
+** Searching for MR_RTTI_VERSION__ should find all code related to the
+** RTTI version number.
 */
+
 #define MR_GRADE_PART_0		v1_
 
 #ifdef USE_ASM_LABELS
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.24
diff -u -r1.24 mercury_ho_call.c
--- mercury_ho_call.c	1999/10/19 05:26:10	1.24
+++ mercury_ho_call.c	1999/10/27 06:29:18
@@ -274,10 +274,11 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_unify[type_ctor_info->type_ctor_rep]++;
+	MR_ctor_rep_unify[MR_get_new_type_ctor_rep(
+				type_ctor_info->type_ctor_rep)]++;
 #endif
 
-	switch (type_ctor_info->type_ctor_rep) {
+	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
 
 			/*
 			** For notag and equiv types, we should probably
@@ -287,9 +288,12 @@
 			** improved.
 			*/
 
+		case MR_TYPECTOR_REP_ENUM_USEREQ:
 		case MR_TYPECTOR_REP_DU:
+		case MR_TYPECTOR_REP_DU_USEREQ:
 		case MR_TYPECTOR_REP_ARRAY:
 		case MR_TYPECTOR_REP_NOTAG:
+		case MR_TYPECTOR_REP_NOTAG_USEREQ:
 		case MR_TYPECTOR_REP_EQUIV:
 		case MR_TYPECTOR_REP_EQUIV_VAR:
 
@@ -504,10 +508,11 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_index[type_ctor_info->type_ctor_rep]++;
+	MR_ctor_rep_index[MR_get_new_type_ctor_rep(
+				type_ctor_info->type_ctor_rep)]++;
 #endif
 
-	switch (type_ctor_info->type_ctor_rep) {
+	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
 
 			/*
 			** For notag and equiv types, we should probably
@@ -518,7 +523,9 @@
 			*/
 
 		case MR_TYPECTOR_REP_DU:
+		case MR_TYPECTOR_REP_DU_USEREQ:
 		case MR_TYPECTOR_REP_NOTAG:
+		case MR_TYPECTOR_REP_NOTAG_USEREQ:
 		case MR_TYPECTOR_REP_EQUIV:
 		case MR_TYPECTOR_REP_EQUIV_VAR:
 		case MR_TYPECTOR_REP_ARRAY:
@@ -580,6 +587,7 @@
 				LABEL(mercury__index_2_0));
 
 		case MR_TYPECTOR_REP_ENUM:
+		case MR_TYPECTOR_REP_ENUM_USEREQ:
 		case MR_TYPECTOR_REP_INT:
 		case MR_TYPECTOR_REP_CHAR:
 			r1 = x;
@@ -699,10 +707,11 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_compare[type_ctor_info->type_ctor_rep]++;
+	MR_ctor_rep_compare[MR_get_new_type_ctor_rep(
+				type_ctor_info->type_ctor_rep)]++;
 #endif
 
-	switch (type_ctor_info->type_ctor_rep) {
+	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
 
 			/*
 			** For notag and equiv types, we should probably
@@ -713,7 +722,9 @@
 			*/
 
 		case MR_TYPECTOR_REP_DU:
+		case MR_TYPECTOR_REP_DU_USEREQ:
 		case MR_TYPECTOR_REP_NOTAG:
+		case MR_TYPECTOR_REP_NOTAG_USEREQ:
 		case MR_TYPECTOR_REP_EQUIV:
 		case MR_TYPECTOR_REP_EQUIV_VAR:
 		case MR_TYPECTOR_REP_ARRAY:
@@ -780,6 +791,7 @@
 				LABEL(mercury__compare_3_3));
 
 		case MR_TYPECTOR_REP_ENUM:
+		case MR_TYPECTOR_REP_ENUM_USEREQ:
 		case MR_TYPECTOR_REP_INT:
 		case MR_TYPECTOR_REP_CHAR:
 			if ((Integer) x == (Integer) y) {
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.13
diff -u -r1.13 mercury_tabling.c
--- mercury_tabling.c	1999/10/18 15:47:00	1.13
+++ mercury_tabling.c	1999/10/27 06:30:21
@@ -487,18 +487,22 @@
 #ifdef  MR_TABLE_DEBUG
     if (MR_tabledebug) {
         printf("ENTRY %p %x, data rep: %d\n",
-            table, data, type_ctor_info->type_ctor_rep);
+            table, data, MR_get_new_type_ctor_rep(type_ctor_info));
     }
 #endif  /* MR_TABLE_DEBUG */
 
-    switch (type_ctor_info->type_ctor_rep) {
-        case MR_TYPECTOR_REP_ENUM: {
+    switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+        case MR_TYPECTOR_REP_ENUM: 
+        case MR_TYPECTOR_REP_ENUM_USEREQ: 
+	{
             int functors = MR_TYPE_CTOR_LAYOUT_ENUM_VECTOR_NUM_FUNCTORS(
                                 layout_vector_for_tag);
             MR_DEBUG_TABLE_ENUM(table, functors, data);
             break;
         }
-        case MR_TYPECTOR_REP_DU: {
+        case MR_TYPECTOR_REP_DU: 
+        case MR_TYPECTOR_REP_DU_USEREQ: 
+	{
             tag_rep = MR_get_tag_representation((Word) layout_for_tag);
             switch(tag_rep) {
             case MR_DISCUNIONTAG_SHARED_LOCAL: {
@@ -567,7 +571,9 @@
             }
             break;
         }
-        case MR_TYPECTOR_REP_NOTAG: {
+        case MR_TYPECTOR_REP_NOTAG: 
+        case MR_TYPECTOR_REP_NOTAG_USEREQ:
+	{
             Word *new_type_info;
             new_type_info = MR_make_type_info(type_info,
                 (Word *) *MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
Index: runtime/mercury_type_info.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.c,v
retrieving revision 1.24
diff -u -r1.24 mercury_type_info.c
--- mercury_type_info.c	1999/10/20 07:03:23	1.24
+++ mercury_type_info.c	1999/10/27 05:14:59
@@ -550,3 +550,31 @@
 		mercury_data___type_ctor_info_pred_0, _pred_);
 }
 
+/*---------------------------------------------------------------------------*/
+
+	/* Functions for handling previous versions of the RTTI code */
+
+	/*
+	** After updating the type_ctor_rep enumeration to add user
+	** defined equality alternatives, we need to convert old
+	** type_ctor_reps into the new type_ctor_rep.
+	*/
+MR_TypeCtorRepresentation
+MR_get_new_type_ctor_rep(MR_TypeCtorInfo type_ctor_info)
+{
+	MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(type_ctor_info);
+	if (type_ctor_info->type_ctor_version < MR_RTTI_VERSION__USEREQ) {
+		if (type_ctor_info->type_ctor_rep < 3) {
+			return type_ctor_info->type_ctor_rep * 2;
+		} else {
+			return type_ctor_info->type_ctor_rep + 3;
+		}
+	} else {
+		return type_ctor_info->type_ctor_rep;
+	}
+}
+
+/*---------------------------------------------------------------------------*/
+
+
+
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.29
diff -u -r1.29 mercury_type_info.h
--- mercury_type_info.h	1999/10/20 07:03:23	1.29
+++ mercury_type_info.h	1999/10/27 06:31:01
@@ -36,8 +36,7 @@
 
 /*---------------------------------------------------------------------------*/
 
-#define MR_RTTI_VERSION 		MR_RTTI_VERSION__INITIAL
-#define MR_RTTI_VERSION__INITIAL 	2
+
 
 /* 
 ** The version of the RTTI data structures -- useful for bootstrapping.
@@ -52,6 +51,22 @@
 ** compiler/base_type_info.m.
 */
 
+#define MR_RTTI_VERSION 		MR_RTTI_VERSION__USEREQ
+#define MR_RTTI_VERSION__INITIAL 	2
+#define MR_RTTI_VERSION__USEREQ 	3
+
+/*
+** Check that the RTTI version is in a sensible range.
+** The lower bound should be the lowest currently supported version
+** number.  The upper bound is the current version number.
+** If you increase the lower bound you should also increase the binary
+** compatibility version number in runtime/mercury_grade.h (MR_GRADE_PART_0).
+*/
+
+#define MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(typector)	\
+	assert(MR_RTTI_VERSION__INITIAL <= typector->type_ctor_version \
+		&& typector->type_ctor_version <= MR_RTTI_VERSION__USEREQ)
+
 /*---------------------------------------------------------------------------*/
 
 /*
@@ -772,16 +787,20 @@
 
 /*
 ** MR_DataRepresentation is the representation for a particular type
-** constructor.  For the cases of MR_TYPE_CTOR_REP_DU the exact
-** representation depends on the tag value -- lookup the tag value in
-** type_ctor_layout to find out this information.
+** constructor.  For the cases of MR_TYPE_CTOR_REP_DU and
+** MR_TYPE_CTOR_REP_DU_USEREQ, the exact representation depends on the tag
+** value -- lookup the tag value in type_ctor_layout to find out this
+** information.
 **
 ** 
 */
 typedef enum MR_TypeCtorRepresentation {
 	MR_TYPECTOR_REP_ENUM,
+	MR_TYPECTOR_REP_ENUM_USEREQ,
 	MR_TYPECTOR_REP_DU,
+	MR_TYPECTOR_REP_DU_USEREQ,
 	MR_TYPECTOR_REP_NOTAG,
+	MR_TYPECTOR_REP_NOTAG_USEREQ,
 	MR_TYPECTOR_REP_EQUIV,
 	MR_TYPECTOR_REP_EQUIV_VAR,
 	MR_TYPECTOR_REP_INT,
@@ -893,6 +912,13 @@
 
 #define MR_TYPE_CTOR_INFO_GET_TYPE_MODULE_NAME(TypeCtorInfo)		\
 	((TypeCtorInfo)->type_ctor_module_name)
+
+/*---------------------------------------------------------------------------*/
+
+	/* Functions for handling previous versions of the RTTI code */
+
+MR_TypeCtorRepresentation
+MR_get_new_type_ctor_rep(MR_TypeCtorInfo type_ctor_info);
 
 /*---------------------------------------------------------------------------*/
 #endif /* not MERCURY_TYPEINFO_H */
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.47
diff -u -r1.47 mercury_wrapper.c
--- mercury_wrapper.c	1999/10/18 15:47:02	1.47
+++ mercury_wrapper.c	1999/10/22 04:23:22
@@ -923,10 +923,17 @@
 		if (fp != NULL) {
 			fprintf(fp, "UNIFY ENUM %ld\n",
 				MR_ctor_rep_unify[MR_TYPECTOR_REP_ENUM]);
+			fprintf(fp, "UNIFY ENUM_USEREQ %ld\n",
+				MR_ctor_rep_unify[MR_TYPECTOR_REP_ENUM_USEREQ]);
 			fprintf(fp, "UNIFY DU %ld\n",
 				MR_ctor_rep_unify[MR_TYPECTOR_REP_DU]);
+			fprintf(fp, "UNIFY DU_USEREQ %ld\n",
+				MR_ctor_rep_unify[MR_TYPECTOR_REP_DU_USEREQ]);
 			fprintf(fp, "UNIFY NOTAG %ld\n",
 				MR_ctor_rep_unify[MR_TYPECTOR_REP_NOTAG]);
+			fprintf(fp, "UNIFY NOTAG_USEREQ %ld\n",
+				MR_ctor_rep_unify[
+					MR_TYPECTOR_REP_NOTAG_USEREQ]);
 			fprintf(fp, "UNIFY EQUIV %ld\n",
 				MR_ctor_rep_unify[MR_TYPECTOR_REP_EQUIV]);
 			fprintf(fp, "UNIFY EQUIV_VAR %ld\n",
@@ -974,10 +981,16 @@
 
 			fprintf(fp, "INDEX ENUM %ld\n",
 				MR_ctor_rep_index[MR_TYPECTOR_REP_ENUM]);
+			fprintf(fp, "INDEX ENUM_USEREQ %ld\n",
+				MR_ctor_rep_index[MR_TYPECTOR_REP_ENUM_USEREQ]);
 			fprintf(fp, "INDEX DU %ld\n",
 				MR_ctor_rep_index[MR_TYPECTOR_REP_DU]);
+			fprintf(fp, "INDEX DU_USEREQ %ld\n",
+				MR_ctor_rep_index[MR_TYPECTOR_REP_DU_USEREQ]);
 			fprintf(fp, "INDEX NOTAG %ld\n",
 				MR_ctor_rep_index[MR_TYPECTOR_REP_NOTAG]);
+			fprintf(fp, "INDEX NOTAG_USEREQ %ld\n",
+				MR_ctor_rep_index[MR_TYPECTOR_REP_NOTAG_USEREQ]);
 			fprintf(fp, "INDEX EQUIV %ld\n",
 				MR_ctor_rep_index[MR_TYPECTOR_REP_EQUIV]);
 			fprintf(fp, "INDEX EQUIV_VAR %ld\n",
@@ -1025,10 +1038,16 @@
 
 			fprintf(fp, "COMPARE ENUM %ld\n",
 				MR_ctor_rep_compare[MR_TYPECTOR_REP_ENUM]);
+			fprintf(fp, "COMPARE ENUM_USEREQ %ld\n",
+				MR_ctor_rep_compare[MR_TYPECTOR_REP_ENUM_USEREQ]);
 			fprintf(fp, "COMPARE DU %ld\n",
 				MR_ctor_rep_compare[MR_TYPECTOR_REP_DU]);
+			fprintf(fp, "COMPARE DU_USEREQ %ld\n",
+				MR_ctor_rep_compare[MR_TYPECTOR_REP_DU_USEREQ]);
 			fprintf(fp, "COMPARE NOTAG %ld\n",
 				MR_ctor_rep_compare[MR_TYPECTOR_REP_NOTAG]);
+			fprintf(fp, "COMPARE NOTAG_USEREQ %ld\n",
+				MR_ctor_rep_compare[MR_TYPECTOR_REP_NOTAG_USEREQ]);
 			fprintf(fp, "COMPARE EQUIV %ld\n",
 				MR_ctor_rep_compare[MR_TYPECTOR_REP_EQUIV]);
 			fprintf(fp, "COMPARE EQUIV_VAR %ld\n",

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