[m-rev.] diff: tc_rtti_ids

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Mar 24 13:56:48 AEDT 2004


Eliminate an unnecessary difference between the compiler's representation of
type constructor related RTTI structures and typeclass related RTTI structures.
Just as for the former we separate out the identity of the type constructor,
we now also separate out the identity of the type class for the latter.
(That we didn't always do so was a historical accident, due to the fact that
for a long time there was only one kind of type class related RTTI structure,
base_typeclass_info.)

compiler/rtti.m:
	Factor out the type class identity from tc_rtti_ids. Make
	base_typeclass_infos include a tc_name instead of a class_id
	(the same info in a different form) just as the other type class
	related tc_names do.

compiler/base_typeclass_info.m:
compiler/ml_unify_gen.m:
compiler/mlds_to_gcc.m:
compiler/name_mangle.m:
compiler/opt_debug.m:
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/unify_gen.m:
	Conform to the change above. In some cases, the change in
	representation allows us to eliminate duplicated code that wasn't
	worth factoring out with the previous representation.

compiler/type_class_info.m:
	Export a function for use in the changed code in the above modules.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/base_typeclass_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/base_typeclass_info.m,v
retrieving revision 1.27
diff -u -b -r1.27 base_typeclass_info.m
--- compiler/base_typeclass_info.m	23 Mar 2004 10:52:00 -0000	1.27
+++ compiler/base_typeclass_info.m	23 Mar 2004 11:01:27 -0000
@@ -32,6 +32,7 @@
 
 :- implementation.
 
+:- import_module backend_libs__type_class_info.
 :- import_module check_hlds__type_util.
 :- import_module hlds__hlds_code_util.
 :- import_module hlds__hlds_data.
@@ -91,8 +92,9 @@
 		base_typeclass_info__gen_body(PredProcIds,
 			InstanceTypes, InstanceConstraints, ModuleInfo, 
 			ClassId, BaseTypeClassInfo),
-		RttiData = base_typeclass_info(InstanceModule,
-			ClassId, InstanceString, BaseTypeClassInfo),
+		TCName = generate_class_name(ClassId),
+		RttiData = base_typeclass_info(TCName, InstanceModule,
+			InstanceString, BaseTypeClassInfo),
 		RttiDataList = [RttiData | RttiDataList1]
 	;
 			% The instance decl is from another module,
Index: compiler/ml_unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_unify_gen.m,v
retrieving revision 1.72
diff -u -b -r1.72 ml_unify_gen.m
--- compiler/ml_unify_gen.m	23 Mar 2004 10:52:08 -0000	1.72
+++ compiler/ml_unify_gen.m	23 Mar 2004 11:01:29 -0000
@@ -85,6 +85,7 @@
 
 :- import_module backend_libs__builtin_ops.
 :- import_module backend_libs__rtti.
+:- import_module backend_libs__type_class_info.
 :- import_module check_hlds__mode_util.
 :- import_module check_hlds__type_util.
 :- import_module hlds__hlds_code_util.
@@ -411,31 +412,28 @@
 	RttiTypeCtor = rtti_type_ctor(ModuleName, TypeName, TypeArity),
 	DataAddr = data_addr(MLDS_Module,
 		rtti(ctor_rtti_id(RttiTypeCtor, type_ctor_info))),
-	Rval = unop(cast(MLDS_VarType),
-		const(data_addr_const(DataAddr))).
+	Rval = unop(cast(MLDS_VarType), const(data_addr_const(DataAddr))).
 
 ml_gen_constant(base_typeclass_info_constant(ModuleName, ClassId, Instance),
 		VarType, Rval, !Info) :-
 	ml_gen_type(!.Info, VarType, MLDS_VarType),
 	MLDS_Module = mercury_module_name_to_mlds(ModuleName),
-	DataAddr = data_addr(MLDS_Module, rtti(tc_rtti_id(
-		base_typeclass_info(ModuleName, ClassId, Instance)))),
-	Rval = unop(cast(MLDS_VarType),
-		const(data_addr_const(DataAddr))).
+	TCName = generate_class_name(ClassId),
+	DataAddr = data_addr(MLDS_Module, rtti(tc_rtti_id(TCName,
+		base_typeclass_info(ModuleName, Instance)))),
+	Rval = unop(cast(MLDS_VarType), const(data_addr_const(DataAddr))).
 
 ml_gen_constant(tabling_pointer_constant(PredId, ProcId), VarType, Rval,
 		!Info) :-
 	ml_gen_type(!.Info, VarType, MLDS_VarType),
 	ml_gen_info_get_module_info(!.Info, ModuleInfo),
-	ml_gen_pred_label(ModuleInfo, PredId, ProcId,
-		PredLabel, PredModule),
-	DataAddr = data_addr(PredModule,
-		tabling_pointer(PredLabel - ProcId)),
-	Rval = unop(cast(MLDS_VarType),
-		const(data_addr_const(DataAddr))).
+	ml_gen_pred_label(ModuleInfo, PredId, ProcId, PredLabel, PredModule),
+	DataAddr = data_addr(PredModule, tabling_pointer(PredLabel - ProcId)),
+	Rval = unop(cast(MLDS_VarType), const(data_addr_const(DataAddr))).
 
 ml_gen_constant(deep_profiling_proc_static_tag(_), _, _, !Info) :-
-	error("ml_gen_constant: deep_profiling_proc_static_tag not yet supported").
+	error("ml_gen_constant: " ++
+		"deep_profiling_proc_static_tag not yet supported").
 
 ml_gen_constant(table_io_decl_tag(_), _, _, !Info) :-
 	error("ml_gen_constant: table_io_decl_tag not yet supported").
@@ -443,8 +441,7 @@
 ml_gen_constant(reserved_address(ReservedAddr), VarType, Rval, !Info) :-
 	ml_gen_info_get_module_info(!.Info, ModuleInfo),
 	ml_gen_type(!.Info, VarType, MLDS_VarType),
-	Rval = ml_gen_reserved_address(ModuleInfo, ReservedAddr,
-		MLDS_VarType).
+	Rval = ml_gen_reserved_address(ModuleInfo, ReservedAddr, MLDS_VarType).
 
 ml_gen_constant(shared_with_reserved_addresses(_, ThisTag), VarType, Rval,
 		!Info) :-
Index: compiler/mlds_to_gcc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.95
diff -u -b -r1.95 mlds_to_gcc.m
--- compiler/mlds_to_gcc.m	23 Mar 2004 10:52:09 -0000	1.95
+++ compiler/mlds_to_gcc.m	23 Mar 2004 11:01:30 -0000
@@ -1971,7 +1971,7 @@
 		RttiId = ctor_rtti_id(_, RttiName), 
 		build_rtti_type_name(RttiName, BaseType, !IO)
 	;
-		RttiId = tc_rtti_id(TCRttiName),
+		RttiId = tc_rtti_id(_, TCRttiName),
 		build_rtti_type_tc_name(TCRttiName, BaseType, !IO)
 	),
 	IsArray = rtti_id_has_array_type(RttiId),
@@ -2171,32 +2171,30 @@
 :- pred build_rtti_type_tc_name(tc_rtti_name::in, gcc__type::out,
 	io__state::di, io__state::uo) is det.
 
-build_rtti_type_tc_name(base_typeclass_info(_, _, _), gcc__ptr_type_node, !IO).
-build_rtti_type_tc_name(type_class_id(_), GCC_Type, !IO) :-
+build_rtti_type_tc_name(base_typeclass_info(_, _), gcc__ptr_type_node, !IO).
+build_rtti_type_tc_name(type_class_id, GCC_Type, !IO) :-
 	build_tc_id_type(GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_id_var_names(_), 'MR_ConstString', !IO).
-build_rtti_type_tc_name(type_class_id_method_ids(_), GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_id_var_names, 'MR_ConstString', !IO).
+build_rtti_type_tc_name(type_class_id_method_ids, GCC_Type, !IO) :-
 	build_tc_id_method_type(GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_decl(_), GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_decl, GCC_Type, !IO) :-
 	build_tc_decl_type(GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_decl_super(_, _, N), GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_decl_super(_, N), GCC_Type, !IO) :-
 	build_tc_constr_struct_type(N, GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_decl_supers(_), GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_decl_supers, GCC_Type, !IO) :-
 	build_tc_constr_type(StructType, !IO),
 	gcc__build_pointer_type(StructType, GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_instance(_, _), GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_instance(_), GCC_Type, !IO) :-
 	build_tc_instance_type(GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_instance_tc_type_vector(_, _),
+build_rtti_type_tc_name(type_class_instance_tc_type_vector(_),
 		'MR_PseudoTypeInfo', !IO).
-build_rtti_type_tc_name(type_class_instance_constraint(_, _, _, N),
+build_rtti_type_tc_name(type_class_instance_constraint(_, _, N),
 		GCC_Type, !IO) :-
 	build_tc_constr_struct_type(N, GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_instance_constraints(_, _),
-		GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_instance_constraints(_), GCC_Type, !IO) :-
 	build_tc_constr_type(StructType, !IO),
 	gcc__build_pointer_type(StructType, GCC_Type, !IO).
-build_rtti_type_tc_name(type_class_instance_methods(_, _),
-		_GCC_Type, !IO) :-
+build_rtti_type_tc_name(type_class_instance_methods(_), _GCC_Type, !IO) :-
 	sorry(this_file,
 		"build_rtti_type_tc_name: type_class_instance_methods").
 
@@ -2588,12 +2586,13 @@
 		= ctor_rtti_id(RttiTypeCtor, RttiName) :-
 	RttiTypeCtor = fixup_rtti_type_ctor(RttiTypeCtor0),
 	RttiName = fixup_rtti_name(RttiName0).
-fixup_rtti_id(tc_rtti_id(TCRttiName)) = tc_rtti_id(TCRttiName).
+fixup_rtti_id(tc_rtti_id(TCName, TCRttiName)) = tc_rtti_id(TCName, TCRttiName).
 
 	% XXX sometimes earlier stages of the compiler forget to add
 	% the appropriate qualifiers for stuff in the `builtin' module;
 	% we fix that here.
 :- func fixup_rtti_type_ctor(rtti_type_ctor) = rtti_type_ctor.
+
 fixup_rtti_type_ctor(RttiTypeCtor0) = RttiTypeCtor :-
 	(
 		RttiTypeCtor0 = rtti_type_ctor(ModuleName0, Name, Arity),
@@ -2606,6 +2605,7 @@
 	).
 
 :- func fixup_rtti_name(ctor_rtti_name) = ctor_rtti_name.
+
 fixup_rtti_name(RttiTypeCtor0) = RttiTypeCtor :-
 	(
 		RttiTypeCtor0 = pseudo_type_info(PseudoTypeInfo)
Index: compiler/name_mangle.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/name_mangle.m,v
retrieving revision 1.5
diff -u -b -r1.5 name_mangle.m
--- compiler/name_mangle.m	10 Mar 2004 05:21:54 -0000	1.5
+++ compiler/name_mangle.m	11 Mar 2004 03:46:53 -0000
@@ -21,7 +21,7 @@
 :- interface.
 
 :- import_module backend_libs__proc_label.
-:- import_module hlds__hlds_data.
+:- import_module backend_libs__rtti.
 :- import_module parse_tree__prog_data.
 
 :- import_module io, bool, string.
@@ -55,12 +55,12 @@
 
 	% Create a name for base_typeclass_info.
 
-:- func make_base_typeclass_info_name(class_id, string) = string.
+:- func make_base_typeclass_info_name(tc_name, string) = string.
 
 	% Output the name for base_typeclass_info,
 	% with the appropriate mercury_data_prefix.
 
-:- pred output_base_typeclass_info_name(class_id::in, string::in,
+:- pred output_base_typeclass_info_name(tc_name::in, string::in,
 	io__state::di, io__state::uo) is det.
 
 	% Prints the name of the initialization function
@@ -342,14 +342,15 @@
 
 %-----------------------------------------------------------------------------%
 
-output_base_typeclass_info_name(ClassId, TypeNames, !IO) :-
-	Str = make_base_typeclass_info_name(ClassId, TypeNames),
+output_base_typeclass_info_name(TCName, TypeNames, !IO) :-
+	Str = make_base_typeclass_info_name(TCName, TypeNames),
 	io__write_string(mercury_data_prefix, !IO),
 	io__write_string("__", !IO),
 	io__write_string(Str, !IO).
 
-make_base_typeclass_info_name(class_id(ClassSym, ClassArity), TypeNames)
-		= Str :-
+make_base_typeclass_info_name(TCName, TypeNames) = Str :-
+	TCName = tc_name(ModuleName, ClassName, ClassArity),
+	ClassSym = qualified(ModuleName, ClassName),
 	MangledClassString = sym_name_mangle(ClassSym),
 	string__int_to_string(ClassArity, ArityString),
 	MangledTypeNames = name_mangle(TypeNames),
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.138
diff -u -b -r1.138 opt_debug.m
--- compiler/opt_debug.m	23 Mar 2004 10:52:10 -0000	1.138
+++ compiler/opt_debug.m	23 Mar 2004 11:01:30 -0000
@@ -75,9 +75,8 @@
 :- pred opt_debug__dump_rtti_type_class_name(tc_name, string).
 :- mode opt_debug__dump_rtti_type_class_name(in, out) is det.
 
-:- pred opt_debug__dump_rtti_type_class_instance_name(tc_name, list(tc_type),
-	string).
-:- mode opt_debug__dump_rtti_type_class_instance_name(in, in, out) is det.
+:- pred opt_debug__dump_rtti_type_class_instance_types(list(tc_type), string).
+:- mode opt_debug__dump_rtti_type_class_instance_types(in, out) is det.
 
 :- pred opt_debug__dump_rtti_name(ctor_rtti_name, string).
 :- mode opt_debug__dump_rtti_name(in, out) is det.
@@ -355,10 +354,11 @@
 	string__append_list(
 		["rtti_addr(", RttiTypeCtor_str, ", ", DataName_str, ")"],
 		Str).
-opt_debug__dump_data_addr(rtti_addr(tc_rtti_id(TCDataName)), Str) :-
+opt_debug__dump_data_addr(rtti_addr(tc_rtti_id(TCName, TCDataName)), Str) :-
+	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
 	opt_debug__dump_tc_rtti_name(TCDataName, TCDataName_str),
 	string__append_list(
-		["tc_rtti_addr(", TCDataName_str, ")"],
+		["tc_rtti_addr(", TCNameStr, ", ", TCDataName_str, ")"],
 		Str).
 opt_debug__dump_data_addr(layout_addr(LayoutName), Str) :-
 	opt_debug__dump_layout_name(LayoutName, LayoutName_str),
@@ -453,75 +453,41 @@
 opt_debug__dump_rtti_name(type_hashcons_pointer, Str) :-
 	Str = "type_hashcons_pointer".
 
-opt_debug__dump_tc_rtti_name(base_typeclass_info(_ModuleName, ClassId,
-		InstanceStr), Str) :-
-	Str = make_base_typeclass_info_name(ClassId, InstanceStr).
-opt_debug__dump_tc_rtti_name(type_class_id(TCName), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "id",
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_decl(TCName), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "decl",
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_decl_super(TCName, Ordinal, _), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "decl_super",
-	string__int_to_string(Ordinal, OrdinalStr),
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, "(", OrdinalStr, "))"], Str).
-opt_debug__dump_tc_rtti_name(type_class_decl_supers(TCName), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "decl_supers",
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_id_method_ids(TCName), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "id_method_ids",
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_id_var_names(TCName), Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameStr),
-	DataNameStr = "id_var_names",
-	string__append_list(["tc_rtti_addr(", TCNameStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_instance(TCName, TCTypes), Str) :-
-	opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes,
-		InstanceStr),
-	DataNameStr = "instance",
-	string__append_list(["tc_rtti_addr(", InstanceStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_instance_tc_type_vector(TCName,
-		TCTypes), Str) :-
-	opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes,
-		InstanceStr),
-	DataNameStr = "instance_tc_types_vector",
-	string__append_list(["tc_rtti_addr(", InstanceStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_instance_constraints(TCName,
-		TCTypes), Str) :-
-	opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes,
-		InstanceStr),
-	DataNameStr = "instance_constraints",
-	string__append_list(["tc_rtti_addr(", InstanceStr, ", ",
-		DataNameStr, ")"], Str).
-opt_debug__dump_tc_rtti_name(type_class_instance_constraint(TCName,
-		TCTypes, Ordinal, _), Str) :-
-	opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes,
-		InstanceStr),
-	DataNameStr = "instance_constraint",
+opt_debug__dump_tc_rtti_name(base_typeclass_info(_ModuleName, InstanceStr),
+		Str) :-
+	string__append_list(["base_typeclass_info(", InstanceStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_id, "type_class_id").
+opt_debug__dump_tc_rtti_name(type_class_decl, "type_class_decl").
+opt_debug__dump_tc_rtti_name(type_class_decl_super(Ordinal, _), Str) :-
 	string__int_to_string(Ordinal, OrdinalStr),
-	string__append_list(["tc_rtti_addr(", InstanceStr, ", ",
-		DataNameStr, "(", OrdinalStr, "))"], Str).
-opt_debug__dump_tc_rtti_name(type_class_instance_methods(TCName, TCTypes),
+	string__append_list(["type_class_decl_super(", OrdinalStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_decl_supers, "type_class_decl_supers").
+opt_debug__dump_tc_rtti_name(type_class_id_method_ids,
+		"type_class_id_method_ids").
+opt_debug__dump_tc_rtti_name(type_class_id_var_names,
+		"type_class_id_var_names").
+opt_debug__dump_tc_rtti_name(type_class_instance(TCTypes), Str) :-
+	opt_debug__dump_rtti_type_class_instance_types(TCTypes, InstanceStr),
+	string__append_list(["type_class_instance(", InstanceStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_instance_tc_type_vector(TCTypes),
 		Str) :-
-	opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes,
-		InstanceStr),
-	DataNameStr = "instance_methods",
-	string__append_list(["tc_rtti_addr(", InstanceStr, ", ",
-		DataNameStr, ")"], Str).
+	opt_debug__dump_rtti_type_class_instance_types(TCTypes, InstanceStr),
+	string__append_list(["type_class_instance_tc_types_vector(",
+		InstanceStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_instance_constraints(TCTypes), Str) :-
+	opt_debug__dump_rtti_type_class_instance_types(TCTypes, InstanceStr),
+	string__append_list(["type_class_instance_constraints(",
+		InstanceStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_instance_constraint(TCTypes,
+		Ordinal, _), Str) :-
+	opt_debug__dump_rtti_type_class_instance_types(TCTypes, InstanceStr),
+	string__int_to_string(Ordinal, OrdinalStr),
+	string__append_list(["type_class_instance_constraint(",
+		InstanceStr, ", ", OrdinalStr, ")"], Str).
+opt_debug__dump_tc_rtti_name(type_class_instance_methods(TCTypes), Str) :-
+	opt_debug__dump_rtti_type_class_instance_types(TCTypes, InstanceStr),
+	string__append_list(["type_class_instance_methods(",
+		InstanceStr, ")"], Str).
 
 opt_debug__dump_rtti_type_class_name(tc_name(ModuleName, ClassName, Arity),
 		Str) :-
@@ -531,11 +497,10 @@
 	string__append_list(["tc_name(", ModuleNameStr, ", ",
 		ClassNameStr, ArityStr, ")"], Str).
 
-opt_debug__dump_rtti_type_class_instance_name(TCName, TCTypes, Str) :-
-	opt_debug__dump_rtti_type_class_name(TCName, TCNameSTr),
+opt_debug__dump_rtti_type_class_instance_types(TCTypes, Str) :-
 	EncodedTCTypes = list__map(rtti__encode_tc_instance_type, TCTypes),
 	string__append_list(EncodedTCTypes, TypesStr),
-	string__append_list(["tc_instance(", TCNameSTr, ", ", TypesStr, ")"],
+	string__append_list(["tc_instance(", TypesStr, ")"],
 		Str).
 
 opt_debug__dump_layout_name(label_layout(Label, LabelVars), Str) :-
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.45
diff -u -b -r1.45 rtti.m
--- compiler/rtti.m	24 Mar 2004 00:39:29 -0000	1.45
+++ compiler/rtti.m	24 Mar 2004 00:46:42 -0000
@@ -567,8 +567,8 @@
 			rtti_pseudo_type_info
 		)
 	;	base_typeclass_info(
+			tc_name,	% identifies the type class
 			module_name,	% module containing instance decl.
-			class_id,	% specifies class name & class arity
 			string,		% encodes the names and arities of the
 					% types in the instance declaration
 
@@ -591,7 +591,7 @@
 
 :- type rtti_id
 	--->	ctor_rtti_id(rtti_type_ctor, ctor_rtti_name)
-	;	tc_rtti_id(tc_rtti_name).
+	;	tc_rtti_id(tc_name, tc_rtti_name).
 
 :- type ctor_rtti_name
 	--->	exist_locns(int)		% functor ordinal
@@ -628,24 +628,23 @@
 :- type tc_rtti_name
 	--->	base_typeclass_info(
 			module_name,	% module containing instance decl.
-			class_id,	% specifies class name & class arity
 			string		% encodes the names and arities of the
 					% types in the instance declaration
 		)
-	;	type_class_id(tc_name)
-	;	type_class_id_var_names(tc_name)
-	;	type_class_id_method_ids(tc_name)
-	;	type_class_decl(tc_name)
-	;	type_class_decl_super(tc_name, int, int)
+	;	type_class_id
+	;	type_class_id_var_names
+	;	type_class_id_method_ids
+	;	type_class_decl
+	;	type_class_decl_super(int, int)
 			% superclass ordinal, constraint arity
-	;	type_class_decl_supers(tc_name)
-	;	type_class_instance(tc_name, list(tc_type))
-	;	type_class_instance_tc_type_vector(tc_name, list(tc_type))
-	;	type_class_instance_constraint(tc_name, list(tc_type),
+	;	type_class_decl_supers
+	;	type_class_instance(list(tc_type))
+	;	type_class_instance_tc_type_vector(list(tc_type))
+	;	type_class_instance_constraint(list(tc_type),
 			int, int)
 			% constraint ordinal, constraint arity
-	;	type_class_instance_constraints(tc_name, list(tc_type))
-	;	type_class_instance_methods(tc_name, list(tc_type)).
+	;	type_class_instance_constraints(list(tc_type))
+	;	type_class_instance_methods(list(tc_type)).
 
 %-----------------------------------------------------------------------------%
 %
@@ -835,13 +834,13 @@
 rtti_data_to_id(pseudo_type_info(PseudoTypeInfo),
 		ctor_rtti_id(RttiTypeCtor, pseudo_type_info(PseudoTypeInfo))) :-
 	RttiTypeCtor = pti_get_rtti_type_ctor(PseudoTypeInfo).
-rtti_data_to_id(base_typeclass_info(Module, ClassId, Instance, _),
-		tc_rtti_id(base_typeclass_info(Module, ClassId, Instance))).
+rtti_data_to_id(base_typeclass_info(TCName, Module, Instance, _),
+		tc_rtti_id(TCName, base_typeclass_info(Module, Instance))).
 rtti_data_to_id(type_class_decl(tc_decl(TCId, _, _)),
-		tc_rtti_id(type_class_decl(TCName))) :-
+		tc_rtti_id(TCName, type_class_decl)) :-
 	TCId = tc_id(TCName, _, _).
 rtti_data_to_id(type_class_instance(tc_instance(TCName, TCTypes, _, _, _)),
-		tc_rtti_id(type_class_instance(TCName, TCTypes))).
+		tc_rtti_id(TCName, type_class_instance(TCTypes))).
 
 tcd_get_rtti_type_ctor(TypeCtorData) = RttiTypeCtor :-
 	ModuleName = TypeCtorData ^ tcr_module_name,
@@ -896,7 +895,7 @@
 
 rtti_id_has_array_type(ctor_rtti_id(_, RttiName)) =
 	ctor_rtti_name_has_array_type(RttiName).
-rtti_id_has_array_type(tc_rtti_id(TCRttiName)) =
+rtti_id_has_array_type(tc_rtti_id(_, TCRttiName)) =
 	tc_rtti_name_has_array_type(TCRttiName).
 
 ctor_rtti_name_has_array_type(RttiName) = IsArray :-
@@ -907,7 +906,7 @@
 
 rtti_id_is_exported(ctor_rtti_id(_, RttiName)) =
 	ctor_rtti_name_is_exported(RttiName).
-rtti_id_is_exported(tc_rtti_id(TCRttiName)) =
+rtti_id_is_exported(tc_rtti_id(_, TCRttiName)) =
 	tc_rtti_name_is_exported(TCRttiName).
 
 ctor_rtti_name_is_exported(exist_locns(_))		= no.
@@ -941,18 +940,18 @@
 	pseudo_type_info_is_exported(PseudoTypeInfo).
 ctor_rtti_name_is_exported(type_hashcons_pointer)       = no.
 
-tc_rtti_name_is_exported(base_typeclass_info(_, _, _)) = yes.
-tc_rtti_name_is_exported(type_class_id(_)) = no.
-tc_rtti_name_is_exported(type_class_id_var_names(_)) = no.
-tc_rtti_name_is_exported(type_class_id_method_ids(_)) = no.
-tc_rtti_name_is_exported(type_class_decl(_)) = yes.
-tc_rtti_name_is_exported(type_class_decl_super(_, _, _)) = no.
-tc_rtti_name_is_exported(type_class_decl_supers(_)) = no.
-tc_rtti_name_is_exported(type_class_instance(_, _)) = yes.
-tc_rtti_name_is_exported(type_class_instance_tc_type_vector(_, _)) = no.
-tc_rtti_name_is_exported(type_class_instance_constraint(_, _, _, _)) = no.
-tc_rtti_name_is_exported(type_class_instance_constraints(_, _)) = no.
-tc_rtti_name_is_exported(type_class_instance_methods(_, _)) = no.
+tc_rtti_name_is_exported(base_typeclass_info(_, _)) = yes.
+tc_rtti_name_is_exported(type_class_id) = no.
+tc_rtti_name_is_exported(type_class_id_var_names) = no.
+tc_rtti_name_is_exported(type_class_id_method_ids) = no.
+tc_rtti_name_is_exported(type_class_decl) = yes.
+tc_rtti_name_is_exported(type_class_decl_super(_, _)) = no.
+tc_rtti_name_is_exported(type_class_decl_supers) = no.
+tc_rtti_name_is_exported(type_class_instance(_)) = yes.
+tc_rtti_name_is_exported(type_class_instance_tc_type_vector(_)) = no.
+tc_rtti_name_is_exported(type_class_instance_constraint(_, _, _)) = no.
+tc_rtti_name_is_exported(type_class_instance_constraints(_)) = no.
+tc_rtti_name_is_exported(type_class_instance_methods(_)) = no.
 
 :- func type_info_is_exported(rtti_type_info) = bool.
 
@@ -1000,8 +999,8 @@
 
 rtti__id_to_c_identifier(ctor_rtti_id(RttiTypeCtor, RttiName), Str) :-
 	rtti__name_to_string(RttiTypeCtor, RttiName, Str).
-rtti__id_to_c_identifier(tc_rtti_id(TCRttiName), Str) :-
-	rtti__tc_name_to_string(TCRttiName, Str).
+rtti__id_to_c_identifier(tc_rtti_id(TCName, TCRttiName), Str) :-
+	rtti__tc_name_to_string(TCName, TCRttiName, Str).
 
 :- pred rtti__name_to_string(rtti_type_ctor::in, ctor_rtti_name::in,
 	string::out) is det.
@@ -1135,58 +1134,59 @@
 			TypeName, "_", A_str], Str)
 	).
 
-:- pred rtti__tc_name_to_string(tc_rtti_name::in, string::out) is det.
+:- pred rtti__tc_name_to_string(tc_name::in, tc_rtti_name::in, string::out)
+	is det.
 
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = base_typeclass_info(_ModuleName, ClassId, InstanceStr),
-	Str = make_base_typeclass_info_name(ClassId, InstanceStr).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_id(TCName),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = base_typeclass_info(_ModuleName, InstanceStr),
+	Str = make_base_typeclass_info_name(TCName, InstanceStr).
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_id,
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__append_list([ModuleName, "__type_class_id_",
 		ClassName, "_", ArityStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_id_method_ids(TCName),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_id_method_ids,
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__append_list([ModuleName, "__type_class_id_method_ids_",
 		ClassName, "_", ArityStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_id_var_names(TCName),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_id_var_names,
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__append_list([ModuleName, "__type_class_id_var_names_",
 		ClassName, "_", ArityStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_decl(TCName),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_decl,
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__append_list([ModuleName, "__type_class_decl_",
 		ClassName, "_", ArityStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_decl_supers(TCName),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_decl_supers,
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__append_list([ModuleName, "__type_class_decl_supers_",
 		ClassName, "_", ArityStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_decl_super(TCName, Ordinal, _),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_decl_super(Ordinal, _),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	string__int_to_string(Ordinal, OrdinalStr),
 	string__append_list([ModuleName, "__type_class_decl_super_",
 		ClassName, "_", ArityStr, "_", OrdinalStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_instance(TCName, TCTypes),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_instance(TCTypes),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	TypeStrs = list__map(rtti__encode_tc_instance_type, TCTypes),
 	TypeVectorStr = string__append_list(TypeStrs),
 	string__append_list([ModuleName, "__type_class_instance_",
 		ClassName, "_", ArityStr, "_", TypeVectorStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_instance_tc_type_vector(TCName, TCTypes),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_instance_tc_type_vector(TCTypes),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	TypeStrs = list__map(rtti__encode_tc_instance_type, TCTypes),
@@ -1194,9 +1194,8 @@
 	string__append_list([ModuleName,
 		"__type_class_instance_tc_type_vector_",
 		ClassName, "_", ArityStr, "_", TypeVectorStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName =
-		type_class_instance_constraint(TCName, TCTypes, Ordinal, _),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_instance_constraint(TCTypes, Ordinal, _),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	TypeStrs = list__map(rtti__encode_tc_instance_type, TCTypes),
@@ -1205,16 +1204,16 @@
 	string__append_list([ModuleName, "__type_class_instance_constraint_",
 		ClassName, "_", ArityStr, "_", OrdinalStr, "_", TypeVectorStr],
 		Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_instance_constraints(TCName, TCTypes),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_instance_constraints(TCTypes),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	TypeStrs = list__map(rtti__encode_tc_instance_type, TCTypes),
 	TypeVectorStr = string__append_list(TypeStrs),
 	string__append_list([ModuleName, "__type_class_instance_constraints_",
 		ClassName, "_", ArityStr, "_", TypeVectorStr], Str).
-rtti__tc_name_to_string(TCRttiName, Str) :-
-	TCRttiName = type_class_instance_methods(TCName, TCTypes),
+rtti__tc_name_to_string(TCName, TCRttiName, Str) :-
+	TCRttiName = type_class_instance_methods(TCTypes),
 	rtti__mangle_rtti_type_class_name(TCName, ModuleName, ClassName,
 		ArityStr),
 	TypeStrs = list__map(rtti__encode_tc_instance_type, TCTypes),
@@ -1589,7 +1588,7 @@
 
 rtti_id_would_include_code_addr(ctor_rtti_id(_, RttiName)) =
 	ctor_rtti_name_would_include_code_addr(RttiName).
-rtti_id_would_include_code_addr(tc_rtti_id(TCRttiName)) =
+rtti_id_would_include_code_addr(tc_rtti_id(_, TCRttiName)) =
 	tc_rtti_name_would_include_code_addr(TCRttiName).
 
 ctor_rtti_name_would_include_code_addr(exist_locns(_)) =		no.
@@ -1623,22 +1622,20 @@
 ctor_rtti_name_would_include_code_addr(pseudo_type_info(PseudoTypeInfo)) =
 	pseudo_type_info_would_incl_code_addr(PseudoTypeInfo).
 
-tc_rtti_name_would_include_code_addr(base_typeclass_info(_, _, _)) = yes.
-tc_rtti_name_would_include_code_addr(type_class_id(_)) = no.
-tc_rtti_name_would_include_code_addr(type_class_id_var_names(_)) = no.
-tc_rtti_name_would_include_code_addr(type_class_id_method_ids(_)) = no.
-tc_rtti_name_would_include_code_addr(type_class_decl(_)) = no.
-tc_rtti_name_would_include_code_addr(type_class_decl_super(_, _, _)) = no.
-tc_rtti_name_would_include_code_addr(type_class_decl_supers(_)) = no.
-tc_rtti_name_would_include_code_addr(type_class_instance(_, _)) = no.
-tc_rtti_name_would_include_code_addr(type_class_instance_tc_type_vector(_, _))
-	= no.
-tc_rtti_name_would_include_code_addr(type_class_instance_constraint(_, _, _, _))
-	= no.
-tc_rtti_name_would_include_code_addr(type_class_instance_constraints(_, _))
+tc_rtti_name_would_include_code_addr(base_typeclass_info(_, _)) = yes.
+tc_rtti_name_would_include_code_addr(type_class_id) = no.
+tc_rtti_name_would_include_code_addr(type_class_id_var_names) = no.
+tc_rtti_name_would_include_code_addr(type_class_id_method_ids) = no.
+tc_rtti_name_would_include_code_addr(type_class_decl) = no.
+tc_rtti_name_would_include_code_addr(type_class_decl_super(_, _)) = no.
+tc_rtti_name_would_include_code_addr(type_class_decl_supers) = no.
+tc_rtti_name_would_include_code_addr(type_class_instance(_)) = no.
+tc_rtti_name_would_include_code_addr(type_class_instance_tc_type_vector(_))
 	= no.
-tc_rtti_name_would_include_code_addr(type_class_instance_methods(_, _))
+tc_rtti_name_would_include_code_addr(type_class_instance_constraint(_, _, _))
 	= no.
+tc_rtti_name_would_include_code_addr(type_class_instance_constraints(_)) = no.
+tc_rtti_name_would_include_code_addr(type_class_instance_methods(_)) = no.
 
 type_info_would_incl_code_addr(plain_arity_zero_type_info(_)) = yes.
 type_info_would_incl_code_addr(plain_type_info(_, _)) =	no.
@@ -1664,7 +1661,7 @@
 
 rtti_id_c_type(ctor_rtti_id(_, RttiName), CTypeName, IsArray) :-
 	ctor_rtti_name_c_type(RttiName, CTypeName, IsArray).
-rtti_id_c_type(tc_rtti_id(TCRttiName), CTypeName, IsArray) :-
+rtti_id_c_type(tc_rtti_id(_, TCRttiName), CTypeName, IsArray) :-
 	tc_rtti_name_c_type(TCRttiName, CTypeName, IsArray).
 
 ctor_rtti_name_c_type(RttiName, CTypeName, IsArray) :-
@@ -1689,7 +1686,7 @@
 
 rtti_id_java_type(ctor_rtti_id(_, RttiName), JavaTypeName, IsArray) :-
 	ctor_rtti_name_java_type(RttiName, JavaTypeName, IsArray).
-rtti_id_java_type(tc_rtti_id(TCRttiName), JavaTypeName, IsArray) :-
+rtti_id_java_type(tc_rtti_id(_, TCRttiName), JavaTypeName, IsArray) :-
 	tc_rtti_name_java_type(TCRttiName, JavaTypeName, IsArray).
 
 ctor_rtti_name_java_type(RttiName, JavaTypeName, IsArray) :-
@@ -1803,22 +1800,22 @@
 	% tc_rtti_name_type(RttiName, Type, IsArray):
 :- pred tc_rtti_name_type(tc_rtti_name::in, string::out, bool::out) is det.
 
-tc_rtti_name_type(base_typeclass_info(_, _, _), "BaseTypeclassInfo", yes).
-tc_rtti_name_type(type_class_id(_),		"TypeClassId", no).
-tc_rtti_name_type(type_class_id_var_names(_),	"ConstString", yes).
-tc_rtti_name_type(type_class_id_method_ids(_),	"TypeClassMethod", yes).
-tc_rtti_name_type(type_class_decl(_),		"TypeClassDeclStruct", no).
-tc_rtti_name_type(type_class_decl_super(_, _, N), TypeName, no) :-
+tc_rtti_name_type(base_typeclass_info(_, _),    "BaseTypeclassInfo", yes).
+tc_rtti_name_type(type_class_id,		"TypeClassId", no).
+tc_rtti_name_type(type_class_id_var_names,	"ConstString", yes).
+tc_rtti_name_type(type_class_id_method_ids,	"TypeClassMethod", yes).
+tc_rtti_name_type(type_class_decl,		"TypeClassDeclStruct", no).
+tc_rtti_name_type(type_class_decl_super(_, N), TypeName, no) :-
 	TypeName = tc_constraint_type_name(N).
-tc_rtti_name_type(type_class_decl_supers(_),	"TypeClassConstraint", yes).
-tc_rtti_name_type(type_class_instance(_, _),	"InstanceStruct", no).
-tc_rtti_name_type(type_class_instance_tc_type_vector(_, _),
+tc_rtti_name_type(type_class_decl_supers,	"TypeClassConstraint", yes).
+tc_rtti_name_type(type_class_instance(_),	"InstanceStruct", no).
+tc_rtti_name_type(type_class_instance_tc_type_vector(_),
 						"PseudoTypeInfo", yes).
-tc_rtti_name_type(type_class_instance_constraint(_, _, _, N), TypeName, no) :-
+tc_rtti_name_type(type_class_instance_constraint(_, _, N), TypeName, no) :-
 	TypeName = tc_constraint_type_name(N).
-tc_rtti_name_type(type_class_instance_constraints(_, _),
+tc_rtti_name_type(type_class_instance_constraints(_),
 						"TypeClassConstraint", yes).
-tc_rtti_name_type(type_class_instance_methods(_, _),
+tc_rtti_name_type(type_class_instance_methods(_),
 						"CodePtr", yes).
 
 :- func tc_constraint_type_name(int) = string.
@@ -1858,7 +1855,7 @@
 		ShouldModuleQualify =
 			module_qualify_name_of_ctor_rtti_name(CtorRttiName)
 	;
-		RttiId = tc_rtti_id(TCRttiName),
+		RttiId = tc_rtti_id(_, TCRttiName),
 		ShouldModuleQualify =
 			module_qualify_name_of_tc_rtti_name(TCRttiName)
 	).
@@ -1875,7 +1872,7 @@
 % This decision is implemented separately in rtti__tc_name_to_string.
 
 module_qualify_name_of_tc_rtti_name(TCRttiName) =
-	( TCRttiName = base_typeclass_info(_, _, _) ->
+	( TCRttiName = base_typeclass_info(_, _) ->
 		no
 	;
 		yes
Index: compiler/rtti_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti_out.m,v
retrieving revision 1.42
diff -u -b -r1.42 rtti_out.m
--- compiler/rtti_out.m	19 Mar 2004 10:19:25 -0000	1.42
+++ compiler/rtti_out.m	19 Mar 2004 11:28:38 -0000
@@ -96,9 +96,9 @@
 	output_pseudo_type_info_defn(PseudoTypeInfo, !DeclSet, !IO).
 output_rtti_data_defn(type_ctor_info(TypeCtorData), !DeclSet, !IO) :-
 	output_type_ctor_data_defn(TypeCtorData, !DeclSet, !IO).
-output_rtti_data_defn(base_typeclass_info(InstanceModuleName, ClassId,
+output_rtti_data_defn(base_typeclass_info(TCName, InstanceModuleName,
 		InstanceString, BaseTypeClassInfo), !DeclSet, !IO) :-
-	output_base_typeclass_info_defn(InstanceModuleName, ClassId,
+	output_base_typeclass_info_defn(TCName, InstanceModuleName,
 		InstanceString, BaseTypeClassInfo, !DeclSet, !IO).
 output_rtti_data_defn(type_class_decl(TCDecl), !DeclSet, !IO) :-
 	output_type_class_decl_defn(TCDecl, !DeclSet, !IO).
@@ -107,18 +107,18 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred output_base_typeclass_info_defn(module_name::in, class_id::in,
+:- pred output_base_typeclass_info_defn(tc_name::in, module_name::in,
 	string::in, base_typeclass_info::in, decl_set::in, decl_set::out,
 	io__state::di, io__state::uo) is det.
 
-output_base_typeclass_info_defn(InstanceModuleName, ClassId, InstanceString,
+output_base_typeclass_info_defn(TCName, InstanceModuleName, InstanceString,
 		base_typeclass_info(N1, N2, N3, N4, N5, Methods),
 		!DeclSet, !IO) :-
 	CodeAddrs = list__map(make_code_addr, Methods),
 	list__foldl2(output_code_addr_decls, CodeAddrs, !DeclSet, !IO),
 	io__write_string("\n", !IO),
-	RttiId = tc_rtti_id(base_typeclass_info(InstanceModuleName,
-		ClassId, InstanceString)),
+	RttiId = tc_rtti_id(TCName,
+		base_typeclass_info(InstanceModuleName, InstanceString)),
 	output_rtti_id_storage_type_name(RttiId, yes, !IO),
 	% XXX It would be nice to avoid generating redundant declarations
 	% of base_typeclass_infos, but currently we don't.
@@ -139,16 +139,16 @@
 	TCId = tc_id(TCName, TVarNames, MethodIds),
 	TCName = tc_name(ModuleSymName, ClassName, Arity),
 
-	TCIdVarNamesRttiName = type_class_id_var_names(TCName),
-	TCIdVarNamesRttiId = tc_rtti_id(TCIdVarNamesRttiName),
-	TCIdMethodIdsRttiName = type_class_id_method_ids(TCName),
-	TCIdMethodIdsRttiId = tc_rtti_id(TCIdMethodIdsRttiName),
-	TCIdRttiName = type_class_id(TCName),
-	TCIdRttiId = tc_rtti_id(TCIdRttiName),
-	TCDeclSupersRttiName = type_class_decl_supers(TCName),
-	TCDeclSupersRttiId = tc_rtti_id(TCDeclSupersRttiName),
-	TCDeclRttiName = type_class_decl(TCName),
-	TCDeclRttiId = tc_rtti_id(TCDeclRttiName),
+	TCIdVarNamesRttiName = type_class_id_var_names,
+	TCIdVarNamesRttiId = tc_rtti_id(TCName, TCIdVarNamesRttiName),
+	TCIdMethodIdsRttiName = type_class_id_method_ids,
+	TCIdMethodIdsRttiId = tc_rtti_id(TCName, TCIdMethodIdsRttiName),
+	TCIdRttiName = type_class_id,
+	TCIdRttiId = tc_rtti_id(TCName, TCIdRttiName),
+	TCDeclSupersRttiName = type_class_decl_supers,
+	TCDeclSupersRttiId = tc_rtti_id(TCName, TCDeclSupersRttiName),
+	TCDeclRttiName = type_class_decl,
+	TCDeclRttiId = tc_rtti_id(TCName, TCDeclRttiName),
 
 	(
 		TVarNames = []
@@ -262,7 +262,7 @@
 	is det.
 
 make_tc_decl_super_id(TCName, Ordinal, NumTypes, RttiId) :-
-	RttiId = tc_rtti_id(type_class_decl_super(TCName, Ordinal, NumTypes)).
+	RttiId = tc_rtti_id(TCName, type_class_decl_super(Ordinal, NumTypes)).
 
 %-----------------------------------------------------------------------------%
 
@@ -276,16 +276,16 @@
 		!DeclSet, !IO),
 	TCTypeRttiDatas = list__map(maybe_pseudo_type_info_to_rtti_data,
 		TCTypes),
-	TCInstanceTypesRttiId = tc_rtti_id(
-		type_class_instance_tc_type_vector(TCName, TCTypes)),
+	TCInstanceTypesRttiId = tc_rtti_id(TCName, 
+		type_class_instance_tc_type_vector(TCTypes)),
 	output_generic_rtti_data_defn_start(TCInstanceTypesRttiId,
 		!DeclSet, !IO),
 	io__write_string(" = {\n", !IO),
 	output_cast_addr_of_rtti_datas("(MR_PseudoTypeInfo) ", TCTypeRttiDatas,
 		!IO),
 	io__write_string("};\n", !IO),
-	TCInstanceConstraintsRttiId = tc_rtti_id(
-		type_class_instance_constraints(TCName, TCTypes)),
+	TCInstanceConstraintsRttiId = tc_rtti_id(TCName,
+		type_class_instance_constraints(TCTypes)),
 	(
 		Constraints = []
 	;
@@ -316,9 +316,9 @@
 %		list__foldl(output_code_addr_in_list, MethodCodeAddrs, !IO),
 %		io__write_string("};\n", !IO)
 %	),
-	TCDeclRttiId = tc_rtti_id(type_class_decl(TCName)),
+	TCDeclRttiId = tc_rtti_id(TCName, type_class_decl),
 	output_rtti_id_decls(TCDeclRttiId, "", "", 0, _, !DeclSet, !IO),
-	TCInstanceRttiId = tc_rtti_id(type_class_instance(TCName, TCTypes)),
+	TCInstanceRttiId = tc_rtti_id(TCName, type_class_instance(TCTypes)),
 	output_generic_rtti_data_defn_start(TCInstanceRttiId, !DeclSet, !IO),
 	io__write_string(" = {\n\t&", !IO),
 	output_rtti_id(TCDeclRttiId, !IO),
@@ -351,8 +351,8 @@
 	int::in, int::in, rtti_id::out) is det.
 
 make_tc_instance_constraint_id(TCName, TCTypes, Ordinal, NumTypes, RttiId) :-
-	RttiId = tc_rtti_id(type_class_instance_constraint(TCName, TCTypes,
-		Ordinal, NumTypes)).
+	RttiId = tc_rtti_id(TCName,
+		type_class_instance_constraint(TCTypes, Ordinal, NumTypes)).
 
 :- pred output_code_addr_in_list(code_addr::in,
 	io__state::di, io__state::uo) is det.
@@ -375,7 +375,7 @@
 	list__length(Types, NumTypes),
 	counter__allocate(TCNum, !Counter),
 	MakeRttiId(TCNum, NumTypes, TCDeclSuperRttiId),
-	TCDeclRttiId = tc_rtti_id(type_class_decl(TCName)),
+	TCDeclRttiId = tc_rtti_id(TCName, type_class_decl),
 	output_generic_rtti_data_decl(TCDeclRttiId, !DeclSet, !IO),
 	list__foldl2(output_maybe_pseudo_type_info_defn, Types, !DeclSet, !IO),
 	TypeRttiDatas = list__map(maybe_pseudo_type_info_to_rtti_data, Types),
@@ -1306,7 +1306,7 @@
 ",
 		io__format(Template, [i(Arity), i(Arity), i(Arity)], !IO)
 	;
-		RttiId = tc_rtti_id(TCRttiName),
+		RttiId = tc_rtti_id(_, TCRttiName),
 		rtti_type_class_constraint_template_arity(TCRttiName, Arity),
 		Arity > max_always_declared_arity_type_class_constraint
 	->
@@ -1349,9 +1349,9 @@
 	is semidet.
 
 rtti_type_class_constraint_template_arity(TCRttiName, Arity) :-
-	TCRttiName = type_class_decl_super(_, _, Arity).
+	TCRttiName = type_class_decl_super(_, Arity).
 rtti_type_class_constraint_template_arity(TCRttiName, Arity) :-
-	TCRttiName = type_class_instance_constraint(_, _, _, Arity).
+	TCRttiName = type_class_instance_constraint(_, _, Arity).
 
 :- func max_always_declared_arity_type_class_constraint = int.
 
@@ -1383,7 +1383,7 @@
 		io__write_int(Arity, !IO),
 		io__write_string("_0);\n", !IO)
 	;
-		Data = base_typeclass_info(_ModName, ClassName, ClassArity,
+		Data = base_typeclass_info(TCName, _ModuleName, ClassArity,
 			base_typeclass_info(_N1, _N2, _N3, _N4, _N5,
 			Methods))
 	->
@@ -1394,7 +1394,7 @@
 		FirstFieldNum = 5,
 		CodeAddrs = list__map(make_code_addr, Methods),
 		output_init_method_pointers(FirstFieldNum, CodeAddrs,
-			ClassName, ClassArity, !IO),
+			TCName, ClassArity, !IO),
 		io__write_string("#endif /* MR_STATIC_CODE_ADDRESSES */\n",
 			!IO)
 	;
@@ -1432,7 +1432,7 @@
 	->
 		TCDecl = tc_decl(TCId, _, _),
 		TCId = tc_id(TCName, _, _),
-		RttiId = tc_rtti_id(type_class_decl(TCName)),
+		RttiId = tc_rtti_id(TCName, type_class_decl),
 		io__write_string("\t{\n\t", !IO),
 		(
 			SplitFiles = yes,
@@ -1448,7 +1448,7 @@
 		Data = type_class_instance(TCInstance)
 	->
 		TCInstance = tc_instance(TCName, TCTypes, _, _, _),
-		RttiId = tc_rtti_id(type_class_instance(TCName, TCTypes)),
+		RttiId = tc_rtti_id(TCName, type_class_instance(TCTypes)),
 		io__write_string("\t{\n\t", !IO),
 		(
 			SplitFiles = yes,
@@ -1466,19 +1466,18 @@
 	).
 
 
-:- pred output_init_method_pointers(int, list(code_addr), class_id, string,
-		io__state, io__state).
-:- mode output_init_method_pointers(in, in, in, in, di, uo) is det.
+:- pred output_init_method_pointers(int::in, list(code_addr)::in, tc_name::in,
+	string::in, io::di, io::uo) is det.
 
 output_init_method_pointers(_, [], _, _, !IO).
-output_init_method_pointers(FieldNum, [Arg|Args], ClassId, InstanceStr, !IO) :-
+output_init_method_pointers(FieldNum, [Arg|Args], TCName, InstanceStr, !IO) :-
 	io__write_string("\t\t", !IO),
 	io__write_string("MR_field(MR_mktag(0), ", !IO),
-	output_base_typeclass_info_name(ClassId, InstanceStr, !IO),
+	output_base_typeclass_info_name(TCName, InstanceStr, !IO),
 	io__format(", %d) =\n\t\t\t", [i(FieldNum)], !IO),
 	output_code_addr(Arg, !IO),
 	io__write_string(";\n", !IO),
-	output_init_method_pointers(FieldNum + 1, Args, ClassId, InstanceStr,
+	output_init_method_pointers(FieldNum + 1, Args, TCName, InstanceStr,
 		!IO).
 
 %-----------------------------------------------------------------------------%
Index: compiler/rtti_to_mlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti_to_mlds.m,v
retrieving revision 1.49
diff -u -b -r1.49 rtti_to_mlds.m
--- compiler/rtti_to_mlds.m	26 Feb 2004 06:36:20 -0000	1.49
+++ compiler/rtti_to_mlds.m	27 Feb 2004 01:23:52 -0000
@@ -276,7 +276,7 @@
 	TCId = tc_id(TCName, TVarNames, MethodIds),
 	TCName = tc_name(ModuleSymName, ClassName, Arity),
 	module_info_name(ModuleInfo, ModuleName),
-	TVarNamesRttiId = tc_rtti_id(type_class_id_var_names(TCName)),
+	TVarNamesRttiId = tc_rtti_id(TCName, type_class_id_var_names),
 	(
 		TVarNames = [],
 		TVarNameDefns = [],
@@ -288,7 +288,7 @@
 		TVarNameDefns = [TVarNameDefn],
 		TVarNamesInit = gen_init_rtti_id(ModuleName, TVarNamesRttiId)
 	),
-	MethodIdsRttiId = tc_rtti_id(type_class_id_method_ids(TCName)),
+	MethodIdsRttiId = tc_rtti_id(TCName, type_class_id_method_ids),
 	(
 		MethodIds = [],
 		MethodIdDefns = [],
@@ -301,7 +301,7 @@
 		MethodIdDefns = [MethodIdDefn],
 		MethodIdsInit = gen_init_rtti_id(ModuleName, MethodIdsRttiId)
 	),
-	TCIdRttiId = tc_rtti_id(type_class_id(TCName)),
+	TCIdRttiId = tc_rtti_id(TCName, type_class_id),
 	prog_out__sym_name_to_string(ModuleSymName, ModuleSymNameStr),
 	list__length(TVarNames, NumTVars),
 	list__length(MethodIds, NumMethods),
@@ -325,12 +325,12 @@
 		list__map_foldl2(gen_tc_constraint(ModuleInfo,
 			make_decl_super_id(TCName)), Supers, SuperRttiIds,
 			counter__init(1), _, [], SuperConstrDefns),
-		SuperArrayRttiId = tc_rtti_id(SuperArrayRttiName),
+		SuperArrayRttiName = type_class_decl_supers,
+		SuperArrayRttiId = tc_rtti_id(TCName, SuperArrayRttiName),
 		ElementType = mlds__rtti_type(element_type(SuperArrayRttiId)),
 		SuperArrayInit = gen_init_array(
 			gen_init_cast_rtti_id(ElementType, ModuleName),
 			SuperRttiIds),
-		SuperArrayRttiName = type_class_decl_supers(TCName),
 		rtti_id_and_init_to_defn(SuperArrayRttiId, SuperArrayInit,
 			SuperDefn),
 		list__append(SuperConstrDefns, [SuperDefn], SuperDefns),
@@ -351,8 +351,8 @@
 	is det.
 
 make_decl_super_id(TCName, TCNum, Arity, RttiId) :-
-	TCRttiName = type_class_decl_super(TCName, TCNum, Arity),
-	RttiId = tc_rtti_id(TCRttiName).
+	TCRttiName = type_class_decl_super(TCNum, Arity),
+	RttiId = tc_rtti_id(TCName, TCRttiName).
 
 :- pred gen_tc_id_var_names(rtti_id::in, list(string)::in, mlds__defn::out)
 	is det.
@@ -372,7 +372,7 @@
 
 gen_tc_id_method_id(TCName, MethodId) = Init :-
 	MethodId = tc_method_id(MethodName, MethodArity, PredOrFunc),
-	RttiId = tc_rtti_id(type_class_id_method_ids(TCName)),
+	RttiId = tc_rtti_id(TCName, type_class_id_method_ids),
 	Init = init_struct(mlds__rtti_type(element_type(RttiId)), [
 		gen_init_string(MethodName),
 		gen_init_int(MethodArity),
@@ -387,14 +387,14 @@
 gen_type_class_instance_defn(Instance, RttiId, ModuleInfo, Init, SubDefns) :-
 	Instance = tc_instance(TCName, Types, NumTypeVars,
 		InstanceConstraints, _Methods),
-	TCDeclRttiId = tc_rtti_id(type_class_decl(TCName)),
+	TCDeclRttiId = tc_rtti_id(TCName, type_class_decl),
 	list__length(InstanceConstraints, NumInstanceConstraints),
 	InstanceTypesTCRttiName =
-		type_class_instance_tc_type_vector(TCName, Types),
-	InstanceTypesRttiId = tc_rtti_id(InstanceTypesTCRttiName),
+		type_class_instance_tc_type_vector(Types),
+	InstanceTypesRttiId = tc_rtti_id(TCName, InstanceTypesTCRttiName),
 	InstanceConstrsTCRttiName =
-		type_class_instance_constraints(TCName, Types),
-	InstanceConstrsRttiId = tc_rtti_id(InstanceConstrsTCRttiName),
+		type_class_instance_constraints(Types),
+	InstanceConstrsRttiId = tc_rtti_id(TCName, InstanceConstrsTCRttiName),
 	module_info_name(ModuleInfo, ModuleName),
 
 	TypeRttiDatas = list__map(maybe_pseudo_type_info_to_rtti_data, Types),
@@ -427,8 +427,8 @@
 	int::in, int::in, rtti_id::out) is det.
 
 make_instance_constr_id(TCName, Types, TCNum, Arity, RttiId) :-
-	RttiName = type_class_instance_constraint(TCName, Types, TCNum, Arity),
-	RttiId = tc_rtti_id(RttiName).
+	RttiName = type_class_instance_constraint(Types, TCNum, Arity),
+	RttiId = tc_rtti_id(TCName, RttiName).
 
 %-----------------------------------------------------------------------------%
 
@@ -776,13 +776,13 @@
 	list__length(Types, Arity),
 	counter__allocate(TCNum, !Counter),
 	MakeRttiId(TCNum, Arity, RttiId),
-	TCDeclRttiName = type_class_decl(TCName),
+	TCDeclRttiName = type_class_decl,
 	module_info_name(ModuleInfo, ModuleName),
 	TypeRttiDatas = list__map(maybe_pseudo_type_info_to_rtti_data, Types),
 	gen_pseudo_type_info_array(ModuleInfo, TypeRttiDatas, PTIInits,
 		PTIDefns),
  	Init = init_struct(mlds__rtti_type(item_type(RttiId)), [
-		gen_init_tc_rtti_name(ModuleName, TCDeclRttiName),
+		gen_init_tc_rtti_name(ModuleName, TCName, TCDeclRttiName),
 		PTIInits
  	]),
 	rtti_id_and_init_to_defn(RttiId, Init, ConstrDefn),
@@ -1121,17 +1121,17 @@
 		Initializer = init_obj(unop(gen_cast(SrcType, DestType),
 			const(int_const(VarNum))))
 	;
-		RttiData = base_typeclass_info(InstanceModuleName, ClassId,
+		RttiData = base_typeclass_info(TCName, InstanceModuleName,
 			InstanceString, _)
 	->
-		SrcType = rtti_type(item_type(tc_rtti_id(
+		SrcType = rtti_type(item_type(tc_rtti_id(TCName,
 			base_typeclass_info(InstanceModuleName,
-			ClassId, InstanceString)))),
+			InstanceString)))),
 		MLDS_ModuleName = mercury_module_name_to_mlds(
 			InstanceModuleName),
-		MLDS_DataName = rtti(tc_rtti_id(
+		MLDS_DataName = rtti(tc_rtti_id(TCName,
 			base_typeclass_info(InstanceModuleName,
-				ClassId, InstanceString))),
+				InstanceString))),
 		DataAddr = data_addr(MLDS_ModuleName, MLDS_DataName),
 		Rval = const(data_addr_const(DataAddr)),
 		Initializer = init_obj(unop(gen_cast(SrcType, DestType),
@@ -1161,8 +1161,8 @@
 
 gen_init_rtti_id(ModuleName, ctor_rtti_id(RttiTypeCtor, RttiName)) =
 	gen_init_rtti_name(ModuleName, RttiTypeCtor, RttiName).
-gen_init_rtti_id(ModuleName, tc_rtti_id(TCRttiName)) =
-	gen_init_tc_rtti_name(ModuleName, TCRttiName).
+gen_init_rtti_id(ModuleName, tc_rtti_id(TCName, TCRttiName)) =
+	gen_init_tc_rtti_name(ModuleName, TCName, TCRttiName).
 
 	% Generate an MLDS initializer comprising just the
 	% the rval for a given rtti_name
@@ -1174,11 +1174,11 @@
 
 	% Generate an MLDS initializer comprising just the
 	% the rval for a given tc_rtti_name
-:- func gen_init_tc_rtti_name(module_name, tc_rtti_name) =
+:- func gen_init_tc_rtti_name(module_name, tc_name, tc_rtti_name) =
 	mlds__initializer.
 
-gen_init_tc_rtti_name(ModuleName, TCRttiName) =
-	init_obj(gen_tc_rtti_name(ModuleName, TCRttiName)).
+gen_init_tc_rtti_name(ModuleName, TCName, TCRttiName) =
+	init_obj(gen_tc_rtti_name(ModuleName, TCName, TCRttiName)).
 
 	% Generate the MLDS initializer comprising the rtti_name
 	% for a given rtti_name, converted to the given type.
@@ -1195,8 +1195,8 @@
 
 gen_rtti_id(ThisModuleName, ctor_rtti_id(RttiTypeCtor, RttiName)) =
 	gen_rtti_name(ThisModuleName, RttiTypeCtor, RttiName).
-gen_rtti_id(ThisModuleName, tc_rtti_id(TCRttiName)) =
-	gen_tc_rtti_name(ThisModuleName, TCRttiName).
+gen_rtti_id(ThisModuleName, tc_rtti_id(TCName, TCRttiName)) =
+	gen_tc_rtti_name(ThisModuleName, TCName, TCRttiName).
 
 :- func gen_rtti_name(module_name, rtti_type_ctor, ctor_rtti_name)
 	= mlds__rval.
@@ -1245,49 +1245,49 @@
 	DataAddr = data_addr(MLDS_ModuleName, MLDS_DataName),
 	Rval = const(data_addr_const(DataAddr)).
 
-:- func gen_tc_rtti_name(module_name, tc_rtti_name) = mlds__rval.
+:- func gen_tc_rtti_name(module_name, tc_name, tc_rtti_name) = mlds__rval.
 
-gen_tc_rtti_name(_ThisModuleName, TCRttiName) = Rval :-
+gen_tc_rtti_name(_ThisModuleName, TCName, TCRttiName) = Rval :-
 	(
-		TCRttiName = base_typeclass_info(InstanceModuleName, _, _),
+		TCRttiName = base_typeclass_info(InstanceModuleName, _),
 		MLDS_ModuleName =
 			mercury_module_name_to_mlds(InstanceModuleName)
 	;
-		TCRttiName = type_class_id(TCName),
+		TCRttiName = type_class_id,
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_decl(TCName),
+		TCRttiName = type_class_decl,
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_decl_super(TCName, _, _),
+		TCRttiName = type_class_decl_super(_, _),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_decl_supers(TCName),
+		TCRttiName = type_class_decl_supers,
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_id_var_names(TCName),
+		TCRttiName = type_class_id_var_names,
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_id_method_ids(TCName),
+		TCRttiName = type_class_id_method_ids,
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_instance(TCName, _Types),
+		TCRttiName = type_class_instance(_Types),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_instance_tc_type_vector(TCName, _Types),
+		TCRttiName = type_class_instance_tc_type_vector(_Types),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_instance_constraint(TCName, _Types,
+		TCRttiName = type_class_instance_constraint(_Types,
 			_, _),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_instance_constraints(TCName, _Types),
+		TCRttiName = type_class_instance_constraints(_Types),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	;
-		TCRttiName = type_class_instance_methods(TCName, _Types),
+		TCRttiName = type_class_instance_methods(_Types),
 		MLDS_ModuleName = mlds_module_name_from_tc_name(TCName)
 	),
-	MLDS_DataName = rtti(tc_rtti_id(TCRttiName)),
+	MLDS_DataName = rtti(tc_rtti_id(TCName, TCRttiName)),
 	DataAddr = data_addr(MLDS_ModuleName, MLDS_DataName),
 	Rval = const(data_addr_const(DataAddr)).
 
Index: compiler/type_class_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_class_info.m,v
retrieving revision 1.3
diff -u -b -r1.3 type_class_info.m
--- compiler/type_class_info.m	3 Feb 2004 05:40:01 -0000	1.3
+++ compiler/type_class_info.m	18 Feb 2004 03:48:35 -0000
@@ -21,6 +21,7 @@
 :- interface.
 
 :- import_module backend_libs__rtti.
+:- import_module hlds__hlds_data.
 :- import_module hlds__hlds_module.
 :- import_module parse_tree__prog_data.
 
@@ -31,10 +32,11 @@
 
 :- func generate_class_constraint(class_constraint) = tc_constraint.
 
+:- func generate_class_name(class_id) = tc_name.
+
 :- implementation.
 
 :- import_module check_hlds__type_util.
-:- import_module hlds__hlds_data.
 :- import_module hlds__hlds_out.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
@@ -181,8 +183,6 @@
 	make_rtti_proc_label(ModuleInfo, PredId, ProcId).
 
 %---------------------------------------------------------------------------%
-
-:- func generate_class_name(class_id) = tc_name.
 
 generate_class_name(class_id(SymName, Arity)) = TCName :-
 	(
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.138
diff -u -b -r1.138 unify_gen.m
--- compiler/unify_gen.m	23 Mar 2004 10:52:14 -0000	1.138
+++ compiler/unify_gen.m	23 Mar 2004 11:01:32 -0000
@@ -44,6 +44,7 @@
 :- import_module backend_libs__builtin_ops.
 :- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
+:- import_module backend_libs__type_class_info.
 :- import_module check_hlds__mode_util.
 :- import_module check_hlds__type_util.
 :- import_module hlds__arg_info.
@@ -407,9 +408,10 @@
 	;
 		error("unify_gen: typeclass-info constant has args")
 	),
+	TCName = generate_class_name(ClassId),
 	code_info__assign_const_to_var(Var,
-		const(data_addr_const(rtti_addr(tc_rtti_id(
-			base_typeclass_info(ModuleName, ClassId, Instance))),
+		const(data_addr_const(rtti_addr(tc_rtti_id(TCName,
+			base_typeclass_info(ModuleName, Instance))),
 			no)), !CI).
 unify_gen__generate_construction_2(tabling_pointer_constant(PredId, ProcId),
 		Var, Args, _Modes, _, _, empty, !CI) :-
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list