[m-dev.] for review: stop using functors indicators.

Tyson Dowd trd at cs.mu.OZ.AU
Fri Nov 19 15:59:36 AEDT 1999


Hi,

While working on another change to remove type_ctor_functors and
type_ctor_layouts for builtin types, I needed to stop using
functors indicators throughout the runtime.

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


Estimated hours taken: 8 (including debugging)

Stop using the functors indicator in the runtime system.
Once this change has bootstrapped, it will be safe to actually
remove the code that generates the functors indicator.

compiler/base_type_layout.m:
	Mention that functors indicator is no longer needed.

library/array.m:
library/builtin.m:
library/private_builtin.m:
	Set functors indicators to zero (so as to cause errors if code
	is still using them).

library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_type_info.c:
	Use type_ctor_rep instead of functors indicators.

runtime/mercury_type_info.h:
	Remove functors indicators macros.



Index: compiler/base_type_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_type_layout.m,v
retrieving revision 1.46
diff -u -r1.46 base_type_layout.m
--- base_type_layout.m	1999/07/13 08:52:40	1.46
+++ base_type_layout.m	1999/11/16 08:01:56
@@ -169,6 +169,7 @@
 %
 % The first word of any functors table is an indicator of whether this
 % type is a du, no_tag, equivalence, enumeration or special (e.g. builtin).
+% XXX this is now unused, and should be removed.
 %
 % For discriminated unions, the tables contain:
 % 	- disc. union indicator
@@ -504,7 +505,11 @@
 :- pred base_type_layout__tag_value_equiv(int::out) is det.
 base_type_layout__tag_value_equiv(3).
 
+
+
+
 	% Constants for type_ctor_functors
+	% XXX this is no longer used and can be removed.
 
 :- type functors_category 	--->	du
 				;	enum
@@ -514,11 +519,7 @@
 
 :- pred base_type_layout__functors_value(functors_category::in, int::out) 
 	is det.
-base_type_layout__functors_value(du, 0).
-base_type_layout__functors_value(enum, 1).
-base_type_layout__functors_value(equiv, 2).
-base_type_layout__functors_value(special, 3).
-base_type_layout__functors_value(no_tag, 4).
+base_type_layout__functors_value(_, 0).
 
 %---------------------------------------------------------------------------%
 
Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.65
diff -u -r1.65 array.m
--- array.m	1999/11/15 10:12:02	1.65
+++ array.m	1999/11/18 01:57:56
@@ -307,7 +307,7 @@
 const struct mercury_data_array__type_ctor_functors_array_1_struct {
 	Integer f1;
 } mercury_data_array__type_ctor_functors_array_1 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 Declare_entry(mercury__array__array_equal_2_0);
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.26
diff -u -r1.26 builtin.m
--- builtin.m	1999/11/15 10:12:03	1.26
+++ builtin.m	1999/11/18 01:57:57
@@ -386,7 +386,7 @@
 const struct mercury_data___type_ctor_functors_int_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_int_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `character' */
@@ -395,7 +395,7 @@
 const struct mercury_data___type_ctor_functors_character_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_character_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `string' */
@@ -404,7 +404,7 @@
 const struct mercury_data___type_ctor_functors_string_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_string_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `float' */
@@ -413,7 +413,7 @@
 const struct mercury_data___type_ctor_functors_float_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_float_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `void' */
@@ -422,7 +422,7 @@
 const struct mercury_data___type_ctor_functors_void_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_void_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 #ifdef	NATIVE_GC
@@ -433,7 +433,7 @@
 const struct mercury_data___type_ctor_functors_succip_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_succip_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `hp' (only used by accurate gc) */
@@ -442,7 +442,7 @@
 const struct mercury_data___type_ctor_functors_hp_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_hp_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `curfr' (only used by accurate gc) */
@@ -451,7 +451,7 @@
 const struct mercury_data___type_ctor_functors_curfr_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_curfr_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `maxfr' (only used by accurate gc) */
@@ -460,7 +460,7 @@
 const struct mercury_data___type_ctor_functors_maxfr_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_maxfr_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `redofr' (only used by accurate gc) */
@@ -469,7 +469,7 @@
 const struct mercury_data___type_ctor_functors_redofr_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_redofr_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `redoip' (only used by accurate gc) */
@@ -478,7 +478,7 @@
 const struct mercury_data___type_ctor_functors_redoip_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_redoip_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 #endif /* NATIVE_GC */
@@ -489,7 +489,7 @@
 const struct mercury_data___type_ctor_functors_trail_ptr_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_trail_ptr_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_functors for `ticket' (only used by agc and debugger) */
@@ -498,7 +498,7 @@
 const struct mercury_data___type_ctor_functors_ticket_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_ticket_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* type_ctor_infos definitions */
@@ -877,7 +877,7 @@
 mercury_data_builtin__type_ctor_functors_c_pointer_0_struct {
 	Integer f1;
 } mercury_data_builtin__type_ctor_functors_c_pointer_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 Define_extern_entry(mercury____Unify___builtin__c_pointer_0_0);
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.33
diff -u -r1.33 private_builtin.m
--- private_builtin.m	1999/11/15 10:12:10	1.33
+++ private_builtin.m	1999/11/18 01:58:00
@@ -349,7 +349,7 @@
 const struct mercury_data_private_builtin__type_ctor_functors_type_info_1_struct {
 	Integer f1;
 } mercury_data_private_builtin__type_ctor_functors_type_info_1 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+        ((Integer) 0)
 };
 
 Define_extern_entry(mercury____Unify___private_builtin__typeclass_info_1_0);
@@ -412,7 +412,7 @@
 const struct mercury_data_private_builtin__type_ctor_functors_typeclass_info_1_struct {
 	Integer f1;
 } mercury_data_private_builtin__type_ctor_functors_typeclass_info_1 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.173
diff -u -r1.173 std_util.m
--- std_util.m	1999/11/16 12:18:19	1.173
+++ std_util.m	1999/11/18 02:35:14
@@ -1038,7 +1038,7 @@
 const struct mercury_data_std_util__type_ctor_functors_univ_0_struct {
 	Integer f1;
 } mercury_data_std_util__type_ctor_functors_univ_0 = {
-	MR_TYPE_CTOR_FUNCTORS_UNIV
+	((Integer) 0)
 };
 
 MR_MODULE_STATIC_OR_EXTERN
@@ -1055,7 +1055,7 @@
 mercury_data_std_util__type_ctor_functors_type_info_0_struct {
 	Integer f1;
 } mercury_data_std_util__type_ctor_functors_type_info_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+        ((Integer) 0)
 };
 
 Declare_entry(mercury____Unify___std_util__type_info_0_0);
@@ -1219,7 +1219,7 @@
 /*
 INIT sys_init_unify_univ_module
 */
-MR_MODULE_STATIC_OR_EXTERN ModuleFunc unify_univ_module;
+extern ModuleFunc unify_univ_module;
 void sys_init_unify_univ_module(void); /* suppress gcc -Wmissing-decl warning */
 void sys_init_unify_univ_module(void) {
 	unify_univ_module();
@@ -1242,7 +1242,6 @@
 :- pragma c_header_code("
 
 typedef struct ML_Construct_Info_Struct {
-	int vector_type;
 	int arity;
 	Word *functor_descriptor;
 	Word *argument_vector;
@@ -1590,9 +1589,12 @@
 	(Term::out), will_not_call_mercury, "
 {
 	Word 	layout_entry, new_data, term_vector;
+	MR_TypeCtorInfo type_ctor_info;
 	ML_Construct_Info info;
 	bool success;
 
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) TypeInfo); 
+
 		/* 
 		** Check range of FunctorNum, get info for this
 		** functor.
@@ -1613,34 +1615,41 @@
 		*/
 	if (success) {
 
-		layout_entry = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT_ENTRY(
-			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) TypeInfo), 
-				info.primary_tag);
-
-		if (info.vector_type == MR_TYPE_CTOR_FUNCTORS_ENUM) {
+	switch (type_ctor_info->type_ctor_rep) {
+		case MR_TYPECTOR_REP_ENUM:
+		case MR_TYPECTOR_REP_ENUM_USEREQ:
 			/*
 			** Enumeratiors don't have tags or arguments,
 			** just the enumeration value.
 			*/
 			new_data = (Word) info.secondary_tag;
-		} else {
-			/* 
-			** It must be some sort of tagged functor.
-			*/
-
-			if (info.vector_type == MR_TYPE_CTOR_FUNCTORS_NO_TAG) {
+			break;
 
-				/*
-				** We set term_vector to point to
-				** new_data so that the argument filling
-				** loop will fill the argument in.
+		case MR_TYPECTOR_REP_NOTAG:
+		case MR_TYPECTOR_REP_NOTAG_USEREQ:
+				/* 
+				** Copy arguments and add tag to new_data.
 				*/
+			term_vector = (Word) &new_data;
+			ML_copy_arguments_from_list_to_vector(info.arity,
+					ArgList, term_vector);
+			new_data = (Word) MR_mkword(MR_mktag(info.primary_tag), 
+				new_data);
+			break;
 
-				term_vector = (Word) &new_data;
+		case MR_TYPECTOR_REP_DU:
+		case MR_TYPECTOR_REP_DU_USEREQ:
+			layout_entry = 
+			  MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_LAYOUT_ENTRY(
+				type_ctor_info, info.primary_tag);
+			switch (MR_get_tag_representation(layout_entry)) {
 
-			} else if (MR_tag(layout_entry) == 
-					TYPE_CTOR_LAYOUT_SHARED_REMOTE_TAG) {
+			case MR_DISCUNIONTAG_SHARED_LOCAL:
+				new_data = MR_mkbody(info.secondary_tag);
+				term_vector = (Word) NULL;
+				break;
 
+			case MR_DISCUNIONTAG_SHARED_REMOTE:
 				/*
 				** Create arity + 1 words, fill in the
 				** secondary tag, and the term_vector will
@@ -1652,45 +1661,56 @@
 				MR_field(MR_mktag(0), new_data, 0)
 					= info.secondary_tag;
 				term_vector = (Word) (new_data + sizeof(Word));
+				break;
 
-			} else if (MR_tag(layout_entry) == TYPE_CTOR_LAYOUT_CONST_TAG) {
-
-				/* 
-				** If it's a du, and this tag is
-				** constant, it must be a shared local
-				** tag. 
-				*/
-
-				new_data = MR_mkbody(info.secondary_tag);
-				term_vector = (Word) NULL;
-
-			} else {
-
+			case MR_DISCUNIONTAG_UNSHARED:
 				/*
 				** An unshared tagged word, just need to
 				** create arguments.
 				*/
-
 				incr_hp_msg(new_data, info.arity,
 					MR_PROC_LABEL, ""<unknown type from ""
 					""std_util:construct/3>"");
 				term_vector = (Word) new_data; 
+				break;
 			}
 
 				/* 
-				** Copy arguments.
+				** Copy arguments and add tag to new_data.
 				*/
-
 			ML_copy_arguments_from_list_to_vector(info.arity,
 					ArgList, term_vector);
-
-				/* 
-				** Add tag to new_data.
-				*/
 			new_data = (Word) MR_mkword(MR_mktag(info.primary_tag), 
 				new_data);
-		}
+			break;
 
+		case MR_TYPECTOR_REP_EQUIV_VAR:
+		case MR_TYPECTOR_REP_EQUIV:
+			/* XXX maybe we should handle equivs */
+		case MR_TYPECTOR_REP_INT:
+		case MR_TYPECTOR_REP_CHAR:
+		case MR_TYPECTOR_REP_FLOAT:
+		case MR_TYPECTOR_REP_STRING:
+		case MR_TYPECTOR_REP_PRED:
+		case MR_TYPECTOR_REP_UNIV:
+		case MR_TYPECTOR_REP_VOID:
+		case MR_TYPECTOR_REP_C_POINTER:
+		case MR_TYPECTOR_REP_TYPEINFO:
+		case MR_TYPECTOR_REP_TYPECLASSINFO:
+		case MR_TYPECTOR_REP_ARRAY:
+		case MR_TYPECTOR_REP_SUCCIP:
+		case MR_TYPECTOR_REP_HP:
+		case MR_TYPECTOR_REP_CURFR:
+		case MR_TYPECTOR_REP_MAXFR:
+		case MR_TYPECTOR_REP_REDOFR:
+		case MR_TYPECTOR_REP_REDOIP:
+		case MR_TYPECTOR_REP_TRAIL_PTR:
+		case MR_TYPECTOR_REP_TICKET:
+		default:
+			fatal_error(""std_util:construct - not a discriminated union"");
+
+	}
+
 		/* 
 		** Create a univ.
 		*/
@@ -1726,21 +1746,19 @@
 	** calls to this function.
 	*/
 
-static int 
+int 
 ML_get_functor_info(Word type_info, int functor_number, ML_Construct_Info *info)
 {
-	Word *type_ctor_functors;
-
-	type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
-		MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info));
+	MR_TypeCtorInfo type_ctor_info;
 
-	info->vector_type = MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors);
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
-	switch (info->vector_type) {
+	switch (type_ctor_info->type_ctor_rep) {
 
-	case MR_TYPE_CTOR_FUNCTORS_ENUM:
+	case MR_TYPECTOR_REP_ENUM:
+	case MR_TYPECTOR_REP_ENUM_USEREQ:
 		info->functor_descriptor = MR_TYPE_CTOR_FUNCTORS_ENUM_VECTOR(
-				type_ctor_functors);
+				type_ctor_info->type_ctor_functors);
 		info->arity = 0;
 		info->argument_vector = NULL;
 		info->primary_tag = 0;
@@ -1750,10 +1768,12 @@
 				info->functor_descriptor, functor_number);
 		break; 
 
-	case MR_TYPE_CTOR_FUNCTORS_DU:
+	case MR_TYPECTOR_REP_DU:
+	case MR_TYPECTOR_REP_DU_USEREQ:
 		info->functor_descriptor =
 			MR_TYPE_CTOR_FUNCTORS_DU_FUNCTOR_N(
-				type_ctor_functors, functor_number);
+				type_ctor_info->type_ctor_functors,
+				functor_number);
 		info->arity = MR_TYPE_CTOR_LAYOUT_FUNCTOR_DESCRIPTOR_ARITY(
 			info->functor_descriptor);
 		info->argument_vector =
@@ -1770,32 +1790,53 @@
 				info->functor_descriptor);
 		break; 
 
-	case MR_TYPE_CTOR_FUNCTORS_NO_TAG:
+	case MR_TYPECTOR_REP_NOTAG:
+	case MR_TYPECTOR_REP_NOTAG_USEREQ:
 		info->functor_descriptor =
 			MR_TYPE_CTOR_FUNCTORS_NO_TAG_FUNCTOR(
-				type_ctor_functors);
+				type_ctor_info->type_ctor_functors);
 		info->arity = 1;
 		info->argument_vector = MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
 				info->functor_descriptor);
 		info->primary_tag = 0;
 		info->secondary_tag = 0;
-		info->functor_name = MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(
+		info->functor_name =
+			MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_FUNCTOR_NAME(
 				info->functor_descriptor);
 		break; 
 
-	case MR_TYPE_CTOR_FUNCTORS_EQUIV: {
+	case MR_TYPECTOR_REP_EQUIV: {
 		Word *equiv_type;
 		equiv_type = (Word *) MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(
-				type_ctor_functors);
+				type_ctor_info->type_ctor_functors);
 		return ML_get_functor_info((Word)
 				MR_create_type_info((Word *) type_info, 
 						equiv_type),
 				functor_number, info);
 	}
-	case MR_TYPE_CTOR_FUNCTORS_SPECIAL:
-		return FALSE;
-	case MR_TYPE_CTOR_FUNCTORS_UNIV:
+	case MR_TYPECTOR_REP_INT:
+	case MR_TYPECTOR_REP_CHAR:
+	case MR_TYPECTOR_REP_FLOAT:
+	case MR_TYPECTOR_REP_STRING:
+	case MR_TYPECTOR_REP_PRED:
+	case MR_TYPECTOR_REP_UNIV:
+	case MR_TYPECTOR_REP_VOID:
+	case MR_TYPECTOR_REP_C_POINTER:
+	case MR_TYPECTOR_REP_TYPEINFO:
+	case MR_TYPECTOR_REP_TYPECLASSINFO:
+	case MR_TYPECTOR_REP_ARRAY:
+	case MR_TYPECTOR_REP_SUCCIP:
+	case MR_TYPECTOR_REP_HP:
+	case MR_TYPECTOR_REP_CURFR:
+	case MR_TYPECTOR_REP_MAXFR:
+	case MR_TYPECTOR_REP_REDOFR:
+	case MR_TYPECTOR_REP_REDOIP:
+	case MR_TYPECTOR_REP_TRAIL_PTR:
+	case MR_TYPECTOR_REP_TICKET:
 		return FALSE;
+		break;
+	case MR_TYPECTOR_REP_UNKNOWN:
+	case MR_TYPECTOR_REP_EQUIV_VAR:
 	default:
 		fatal_error(""std_util:construct - unexpected type."");
 	}
@@ -2013,50 +2054,44 @@
 int 
 ML_get_num_functors(Word type_info)
 {
-	Word *type_ctor_functors;
+	MR_TypeCtorInfo type_ctor_info;
 	int Functors;
 
-	type_ctor_functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
-		MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info));
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
-	switch ((int) MR_TYPE_CTOR_FUNCTORS_INDICATOR(type_ctor_functors)) {
+	switch (type_ctor_info->type_ctor_rep) {
 
-		case MR_TYPE_CTOR_FUNCTORS_DU:
+		case MR_TYPECTOR_REP_DU:
+		case MR_TYPECTOR_REP_DU_USEREQ:
 			Functors = MR_TYPE_CTOR_FUNCTORS_DU_NUM_FUNCTORS(
-					type_ctor_functors);
+					type_ctor_info->type_ctor_functors);
 			break;
 
-		case MR_TYPE_CTOR_FUNCTORS_ENUM:
+		case MR_TYPECTOR_REP_ENUM:
+		case MR_TYPECTOR_REP_ENUM_USEREQ:
 			Functors = MR_TYPE_CTOR_FUNCTORS_ENUM_NUM_FUNCTORS(
-					type_ctor_functors);
+					type_ctor_info->type_ctor_functors);
+			break;
+
+		case MR_TYPECTOR_REP_NOTAG:
+		case MR_TYPECTOR_REP_NOTAG_USEREQ:
+			Functors = 1;
 			break;
 
-		case MR_TYPE_CTOR_FUNCTORS_EQUIV: {
+		case MR_TYPECTOR_REP_EQUIV: {
 			Word *equiv_type;
 			equiv_type = (Word *) 
 				MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(
-					type_ctor_functors);
+					type_ctor_info->type_ctor_functors);
 			Functors = ML_get_num_functors((Word)
 					MR_create_type_info((Word *) 
 						type_info, equiv_type));
 			break;
 		}
-
-		case MR_TYPE_CTOR_FUNCTORS_SPECIAL:
-			Functors = -1;
-			break;
 
-		case MR_TYPE_CTOR_FUNCTORS_NO_TAG:
-			Functors = 1;
-			break;
-
-		case MR_TYPE_CTOR_FUNCTORS_UNIV:
+		default:
 			Functors = -1;
 			break;
-
-		default:
-			fatal_error(""std_util:ML_get_num_functors :""
-				"" unknown indicator"");
 	}
 	return Functors;
 }
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.14
diff -u -r1.14 mercury_deep_copy_body.h
--- mercury_deep_copy_body.h	1999/10/28 06:22:56	1.14
+++ mercury_deep_copy_body.h	1999/11/09 07:15:20
@@ -29,7 +29,6 @@
     MR_TypeCtorLayout type_ctor_layout;
     MR_TypeCtorFunctors type_ctor_functors;
 
-    Word functors_indicator;
     Word layout_entry, *entry_value, *data_value;
     MR_DiscUnionTagRepresentation tag_rep;
     int data_tag; 
@@ -138,8 +137,10 @@
         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);
+                (Word *) *MR_TYPE_CTOR_LAYOUT_NO_TAG_VECTOR_ARGS(
+                    MR_TYPE_CTOR_FUNCTORS_NO_TAG_FUNCTOR(
+                    type_ctor_info->type_ctor_functors)),
+		    lower_limit, upper_limit);
             break;
 
         case MR_TYPECTOR_REP_EQUIV: 
Index: runtime/mercury_type_info.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.c,v
retrieving revision 1.25
diff -u -r1.25 mercury_type_info.c
--- mercury_type_info.c	1999/10/28 06:23:00	1.25
+++ mercury_type_info.c	1999/11/16 08:10:37
@@ -35,7 +35,7 @@
 const struct mercury_data___type_ctor_functors_pred_0_struct {
 	Integer f1;
 } mercury_data___type_ctor_functors_pred_0 = {
-	MR_TYPE_CTOR_FUNCTORS_SPECIAL
+	((Integer) 0)
 };
 
 	/* 
@@ -361,21 +361,22 @@
 Word
 MR_collapse_equivalences(Word maybe_equiv_type_info) 
 {
-	Word *functors, equiv_type_info;
+	MR_TypeCtorInfo type_ctor_info;
+	Word equiv_type_info;
 	
-	functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
-			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) 
-					maybe_equiv_type_info));
+	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO(
+			(Word *) maybe_equiv_type_info);
 
 		/* Look past equivalences */
-	while (MR_TYPE_CTOR_FUNCTORS_INDICATOR(functors) == MR_TYPE_CTOR_FUNCTORS_EQUIV) {
-		equiv_type_info = (Word) MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(functors);
+	while (MR_get_new_type_ctor_rep(type_ctor_info) == 
+			MR_TYPECTOR_REP_EQUIV) {
+		equiv_type_info = (Word) MR_TYPE_CTOR_FUNCTORS_EQUIV_TYPE(
+				type_ctor_info->type_ctor_functors);
 		equiv_type_info = (Word) MR_create_type_info(
 				(Word *) maybe_equiv_type_info, 
 				(Word *) equiv_type_info);
-		functors = MR_TYPE_CTOR_INFO_GET_TYPE_CTOR_FUNCTORS(
-			MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) 
-				equiv_type_info));
+		type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) 
+				equiv_type_info);
 		maybe_equiv_type_info = equiv_type_info;
 	}
 
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.30
diff -u -r1.30 mercury_type_info.h
--- mercury_type_info.h	1999/10/28 06:23:01	1.30
+++ mercury_type_info.h	1999/11/16 07:47:02
@@ -505,28 +505,6 @@
 ** type_ctor_functors.
 */
 
-/*
-** All type_functors have an indicator.
-*/
-
-#define MR_TYPE_CTOR_FUNCTORS_OFFSET_FOR_INDICATOR	((Integer) 0)
-
-#define MR_TYPE_CTOR_FUNCTORS_INDICATOR(Functors)				\
-	((Functors)[MR_TYPE_CTOR_FUNCTORS_OFFSET_FOR_INDICATOR])
-
-
-/*
-** Values that the indicator can take.
-*/
-
-#define MR_TYPE_CTOR_FUNCTORS_DU	((Integer) 0)
-#define MR_TYPE_CTOR_FUNCTORS_ENUM	((Integer) 1)
-#define MR_TYPE_CTOR_FUNCTORS_EQUIV	((Integer) 2)
-#define MR_TYPE_CTOR_FUNCTORS_SPECIAL	((Integer) 3)
-#define MR_TYPE_CTOR_FUNCTORS_NO_TAG	((Integer) 4)
-#define MR_TYPE_CTOR_FUNCTORS_UNIV	((Integer) 5)
-
-
 	/*
 	** Macros to access the data in a discriminated union
 	** type_functors, the number of functors, and the functor descriptor


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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