[m-rev.] for review: replace proc_id with proc_label in declarative debugger

Ian MacLarty maclarty at cs.mu.OZ.AU
Sat Jan 22 16:25:53 AEDT 2005


For review by anyone.

Estimated hours taken: 4
Branches: main

Use proc_label data structure defined in mdbcomp.prim_data instead of proc_id
defined in mdb.declarative_execution and delete proc_id, since these data
structures are almost identical.

browser/declarative_execution.m
	Remove proc_id and flat_module_name types.  Use 
	mdbcomp.primdata.proc_label and mdbcomp.primdata.module_name instead.

browser/declarative_debugger.m
browser/declarative_oracle.m
browser/declarative_tree.m
browser/declarative_user.m
	Use mdbcomp.primdata.proc_label and mdbcomp.primdata.module_name 
	instead of mdb.declarative_execution.proc_id and 
	mdb.declarative_execution.module_name.

browser/prim_data.m
compiler/prog_out.m
	Move sym_name_to_string from prog_out to prim_data.
	Fix comment for prog_out.sym_name_and_arity_to_string.

compiler/bytecode.m
compiler/check_typeclass.m
compiler/code_gen.m
compiler/deforest.m
compiler/higher_order.m
compiler/hlds_code_util.m
compiler/hlds_error_util.m
compiler/hlds_module.m
compiler/hlds_out.m
compiler/intermod.m
compiler/layout_out.m
compiler/make.module_target.m
compiler/make_hlds.m
compiler/mercury_compile.m
compiler/mercury_to_mercury.m
compiler/ml_elim_nested.m
compiler/mlds_to_c.m
compiler/mlds_to_gcc.m
compiler/mlds_to_il.m
compiler/mlds_to_java.m
compiler/mlds_to_managed.m
compiler/modes.m
compiler/modules.m
compiler/opt_debug.m
compiler/options_file.m
compiler/polymorphism.m
compiler/prog_io.m
compiler/prog_rep.m
compiler/rl.m
compiler/rl_exprn.m
compiler/rl_gen.m
compiler/rl_info.m
compiler/rl_out.pp
compiler/rtti.m
compiler/rtti_out.m
compiler/rtti_to_mlds.m
compiler/source_file_map.m
compiler/table_gen.m
compiler/trans_opt.m
compiler/unify_gen.m
compiler/unique_modes.m
compiler/unused_args.m
	Use mdbcomp.prim_data.sym_name_to_string instead of
	prog_out.sym_name_to_string.

Index: browser/declarative_debugger.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_debugger.m,v
retrieving revision 1.47
diff -u -r1.47 declarative_debugger.m
--- browser/declarative_debugger.m	19 Jan 2005 02:43:36 -0000	1.47
+++ browser/declarative_debugger.m	21 Jan 2005 11:14:23 -0000
@@ -303,6 +303,7 @@
 :- import_module mdb__declarative_oracle.
 :- import_module mdb__declarative_tree.
 :- import_module mdb__util.
+:- import_module mdbcomp__prim_data.
 
 :- import_module exception, int, map, bool.
 
@@ -634,7 +635,8 @@
 		"MR_DD_decl_add_trusted_module").
 		
 add_trusted_module(ModuleName, Diagnoser0, Diagnoser) :-
-	add_trusted_module(ModuleName, Diagnoser0 ^ oracle_state, Oracle),
+	string_to_sym_name(ModuleName, ".", SymModuleName),
+	add_trusted_module(SymModuleName, Diagnoser0 ^ oracle_state, Oracle),
 	Diagnoser = Diagnoser0 ^ oracle_state := Oracle.
 
 	% Adds a trusted predicate/function to the given diagnoser.
@@ -750,9 +752,9 @@
 write_origin(wrap(Store), Origin, !IO) :-
 	(Origin = output(dynamic(NodeId), ArgPos, TermPath) ->
 		exit_node_from_id(Store, NodeId, ExitNode),
-		ProcId = get_proc_id_from_layout(
+		ProcLabel = get_proc_label_from_layout(
 			ExitNode ^ exit_atom ^ proc_layout),
-		ProcName = get_proc_name(ProcId),
+		ProcName = get_proc_name(ProcLabel),
 		io__write_string("output(", !IO),
 		io__write_string(ProcName, !IO),
 		io__write_string(", ", !IO),
Index: browser/declarative_execution.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_execution.m,v
retrieving revision 1.32
diff -u -r1.32 declarative_execution.m
--- browser/declarative_execution.m	19 Jan 2005 03:10:17 -0000	1.32
+++ browser/declarative_execution.m	21 Jan 2005 11:14:23 -0000
@@ -193,45 +193,20 @@
 						% data structures.
 		).
  
-	% A module name should consist of a base name and a list of the names
-	% of the enclosing modules. For now, we have them all in one string.
-:- type flat_module_name == string.
-
-:- type proc_id
-	--->	proc(
-			flat_module_name,	% defining module
-			pred_or_func,
-			flat_module_name,	% declaring module
-			string,			% name
-			int,			% arity
-			int			% mode number
-		)
-	;	uci_proc(
-			flat_module_name,	% defining module
-			special_pred_id,	% indirectly defines pred name
-			flat_module_name,	% type module
-			string,			% type name
-			int,			% type arity
-			int			% mode number
-		).
-
-	% Should be a foreign type, MR_Proc_Layout *. This is a
-	% temporary workaround: we can't do compare_representation
-	% on foreign types yet.
 :- type proc_layout. 
 
-:- func get_proc_id_from_layout(proc_layout) = proc_id.
+:- func get_proc_label_from_layout(proc_layout) = proc_label.
 
-:- func get_proc_name(proc_id) = string.
+:- func get_proc_name(proc_label) = string.
 
 :- func get_all_modes_for_layout(proc_layout) = list(proc_layout).
 
-	% get_pred_attributes(ProcId, Module, Name, Arity, PredOrFunc).
+	% get_pred_attributes(ProcLabel, Module, Name, Arity, PredOrFunc).
 	% Return the predicate/function attributes common to both UCI and
 	% regular predicates/functions.  
 	%
-:- pred get_pred_attributes(proc_id::in, string::out, string::out, int::out, 
-	pred_or_func::out) is det.
+:- pred get_pred_attributes(proc_label::in, module_name::out, string::out, 
+	int::out, pred_or_func::out) is det.
 
 %-----------------------------------------------------------------------------%
 
@@ -409,7 +384,7 @@
 	[can_pass_as_mercury_type, stable]).
 :- pragma foreign_type("Java", proc_layout, "Object", []). % stub only
 
-get_proc_id_from_layout(Layout) = ProcId :-
+get_proc_label_from_layout(Layout) = ProcLabel :-
 	( proc_layout_is_uci(Layout) ->
 		proc_layout_get_uci_fields(Layout, TypeName, TypeModule,
 			DefModule, PredName, TypeArity, ModeNum),
@@ -420,19 +395,24 @@
 		; PredName = "__Compare__" ->
 			SpecialId = compare
 		;
-			error("get_proc_id_from_layout: bad special_pred_id")
+			error("get_proc_label_from_layout: " ++ 
+				"bad special_pred_id")
 		),
-		ProcId = uci_proc(DefModule, SpecialId, TypeModule, TypeName, 
-			TypeArity, ModeNum)
+		string_to_sym_name(DefModule, ".", SymDefModule),
+		string_to_sym_name(TypeModule, ".", SymTypeModule),
+		ProcLabel = special_proc(SymDefModule, SpecialId, 
+			SymTypeModule, TypeName, TypeArity, ModeNum)
 	;
 		proc_layout_get_non_uci_fields(Layout, PredOrFunc,
 			DeclModule, DefModule, PredName, Arity, ModeNum),
-		ProcId = proc(DefModule, PredOrFunc, DeclModule, PredName, 
-			Arity, ModeNum)
+		string_to_sym_name(DefModule, ".", SymDefModule),
+		string_to_sym_name(DeclModule, ".", SymDeclModule),
+		ProcLabel = proc(SymDefModule, PredOrFunc, SymDeclModule, 
+			PredName, Arity, ModeNum)
 	).
 
 get_proc_name(proc(_, _, _, ProcName, _, _)) = ProcName.
-get_proc_name(uci_proc(_, _, _, ProcName , _, _)) = ProcName. 
+get_proc_name(special_proc(_, _, _, ProcName , _, _)) = ProcName. 
 
 :- pred proc_layout_is_uci(proc_layout::in) is semidet.
 
@@ -591,7 +571,7 @@
 	(
 		ProcId = proc(Module, PredOrFunc, _, Name, Arity, _)
 	;
-		ProcId = uci_proc(Module, SpecialId, _, _, _, _), 
+		ProcId = special_proc(Module, SpecialId, _, _, _, _), 
 		PredOrFunc = predicate,
 		Arity = get_special_pred_id_arity(SpecialId),
 		Name = get_special_pred_id_name(SpecialId)
Index: browser/declarative_oracle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_oracle.m,v
retrieving revision 1.35
diff -u -r1.35 declarative_oracle.m
--- browser/declarative_oracle.m	20 Jan 2005 02:47:50 -0000	1.35
+++ browser/declarative_oracle.m	21 Jan 2005 14:06:29 -0000
@@ -29,6 +29,7 @@
 :- import_module mdb__declarative_debugger.
 :- import_module mdb__declarative_execution.
 :- import_module mdb.browser_info.
+:- import_module mdbcomp.prim_data.
 
 :- import_module io, bool, string.
 
@@ -52,8 +53,8 @@
 
 	% Add a module to the set of modules trusted by the oracle
 	%
-:- pred add_trusted_module(string::in, oracle_state::in, oracle_state::out) 
-	is det. 
+:- pred add_trusted_module(module_name::in, oracle_state::in, 
+	oracle_state::out) is det. 
 
 	% Add a predicate/function to the set of predicates/functions trusted 
 	% by the oracle.
@@ -177,8 +178,8 @@
 	;
 		UserResponse = trust_module(Question),
 		Atom = get_decl_question_atom(Question),
-		ProcId = get_proc_id_from_layout(Atom ^ proc_layout),
-		get_pred_attributes(ProcId, Module, _, _, _),
+		ProcLabel = get_proc_label_from_layout(Atom ^ proc_layout),
+		get_pred_attributes(ProcLabel, Module, _, _, _),
 		add_trusted_module(Module, !Oracle),
 		OracleResponse = oracle_answer(
 			ignore(get_decl_question_node(Question)))
@@ -257,14 +258,14 @@
 %-----------------------------------------------------------------------------%
 
 :- type trusted_object
-	--->	module(string) % all predicates/functions in a module
+	--->	module(module_name) % all predicates/functions in a module
 	;	predicate(
-			string,		% module name
+			module_name,
 			string,		% pred name
 			int		% arity
 		)
 	;	function(
-			string,		% module name
+			module_name,
 			string,		% function name
 			int		% arity including return value
 		)
@@ -284,11 +285,11 @@
 
 add_trusted_pred_or_func(ProcLayout, !Oracle) :-
 	counter.allocate(Id, !.Oracle ^ trusted_id_counter, Counter),
-	ProcId = get_proc_id_from_layout(ProcLayout),
+	ProcLabel = get_proc_label_from_layout(ProcLayout),
 	(
-		ProcId = proc(ModuleName, PredOrFunc, _, Name, Arity, _)
+		ProcLabel = proc(ModuleName, PredOrFunc, _, Name, Arity, _)
 	;
-		ProcId = uci_proc(ModuleName, _, _, Name, Arity, _),
+		ProcLabel = special_proc(ModuleName, _, _, Name, Arity, _),
 		PredOrFunc = predicate
 	),
 	(
@@ -343,30 +344,37 @@
 :- pred format_trust_command(trusted_object::in, string::in,
 	string::out) is det.
 
-format_trust_command(module(ModuleName), S, S ++ "trust " ++ ModuleName++"\n").
+format_trust_command(module(ModuleName), S, S ++ "trust " ++ ModuleNameStr ++
+		"\n") :-
+	sym_name_to_string(ModuleName, ".", ModuleNameStr).
 format_trust_command(predicate(ModuleName, Name, Arity), S, S ++ Command) :-
 	ArityStr = int_to_string(Arity),
-	Command = "trust pred*" ++ ModuleName ++ "."++Name ++ "/" ++ ArityStr 
-	++ "\n".
+	sym_name_to_string(ModuleName, ".", ModuleNameStr),
+	Command = "trust pred*" ++ ModuleNameStr ++ "."++Name ++ "/" ++ 
+		ArityStr ++ "\n".
 format_trust_command(function(ModuleName, Name, Arity), S, S ++ Command) :-
 	ArityStr = int_to_string(Arity - 1),
-	Command = "trust func*"++ModuleName ++ "." ++ Name++"/" ++ ArityStr ++
-	"\n".
+	sym_name_to_string(ModuleName, ".", ModuleNameStr),
+	Command = "trust func*" ++ ModuleNameStr ++ "." ++ Name++"/" ++ 
+		ArityStr ++ "\n".
 format_trust_command(standard_library, S, S ++ "trust std lib\n").
 
 :- pred format_trust_display(int::in, trusted_object::in, string::in, 
 	string::out) is det.
 
 format_trust_display(Id, module(ModuleName), S, S ++ Display) :-
-	Display = int_to_string(Id) ++ ": module " ++ ModuleName ++ "\n".
+	sym_name_to_string(ModuleName, ".", ModuleNameStr),
+	Display = int_to_string(Id) ++ ": module " ++ ModuleNameStr ++ "\n".
 format_trust_display(Id, predicate(ModuleName, Name, Arity), S, S ++ Display) 
 		:-
-	Display = int_to_string(Id) ++ ": predicate " ++ ModuleName ++ "." ++
-		Name ++ "/" ++ int_to_string(Arity) ++ "\n".
+	sym_name_to_string(ModuleName, ".", ModuleNameStr),
+	Display = int_to_string(Id) ++ ": predicate " ++ ModuleNameStr ++ "." 
+		++ Name ++ "/" ++ int_to_string(Arity) ++ "\n".
 format_trust_display(Id, function(ModuleName, Name, Arity), S, S ++ Display)
 		:-
-	Display = int_to_string(Id) ++ ": function " ++ ModuleName ++ "." ++
-		Name++"/" ++ int_to_string(Arity - 1) ++ "\n".
+	sym_name_to_string(ModuleName, ".", ModuleNameStr),
+	Display = int_to_string(Id) ++ ": function " ++ ModuleNameStr ++ "." ++
+		Name ++ "/" ++ int_to_string(Arity - 1) ++ "\n".
 format_trust_display(Id, standard_library, S, S ++ Display) :-
 	Display = int_to_string(Id) ++ ": the Mercury standard library\n".
 		
@@ -483,12 +491,17 @@
 
 trusted(ProcLayout, Oracle) :-
 	Trusted = Oracle ^ trusted,
-	ProcId = get_proc_id_from_layout(ProcLayout),
+	ProcLabel = get_proc_label_from_layout(ProcLayout),
 	(
-		ProcId = proc(Module, PredOrFunc, _, Name, Arity, _),
+		ProcLabel = proc(Module, PredOrFunc, _, Name, Arity, _),
 		(
 			bimap.search(Trusted, standard_library, _),
-			mercury_std_library_module(Module)
+			(
+				Module = qualified(_, ModuleNameStr)
+			;
+				Module = unqualified(ModuleNameStr)
+			),
+			mercury_std_library_module(ModuleNameStr)
 		;
 			bimap.search(Trusted, module(Module), _)
 		;
@@ -500,7 +513,7 @@
 			bimap.search(Trusted, function(Module, Name, Arity), _)
 		)
 	;
-		ProcId = uci_proc(_, _, _, _, _, _)
+		ProcLabel = special_proc(_, _, _, _, _, _)
 	).
 
 :- pred query_oracle_kb(oracle_kb::in, decl_question(T)::in,
Index: browser/declarative_tree.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_tree.m,v
retrieving revision 1.16
diff -u -r1.16 declarative_tree.m
--- browser/declarative_tree.m	19 Jan 2005 09:55:20 -0000	1.16
+++ browser/declarative_tree.m	21 Jan 2005 14:14:45 -0000
@@ -381,9 +381,18 @@
 :- pred missing_answer_special_case(trace_atom::in) is semidet.
 
 missing_answer_special_case(Atom) :-
-	ProcId = get_proc_id_from_layout(Atom ^ proc_layout),
-	ProcId = proc("std_util", predicate, "std_util", "builtin_aggregate", 
-		4, _).
+	ProcLabel = get_proc_label_from_layout(Atom ^ proc_layout),
+	ProcLabel = proc(StdUtilModule1, predicate, StdUtilModule2, 
+		"builtin_aggregate", 4, _),
+	possible_sym_library_module_name("std_util", StdUtilModule1),
+	possible_sym_library_module_name("std_util", StdUtilModule2).
+
+:- pred possible_sym_library_module_name(string::in, module_name::out) 
+	is multi.
+
+possible_sym_library_module_name(ModuleStr, unqualified(ModuleStr)).
+possible_sym_library_module_name(ModuleStr, qualified(unqualified("library"), 
+	ModuleStr)).
 
 :- pred not_at_depth_limit(S, R) <= annotated_trace(S, R).
 :- mode not_at_depth_limit(in, in) is semidet.
@@ -1393,10 +1402,11 @@
 
 atomic_goal_matches_atom(AtomicGoalId, Atom) :-	
 	AtomicGoalId = atomic_goal_id(GoalModule, GoalName, GoalArity),
-	ProcId = get_proc_id_from_layout(Atom ^ proc_layout),
-	get_pred_attributes(ProcId, EventModule, EventName, _, _),
+	ProcLabel = get_proc_label_from_layout(Atom ^ proc_layout),
+	get_pred_attributes(ProcLabel, EventModule, EventName, _, _),
 	EventArity = length(Atom ^ atom_args),
-	EventModule = GoalModule, 
+	sym_name_to_string(EventModule, ".", EventModuleStr),
+	EventModuleStr = GoalModule, 
 	EventName = GoalName, 
 	EventArity = GoalArity.
 
Index: browser/declarative_user.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_user.m,v
retrieving revision 1.37
diff -u -r1.37 declarative_user.m
--- browser/declarative_user.m	19 Jan 2005 03:10:17 -0000	1.37
+++ browser/declarative_user.m	21 Jan 2005 11:14:23 -0000
@@ -422,11 +422,12 @@
 
 browse_atom(InitAtom, FinalAtom, MaybeMark, !User, !IO) :-
 	FinalAtom = atom(ProcLayout, Args),
-	ProcId = get_proc_id_from_layout(ProcLayout),
+	ProcLabel = get_proc_label_from_layout(ProcLayout),
 	get_user_arg_values(Args, ArgValues),
-	get_pred_attributes(ProcId, Module, Name, _, PredOrFunc),
+	get_pred_attributes(ProcLabel, Module, Name, _, PredOrFunc),
 	Function = pred_to_bool(unify(PredOrFunc,function)),
-	BrowserTerm = synthetic_term_to_browser_term(Module++"."++Name, 
+	sym_name_to_string(Module, ".", ModuleStr),
+	BrowserTerm = synthetic_term_to_browser_term(ModuleStr ++ "." ++ Name, 
 		ArgValues, Function),
 	browse_browser_term(BrowserTerm, !.User ^ instr, !.User ^ outstr,
 		yes(get_subterm_mode_from_atoms(InitAtom, FinalAtom)),
@@ -850,9 +851,9 @@
 write_decl_atom(User, Indent, CallerType, DeclAtom, !IO) :-
 	io__write_string(User ^ outstr, Indent, !IO),
 	unravel_decl_atom(DeclAtom, TraceAtom, IoActions),
-	TraceAtom = atom(ProcLabel, Args0),
-	ProcId = get_proc_id_from_layout(ProcLabel),
-	get_pred_attributes(ProcId, _, Functor, _, PredOrFunc),
+	TraceAtom = atom(ProcLayout, Args0),
+	ProcLabel = get_proc_label_from_layout(ProcLayout),
+	get_pred_attributes(ProcLabel, _, Functor, _, PredOrFunc),
 	Which = chosen_head_vars_presentation,
 	maybe_filter_headvars(Which, Args0, Args1),
 	list__map(trace_atom_arg_to_univ, Args1, Args),
Index: browser/prim_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/prim_data.m,v
retrieving revision 1.1
diff -u -r1.1 prim_data.m
--- browser/prim_data.m	19 Jan 2005 03:10:18 -0000	1.1
+++ browser/prim_data.m	21 Jan 2005 12:11:05 -0000
@@ -111,6 +111,20 @@
 	%
 :- pred string_to_sym_name(string::in, string::in, sym_name::out) is det.
 
+	% sym_name_to_string(SymName, Separator, String):
+	%	convert a symbol name to a string,
+	%	with module qualifiers separated by Separator.
+:- pred sym_name_to_string(sym_name::in, string::in, string::out)
+	is det.
+:- func sym_name_to_string(sym_name, string) = string.
+
+	% sym_name_to_string(SymName, String):
+	%	convert a symbol name to a string,
+	%	with module qualifiers separated by
+	%	the standard Mercury module qualifier operator.
+:- pred sym_name_to_string(sym_name::in, string::out) is det.
+:- func sym_name_to_string(sym_name) = string.
+
 	% insert_module_qualifier(ModuleName, SymName0, SymName):
 	%	prepend the specified ModuleName onto the module
 	%	qualifiers in SymName0, giving SymName.
@@ -121,7 +135,7 @@
 
 :- implementation.
 
-:- import_module int, string. 
+:- import_module int, string, list. 
 
 % This would be simpler if we had a string__rev_sub_string_search/3 pred.
 % With that, we could search for underscores right-to-left,
@@ -150,3 +164,18 @@
 insert_module_qualifier(ModuleName, qualified(ModuleQual0, PlainName),
 		qualified(ModuleQual, PlainName)) :-
 	insert_module_qualifier(ModuleName, ModuleQual0, ModuleQual).
+
+sym_name_to_string(SymName, String) :-
+	sym_name_to_string(SymName, ".", String).
+
+sym_name_to_string(SymName) = String :-
+	sym_name_to_string(SymName, String).
+
+sym_name_to_string(SymName, Separator) = String :-
+	sym_name_to_string(SymName, Separator, String).
+
+sym_name_to_string(unqualified(Name), _Separator, Name).
+sym_name_to_string(qualified(ModuleSym, Name), Separator,
+		QualName) :-
+	sym_name_to_string(ModuleSym, Separator, ModuleName),
+	string__append_list([ModuleName, Separator, Name], QualName).
Index: compiler/bytecode.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode.m,v
retrieving revision 1.57
diff -u -r1.57 bytecode.m
--- compiler/bytecode.m	19 Jan 2005 03:10:28 -0000	1.57
+++ compiler/bytecode.m	21 Jan 2005 12:33:53 -0000
@@ -684,7 +684,7 @@
 :- pred output_module_id(byte_module_id::in, io::di, io::uo) is det.
 
 output_module_id(ModuleId) -->
-	{ prog_out__sym_name_to_string(ModuleId, ModuleIdString) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleId, ModuleIdString) },
 	output_string(ModuleIdString).
 
 :- pred debug_module_id(byte_module_id::in, io::di, io::uo) is det.
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.62
diff -u -r1.62 check_typeclass.m
--- compiler/check_typeclass.m	21 Jan 2005 06:20:35 -0000	1.62
+++ compiler/check_typeclass.m	22 Jan 2005 04:29:58 -0000
@@ -323,7 +323,8 @@
 		% Construct an appropriate error message.
 		%
 		ClassId = class_id(ClassName, ClassArity),
-		prog_out__sym_name_to_string(ClassName, ClassNameString),
+		mdbcomp__prim_data__sym_name_to_string(ClassName, 
+			ClassNameString),
 		string__int_to_string(ClassArity, ClassArityString),
 		string__append_list([
 			"In instance declaration for `",
@@ -525,8 +526,10 @@
 		OrderedInstanceMethods = OrderedInstanceMethods0,
 		InstanceDefn = InstanceDefn0,
 		ClassId = class_id(ClassName, _ClassArity),
-		prog_out__sym_name_to_string(MethodName, MethodNameString),
-		prog_out__sym_name_to_string(ClassName, ClassNameString),
+		mdbcomp__prim_data__sym_name_to_string(MethodName, 
+			MethodNameString),
+		mdbcomp__prim_data__sym_name_to_string(ClassName, 
+			ClassNameString),
 		pred_or_func_to_string(PredOrFunc, PredOrFuncString),
 		string__int_to_string(Arity, ArityString),
 		InstanceTypesString = mercury_type_list_to_string(
@@ -562,8 +565,10 @@
 		OrderedInstanceMethods = OrderedInstanceMethods0,
 		InstanceDefn = InstanceDefn0,
 		ClassId = class_id(ClassName, _ClassArity),
-		prog_out__sym_name_to_string(MethodName, MethodNameString),
-		prog_out__sym_name_to_string(ClassName, ClassNameString),
+		mdbcomp__prim_data__sym_name_to_string(MethodName, 
+			MethodNameString),
+		mdbcomp__prim_data__sym_name_to_string(ClassName, 
+			ClassNameString),
 		pred_or_func_to_string(PredOrFunc, PredOrFuncString),
 		string__int_to_string(Arity, ArityString),
 		InstanceTypesString = mercury_type_list_to_string(
@@ -779,8 +784,10 @@
 make_introduced_pred_name(ClassId, MethodName, Arity,
 		InstanceTypes, PredName) :-
 	ClassId = class_id(ClassName, _ClassArity),
-	prog_out__sym_name_to_string(ClassName, "__", ClassNameString),
-	prog_out__sym_name_to_string(MethodName, "__", MethodNameString),
+	mdbcomp__prim_data__sym_name_to_string(ClassName, "__", 
+		ClassNameString),
+	mdbcomp__prim_data__sym_name_to_string(MethodName, "__", 
+		MethodNameString),
 		% Perhaps we should include the arity in this mangled
 		% string?
 	string__int_to_string(Arity, ArityString),
@@ -852,7 +859,8 @@
 	;
 		UnprovenConstraints = [_ | _],
 		ClassId = class_id(ClassName, _ClassArity),
-		prog_out__sym_name_to_string(ClassName, ClassNameString),
+		mdbcomp__prim_data__sym_name_to_string(ClassName, 
+			ClassNameString),
 		InstanceTypesString = mercury_type_list_to_string(
 			InstanceVarSet2, InstanceTypes),
 		constraint_list_to_string(ClassVarSet, UnprovenConstraints,
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.134
diff -u -r1.134 code_gen.m
--- compiler/code_gen.m	21 Jan 2005 06:20:36 -0000	1.134
+++ compiler/code_gen.m	22 Jan 2005 04:30:34 -0000
@@ -1392,7 +1392,8 @@
 	module_info_pred_info(ModuleInfo, PredId, PredInfo),
 	ModuleSymName = pred_info_module(PredInfo),
 
-	prog_out__sym_name_to_string(ModuleSymName, "__", ModuleName),
+	mdbcomp__prim_data__sym_name_to_string(ModuleSymName, "__", 
+		ModuleName),
 
 	code_util__make_local_entry_label(ModuleInfo, PredId,
 		ProcId, no, Entry),
@@ -1461,7 +1462,7 @@
 		FullPredName = PredName
 	),
 	PredOrFuncString = pred_or_func_to_str(PredOrFunc),
-	prog_out__sym_name_to_string(ModuleName, ModuleNameString),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameString),
 	string__int_to_string(Arity, ArityStr),
 	proc_id_to_int(ProcId, ProcNum),
 	string__int_to_string(ProcNum, ProcNumStr),
@@ -1476,7 +1477,7 @@
 
 code_gen__find_arg_type_ctor_name(TypeCtor, TypeName) :-
 	TypeCtor = TypeCtorSymName - TypeCtorArity,
-	prog_out__sym_name_to_string(TypeCtorSymName, TypeCtorName),
+	mdbcomp__prim_data__sym_name_to_string(TypeCtorSymName, TypeCtorName),
 	string__int_to_string(TypeCtorArity, ArityStr),
 	string__append_list([TypeCtorName, "_", ArityStr], TypeName).
 
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.43
diff -u -r1.43 deforest.m
--- compiler/deforest.m	21 Jan 2005 06:20:37 -0000	1.43
+++ compiler/deforest.m	21 Jan 2005 12:33:53 -0000
@@ -453,7 +453,7 @@
 		), Goals0, Constraints, Goals1),
 		Constraints \= []
 	->
-		prog_out__sym_name_to_string(SymName, SymNameString),
+		mdbcomp__prim_data__sym_name_to_string(SymName, SymNameString),
 		pd_debug__message("propagating constraints into call to %s\n",
 			[s(SymNameString)], !IO),
 
Index: compiler/higher_order.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.123
diff -u -r1.123 higher_order.m
--- compiler/higher_order.m	21 Jan 2005 06:20:38 -0000	1.123
+++ compiler/higher_order.m	21 Jan 2005 12:33:53 -0000
@@ -2557,7 +2557,7 @@
 maybe_write_request(no, _, _, _, _, _, _, _, _, !IO).
 maybe_write_request(yes, ModuleInfo, Msg, SymName, Arity, ActualArity,
 		MaybeNewName, HOArgs, Context, !IO) :-
-	prog_out__sym_name_to_string(SymName, OldName),
+	mdbcomp__prim_data__sym_name_to_string(SymName, OldName),
 	string__int_to_string(Arity, ArStr),
 	io__write_string("% ", !IO),
 	prog_out__write_context(Context, !IO),
Index: compiler/hlds_code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_code_util.m,v
retrieving revision 1.14
diff -u -r1.14 hlds_code_util.m
--- compiler/hlds_code_util.m	21 Jan 2005 03:27:38 -0000	1.14
+++ compiler/hlds_code_util.m	22 Jan 2005 04:30:54 -0000
@@ -137,7 +137,8 @@
 
 type_to_string(Type, String) :-
 	( sym_name_and_args(Type, TypeName, TypeArgs) ->
-		prog_out__sym_name_to_string(TypeName, "__", TypeNameString),
+		mdbcomp__prim_data__sym_name_to_string(TypeName, "__", 
+			TypeNameString),
 		list__length(TypeArgs, TypeArity),
 		string__int_to_string(TypeArity, TypeArityString),
 		string__append_list(
Index: compiler/hlds_error_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_error_util.m,v
retrieving revision 1.7
diff -u -r1.7 hlds_error_util.m
--- compiler/hlds_error_util.m	21 Jan 2005 06:20:38 -0000	1.7
+++ compiler/hlds_error_util.m	22 Jan 2005 04:31:16 -0000
@@ -190,7 +190,8 @@
 module_qualification(ModuleName, ShouldModuleQualify) = ModuleQualification :-
 	(
 		ShouldModuleQualify = should_module_qualify,
-		prog_out__sym_name_to_string(ModuleName, ModuleNameString),
+		mdbcomp__prim_data__sym_name_to_string(ModuleName, 
+			ModuleNameString),
 		ModuleQualification = string__append(ModuleNameString, ".")
 	;
 		ShouldModuleQualify = should_not_module_qualify,
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.106
diff -u -r1.106 hlds_module.m
--- compiler/hlds_module.m	21 Jan 2005 06:20:38 -0000	1.106
+++ compiler/hlds_module.m	21 Jan 2005 12:33:53 -0000
@@ -1998,7 +1998,7 @@
 		% the type-checker should ensure that this never happens
 		list__length(ArgTypes, Arity),
 		PredOrFuncStr = prog_out__pred_or_func_to_str(PredOrFunc),
-		prog_out__sym_name_to_string(SymName, Name2),
+		mdbcomp__prim_data__sym_name_to_string(SymName, Name2),
 		string__int_to_string(Arity, ArityString),
 		string__append_list(["get_pred_id_and_proc_id: ",
 			"undefined/invalid ", PredOrFuncStr,
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.344
diff -u -r1.344 hlds_out.m
--- compiler/hlds_out.m	21 Jan 2005 06:20:38 -0000	1.344
+++ compiler/hlds_out.m	21 Jan 2005 12:33:53 -0000
@@ -295,7 +295,7 @@
 	io__write_string(hlds_out__cons_id_to_string(ConsId), !IO).
 
 hlds_out__cons_id_to_string(cons(SymName, Arity)) = String :-
-	prog_out__sym_name_to_string(SymName, SymNameString0),
+	mdbcomp__prim_data__sym_name_to_string(SymName, SymNameString0),
 	( string__contains_char(SymNameString0, '*') ->
 		% We need to protect against the * appearing next to a /
 		Stuff = (pred(Char::in, Str0::in, Str::out) is det :-
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.165
diff -u -r1.165 intermod.m
--- compiler/intermod.m	21 Jan 2005 06:20:39 -0000	1.165
+++ compiler/intermod.m	22 Jan 2005 04:31:44 -0000
@@ -2324,7 +2324,8 @@
 	maybe_write_string(VeryVerbose,
 		"% Reading optimization interface for module", !IO),
 	maybe_write_string(VeryVerbose, " `", !IO),
-	prog_out__sym_name_to_string(ModuleToRead, ModuleToReadString),
+	mdbcomp__prim_data__sym_name_to_string(ModuleToRead, 
+		ModuleToReadString),
 	maybe_write_string(VeryVerbose, ModuleToReadString, !IO),
 	maybe_write_string(VeryVerbose, "'...\n", !IO),
 	maybe_flush_output(VeryVerbose, !IO),
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.41
diff -u -r1.41 layout_out.m
--- compiler/layout_out.m	21 Jan 2005 06:20:40 -0000	1.41
+++ compiler/layout_out.m	22 Jan 2005 04:32:22 -0000
@@ -1010,7 +1010,7 @@
 	io__write_string(" = {\n{\n", !IO),
 	output_proc_id(ClosureProcLabel, lambda(FileName, LineNumber), !IO),
 	io__write_string("},\n", !IO),
-	prog_out__sym_name_to_string(ModuleName, ModuleNameStr),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameStr),
 	quote_and_write_string(ModuleNameStr, !IO),
 	io__write_string(",\n", !IO),
 	quote_and_write_string(FileName, !IO),
@@ -1028,9 +1028,9 @@
 		ProcLabel = proc(DefiningModule, PredOrFunc, DeclaringModule,
 			PredName0, Arity, Mode),
 		PredName = origin_name(Origin, PredName0),
-		prog_out__sym_name_to_string(DefiningModule,
+		mdbcomp__prim_data__sym_name_to_string(DefiningModule,
 			DefiningModuleStr),
-		prog_out__sym_name_to_string(DeclaringModule,
+		mdbcomp__prim_data__sym_name_to_string(DeclaringModule,
 			DeclaringModuleStr),
 		output_pred_or_func(PredOrFunc, !IO),
 		io__write_string(",\n", !IO),
@@ -1050,9 +1050,10 @@
 		TypeCtor = qualified(TypeModule, TypeName) - TypeArity,
 		PredName0 = special_pred_name(SpecialPredId, TypeCtor),
 		PredName = origin_name(Origin, PredName0),
-		prog_out__sym_name_to_string(DefiningModule,
+		mdbcomp__prim_data__sym_name_to_string(DefiningModule,
 			DefiningModuleStr),
-		prog_out__sym_name_to_string(TypeModule, TypeModuleStr),
+		mdbcomp__prim_data__sym_name_to_string(TypeModule, 
+			TypeModuleStr),
 		quote_and_write_string(TypeName, !IO),
 		io__write_string(",\n", !IO),
 		quote_and_write_string(TypeModuleStr, !IO),
@@ -1184,7 +1185,7 @@
 	io__write_string("\n", !IO),
 	output_layout_name_storage_type_name(ModuleLayoutName, yes, !IO),
 	io__write_string(" = {\n", !IO),
-	prog_out__sym_name_to_string(ModuleName, ModuleNameStr),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameStr),
 	quote_and_write_string(ModuleNameStr, !IO),
 	io__write_string(",\n", !IO),
 	io__write_int(StringTableSize, !IO),
Index: compiler/make.module_target.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.module_target.m,v
retrieving revision 1.27
diff -u -r1.27 make.module_target.m
--- compiler/make.module_target.m	23 Dec 2004 06:49:16 -0000	1.27
+++ compiler/make.module_target.m	21 Jan 2005 12:33:54 -0000
@@ -301,7 +301,7 @@
 build_target_2(ModuleName, process_module(ModuleTask), ArgFileName,
 		_Imports, AllOptionArgs, ErrorStream,
 		Succeeded, Info, Info) -->
-	{ prog_out__sym_name_to_string(ModuleName, ".", ModuleArg) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", ModuleArg) },
 
 	globals__io_lookup_bool_option(verbose_commands, Verbose),
 	( { Verbose = yes } ->
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.494
diff -u -r1.494 make_hlds.m
--- compiler/make_hlds.m	21 Jan 2005 06:20:41 -0000	1.494
+++ compiler/make_hlds.m	22 Jan 2005 04:32:45 -0000
@@ -3260,7 +3260,7 @@
 		% XXX we should record each error
 		% using module_info_incr_errors
 		FieldDefn = hlds_ctor_field_defn(Context, _, _, _, _),
-		prog_out__sym_name_to_string(FieldName, FieldString),
+		mdbcomp__prim_data__sym_name_to_string(FieldName, FieldString),
 		ErrorPieces = [
 			words("Error: field"),
 			fixed(string__append_list(["`", FieldString, "'"])),
@@ -4623,7 +4623,8 @@
 	->
 		PredId = PredId0,
 		( GoalType = promise(_) ->
-			prog_out__sym_name_to_string(PredName, NameString),
+			mdbcomp__prim_data__sym_name_to_string(PredName, 
+				NameString),
 			string__format("%s %s %s (%s).\n",
 				[s("Attempted to introduce a predicate"),
 				s("for a promise with an identical"),
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.322
diff -u -r1.322 mercury_compile.m
--- compiler/mercury_compile.m	21 Jan 2005 06:20:42 -0000	1.322
+++ compiler/mercury_compile.m	21 Jan 2005 12:33:57 -0000
@@ -864,7 +864,7 @@
 		MaybeTimestamp, Items, Error, !ReadModules, !IO) :-
 	globals__io_lookup_bool_option(verbose, Verbose, !IO),
 	maybe_write_string(Verbose, "% Parsing module `", !IO),
-	prog_out__sym_name_to_string(ModuleName, ModuleNameString),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameString),
 	maybe_write_string(Verbose, ModuleNameString, !IO),
 	maybe_write_string(Verbose, "' and imported interfaces...\n", !IO),
 	(
@@ -1838,7 +1838,7 @@
 				warn_missing_trans_opt_deps,
 				WarnNoTransOptDeps),
 			( WarnNoTransOptDeps = yes ->
-				prog_out__sym_name_to_string(ModuleName,
+				mdbcomp__prim_data__sym_name_to_string(ModuleName,
 					ModuleString),
 				Msg1 = "Warning: cannot read trans-opt " ++
 					"dependencies for module `" ++
@@ -4456,7 +4456,7 @@
 	globals__io_lookup_bool_option(dump_rl, Dump, !IO),
 	( Dump = yes ->
 		module_info_name(ModuleInfo, ModuleName0),
-		prog_out__sym_name_to_string(ModuleName0, ModuleName),
+		mdbcomp__prim_data__sym_name_to_string(ModuleName0, ModuleName),
 		string__append_list([ModuleName, ".rl_dump", StageName],
 			DumpFile),
 		globals__io_lookup_bool_option(verbose, Verbose, !IO),
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.250
diff -u -r1.250 mercury_to_mercury.m
--- compiler/mercury_to_mercury.m	19 Jan 2005 03:10:42 -0000	1.250
+++ compiler/mercury_to_mercury.m	21 Jan 2005 12:33:57 -0000
@@ -1464,13 +1464,13 @@
 	add_lambda_eval_method(EvalMethod),
 	add_string(")>").
 mercury_format_cons_id(type_ctor_info_const(Module, Type, Arity), _) -->
-	{ prog_out__sym_name_to_string(Module, ModuleString) },
+	{ mdbcomp__prim_data__sym_name_to_string(Module, ModuleString) },
 	{ string__int_to_string(Arity, ArityString) },
 	add_strings(["<type_ctor_info for ",
 		ModuleString, ".", Type, "/", ArityString, ">"]).
 mercury_format_cons_id(base_typeclass_info_const(Module, Class, InstanceNum,
 		InstanceString), _) -->
-	{ prog_out__sym_name_to_string(Module, ModuleString) },
+	{ mdbcomp__prim_data__sym_name_to_string(Module, ModuleString) },
 	add_string("<base_typeclass_info for "),
 	add_class_id(Class),
 	( { ModuleString \= "some bogus module name" } ->
Index: compiler/ml_elim_nested.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.67
diff -u -r1.67 ml_elim_nested.m
--- compiler/ml_elim_nested.m	19 Jan 2005 03:10:43 -0000	1.67
+++ compiler/ml_elim_nested.m	22 Jan 2005 04:33:06 -0000
@@ -1392,7 +1392,8 @@
 
 ml_module_name_string(ModuleName) = ModuleNameString :-
 	Separator = "__",
-	prog_out__sym_name_to_string(ModuleName, Separator, ModuleNameString).
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, Separator, 
+		ModuleNameString).
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.168
diff -u -r1.168 mlds_to_c.m
--- compiler/mlds_to_c.m	21 Jan 2005 03:27:41 -0000	1.168
+++ compiler/mlds_to_c.m	22 Jan 2005 04:33:32 -0000
@@ -528,8 +528,9 @@
 output_init_fn_name(ModuleName, Suffix, !IO) :-
 		% Here we ensure that we only get one "mercury__" at the
 		% start of the function name.
-	prog_out__sym_name_to_string(mlds_module_name_to_sym_name(ModuleName),
-		"__", ModuleNameString0),
+	mdbcomp__prim_data__sym_name_to_string(
+		mlds_module_name_to_sym_name(ModuleName), "__",
+		ModuleNameString0),
 	( string__prefix(ModuleNameString0, "mercury__") ->
 		ModuleNameString = ModuleNameString0
 	;
Index: compiler/mlds_to_gcc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.101
diff -u -r1.101 mlds_to_gcc.m
--- compiler/mlds_to_gcc.m	19 Jan 2005 03:10:45 -0000	1.101
+++ compiler/mlds_to_gcc.m	21 Jan 2005 12:33:57 -0000
@@ -407,7 +407,7 @@
 init_fn_name(ModuleName, Suffix) = InitFnName :-
 		% Here we ensure that we only get one "mercury__" at the
 		% start of the function name.
-	prog_out__sym_name_to_string(
+	mdbcomp__prim_data__sym_name_to_string(
 			mlds_module_name_to_sym_name(ModuleName), "__",
 			ModuleNameString0),
 	(
@@ -493,7 +493,7 @@
 output_init_fn_name(ModuleName, Suffix) -->
 		% Here we ensure that we only get one "mercury__" at the
 		% start of the function name.
-	{ prog_out__sym_name_to_string(
+	{ mdbcomp__prim_data__sym_name_to_string(
 			mlds_module_name_to_sym_name(ModuleName), "__",
 			ModuleNameString0) },
 	{
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.144
diff -u -r1.144 mlds_to_il.m
--- compiler/mlds_to_il.m	21 Jan 2005 03:27:42 -0000	1.144
+++ compiler/mlds_to_il.m	22 Jan 2005 04:33:59 -0000
@@ -253,7 +253,8 @@
 		transform_mlds(MLDS),
 
 	ModuleName = mercury_module_name_to_mlds(MercuryModuleName),
-	prog_out__sym_name_to_string(mlds_module_name_to_sym_name(ModuleName),
+	mdbcomp__prim_data__sym_name_to_string(
+			mlds_module_name_to_sym_name(ModuleName),
 			".", AssemblyName),
 	get_il_data_rep(ILDataRep, !IO),
 	globals__io_lookup_bool_option(debug_il_asm, DebugIlAsm, !IO),
@@ -4032,7 +4033,7 @@
 			ForeignImportName = il_assembly_name(ImportName),
 			PackageName = mlds_module_name_to_package_name(
 					ImportName),
-			prog_out__sym_name_to_string(PackageName,
+			mdbcomp__prim_data__sym_name_to_string(PackageName,
 					ForeignPackageStr),
 			( string__prefix(ForeignPackageStr, "System") ->
 				AsmDecls = dotnet_system_assembly_decls(Version)
Index: compiler/mlds_to_java.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_java.m,v
retrieving revision 1.63
diff -u -r1.63 mlds_to_java.m
--- compiler/mlds_to_java.m	21 Jan 2005 03:27:42 -0000	1.63
+++ compiler/mlds_to_java.m	21 Jan 2005 12:33:57 -0000
@@ -385,7 +385,7 @@
 	),
 	SymName = mlds_module_name_to_sym_name(ImportName),
 	JavaSafeSymName = valid_module_name(SymName),
-	prog_out__sym_name_to_string(JavaSafeSymName, ".", File),
+	mdbcomp__prim_data__sym_name_to_string(JavaSafeSymName, ".", File),
 	% XXX Name mangling code should be put here when we start enforcing
 	%     Java's naming conventions.
 	ClassFile = File,
@@ -999,7 +999,7 @@
 output_package_info(unqualified(_), !IO).
 output_package_info(qualified(Module, _), !IO) :-
 	io__write_string("package ", !IO),
-	prog_out__sym_name_to_string(Module, ".", Package),
+	mdbcomp__prim_data__sym_name_to_string(Module, ".", Package),
 	io__write_string(Package, !IO),
 	io__write_string(";\n", !IO).
 
Index: compiler/mlds_to_managed.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_managed.m,v
retrieving revision 1.15
diff -u -r1.15 mlds_to_managed.m
--- compiler/mlds_to_managed.m	19 Jan 2005 03:10:46 -0000	1.15
+++ compiler/mlds_to_managed.m	22 Jan 2005 04:34:25 -0000
@@ -77,7 +77,7 @@
 
 output_src_start(ModuleName) -->
 	{ library__version(Version) },
-	{ prog_out__sym_name_to_string(ModuleName, ModuleNameStr) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameStr) },
 	io__write_strings(
 		["//\n// Automatically generated from `",
 		ModuleNameStr,
@@ -212,7 +212,8 @@
 			    )
 			;
 			    SymName = mlds_module_name_to_sym_name(Name),
-			    prog_out__sym_name_to_string(SymName, ".", Str)
+			    mdbcomp__prim_data__sym_name_to_string(SymName, 
+			    	".", Str)
 			),
 			Result = [Str]
 		    ;
@@ -227,7 +228,7 @@
 			io__write_string(".dll""\n")
 		), ActualImports),
 
-	{ prog_out__sym_name_to_string(ModuleName, ModuleNameStr) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleNameStr) },
 	io__write_strings([
 		"#using """, ModuleNameStr, ".dll""\n",
 		"#include ""mercury_mcpp.h""\n",
Index: compiler/modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.291
diff -u -r1.291 modes.m
--- compiler/modes.m	21 Jan 2005 06:20:43 -0000	1.291
+++ compiler/modes.m	21 Jan 2005 12:33:57 -0000
@@ -1189,7 +1189,7 @@
 
 modecheck_goal_expr(call(PredId, ProcId0, Args0, _, Context, PredName),
 		GoalInfo0, Goal, !ModeInfo, !IO) :-
-	prog_out__sym_name_to_string(PredName, PredNameString),
+	mdbcomp__prim_data__sym_name_to_string(PredName, PredNameString),
 	string__append("call ", PredNameString, CallString),
 	mode_checkpoint(enter, CallString, !ModeInfo, !IO),
 
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.314
diff -u -r1.314 modules.m
--- compiler/modules.m	21 Jan 2005 04:45:49 -0000	1.314
+++ compiler/modules.m	22 Jan 2005 04:35:37 -0000
@@ -810,14 +810,15 @@
 		source_file_map__lookup_module_source_file(ModuleName,
 			FileName, !IO)
 	;
-		prog_out__sym_name_to_string(ModuleName, ".", BaseFileName),
+		mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", 
+			BaseFileName),
 		string__append(BaseFileName, Ext, BaseName),
 		choose_file_name(ModuleName, BaseName, Ext,
 			Search, MkDir, FileName, !IO)
 	).
 
 module_name_to_lib_file_name(Prefix, ModuleName, Ext, MkDir, FileName, !IO) :-
-	prog_out__sym_name_to_string(ModuleName, ".", BaseFileName),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", BaseFileName),
 	string__append_list([Prefix, BaseFileName, Ext], BaseName),
 	choose_file_name(ModuleName, BaseName, Ext, no, MkDir, FileName, !IO).
 
@@ -1050,10 +1051,10 @@
 	string_to_sym_name(FileName, ".", ModuleName).
 
 module_name_to_file_name(ModuleName, FileName) :-
-	prog_out__sym_name_to_string(ModuleName, ".", FileName).
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", FileName).
 
 module_name_to_make_var_name(ModuleName, MakeVarName) :-
-	prog_out__sym_name_to_string(ModuleName, ".", MakeVarName).
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", MakeVarName).
 
 maybe_make_symlink(LinkTarget, LinkName, Result, !IO) :-
 	globals__io_lookup_bool_option(use_symlinks, UseSymLinks, !IO),
@@ -3647,7 +3648,8 @@
 	map__lookup(DepsMap, ModuleName, deps(_, ModuleImports)),
 	module_imports_get_error(ModuleImports, Error),
 	( Error = fatal_module_errors ->
-		prog_out__sym_name_to_string(ModuleName, ModuleString),
+		mdbcomp__prim_data__sym_name_to_string(ModuleName, 
+			ModuleString),
 		string__append_list(["can't read source file for module `",
 			ModuleString, "'."], Message),
 		report_error(Message, !IO)
@@ -4180,7 +4182,8 @@
 generate_dv_file(SourceFileName, ModuleName, DepsMap, DepStream) -->
 	io__write_string(DepStream,
 		"# Automatically generated dependency variables for module `"),
-	{ prog_out__sym_name_to_string(ModuleName, ModuleNameString) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, 
+		ModuleNameString) },
 	io__write_string(DepStream, ModuleNameString),
 	io__write_string(DepStream, "'\n"),
 	io__write_string(DepStream,
@@ -4664,7 +4667,8 @@
 generate_dep_file(SourceFileName, ModuleName, DepsMap, DepStream) -->
 	io__write_string(DepStream,
 		"# Automatically generated dependencies for module `"),
-	{ prog_out__sym_name_to_string(ModuleName, ModuleNameString) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, 
+		ModuleNameString) },
 	io__write_string(DepStream, ModuleNameString),
 	io__write_string(DepStream, "'\n"),
 	io__write_string(DepStream,
@@ -4932,7 +4936,8 @@
 	% The `force-module_init' dependency forces the commands for
 	% the `module_init.c' rule to be run every time the rule
 	% is considered.
-	{ prog_out__sym_name_to_string(ModuleName, ".", ModuleFileName) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", 
+		ModuleFileName) },
 	{ ForceC2InitTarget = "force-" ++ ModuleFileName ++ "_init" },
 	{ TmpInitCFileName = InitCFileName ++ ".tmp" },
 	io__write_strings(DepStream, [
@@ -5361,7 +5366,7 @@
 			= contains_foreign_code(Langs),
 		set__member(c, Langs)
 	->
-		prog_out__sym_name_to_string(Module, ".", FileName),
+		mdbcomp__prim_data__sym_name_to_string(Module, ".", FileName),
 		NewLinkObjs = [(FileName ++ "__c_code") - Module |
 			FactTableObjs]
 	;
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.146
diff -u -r1.146 opt_debug.m
--- compiler/opt_debug.m	19 Jan 2005 03:10:49 -0000	1.146
+++ compiler/opt_debug.m	21 Jan 2005 12:33:57 -0000
@@ -311,7 +311,7 @@
 	string__append_list(["label_entry(", LabelStr, ")"], Str).
 
 dump_data_addr(data_addr(ModuleName, DataName), Str) :-
-	prog_out__sym_name_to_string(ModuleName, ModuleName_str),
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ModuleName_str),
 	dump_data_name(DataName, DataName_str),
 	string__append_list(
 		["data_addr(", ModuleName_str, ", ", DataName_str, ")"], Str).
Index: compiler/options_file.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options_file.m,v
retrieving revision 1.25
diff -u -r1.25 options_file.m
--- compiler/options_file.m	19 Jan 2005 03:10:49 -0000	1.25
+++ compiler/options_file.m	21 Jan 2005 12:33:57 -0000
@@ -1037,7 +1037,7 @@
 		OptionsVariableClass = module_specific(ModuleName),
 		options_variable_type_is_target_specific(FlagsVar) = yes
 	->
-		prog_out__sym_name_to_string(ModuleName, ".",
+		mdbcomp__prim_data__sym_name_to_string(ModuleName, ".",
 			ModuleFileNameBase),
 		ModuleVarName = VarName ++ "-" ++ ModuleFileNameBase,
 		lookup_variable_words_report_error(Vars, ModuleVarName,
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.259
diff -u -r1.259 polymorphism.m
--- compiler/polymorphism.m	21 Jan 2005 06:20:44 -0000	1.259
+++ compiler/polymorphism.m	21 Jan 2005 12:33:57 -0000
@@ -1650,7 +1650,7 @@
 polymorphism__foreign_proc_add_typeclass_info(Mode, Impl, TypeVarSet,
 		Constraint, MaybeArgName) :-
 	Constraint = constraint(Name0, Types),
-	prog_out__sym_name_to_string(Name0, "__", Name),
+	mdbcomp__prim_data__sym_name_to_string(Name0, "__", Name),
 	term__vars_list(Types, TypeVars),
 	TypeVarNames =
 		list__map(underscore_and_tvar_name(TypeVarSet), TypeVars),
Index: compiler/prog_io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io.m,v
retrieving revision 1.234
diff -u -r1.234 prog_io.m
--- compiler/prog_io.m	21 Jan 2005 03:27:46 -0000	1.234
+++ compiler/prog_io.m	22 Jan 2005 04:36:12 -0000
@@ -308,8 +308,10 @@
 
 check_module_has_expected_name(FileName, ExpectedName, ActualName, !IO) :-
 	( ActualName \= ExpectedName ->
-		prog_out__sym_name_to_string(ActualName, ActualString),
-		prog_out__sym_name_to_string(ExpectedName, ExpectedString),
+		mdbcomp__prim_data__sym_name_to_string(ActualName, 
+			ActualString),
+		mdbcomp__prim_data__sym_name_to_string(ExpectedName, 
+			ExpectedString),
 		io__write_strings([
 			"Error: file `", FileName,
 				"' contains the wrong module.\n",
@@ -720,7 +722,7 @@
 			ModuleName = StartModuleName,
 			Messages = []
 		;
-			prog_out__sym_name_to_string(StartModuleName,
+			mdbcomp__prim_data__sym_name_to_string(StartModuleName,
 				StartModuleNameString),
 			string__append_list(["source file `", SourceFileName,
 				"' contains module named `",
Index: compiler/prog_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_out.m,v
retrieving revision 1.54
diff -u -r1.54 prog_out.m
--- compiler/prog_out.m	19 Jan 2005 03:10:53 -0000	1.54
+++ compiler/prog_out.m	21 Jan 2005 12:33:58 -0000
@@ -51,14 +51,7 @@
 	% The output should be a syntactically valid Mercury term.
 :- pred prog_out__write_quoted_sym_name(sym_name::in, io::di, io::uo) is det.
 
-	% sym_name_to_string(SymName, String):
-	%	convert a symbol name to a string,
-	%	with module qualifiers separated by
-	%	the standard Mercury module qualifier operator.
-:- pred prog_out__sym_name_to_string(sym_name::in, string::out) is det.
-:- func prog_out__sym_name_to_string(sym_name) = string.
-
-	% sym_name_to_string(SymName, String):
+	% sym_name_and_arity_to_string(SymName, String):
 	%	convert a symbol name and arity to a "<Name>/<Arity>" string,
 	%	with module qualifiers separated by
 	%	the standard Mercury module qualifier operator.
@@ -66,13 +59,6 @@
 	string::out) is det.
 :- func prog_out__sym_name_and_arity_to_string(sym_name_and_arity) = string.
 
-	% sym_name_to_string(SymName, Separator, String):
-	%	convert a symbol name to a string,
-	%	with module qualifiers separated by Separator.
-:- pred prog_out__sym_name_to_string(sym_name::in, string::in, string::out)
-	is det.
-:- func prog_out__sym_name_to_string(sym_name, string) = string.
-
 :- pred prog_out__write_module_spec(module_specifier::in, io::di, io::uo)
 	is det.
 
@@ -124,6 +110,8 @@
 :- import_module term, varset, term_io.
 :- import_module require, string, std_util, term, term_io, varset, int.
 
+:- import_module mdbcomp__prim_data.
+
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -230,23 +218,8 @@
 	prog_out__write_sym_name(SymName, !IO),
 	io__write_string("'", !IO).
 
-prog_out__sym_name_to_string(SymName, String) :-
-	prog_out__sym_name_to_string(SymName, ".", String).
-
-prog_out__sym_name_to_string(SymName) = String :-
-	prog_out__sym_name_to_string(SymName, String).
-
-prog_out__sym_name_to_string(SymName, Separator) = String :-
-	prog_out__sym_name_to_string(SymName, Separator, String).
-
-prog_out__sym_name_to_string(unqualified(Name), _Separator, Name).
-prog_out__sym_name_to_string(qualified(ModuleSym, Name), Separator,
-		QualName) :-
-	prog_out__sym_name_to_string(ModuleSym, Separator, ModuleName),
-	string__append_list([ModuleName, Separator, Name], QualName).
-
 prog_out__sym_name_and_arity_to_string(SymName/Arity, String) :-
-	prog_out__sym_name_to_string(SymName, SymNameString),
+	mdbcomp__prim_data__sym_name_to_string(SymName, SymNameString),
 	string__int_to_string(Arity, ArityString),
 	string__append_list([SymNameString, "/", ArityString], String).
 
Index: compiler/prog_rep.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.29
diff -u -r1.29 prog_rep.m
--- compiler/prog_rep.m	19 Jan 2005 03:10:53 -0000	1.29
+++ compiler/prog_rep.m	21 Jan 2005 12:33:58 -0000
@@ -243,7 +243,7 @@
 		GoalInfo, InstMap0, Info, Rep) :-
 	module_info_pred_info(Info ^ module_info, PredId, PredInfo),
 	ModuleSymName = pred_info_module(PredInfo),
-	prog_out__sym_name_to_string(ModuleSymName, ModuleName),
+	mdbcomp__prim_data__sym_name_to_string(ModuleSymName, ModuleName),
 	PredName = pred_info_name(PredInfo),
 	list__map(term__var_to_int, Args, ArgsRep),
 	(
Index: compiler/rl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl.m,v
retrieving revision 1.32
diff -u -r1.32 rl.m
--- compiler/rl.m	21 Jan 2005 06:20:46 -0000	1.32
+++ compiler/rl.m	21 Jan 2005 12:33:58 -0000
@@ -687,6 +687,7 @@
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
 :- import_module parse_tree__prog_type.
+:- import_module mdbcomp__prim_data.
 
 :- import_module bool, int, require, string.
 
@@ -1090,7 +1091,7 @@
 	ProcLabel = make_user_proc_label(ModuleName, IsImported,
 		PredOrFunc, PredModule, PredName, Arity, ProcId),
 	ProcLabelStr = proc_label_to_c_string(ProcLabel, no),
-	prog_out__sym_name_to_string(PredModule, PredModuleStr),
+	mdbcomp__prim_data__sym_name_to_string(PredModule, PredModuleStr),
 	ProcName = rl_proc_name(Owner, PredModuleStr, ProcLabelStr, 2).
 
 rl__get_insert_proc_name(ModuleInfo, PredId, ProcName) :-
@@ -1154,7 +1155,7 @@
 	module_info_pred_info(ModuleInfo, PredId, PredInfo),
 	PredName = pred_info_name(PredInfo),
 	PredModule0 = pred_info_module(PredInfo),
-	prog_out__sym_name_to_string(PredModule0, PredModule),
+	mdbcomp__prim_data__sym_name_to_string(PredModule0, PredModule),
 	pred_info_get_aditi_owner(PredInfo, Owner),
 	PredArity = pred_info_orig_arity(PredInfo),
 	string__format("%s__%i", [s(PredName), i(PredArity)], RelName),
@@ -1425,7 +1426,7 @@
 rl__mangle_type_name_2(TypeCtor, Args, MangledTypeName0, MangledTypeName) :-
 	(
 		TypeCtor = qualified(Module0, Name) - Arity,
-		prog_out__sym_name_to_string(Module0, Module),
+		mdbcomp__prim_data__sym_name_to_string(Module0, Module),
 		string__append_list([MangledTypeName0, Module, "__", Name],
 			MangledTypeName1)
 	;
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.47
diff -u -r1.47 rl_exprn.m
--- compiler/rl_exprn.m	21 Jan 2005 06:20:46 -0000	1.47
+++ compiler/rl_exprn.m	21 Jan 2005 12:33:58 -0000
@@ -156,6 +156,7 @@
 :- import_module parse_tree__prog_type.
 :- import_module transform_hlds__inlining.
 :- import_module backend_libs__name_mangle.
+:- import_module mdbcomp__prim_data.
 
 :- import_module assoc_list, bool, char, counter, int, map.
 :- import_module require, set, std_util, string, term, varset.
@@ -2182,7 +2183,8 @@
 			{ Code = tree(RvalCode, PopCode) }
 		)
 	;
-		{ prog_out__sym_name_to_string(PredModule0, PredModule) },
+		{ mdbcomp__prim_data__sym_name_to_string(PredModule0, 
+			PredModule) },
 		{ Arity = pred_info_orig_arity(PredInfo) },
 		{ string__format("Sorry, not implemented in Aditi: %s.%s/%i",
 			[s(PredModule), s(PredName), i(Arity)], Msg) },
Index: compiler/rl_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_gen.m,v
retrieving revision 1.19
diff -u -r1.19 rl_gen.m
--- compiler/rl_gen.m	21 Jan 2005 06:20:46 -0000	1.19
+++ compiler/rl_gen.m	21 Jan 2005 12:34:01 -0000
@@ -47,6 +47,7 @@
 :- import_module parse_tree__prog_type.
 :- import_module transform_hlds__dependency_graph.
 :- import_module transform_hlds__inlining.
+:- import_module mdbcomp__prim_data.
 
 :- import_module assoc_list, bool, char, int, list, map, queue.
 :- import_module relation, require, set, std_util, string, term, varset.
@@ -151,7 +152,8 @@
 			EntryPredId, EntryPredInfo) },
 		{ pred_info_get_aditi_owner(EntryPredInfo, Owner) },
 		{ module_info_name(ModuleInfo, ModuleName0) },
-		{ prog_out__sym_name_to_string(ModuleName0, ModuleName) },
+		{ mdbcomp__prim_data__sym_name_to_string(ModuleName0, 
+			ModuleName) },
 		{ string__int_to_string(RLProcId, ProcStr) },
 		{ string__append("rl_proc_", ProcStr, Name) },
 		{ list__length(EntryPoints, NumEntries) },
@@ -1523,7 +1525,7 @@
 	rl_info_get_module_info(ModuleInfo),
 	{ module_info_pred_info(ModuleInfo, PredId, PredInfo) },
 	{ Module0 = pred_info_module(PredInfo) },
-	{ prog_out__sym_name_to_string(Module0, Module) },
+	{ mdbcomp__prim_data__sym_name_to_string(Module0, Module) },
 	{ Name = pred_info_name(PredInfo) },
 	{ Arity = pred_info_orig_arity(PredInfo) },
 	rl_info_write_message("Generating call to %s.%s/%i\n",
Index: compiler/rl_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_info.m,v
retrieving revision 1.9
diff -u -r1.9 rl_info.m
--- compiler/rl_info.m	21 Jan 2005 06:20:47 -0000	1.9
+++ compiler/rl_info.m	21 Jan 2005 13:25:34 -0000
@@ -247,6 +247,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module parse_tree__prog_out.
+:- import_module mdbcomp__prim_data.
 
 :- import_module int, require.
 
@@ -500,7 +501,8 @@
 		% Get a (sort of) human readable version of the relation name.
 		{ proc_relation_type_to_str(ProcRelType, ProcRelStr) },
 		{ PredModule0 = pred_info_module(PredInfo) },
-		{ prog_out__sym_name_to_string(PredModule0, PredModule) },
+		{ mdbcomp__prim_data__sym_name_to_string(PredModule0, 
+			PredModule) },
 		{ PredName = pred_info_name(PredInfo) },
 		{ Arity = pred_info_orig_arity(PredInfo) },
 		rl_info_get_next_relation_id(RelationId),
Index: compiler/rl_out.pp
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_out.pp,v
retrieving revision 1.25
diff -u -r1.25 rl_out.pp
--- compiler/rl_out.pp	21 Jan 2005 06:20:47 -0000	1.25
+++ compiler/rl_out.pp	22 Jan 2005 04:15:17 -0000
@@ -78,6 +78,7 @@
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
+:- import_module mdbcomp__prim_data.
 
 #if INCLUDE_ADITI_OUTPUT	% See ../Mmake.common.in.
 :- import_module aditi_backend__rl_exprn.
@@ -147,7 +148,8 @@
 	->
 		{ module_info_pred_info(ModuleInfo, PredId, PredInfo) },
 		{ PredModule0 = pred_info_module(PredInfo) }, 
-		{ prog_out__sym_name_to_string(PredModule0, PredModule) },
+		{ mdbcomp__prim_data__sym_name_to_string(PredModule0, 
+			PredModule) },
 		{ PredName = pred_info_name(PredInfo) },
 		{ PredArity0 = pred_info_orig_arity(PredInfo) },
 		{ string__int_to_string(PredArity0, PredArity) },
@@ -234,7 +236,7 @@
 	globals__io_lookup_string_option(aditi_user, Owner),
 	{ rl_out_info_assign_const(string(Owner), OwnerIndex,
 		RLInfo2, RLInfo3) },
-	{ prog_out__sym_name_to_string(ModuleName0, ModuleName) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName0, ModuleName) },
 	module_name_to_file_name(ModuleName0, ".m", no, SourceFileName),
 	module_name_to_file_name(ModuleName0, ".int", no, IntFileName),
 	{ rl_out_info_assign_const(string(ModuleName), ModuleIndex, 
@@ -763,7 +765,7 @@
 	{ string__from_char_list(ProcNameList, ProcNameStr1) },
 	rl_out_info_get_module_info(ModuleInfo),
 	{ module_info_name(ModuleInfo, ModuleName0) },
-	{ prog_out__sym_name_to_string(ModuleName0, ModuleName) },
+	{ mdbcomp__prim_data__sym_name_to_string(ModuleName0, ModuleName) },
 	{ string__format("%s/%s/Memoed__%s__%i", 
 		[s(Owner), s(ModuleName), s(ProcNameStr1), i(Counter0)],
 		UniqueName) },
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.54
diff -u -r1.54 rtti.m
--- compiler/rtti.m	21 Jan 2005 06:20:47 -0000	1.54
+++ compiler/rtti.m	22 Jan 2005 04:38:25 -0000
@@ -1279,8 +1279,8 @@
 		% XXX We may wish to check that all arguments are variables.
 	),
 	RttiTypeCtor = rtti_type_ctor(ModuleName, TypeName, _CtorArity),
-	prog_out__sym_name_to_string(qualified(ModuleName, TypeName), "__",
-		TypeStr),
+	mdbcomp__prim_data__sym_name_to_string(qualified(ModuleName, 
+		TypeName), "__", TypeStr),
 	string__int_to_string(Arity, ArityStr),
 	% XXX This naming scheme is the same as for base_typeclass_infos.
 	% We should think about
Index: compiler/rtti_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti_out.m,v
retrieving revision 1.50
diff -u -r1.50 rtti_out.m
--- compiler/rtti_out.m	19 Jan 2005 03:10:54 -0000	1.50
+++ compiler/rtti_out.m	21 Jan 2005 12:34:04 -0000
@@ -227,7 +227,7 @@
 	list__length(MethodIds, NumMethodIds),
 	output_generic_rtti_data_defn_start(TCIdRttiId, !DeclSet, !IO),
 	io__write_string(" = {\n\t""", !IO),
-	prog_out__sym_name_to_string(ModuleSymName, ModuleName),
+	mdbcomp__prim_data__sym_name_to_string(ModuleSymName, ModuleName),
 	c_util__output_quoted_string(ModuleName, !IO),
 	io__write_string(""",\n\t""", !IO),
 	c_util__output_quoted_string(ClassName, !IO),
@@ -623,7 +623,7 @@
 	io__write_string(",\n\t", !IO),
 	output_static_code_addr(CompareCodeAddr, !IO),
 	io__write_string(",\n\t""", !IO),
-	prog_out__sym_name_to_string(Module, ModuleName),
+	mdbcomp__prim_data__sym_name_to_string(Module, ModuleName),
 	c_util__output_quoted_string(ModuleName, !IO),
 	io__write_string(""",\n\t""", !IO),
 	c_util__output_quoted_string(TypeName, !IO),
Index: compiler/rtti_to_mlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti_to_mlds.m,v
retrieving revision 1.57
diff -u -r1.57 rtti_to_mlds.m
--- compiler/rtti_to_mlds.m	19 Jan 2005 03:10:54 -0000	1.57
+++ compiler/rtti_to_mlds.m	22 Jan 2005 04:38:45 -0000
@@ -215,7 +215,7 @@
 	TypeCtorData = type_ctor_data(Version, TypeModule, TypeName,
 		TypeArity, UnifyUniv, CompareUniv, Flags, TypeCtorDetails),
 	RttiTypeCtor = rtti_type_ctor(TypeModule, TypeName, TypeArity),
-	prog_out__sym_name_to_string(TypeModule, TypeModuleName),
+	mdbcomp__prim_data__sym_name_to_string(TypeModule, TypeModuleName),
 	NumPtags = type_ctor_details_num_ptags(TypeCtorDetails),
 	NumFunctors = type_ctor_details_num_functors(TypeCtorDetails),
 	FunctorsRttiId = ctor_rtti_id(RttiTypeCtor, type_functors),
@@ -337,7 +337,8 @@
 		MethodIdsInit = gen_init_rtti_id(ModuleName, MethodIdsRttiId)
 	),
 	TCIdRttiId = tc_rtti_id(TCName, type_class_id),
-	prog_out__sym_name_to_string(ModuleSymName, ModuleSymNameStr),
+	mdbcomp__prim_data__sym_name_to_string(ModuleSymName, 
+		ModuleSymNameStr),
 	list__length(TVarNames, NumTVars),
 	list__length(MethodIds, NumMethods),
 	TCIdInit = init_struct(mlds__rtti_type(item_type(TCIdRttiId)), [
Index: compiler/source_file_map.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/source_file_map.m,v
retrieving revision 1.11
diff -u -r1.11 source_file_map.m
--- compiler/source_file_map.m	19 Jan 2005 03:10:55 -0000	1.11
+++ compiler/source_file_map.m	21 Jan 2005 12:34:04 -0000
@@ -55,7 +55,7 @@
 	).
 
 default_source_file(ModuleName) = BaseFileName ++ ".m" :-
-	prog_out__sym_name_to_string(ModuleName, ".", BaseFileName).
+	mdbcomp__prim_data__sym_name_to_string(ModuleName, ".", BaseFileName).
 
 have_source_file_map(HaveMap, !IO) :-
 	get_source_file_map(_, !IO),
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.76
diff -u -r1.76 table_gen.m
--- compiler/table_gen.m	21 Jan 2005 06:20:47 -0000	1.76
+++ compiler/table_gen.m	22 Jan 2005 04:39:07 -0000
@@ -2873,7 +2873,8 @@
 	Arity = pred_info_orig_arity(PredInfo),
 	PredOrFunc = pred_info_is_pred_or_func(PredInfo),
 	PredOrFuncStr = pred_or_func_to_str(PredOrFunc),
-	prog_out__sym_name_to_string(qualified(Module, Name), NameStr),
+	mdbcomp__prim_data__sym_name_to_string(qualified(Module, Name), 
+		NameStr),
 	string__int_to_string(Arity, ArityStr),
 	string__append_list([Msg, " in ", PredOrFuncStr, " ", NameStr,
 		"/", ArityStr], Message),
Index: compiler/trans_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.25
diff -u -r1.25 trans_opt.m
--- compiler/trans_opt.m	19 Jan 2005 03:10:57 -0000	1.25
+++ compiler/trans_opt.m	21 Jan 2005 12:34:04 -0000
@@ -169,7 +169,7 @@
 	maybe_write_string(VeryVerbose,
 		"% Reading transitive optimization interface for module", !IO),
 	maybe_write_string(VeryVerbose, " `", !IO),
-	prog_out__sym_name_to_string(Import, ImportString),
+	mdbcomp__prim_data__sym_name_to_string(Import, ImportString),
 	maybe_write_string(VeryVerbose, ImportString, !IO),
 	maybe_write_string(VeryVerbose, "'... ", !IO),
 	maybe_flush_output(VeryVerbose, !IO),
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.146
diff -u -r1.146 unify_gen.m
--- compiler/unify_gen.m	21 Jan 2005 06:20:49 -0000	1.146
+++ compiler/unify_gen.m	21 Jan 2005 13:36:27 -0000
@@ -63,6 +63,7 @@
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_type.
+:- import_module mdbcomp__prim_data.
 
 :- import_module term, bool, string, int, list, map, require, std_util.
 
@@ -1074,7 +1075,7 @@
 unify_gen__var_type_msg(Type, Msg) :-
 	( type_to_ctor_and_args(Type, TypeCtor, _) ->
 		TypeCtor = TypeSym - TypeArity,
-		prog_out__sym_name_to_string(TypeSym, TypeSymStr),
+		mdbcomp__prim_data__sym_name_to_string(TypeSym, TypeSymStr),
 		string__int_to_string(TypeArity, TypeArityStr),
 		string__append_list([TypeSymStr, "/", TypeArityStr], Msg)
 	;
Index: compiler/unique_modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unique_modes.m,v
retrieving revision 1.85
diff -u -r1.85 unique_modes.m
--- compiler/unique_modes.m	10 Jan 2005 05:23:42 -0000	1.85
+++ compiler/unique_modes.m	21 Jan 2005 13:30:41 -0000
@@ -77,6 +77,7 @@
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
+:- import_module mdbcomp__prim_data.
 
 :- import_module term, varset.
 :- import_module assoc_list, bag, int, list, map.
@@ -476,7 +477,7 @@
 
 unique_modes__check_goal_2(call(PredId, ProcId0, Args, Builtin, CallContext,
 		PredName), _GoalInfo0, Goal, !ModeInfo, !IO) :-
-	prog_out__sym_name_to_string(PredName, PredNameString),
+	mdbcomp__prim_data__sym_name_to_string(PredName, PredNameString),
 	string__append("call ", PredNameString, CallString),
 	mode_checkpoint(enter, CallString, !ModeInfo, !IO),
 	mode_info_get_call_id(!.ModeInfo, PredId, CallId),
Index: compiler/unused_args.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.100
diff -u -r1.100 unused_args.m
--- compiler/unused_args.m	21 Jan 2005 06:20:49 -0000	1.100
+++ compiler/unused_args.m	21 Jan 2005 12:34:04 -0000
@@ -1018,7 +1018,7 @@
 			type_util__type_ctor_arity(ModuleInfo,
 				TypeCtor, TypeArity),
 			string__int_to_string(TypeArity, TypeAr),
-			prog_out__sym_name_to_string(TypeModule,
+			mdbcomp__prim_data__sym_name_to_string(TypeModule,
 				TypeModuleString0),
 			string__replace_all(TypeModuleString0, ".", "__",
 				TypeModuleString1),
--------------------------------------------------------------------------
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