[m-rev.] for review: module to read trace counts (2)

Peter Wang wangp at students.cs.mu.OZ.AU
Fri Jan 14 17:12:03 AEDT 2005


I think the name mdbcomp__proc_id is just wrong, given what's now inside.
I can rename it easily at this point with a search & replace on the diff,
if there are suggestions.

Also, I can split the commits in two (one to introduce proc_id.m, then
another for the trace counts reader) if that would be better.


--------

For review by anyone.

Estimated hours taken: 16

This adds a module mdbcomp__trace_counts that reads in the
.mercury_trace_counts files produced by the compiler's trace mechanism.
The format of said files was slightly changed.

As the new module is to be used by the compiler and the debugger, it is
placed in the mdbcomp module.  This required bringing some types from the
compiler into a new module within mdbcomp.

browser/trace_counts.m:
	New module for reading execution trace summaries.

browser/proc_id.m:
	New module holding types and predicates moved in from the compiler.
	Types:
		pred_or_func, sym_name, module_name, proc_label,
		special_pred_id, trace_port
	Predicates:
		string_to_sym_name, insert_module_qualifier

	The mode field of proc_label is now an int instead of a proc_id
	to avoid pulling proc_id into mdbcomp.

browser/mdbcomp.m:
	Add trace_counts and proc_id to the mdbcomp module.

runtime/mercury_trace_base.c:
	In the format of .mercury_trace_counts, write module and predicate
	names now use quoted atom syntax so that names with spaces and
	non-printable characters can be machine-parsed.

compiler/:
	Many changes to account for movement of types, and the change to
	proc_label.


Index: browser/io_action.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/io_action.m,v
retrieving revision 1.5
diff -u -r1.5 io_action.m
--- browser/io_action.m	9 Aug 2004 03:05:20 -0000	1.5
+++ browser/io_action.m	14 Jan 2005 04:34:47 -0000
@@ -16,8 +16,8 @@
 
 :- interface.
 
-:- import_module mdb__util.
 :- import_module mdb__browser_term.
+:- import_module mdbcomp__proc_id.
 :- import_module list, map, std_util, io.
 
 :- type io_action
Index: browser/mdbcomp.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/mdbcomp.m,v
retrieving revision 1.1
diff -u -r1.1 mdbcomp.m
--- browser/mdbcomp.m	27 Oct 2003 06:00:32 -0000	1.1
+++ browser/mdbcomp.m	14 Jan 2005 04:09:03 -0000
@@ -20,7 +20,9 @@
 
 :- pred mdbcomp__version(string::out) is det.
 
+:- include_module proc_id.
 :- include_module program_representation.
+:- include_module trace_counts.
 
 :- implementation.
 
Index: browser/proc_id.m
===================================================================
RCS file: browser/proc_id.m
diff -N browser/proc_id.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ browser/proc_id.m	14 Jan 2005 05:07:36 -0000
@@ -0,0 +1,147 @@
+%-----------------------------------------------------------------------------%
+% Copyright (C) 2005 The University of Melbourne.
+% This file may only be copied under the terms of the GNU General
+% Public License - see the file COPYING in the Mercury distribution.
+%-----------------------------------------------------------------------------%
+%
+% File: proc_id.m.
+% Main authors: fjh, zs.
+%
+% This module contains some types and predicates that are, or are planned to 
+% be, shared between the compiler and the debugger.
+
+%-----------------------------------------------------------------------------%
+
+:- module mdbcomp__proc_id.
+
+:- interface.
+
+% was in compiler/prog_data.m
+
+% XXX: This is duplicated in browser/util.m but moving that in here means this
+% module will need to be imported into most of the debugger, which has a
+% conflicting definition of module_name.
+
+:- type pred_or_func
+	--->	predicate
+	;	function.
+
+:- type sym_name
+	--->	qualified(sym_name, string)
+	;	unqualified(string).
+
+:- type module_name == sym_name.
+
+% was in compiler/proc_label.m
+
+	% A proc_label is a data structure a backend can use to as the basis
+	% of the label used as the entry point of a procedure.
+	%
+	% The defining module is the module that provides the code for the
+	% predicate, the declaring module contains the `:- pred' declaration.
+	% When these are different, as for specialised versions of predicates
+	% from `.opt' files, the defining module's name may need to be added
+	% as a qualifier to the label.
+
+:- type proc_label
+	--->	proc(
+			module_name,	% defining module
+			pred_or_func,
+			module_name,	% declaring module
+			string,		% name
+			int,		% arity
+			int		% mode number
+		)
+	;	special_proc(
+			module_name,	% defining module
+			special_pred_id,% indirectly defines pred name
+			module_name,	% type module
+			string,		% type name
+			int,		% type arity
+			int		% mode number
+		).
+
+% was in compiler/special_pred.m
+
+:- type special_pred_id
+	--->	unify
+	;	index
+	;	compare
+	;	initialise.
+
+% was in compiler/prog_util.m
+
+	% string_to_sym_name(String, Separator, SymName):
+	%	Convert a string, possibly prefixed with
+	%	module qualifiers (separated by Separator),
+	%	into a symbol name.
+	%
+:- pred string_to_sym_name(string::in, string::in, sym_name::out) is det.
+
+	% insert_module_qualifier(ModuleName, SymName0, SymName):
+	%	prepend the specified ModuleName onto the module
+	%	qualifiers in SymName0, giving SymName.
+:- pred insert_module_qualifier(string::in, sym_name::in, sym_name::out)
+	is det.
+
+% was in compiler/trace_params.m
+
+	% The kinds of events with which MR_trace may be called, either
+	% by compiler-generated code, or by code in the standard library
+	% referring to compiler-generated data structures.
+
+% XXX: There is an equivalent but different type in browser/util.m.
+% Trying to make the debugger use this definition instead is troublesome 
+% because of the conflicting definitions of module_name.
+
+:- type trace_port
+	--->	call
+	;	exit
+	;	redo
+	;	fail
+	;	exception
+	;	ite_cond
+	;	ite_then
+	;	ite_else
+	;	neg_enter
+	;	neg_success
+	;	neg_failure
+	;	disj
+	;	switch
+	;	nondet_pragma_first
+	;	nondet_pragma_later
+	.
+
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+:- import_module int, string. 
+
+% 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,
+% and construct the resulting symbol directly.
+% Instead, we search for them left-to-right, and then call
+% insert_module_qualifier to fix things up.
+
+string_to_sym_name(String, ModuleSeparator, Result) :-
+	(
+		string__sub_string_search(String, ModuleSeparator, LeftLength),
+		LeftLength > 0
+	->
+		string__left(String, LeftLength, ModuleName),
+		string__length(String, StringLength),
+		string__length(ModuleSeparator, SeparatorLength),
+		RightLength = StringLength - LeftLength - SeparatorLength,
+		string__right(String, RightLength, Name),
+		string_to_sym_name(Name, ModuleSeparator, NameSym),
+		insert_module_qualifier(ModuleName, NameSym, Result)
+	;
+		Result = unqualified(String)
+	).
+
+insert_module_qualifier(ModuleName, unqualified(PlainName),
+		qualified(unqualified(ModuleName), PlainName)).
+insert_module_qualifier(ModuleName, qualified(ModuleQual0, PlainName),
+		qualified(ModuleQual, PlainName)) :-
+	insert_module_qualifier(ModuleName, ModuleQual0, ModuleQual).
Index: browser/trace_counts.m
===================================================================
RCS file: browser/trace_counts.m
diff -N browser/trace_counts.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ browser/trace_counts.m	14 Jan 2005 05:23:04 -0000
@@ -0,0 +1,216 @@
+%-----------------------------------------------------------------------------%
+% Copyright (C) 2005 The University of Melbourne.
+% This file may only be copied under the terms of the GNU General
+% Public License - see the file COPYING in the Mercury distribution.
+%-----------------------------------------------------------------------------%
+%
+% File: trace_counts.m.
+%
+% Author: wangp.
+%
+% This module defines a predicate to read in the execution trace summaries
+% generated by programs compiled using the compiler's tracing options.
+
+%-----------------------------------------------------------------------------%
+
+:- module mdbcomp__trace_counts.
+
+:- interface.
+
+:- import_module mdbcomp__proc_id.
+:- import_module mdbcomp__program_representation.
+
+:- import_module io, map.
+
+:- type trace_counts		== map(proc_label, proc_trace_counts).
+
+:- type proc_trace_counts	== map(path_port, int).
+
+:- type path_port
+	--->	port_only(trace_port)
+	;	path_only(goal_path)
+	;	port_and_path(trace_port, goal_path).
+
+:- type read_trace_counts_result
+	--->	ok(trace_counts)
+	;	error_message(string)
+	;	io_error(io__error).
+
+:- pred read_trace_counts(string::in, read_trace_counts_result::out,
+	io::di, io::uo) is det.
+
+%-----------------------------------------------------------------------------%
+
+:- implementation.
+
+:- import_module char, exception, int, io, lexer, list, require, std_util.
+:- import_module string, svmap.
+
+read_trace_counts(FileName, ReadResult, !IO) :-
+	io__open_input(FileName, Result, !IO),
+	(
+		Result = ok(FileStream),
+		io__set_input_stream(FileStream, OldInputStream, !IO),
+		promise_only_solution_io(read_trace_counts_2, ReadResult,
+			!IO),
+		io__set_input_stream(OldInputStream, _, !IO),
+		io__close_input(FileStream, !IO)
+	;
+		Result = error(IOError),
+		ReadResult = io_error(IOError)
+	).
+
+:- pred read_trace_counts_2(read_trace_counts_result::out, io::di, io::uo)
+	is cc_multi.
+
+read_trace_counts_2(ReadResult, !IO) :-
+	try_io(read_trace_counts_3(map__init), Result, !IO),
+	(
+		Result = succeeded(TraceCounts),
+		ReadResult = ok(TraceCounts)
+	;
+		Result = exception(Exception),
+		( Exception = univ(IOError) ->
+			ReadResult = io_error(IOError)
+		; Exception = univ(Message) ->
+			ReadResult = error_message(Message)
+		;
+			error("read_trace_counts_2: unexpected exception type")
+		)
+	;
+		Result = failed,
+		error("read_trace_counts_2: IO failure")
+	).
+
+:- pred read_trace_counts_3(trace_counts::in, trace_counts::out,
+	io::di, io::uo) is det.
+
+read_trace_counts_3(!TraceCounts, !IO) :-
+	io__get_line_number(LineNum, !IO),
+	io__read_line_as_string(Result, !IO),
+	(
+		Result = ok(Line),
+		read_proc_trace_counts(LineNum, Line, !TraceCounts, !IO)
+	;
+		Result = eof
+	;
+		Result = error(Error),
+		throw(Error)
+	).
+
+:- pred read_proc_trace_counts(int::in, string::in, trace_counts::in,
+	trace_counts::out, io::di, io::uo) is det.
+
+read_proc_trace_counts(HeaderLineNum, HeaderLine, !TraceCounts, !IO) :-
+	lexer__string_get_token_list(HeaderLine, string__length(HeaderLine),
+		TokenList, posn(HeaderLineNum, 1, 0), _),
+	(if
+		TokenList =
+			token_cons(name("proc"), _,
+			token_cons(name(PredOrFuncStr), _,
+			token_cons(name(ModuleStr), _,
+			token_cons(name(Name), _,
+			token_cons(integer(Arity), _,
+			token_cons(integer(Mode), _,
+			token_nil)))))),
+		string_to_pred_or_func(PredOrFuncStr, PredOrFunc)
+	then
+		string_to_sym_name(ModuleStr, ".", ModuleName),
+		ProcLabel = proc(ModuleName, PredOrFunc, ModuleName, Name,
+				Arity, Mode),
+		% For whatever reason some of the trace counts for a single
+		% procedure or function can be split over multiple spans.
+		% We collate them as if they appeared in a single span.
+		(if svmap__remove(ProcLabel, Probe, !TraceCounts) then
+			ProcData = Probe
+		else
+			ProcData = map__init
+		),
+		read_proc_trace_counts_2(ProcLabel, ProcData, !TraceCounts,
+			!IO)
+	else
+		string__format("parse error on line %d of execution trace",
+			[i(HeaderLineNum)], Message),
+		throw(Message)
+	).
+
+:- pred read_proc_trace_counts_2(proc_label::in, proc_trace_counts::in,
+	trace_counts::in, trace_counts::out, io::di, io::uo) is det.
+
+read_proc_trace_counts_2(ProcLabel, ProcCounts0, !TraceCounts, !IO) :-
+	io__get_line_number(LineNum, !IO),
+	io__read_line_as_string(Result, !IO),
+	(
+		Result = ok(Line),
+		(if parse_path_port_line(Line, PathPort, Count) then
+			map__det_insert(ProcCounts0, PathPort, Count,
+				ProcCounts),
+			read_proc_trace_counts_2(ProcLabel, ProcCounts,
+				!TraceCounts, !IO)
+		else
+			svmap__det_insert(ProcLabel, ProcCounts0,
+				!TraceCounts),
+			read_proc_trace_counts(LineNum, Line,
+				!TraceCounts, !IO)
+		)
+	;
+		Result = eof,
+		svmap__det_insert(ProcLabel, ProcCounts0, !TraceCounts)
+	;
+		Result = error(Error),
+		throw(Error)
+	).
+
+:- pred parse_path_port_line(string::in, path_port::out, int::out) is semidet.
+
+parse_path_port_line(Line, PathPort, Count) :-
+	Words = string__words(Line),
+	(
+		Words = [Word1, CountStr],
+		( Port = string_to_trace_port(Word1) ->
+			PathPort = port_only(Port)
+		; Path = string_to_goal_path(Word1) ->
+			PathPort = path_only(Path)
+		;
+			fail
+		),
+		string__to_int(CountStr, Count)
+	;
+		Words = [PortStr, PathStr, CountStr],
+		Port = string_to_trace_port(PortStr),
+		Path = string_to_goal_path(PathStr),
+		PathPort = port_and_path(Port, Path),
+		string__to_int(CountStr, Count)
+	).
+
+:- pred string_to_pred_or_func(string::in, pred_or_func::out) is semidet.
+
+string_to_pred_or_func("p", predicate).
+string_to_pred_or_func("f", function).
+
+:- func string_to_trace_port(string) = trace_port is semidet.
+
+string_to_trace_port("CALL") = call.
+string_to_trace_port("EXIT") = exit.
+string_to_trace_port("REDO") = redo.
+string_to_trace_port("FAIL") = fail.
+string_to_trace_port("EXCP") = exception.
+string_to_trace_port("COND") = ite_cond.
+string_to_trace_port("THEN") = ite_then.
+string_to_trace_port("ELSE") = ite_else.
+string_to_trace_port("NEGE") = neg_enter.
+string_to_trace_port("NEGS") = neg_success.
+string_to_trace_port("NEGF") = neg_failure.
+string_to_trace_port("DISJ") = disj.
+string_to_trace_port("SWTC") = switch.
+string_to_trace_port("FRST") = nondet_pragma_first.
+string_to_trace_port("LATR") = nondet_pragma_later.
+
+:- func string_to_goal_path(string) = goal_path is semidet.
+
+string_to_goal_path(String) = Path :-
+	string__prefix(String, "<"),
+	string__suffix(String, ">"),
+	string__length(String, Length),
+	string__substring(String, 1, Length-2, SubString),
+	path_from_string(SubString, Path).
Index: compiler/accumulator.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.33
diff -u -r1.33 accumulator.m
--- compiler/accumulator.m	20 Jul 2004 16:06:36 -0000	1.33
+++ compiler/accumulator.m	14 Jan 2005 03:41:15 -0000
@@ -168,6 +168,7 @@
 :- import_module hlds__quantification.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
Index: compiler/add_heap_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.14
diff -u -r1.14 add_heap_ops.m
--- compiler/add_heap_ops.m	20 Jul 2004 04:40:56 -0000	1.14
+++ compiler/add_heap_ops.m	14 Jan 2005 03:24:29 -0000
@@ -47,6 +47,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__instmap.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__modules.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
Index: compiler/add_trail_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.16
diff -u -r1.16 add_trail_ops.m
--- compiler/add_trail_ops.m	20 Jul 2004 04:40:57 -0000	1.16
+++ compiler/add_trail_ops.m	14 Jan 2005 03:24:37 -0000
@@ -46,6 +46,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__instmap.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__modules.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
Index: compiler/aditi_backend.pp
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/aditi_backend.pp,v
retrieving revision 1.7
diff -u -r1.7 aditi_backend.pp
--- compiler/aditi_backend.pp	14 Jun 2004 04:15:56 -0000	1.7
+++ compiler/aditi_backend.pp	11 Jan 2005 06:18:11 -0000
@@ -79,6 +79,7 @@
 :- import_module parse_tree.
 :- import_module libs.
 :- import_module backend_libs.
+:- import_module mdbcomp.
 
 :- end_module aditi_backend.
 
Index: compiler/aditi_builtin_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/aditi_builtin_ops.m,v
retrieving revision 1.11
diff -u -r1.11 aditi_builtin_ops.m
--- compiler/aditi_builtin_ops.m	22 Oct 2004 08:59:44 -0000	1.11
+++ compiler/aditi_builtin_ops.m	13 Jan 2005 06:24:46 -0000
@@ -41,6 +41,7 @@
 :- import_module hlds__instmap.
 :- import_module hlds__passes_aux.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
Index: compiler/assertion.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/assertion.m,v
retrieving revision 1.30
diff -u -r1.30 assertion.m
--- compiler/assertion.m	10 Dec 2004 00:45:44 -0000	1.30
+++ compiler/assertion.m	13 Jan 2005 05:33:11 -0000
@@ -148,6 +148,7 @@
 :- import_module hlds__hlds_out.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
Index: compiler/backend_libs.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/backend_libs.m,v
retrieving revision 1.7
diff -u -r1.7 backend_libs.m
--- compiler/backend_libs.m	23 Mar 2004 10:52:00 -0000	1.7
+++ compiler/backend_libs.m	13 Jan 2005 05:44:02 -0000
@@ -35,6 +35,7 @@
 
 :- import_module check_hlds. 		% needed for type_util, mode_util
 :- import_module libs.
+:- import_module mdbcomp.
 
 :- end_module backend_libs.
 
Index: compiler/base_typeclass_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/base_typeclass_info.m,v
retrieving revision 1.30
diff -u -r1.30 base_typeclass_info.m
--- compiler/base_typeclass_info.m	14 Jul 2004 05:37:05 -0000	1.30
+++ compiler/base_typeclass_info.m	13 Jan 2005 06:29:30 -0000
@@ -40,6 +40,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_out.
Index: compiler/basic_block.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/basic_block.m,v
retrieving revision 1.17
diff -u -r1.17 basic_block.m
--- compiler/basic_block.m	14 Jun 2004 04:15:56 -0000	1.17
+++ compiler/basic_block.m	13 Jan 2005 05:40:37 -0000
@@ -17,8 +17,8 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, map, std_util, counter.
 
Index: compiler/builtin_ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/builtin_ops.m,v
retrieving revision 1.15
diff -u -r1.15 builtin_ops.m
--- compiler/builtin_ops.m	20 May 2004 22:18:30 -0000	1.15
+++ compiler/builtin_ops.m	13 Jan 2005 05:31:25 -0000
@@ -18,7 +18,7 @@
 :- interface.
 
 :- import_module hlds__hlds_pred.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list.
 
Index: compiler/bytecode.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode.m,v
retrieving revision 1.56
diff -u -r1.56 bytecode.m
--- compiler/bytecode.m	30 Jun 2004 02:47:55 -0000	1.56
+++ compiler/bytecode.m	13 Jan 2005 05:27:16 -0000
@@ -17,6 +17,7 @@
 :- import_module backend_libs__builtin_ops.
 :- import_module hlds__hlds_data.
 :- import_module libs__tree.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module char, list, std_util, io.
Index: compiler/bytecode_backend.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode_backend.m,v
retrieving revision 1.3
diff -u -r1.3 bytecode_backend.m
--- compiler/bytecode_backend.m	30 Jun 2004 02:47:56 -0000	1.3
+++ compiler/bytecode_backend.m	13 Jan 2005 05:39:23 -0000
@@ -16,6 +16,7 @@
 :- import_module check_hlds. 		% for type_util and mode_util
 :- import_module hlds.
 :- import_module libs.
+:- import_module mdbcomp.
 :- import_module parse_tree.
 
 %-----------------------------------------------------------------------------%
Index: compiler/bytecode_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode_gen.m,v
retrieving revision 1.84
diff -u -r1.84 bytecode_gen.m
--- compiler/bytecode_gen.m	30 Jun 2004 02:47:56 -0000	1.84
+++ compiler/bytecode_gen.m	14 Jan 2005 03:04:35 -0000
@@ -52,6 +52,7 @@
 :- import_module libs__globals.
 :- import_module libs__tree.
 :- import_module ll_backend__call_gen.	% XXX for arg passing convention
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
Index: compiler/c_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/c_util.m,v
retrieving revision 1.21
diff -u -r1.21 c_util.m
--- compiler/c_util.m	30 Jun 2004 02:47:57 -0000	1.21
+++ compiler/c_util.m	13 Jan 2005 05:31:36 -0000
@@ -21,7 +21,7 @@
 :- import_module aditi_backend.
 :- import_module aditi_backend__rl_file.
 :- import_module backend_libs__builtin_ops.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 :- import_module io, char, string, int, std_util.
 
 %-----------------------------------------------------------------------------%
Index: compiler/check_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_hlds.m,v
retrieving revision 1.6
diff -u -r1.6 check_hlds.m
--- compiler/check_hlds.m	20 Dec 2004 01:15:36 -0000	1.6
+++ compiler/check_hlds.m	13 Jan 2005 05:20:15 -0000
@@ -12,6 +12,7 @@
 :- interface.
 
 :- import_module hlds.
+:- import_module mdbcomp.
 :- import_module parse_tree.
 
 % :- import_module check_hlds__type_analysis.
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.58
diff -u -r1.58 check_typeclass.m
--- compiler/check_typeclass.m	20 May 2004 22:18:30 -0000	1.58
+++ compiler/check_typeclass.m	13 Jan 2005 05:32:48 -0000
@@ -69,6 +69,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_data.
Index: compiler/clause_to_proc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/clause_to_proc.m,v
retrieving revision 1.43
diff -u -r1.43 clause_to_proc.m
--- compiler/clause_to_proc.m	16 Jun 2004 03:44:41 -0000	1.43
+++ compiler/clause_to_proc.m	14 Jan 2005 03:04:45 -0000
@@ -54,6 +54,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__make_hlds.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
 
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.131
diff -u -r1.131 code_gen.m
--- compiler/code_gen.m	19 Nov 2004 05:46:07 -0000	1.131
+++ compiler/code_gen.m	14 Jan 2005 03:07:46 -0000
@@ -106,6 +106,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__trace_params.
+:- import_module mdbcomp__proc_id.
 
 % Standard library modules
 :- import_module bool, char, int, string.
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.294
diff -u -r1.294 code_info.m
--- compiler/code_info.m	19 Nov 2004 05:46:07 -0000	1.294
+++ compiler/code_info.m	14 Jan 2005 05:36:34 -0000
@@ -29,7 +29,6 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module hlds__code_model.
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_goal.
@@ -38,22 +37,24 @@
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
 :- import_module libs__globals.
-:- import_module libs__trace_params.
 :- import_module ll_backend__continuation_info.
 :- import_module ll_backend__global_data.
 :- import_module ll_backend__llds.
 :- import_module ll_backend__trace.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, set, list, map, std_util, assoc_list, counter, term.
 
 :- implementation.
 
+:- import_module backend_libs__proc_label.
 :- import_module check_hlds__mode_util.
 :- import_module check_hlds__type_util.
 :- import_module hlds__arg_info.
 :- import_module hlds__hlds_code_util.
 :- import_module libs__options.
+:- import_module libs__trace_params.
 :- import_module libs__tree.
 :- import_module ll_backend__code_util.
 :- import_module ll_backend__exprn_aux.
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.153
diff -u -r1.153 code_util.m
--- compiler/code_util.m	14 Jun 2004 04:15:58 -0000	1.153
+++ compiler/code_util.m	14 Jan 2005 03:18:14 -0000
@@ -17,12 +17,12 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_llds.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, assoc_list, std_util.
@@ -97,6 +97,7 @@
 :- implementation.
 
 :- import_module backend_libs__builtin_ops.
+:- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
 :- import_module hlds__code_model.
 :- import_module hlds__special_pred.
Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.63
diff -u -r1.63 compile_target_code.m
--- compiler/compile_target_code.m	14 Oct 2004 02:15:49 -0000	1.63
+++ compiler/compile_target_code.m	13 Jan 2005 05:31:46 -0000
@@ -14,10 +14,10 @@
 
 :- interface.
 
-:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__modules.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 
 :- import_module bool, list, io, std_util.
 
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.25
diff -u -r1.25 const_prop.m
--- compiler/const_prop.m	14 Jun 2004 04:15:59 -0000	1.25
+++ compiler/const_prop.m	14 Jan 2005 03:41:40 -0000
@@ -61,6 +61,7 @@
 :- import_module hlds__quantification.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, int, float, map, require, string.
Index: compiler/context.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/context.m,v
retrieving revision 1.9
diff -u -r1.9 context.m
--- compiler/context.m	14 Jun 2004 04:15:59 -0000	1.9
+++ compiler/context.m	13 Jan 2005 06:22:36 -0000
@@ -55,6 +55,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_module.
 :- import_module hlds__instmap.
+:- import_module mdbcomp__proc_id.
 
 :- import_module assoc_list, bool, map, require, set, std_util, term, varset.
 
Index: compiler/continuation_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/continuation_info.m,v
retrieving revision 1.55
diff -u -r1.55 continuation_info.m
--- compiler/continuation_info.m	19 Nov 2004 05:46:08 -0000	1.55
+++ compiler/continuation_info.m	14 Jan 2005 05:21:58 -0000
@@ -61,6 +61,7 @@
 :- import_module ll_backend__layout.
 :- import_module ll_backend__llds.
 :- import_module ll_backend__trace.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, std_util, list, assoc_list, set, map.
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.92
diff -u -r1.92 dead_proc_elim.m
--- compiler/dead_proc_elim.m	14 Jun 2004 04:16:00 -0000	1.92
+++ compiler/dead_proc_elim.m	14 Jan 2005 03:42:05 -0000
@@ -22,7 +22,7 @@
 
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module map, std_util, io.
 
@@ -69,6 +69,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module parse_tree__error_util.
+:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
 
 :- import_module int, string, list, set, queue, bool, require.
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.29
diff -u -r1.29 deep_profiling.m
--- compiler/deep_profiling.m	22 Oct 2004 07:52:17 -0000	1.29
+++ compiler/deep_profiling.m	14 Jan 2005 03:19:07 -0000
@@ -38,6 +38,7 @@
 :- import_module libs__options.
 :- import_module ll_backend__code_util.
 :- import_module ll_backend__trace.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
 :- import_module transform_hlds.
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.41
diff -u -r1.41 deforest.m
--- compiler/deforest.m	10 Jan 2005 05:23:38 -0000	1.41
+++ compiler/deforest.m	14 Jan 2005 03:41:24 -0000
@@ -64,6 +64,7 @@
 :- import_module hlds__quantification.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
Index: compiler/dependency_graph.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dependency_graph.m,v
retrieving revision 1.73
diff -u -r1.73 dependency_graph.m
--- compiler/dependency_graph.m	30 Jun 2004 02:47:58 -0000	1.73
+++ compiler/dependency_graph.m	14 Jan 2005 03:42:33 -0000
@@ -107,6 +107,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_data.
 
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.93
diff -u -r1.93 det_report.m
--- compiler/det_report.m	6 Jan 2005 04:30:54 -0000	1.93
+++ compiler/det_report.m	14 Jan 2005 03:05:05 -0000
@@ -144,6 +144,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_mode.
Index: compiler/dupelim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dupelim.m,v
retrieving revision 1.61
diff -u -r1.61 dupelim.m
--- compiler/dupelim.m	7 Jun 2004 09:06:37 -0000	1.61
+++ compiler/dupelim.m	13 Jan 2005 05:40:55 -0000
@@ -43,8 +43,8 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, counter.
 
Index: compiler/equiv_type.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/equiv_type.m,v
retrieving revision 1.40
diff -u -r1.40 equiv_type.m
--- compiler/equiv_type.m	5 Sep 2004 23:52:02 -0000	1.40
+++ compiler/equiv_type.m	13 Jan 2005 05:14:49 -0000
@@ -13,6 +13,7 @@
 :- module parse_tree__equiv_type.
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module recompilation.
 
Index: compiler/equiv_type_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/equiv_type_hlds.m,v
retrieving revision 1.7
diff -u -r1.7 equiv_type_hlds.m
--- compiler/equiv_type_hlds.m	5 Sep 2004 23:52:03 -0000	1.7
+++ compiler/equiv_type_hlds.m	14 Jan 2005 03:42:42 -0000
@@ -32,6 +32,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__instmap.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__equiv_type.
 :- import_module parse_tree__prog_data.
 :- import_module recompilation.
Index: compiler/error_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/error_util.m,v
retrieving revision 1.29
diff -u -r1.29 error_util.m
--- compiler/error_util.m	8 Dec 2004 05:39:13 -0000	1.29
+++ compiler/error_util.m	13 Jan 2005 05:14:56 -0000
@@ -35,6 +35,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, char, io, list, std_util.
Index: compiler/exception_analysis.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/exception_analysis.m,v
retrieving revision 1.2
diff -u -r1.2 exception_analysis.m
--- compiler/exception_analysis.m	10 Dec 2004 07:03:43 -0000	1.2
+++ compiler/exception_analysis.m	14 Jan 2005 03:42:50 -0000
@@ -105,6 +105,7 @@
 :- import_module hlds.special_pred.
 :- import_module libs.globals.
 :- import_module libs.options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree.error_util.
 :- import_module parse_tree.mercury_to_mercury.
 :- import_module parse_tree.modules.
Index: compiler/export.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.81
diff -u -r1.81 export.m
--- compiler/export.m	6 Jan 2005 04:30:54 -0000	1.81
+++ compiler/export.m	13 Jan 2005 05:25:51 -0000
@@ -20,6 +20,7 @@
 
 :- import_module backend_libs__foreign.
 :- import_module hlds__hlds_module.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module io.
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.56
diff -u -r1.56 fact_table.m
--- compiler/fact_table.m	7 Jul 2004 07:11:03 -0000	1.56
+++ compiler/fact_table.m	13 Jan 2005 05:13:47 -0000
@@ -50,6 +50,7 @@
 
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module io, list.
Index: compiler/foreign.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/foreign.m,v
retrieving revision 1.42
diff -u -r1.42 foreign.m
--- compiler/foreign.m	5 Sep 2004 23:52:03 -0000	1.42
+++ compiler/foreign.m	13 Jan 2005 05:11:17 -0000
@@ -22,6 +22,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, std_util, string, term.
Index: compiler/frameopt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/frameopt.m,v
retrieving revision 1.87
diff -u -r1.87 frameopt.m
--- compiler/frameopt.m	14 Jun 2004 04:16:03 -0000	1.87
+++ compiler/frameopt.m	13 Jan 2005 05:41:05 -0000
@@ -91,8 +91,8 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module bool, list, set, counter.
 
Index: compiler/global_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/global_data.m,v
retrieving revision 1.6
diff -u -r1.6 global_data.m
--- compiler/global_data.m	14 Jun 2004 04:16:04 -0000	1.6
+++ compiler/global_data.m	14 Jan 2005 04:54:15 -0000
@@ -18,7 +18,7 @@
 :- import_module ll_backend__continuation_info.
 :- import_module ll_backend__exprn_aux.
 :- import_module ll_backend__llds.
-:- import_module parse_tree__prog_data. % for module_name
+:- import_module mdbcomp__proc_id. % for module_name
 
 :- import_module bool, list.
 
Index: compiler/globals.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/globals.m,v
retrieving revision 1.62
diff -u -r1.62 globals.m
--- compiler/globals.m	20 Jul 2004 04:40:58 -0000	1.62
+++ compiler/globals.m	14 Jan 2005 04:54:31 -0000
@@ -19,8 +19,8 @@
 
 :- import_module libs__options.
 :- import_module libs__trace_params.
-:- import_module parse_tree.
-:- import_module parse_tree__prog_data. % for module_name.
+:- import_module mdbcomp.
+:- import_module mdbcomp__proc_id. % for module_name
 
 :- import_module bool, getopt, list, map, io, std_util.
 
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.100
diff -u -r1.100 goal_util.m
--- compiler/goal_util.m	10 Jan 2005 05:23:38 -0000	1.100
+++ compiler/goal_util.m	13 Jan 2005 05:13:11 -0000
@@ -18,6 +18,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module assoc_list, bool, list, set, map, term.
Index: compiler/higher_order.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.120
diff -u -r1.120 higher_order.m
--- compiler/higher_order.m	16 Jun 2004 03:44:42 -0000	1.120
+++ compiler/higher_order.m	13 Jan 2005 05:47:20 -0000
@@ -51,6 +51,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
Index: compiler/hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds.m,v
retrieving revision 1.215
diff -u -r1.215 hlds.m
--- compiler/hlds.m	20 Dec 2004 01:15:37 -0000	1.215
+++ compiler/hlds.m	13 Jan 2005 05:21:48 -0000
@@ -10,6 +10,7 @@
 
 :- module hlds.
 :- interface.
+:- import_module mdbcomp.
 :- import_module parse_tree.
 
 %-----------------------------------------------------------------------------%
Index: compiler/hlds_code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_code_util.m,v
retrieving revision 1.12
diff -u -r1.12 hlds_code_util.m
--- compiler/hlds_code_util.m	14 Jun 2004 04:16:05 -0000	1.12
+++ compiler/hlds_code_util.m	14 Jan 2005 03:07:04 -0000
@@ -43,6 +43,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_out.
 
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.88
diff -u -r1.88 hlds_data.m
--- compiler/hlds_data.m	5 Sep 2004 23:52:04 -0000	1.88
+++ compiler/hlds_data.m	13 Jan 2005 05:08:42 -0000
@@ -14,6 +14,7 @@
 :- interface.
 
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, map, std_util.
Index: compiler/hlds_error_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_error_util.m,v
retrieving revision 1.4
diff -u -r1.4 hlds_error_util.m
--- compiler/hlds_error_util.m	14 Jun 2004 04:16:06 -0000	1.4
+++ compiler/hlds_error_util.m	14 Jan 2005 03:07:18 -0000
@@ -58,6 +58,7 @@
 :- implementation.
 
 :- import_module check_hlds__mode_util.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.121
diff -u -r1.121 hlds_goal.m
--- compiler/hlds_goal.m	10 Jan 2005 05:23:39 -0000	1.121
+++ compiler/hlds_goal.m	13 Jan 2005 05:09:06 -0000
@@ -16,6 +16,7 @@
 :- import_module hlds__hlds_llds.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, char, list, set, std_util.
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.104
diff -u -r1.104 hlds_module.m
--- compiler/hlds_module.m	20 Oct 2004 09:44:57 -0000	1.104
+++ compiler/hlds_module.m	13 Jan 2005 05:24:59 -0000
@@ -29,6 +29,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__module_qual.
 :- import_module parse_tree__prog_data.
 :- import_module recompilation.
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.340
diff -u -r1.340 hlds_out.m
--- compiler/hlds_out.m	7 Jan 2005 02:31:16 -0000	1.340
+++ compiler/hlds_out.m	13 Jan 2005 05:13:31 -0000
@@ -42,6 +42,8 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
+% mdbcomp modules.
+:- import_module mdbcomp__proc_id.
 
 :- import_module io, bool, list, term.
 
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.153
diff -u -r1.153 hlds_pred.m
--- compiler/hlds_pred.m	20 Dec 2004 01:15:38 -0000	1.153
+++ compiler/hlds_pred.m	13 Jan 2005 05:25:13 -0000
@@ -24,6 +24,7 @@
 :- import_module hlds__special_pred.
 :- import_module hlds__instmap.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module transform_hlds__term_util.
 
Index: compiler/inlining.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.118
diff -u -r1.118 inlining.m
--- compiler/inlining.m	7 Jun 2004 09:06:44 -0000	1.118
+++ compiler/inlining.m	14 Jan 2005 03:42:58 -0000
@@ -160,6 +160,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__trace_params.
+:- import_module mdbcomp__proc_id.
 
 % Standard library modules
 :- import_module bool, int, list, assoc_list, set, std_util, require.
Index: compiler/inst_match.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inst_match.m,v
retrieving revision 1.60
diff -u -r1.60 inst_match.m
--- compiler/inst_match.m	23 Dec 2004 06:49:15 -0000	1.60
+++ compiler/inst_match.m	14 Jan 2005 03:05:16 -0000
@@ -306,6 +306,7 @@
 :- import_module check_hlds__mode_util.
 :- import_module check_hlds__type_util.
 :- import_module hlds__hlds_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, set, svset, map, term, std_util, require, bool.
Index: compiler/inst_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inst_util.m,v
retrieving revision 1.33
diff -u -r1.33 inst_util.m
--- compiler/inst_util.m	13 Jan 2005 02:44:39 -0000	1.33
+++ compiler/inst_util.m	14 Jan 2005 03:05:27 -0000
@@ -139,6 +139,7 @@
 :- import_module check_hlds__mode_util.
 :- import_module check_hlds__type_util.
 :- import_module hlds__hlds_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_mode.
 
 :- import_module bool, int, std_util, require, list, set, svset, map, svmap.
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.163
diff -u -r1.163 intermod.m
--- compiler/intermod.m	5 Nov 2004 05:39:03 -0000	1.163
+++ compiler/intermod.m	13 Jan 2005 05:52:16 -0000
@@ -100,6 +100,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__modules.
 :- import_module parse_tree__prog_data.
Index: compiler/jumpopt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/jumpopt.m,v
retrieving revision 1.72
diff -u -r1.72 jumpopt.m
--- compiler/jumpopt.m	7 Jun 2004 09:06:46 -0000	1.72
+++ compiler/jumpopt.m	13 Jan 2005 05:41:32 -0000
@@ -14,8 +14,8 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, set, bool, counter.
 
Index: compiler/lambda.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/lambda.m,v
retrieving revision 1.92
diff -u -r1.92 lambda.m
--- compiler/lambda.m	19 Jul 2004 03:37:45 -0000	1.92
+++ compiler/lambda.m	13 Jan 2005 05:47:51 -0000
@@ -100,6 +100,7 @@
 % Misc
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 
 % Standard library modules
 :- import_module list, map, set.
Index: compiler/layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout.m,v
retrieving revision 1.16
diff -u -r1.16 layout.m
--- compiler/layout.m	19 Nov 2004 05:46:08 -0000	1.16
+++ compiler/layout.m	13 Jan 2005 05:41:38 -0000
@@ -32,10 +32,10 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module hlds__hlds_pred.
 :- import_module libs__trace_params.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, std_util, list, assoc_list.
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.38
diff -u -r1.38 layout_out.m
--- compiler/layout_out.m	19 Nov 2004 05:46:09 -0000	1.38
+++ compiler/layout_out.m	14 Jan 2005 03:53:51 -0000
@@ -21,11 +21,10 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__layout.
 :- import_module ll_backend__llds.
 :- import_module ll_backend__llds_out.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module bool, io.
 
@@ -86,6 +85,7 @@
 
 :- import_module backend_libs__c_util.
 :- import_module backend_libs__name_mangle.
+:- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_pred.
@@ -94,6 +94,7 @@
 :- import_module libs__options.
 :- import_module libs__trace_params.
 :- import_module ll_backend__code_util.
+:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 
 :- import_module int, char, string, require, std_util, list.
@@ -1029,7 +1030,6 @@
 			DefiningModuleStr) },
 		{ prog_out__sym_name_to_string(DeclaringModule,
 			DeclaringModuleStr) },
-		{ proc_id_to_int(Mode, ModeInt) },
 		output_pred_or_func(PredOrFunc),
 		io__write_string(",\n"),
 		quote_and_write_string(DeclaringModuleStr),
@@ -1040,7 +1040,7 @@
 		io__write_string(",\n"),
 		io__write_int(Arity),
 		io__write_string(",\n"),
-		io__write_int(ModeInt),
+		io__write_int(Mode),
 		io__write_string("\n")
 	;
 		{ ProcLabel = special_proc(DefiningModule, SpecialPredId,
@@ -1048,7 +1048,6 @@
 		{ prog_out__sym_name_to_string(DefiningModule,
 			DefiningModuleStr) },
 		{ prog_out__sym_name_to_string(TypeModule, TypeModuleStr) },
-		{ proc_id_to_int(Mode, ModeInt) },
 		quote_and_write_string(TypeName),
 		io__write_string(",\n"),
 		quote_and_write_string(TypeModuleStr),
@@ -1061,7 +1060,7 @@
 		io__write_string(",\n"),
 		io__write_int(TypeArity),
 		io__write_string(",\n"),
-		io__write_int(ModeInt),
+		io__write_int(Mode),
 		io__write_string("\n")
 	).
 
Index: compiler/ll_backend.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ll_backend.m,v
retrieving revision 1.7
diff -u -r1.7 ll_backend.m
--- compiler/ll_backend.m	23 Mar 2004 10:52:05 -0000	1.7
+++ compiler/ll_backend.m	13 Jan 2005 05:28:46 -0000
@@ -12,6 +12,7 @@
 
 :- import_module aditi_backend.		% XXX for rl_file, used in llds_out.
 :- import_module hlds.
+:- import_module mdbcomp.
 :- import_module parse_tree.
 
 %-----------------------------------------------------------------------------%
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.308
diff -u -r1.308 llds.m
--- compiler/llds.m	9 Dec 2004 02:02:22 -0000	1.308
+++ compiler/llds.m	13 Jan 2005 05:41:59 -0000
@@ -18,7 +18,6 @@
 
 :- import_module backend_libs__builtin_ops.
 :- import_module backend_libs__foreign.
-:- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
 :- import_module hlds__code_model.
 :- import_module hlds__hlds_goal.
@@ -26,6 +25,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__tree.
 :- import_module ll_backend__layout.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, assoc_list, map, set, std_util, counter, term.
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.241
diff -u -r1.241 llds_out.m
--- compiler/llds_out.m	9 Dec 2004 02:02:22 -0000	1.241
+++ compiler/llds_out.m	14 Jan 2005 03:37:24 -0000
@@ -21,7 +21,7 @@
 :- import_module backend_libs__builtin_ops.
 :- import_module libs__globals.
 :- import_module ll_backend__llds.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module bool, std_util, list, map, io.
 
@@ -179,6 +179,7 @@
 :- import_module ll_backend__rtti_out.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__modules.
+:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
 
@@ -1815,8 +1816,9 @@
 	bintree_set__init(ContLabelSet),
 	DummyModule = unqualified("DEBUG"),
 	DummyPredName = "DEBUG",
+	proc_id_to_int(hlds_pred__initial_proc_id, InitialProcIdInt),
 	ProcLabel = proc(DummyModule, predicate, DummyModule,
-		DummyPredName, 0, hlds_pred__initial_proc_id),
+		DummyPredName, 0, InitialProcIdInt),
 	ProfInfo = entry(local, ProcLabel) - ContLabelSet,
 	output_instruction_and_comment(Instr, Comment, PrintComments,
 		ProfInfo, !IO).
@@ -1828,8 +1830,9 @@
 	bintree_set__init(ContLabelSet),
 	DummyModule = unqualified("DEBUG"),
 	DummyPredName = "DEBUG",
+	proc_id_to_int(hlds_pred__initial_proc_id, InitialProcIdInt),
 	ProcLabel = proc(DummyModule, predicate, DummyModule,
-		DummyPredName, 0, hlds_pred__initial_proc_id),
+		DummyPredName, 0, InitialProcIdInt),
 	ProfInfo = entry(local, ProcLabel) - ContLabelSet,
 	output_instruction(Instr, ProfInfo, !IO).
 
Index: compiler/loop_inv.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/loop_inv.m,v
retrieving revision 1.13
diff -u -r1.13 loop_inv.m
--- compiler/loop_inv.m	21 Sep 2004 04:25:33 -0000	1.13
+++ compiler/loop_inv.m	14 Jan 2005 03:43:10 -0000
@@ -128,6 +128,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__instmap.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
Index: compiler/magic.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic.m,v
retrieving revision 1.47
diff -u -r1.47 magic.m
--- compiler/magic.m	30 Jun 2004 02:48:03 -0000	1.47
+++ compiler/magic.m	13 Jan 2005 06:23:05 -0000
@@ -192,6 +192,7 @@
 :- import_module libs__options.
 :- import_module ll_backend.
 :- import_module ll_backend__saved_vars.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
Index: compiler/magic_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/magic_util.m,v
retrieving revision 1.41
diff -u -r1.41 magic_util.m
--- compiler/magic_util.m	5 Sep 2004 23:52:15 -0000	1.41
+++ compiler/magic_util.m	13 Jan 2005 05:11:11 -0000
@@ -17,6 +17,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, io, list, map, set, std_util, term.
Index: compiler/make.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.m,v
retrieving revision 1.22
diff -u -r1.22 make.m
--- compiler/make.m	30 Jun 2004 02:48:04 -0000	1.22
+++ compiler/make.m	13 Jan 2005 05:30:39 -0000
@@ -23,6 +23,8 @@
 :- include_module make__util.
 
 :- import_module make__options_file.
+:- import_module mdbcomp.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree.
 :- import_module parse_tree__modules.
 :- import_module parse_tree__prog_io.
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.490
diff -u -r1.490 make_hlds.m
--- compiler/make_hlds.m	6 Jan 2005 04:30:53 -0000	1.490
+++ compiler/make_hlds.m	14 Jan 2005 04:57:22 -0000
@@ -25,7 +25,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
-:- import_module hlds__special_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__equiv_type.
 :- import_module parse_tree__module_qual.
 :- import_module parse_tree__prog_data.
@@ -115,6 +115,7 @@
 :- import_module hlds__make_tags.
 :- import_module hlds__passes_aux.
 :- import_module hlds__quantification.
+:- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module ll_backend.
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.318
diff -u -r1.318 mercury_compile.m
--- compiler/mercury_compile.m	23 Dec 2004 06:49:16 -0000	1.318
+++ compiler/mercury_compile.m	13 Jan 2005 05:46:40 -0000
@@ -151,6 +151,7 @@
 :- import_module make.
 :- import_module make__options_file.
 :- import_module make__util.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_data.
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.249
diff -u -r1.249 mercury_to_mercury.m
--- compiler/mercury_to_mercury.m	16 Oct 2004 15:07:30 -0000	1.249
+++ compiler/mercury_to_mercury.m	13 Jan 2005 05:15:03 -0000
@@ -43,6 +43,7 @@
 :- interface.
 
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, char, std_util, list, io, varset, term.
Index: compiler/ml_backend.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_backend.m,v
retrieving revision 1.7
diff -u -r1.7 ml_backend.m
--- compiler/ml_backend.m	23 Mar 2004 10:52:07 -0000	1.7
+++ compiler/ml_backend.m	13 Jan 2005 05:43:38 -0000
@@ -79,6 +79,7 @@
 :- import_module backend_libs.
 :- import_module libs.
 :- import_module check_hlds.	 % is this needed?
+:- import_module mdbcomp.
 :- import_module transform_hlds. % is this needed?
 :- import_module aditi_backend. % need aditi_backend.rl_file
 
Index: compiler/ml_call_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_call_gen.m,v
retrieving revision 1.48
diff -u -r1.48 ml_call_gen.m
--- compiler/ml_call_gen.m	30 Aug 2004 05:44:37 -0000	1.48
+++ compiler/ml_call_gen.m	14 Jan 2005 03:24:46 -0000
@@ -129,6 +129,7 @@
 :- import_module hlds__hlds_module.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_closure_gen.
 :- import_module parse_tree__error_util.
 
Index: compiler/ml_closure_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_closure_gen.m,v
retrieving revision 1.29
diff -u -r1.29 ml_closure_gen.m
--- compiler/ml_closure_gen.m	2 Aug 2004 08:30:06 -0000	1.29
+++ compiler/ml_closure_gen.m	14 Jan 2005 03:24:57 -0000
@@ -86,6 +86,7 @@
 :- import_module hlds__hlds_module.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 
 % XXX The following modules depend on the LLDS,
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.145
diff -u -r1.145 ml_code_gen.m
--- compiler/ml_code_gen.m	5 Sep 2004 23:52:21 -0000	1.145
+++ compiler/ml_code_gen.m	14 Jan 2005 03:25:07 -0000
@@ -790,6 +790,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_call_gen.
 :- import_module ml_backend__ml_code_util.
 :- import_module ml_backend__ml_switch_gen.
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.85
diff -u -r1.85 ml_code_util.m
--- compiler/ml_code_util.m	30 Aug 2004 05:44:38 -0000	1.85
+++ compiler/ml_code_util.m	13 Jan 2005 05:14:12 -0000
@@ -20,6 +20,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__mlds.
 :- import_module parse_tree__prog_data.
 
Index: compiler/ml_elim_nested.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_elim_nested.m,v
retrieving revision 1.66
diff -u -r1.66 ml_elim_nested.m
--- compiler/ml_elim_nested.m	2 Aug 2004 08:30:06 -0000	1.66
+++ compiler/ml_elim_nested.m	14 Jan 2005 03:25:25 -0000
@@ -461,6 +461,7 @@
 
 % the following imports are needed for mangling pred names
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 
Index: compiler/ml_optimize.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_optimize.m,v
retrieving revision 1.27
diff -u -r1.27 ml_optimize.m
--- compiler/ml_optimize.m	2 Aug 2004 08:30:06 -0000	1.27
+++ compiler/ml_optimize.m	14 Jan 2005 03:25:37 -0000
@@ -45,6 +45,7 @@
 :- import_module backend_libs__builtin_ops.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_code_util.
 :- import_module ml_backend__ml_util.
 :- import_module parse_tree__error_util.
Index: compiler/ml_tailcall.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_tailcall.m,v
retrieving revision 1.23
diff -u -r1.23 ml_tailcall.m
--- compiler/ml_tailcall.m	2 Aug 2004 08:30:06 -0000	1.23
+++ compiler/ml_tailcall.m	14 Jan 2005 03:25:45 -0000
@@ -78,6 +78,7 @@
 
 :- import_module hlds__hlds_out.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_util.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
Index: compiler/ml_type_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_type_gen.m,v
retrieving revision 1.38
diff -u -r1.38 ml_type_gen.m
--- compiler/ml_type_gen.m	5 Sep 2004 23:52:23 -0000	1.38
+++ compiler/ml_type_gen.m	14 Jan 2005 03:25:53 -0000
@@ -82,6 +82,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_code_util.
 :- import_module ml_backend__ml_util.
 :- import_module parse_tree__error_util.
Index: compiler/ml_unify_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_unify_gen.m,v
retrieving revision 1.78
diff -u -r1.78 ml_unify_gen.m
--- compiler/ml_unify_gen.m	5 Sep 2004 23:52:24 -0000	1.78
+++ compiler/ml_unify_gen.m	14 Jan 2005 03:26:00 -0000
@@ -93,6 +93,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_call_gen.
 :- import_module ml_backend__ml_closure_gen.
 :- import_module ml_backend__ml_code_gen.
Index: compiler/ml_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_util.m,v
retrieving revision 1.32
diff -u -r1.32 ml_util.m
--- compiler/ml_util.m	14 Dec 2004 01:07:14 -0000	1.32
+++ compiler/ml_util.m	14 Jan 2005 03:26:11 -0000
@@ -149,6 +149,7 @@
 
 :- import_module backend_libs__rtti.
 :- import_module check_hlds__type_util.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_util.
 
Index: compiler/mlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds.m,v
retrieving revision 1.116
diff -u -r1.116 mlds.m
--- compiler/mlds.m	16 Nov 2004 00:45:10 -0000	1.116
+++ compiler/mlds.m	13 Jan 2005 05:53:48 -0000
@@ -336,13 +336,14 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, std_util, map.
 
 %-----------------------------------------------------------------------------%
 
-:- type mercury_module_name == prog_data__module_name.
+:- type mercury_module_name == proc_id__module_name.
 
 %
 % The type `mlds' is the actual MLDS.
@@ -1871,11 +1872,11 @@
 % prefix e.g. `mercury.builtin', `mercury.io', `mercury.std_util', etc.,
 % when mapped to MLDS package names.
 
-% :- type mlds_module_name == prog_data__module_name.
+% :- type mlds_module_name == proc_id__module_name.
 :- type mlds_module_name
 	---> name(
-		package_name	:: prog_data__module_name,
-		module_name	:: prog_data__module_name
+		package_name	:: proc_id__module_name,
+		module_name	:: proc_id__module_name
 	).
 
 mercury_module_and_package_name_to_mlds(MLDS_Package, MercuryModule)
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.166
diff -u -r1.166 mlds_to_c.m
--- compiler/mlds_to_c.m	2 Aug 2004 08:30:07 -0000	1.166
+++ compiler/mlds_to_c.m	14 Jan 2005 03:26:19 -0000
@@ -74,6 +74,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_code_util.
 				% for ml_gen_public_field_decl_flags, which is
 				% used by the code that handles derived classes
Index: compiler/mlds_to_gcc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.100
diff -u -r1.100 mlds_to_gcc.m
--- compiler/mlds_to_gcc.m	14 Dec 2004 01:07:14 -0000	1.100
+++ compiler/mlds_to_gcc.m	14 Jan 2005 03:58:27 -0000
@@ -168,6 +168,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_code_util.% for ml_gen_public_field_decl_flags,
 				% which is used by the code that handles
 				% derived classes
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.142
diff -u -r1.142 mlds_to_il.m
--- compiler/mlds_to_il.m	2 Aug 2004 08:30:08 -0000	1.142
+++ compiler/mlds_to_il.m	14 Jan 2005 03:26:27 -0000
@@ -146,6 +146,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__tree.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__il_peephole.
 :- import_module ml_backend__ml_code_util.
 :- import_module ml_backend__ml_type_gen.
Index: compiler/mlds_to_java.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_java.m,v
retrieving revision 1.61
diff -u -r1.61 mlds_to_java.m
--- compiler/mlds_to_java.m	2 Aug 2004 08:30:08 -0000	1.61
+++ compiler/mlds_to_java.m	13 Jan 2005 05:51:40 -0000
@@ -101,6 +101,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__java_util.
 :- import_module ml_backend__ml_code_util. % for ml_gen_local_var_decl_flags.
 :- import_module ml_backend__ml_type_gen.	% for ml_gen_type_name
Index: compiler/mlds_to_managed.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_managed.m,v
retrieving revision 1.14
diff -u -r1.14 mlds_to_managed.m
--- compiler/mlds_to_managed.m	2 Aug 2004 08:30:08 -0000	1.14
+++ compiler/mlds_to_managed.m	14 Jan 2005 03:26:35 -0000
@@ -49,6 +49,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__tree.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ilasm.
 :- import_module ml_backend__ilds.
 :- import_module ml_backend__il_peephole.
Index: compiler/mmc_analysis.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mmc_analysis.m,v
retrieving revision 1.4
diff -u -r1.4 mmc_analysis.m
--- compiler/mmc_analysis.m	14 Jun 2004 04:16:21 -0000	1.4
+++ compiler/mmc_analysis.m	13 Jan 2005 05:16:29 -0000
@@ -16,6 +16,7 @@
 
 :- import_module analysis.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- type mmc ---> mmc.
Index: compiler/mode_constraints.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_constraints.m,v
retrieving revision 1.3
diff -u -r1.3 mode_constraints.m
--- compiler/mode_constraints.m	20 Dec 2004 12:46:32 -0000	1.3
+++ compiler/mode_constraints.m	14 Jan 2005 03:05:39 -0000
@@ -35,6 +35,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module mode_robdd.
 % :- import_module mode_robdd__check.
 % :- import_module mode_robdd__tfeir.
Index: compiler/mode_errors.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_errors.m,v
retrieving revision 1.82
diff -u -r1.82 mode_errors.m
--- compiler/mode_errors.m	23 Dec 2004 06:49:16 -0000	1.82
+++ compiler/mode_errors.m	13 Jan 2005 05:12:08 -0000
@@ -20,6 +20,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_goal.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module check_hlds__mode_info.
 
Index: compiler/mode_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_info.m,v
retrieving revision 1.68
diff -u -r1.68 mode_info.m
--- compiler/mode_info.m	10 Jan 2005 05:23:40 -0000	1.68
+++ compiler/mode_info.m	13 Jan 2005 05:12:21 -0000
@@ -23,6 +23,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module map, list, set, bag, bool, assoc_list, std_util.
Index: compiler/mode_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_util.m,v
retrieving revision 1.161
diff -u -r1.161 mode_util.m
--- compiler/mode_util.m	10 Jan 2005 05:23:40 -0000	1.161
+++ compiler/mode_util.m	14 Jan 2005 03:05:50 -0000
@@ -158,6 +158,7 @@
 :- import_module check_hlds__mode_info.
 :- import_module check_hlds__type_util.
 :- import_module hlds__hlds_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_util.
Index: compiler/modecheck_call.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modecheck_call.m,v
retrieving revision 1.55
diff -u -r1.55 modecheck_call.m
--- compiler/modecheck_call.m	23 Dec 2004 04:52:24 -0000	1.55
+++ compiler/modecheck_call.m	13 Jan 2005 05:12:32 -0000
@@ -26,6 +26,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, std_util.
Index: compiler/modecheck_unify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.72
diff -u -r1.72 modecheck_unify.m
--- compiler/modecheck_unify.m	13 Jan 2005 02:44:39 -0000	1.72
+++ compiler/modecheck_unify.m	14 Jan 2005 03:06:00 -0000
@@ -61,6 +61,7 @@
 :- import_module hlds__instmap.
 :- import_module hlds__make_hlds.
 :- import_module hlds__quantification.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__module_qual.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
Index: compiler/modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.288
diff -u -r1.288 modes.m
--- compiler/modes.m	10 Jan 2005 05:23:40 -0000	1.288
+++ compiler/modes.m	14 Jan 2005 03:06:11 -0000
@@ -358,6 +358,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__module_qual.
 :- import_module parse_tree__prog_mode.
Index: compiler/module_qual.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/module_qual.m,v
retrieving revision 1.94
diff -u -r1.94 module_qual.m
--- compiler/module_qual.m	16 Oct 2004 15:07:31 -0000	1.94
+++ compiler/module_qual.m	13 Jan 2005 05:15:12 -0000
@@ -19,6 +19,7 @@
 %
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module recompilation.
 
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.311
diff -u -r1.311 modules.m
--- compiler/modules.m	5 Dec 2004 17:31:32 -0000	1.311
+++ compiler/modules.m	13 Jan 2005 05:15:21 -0000
@@ -43,6 +43,7 @@
 
 :- import_module libs__globals.
 :- import_module libs__timestamp.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io.
 
Index: compiler/name_mangle.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/name_mangle.m,v
retrieving revision 1.9
diff -u -r1.9 name_mangle.m
--- compiler/name_mangle.m	5 Sep 2004 23:52:35 -0000	1.9
+++ compiler/name_mangle.m	13 Jan 2005 06:31:39 -0000
@@ -20,9 +20,8 @@
 :- module backend_libs__name_mangle.
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module io, bool, string.
 
@@ -109,6 +108,7 @@
 
 :- import_module hlds__hlds_pred.
 :- import_module hlds__special_pred.
+:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
 
 :- import_module char, int, list, std_util.
@@ -123,7 +123,7 @@
 	io__write_string(ProcLabelString, !IO).
 
 proc_label_to_c_string(proc(DefiningModule, PredOrFunc, PredModule,
-		PredName, Arity, ModeNum0), AddPrefix) = ProcLabelString :-
+		PredName, Arity, ModeInt), AddPrefix) = ProcLabelString :-
 	LabelName = make_pred_or_func_name(DefiningModule, PredOrFunc,
 		PredModule, PredName, Arity, AddPrefix),
 	( PredOrFunc = function ->
@@ -132,7 +132,6 @@
 		OrigArity = Arity
 	),
 	string__int_to_string(OrigArity, ArityString),
-	proc_id_to_int(ModeNum0, ModeInt),
 	string__int_to_string(ModeInt, ModeNumString),
 	string__append_list([LabelName, "_", ArityString, "_", ModeNumString],
 		ProcLabelString).
@@ -140,7 +139,7 @@
 	% For a special proc, output a label of the form:
 	% mercury____<PredName>___<TypeModule>__<TypeName>_<TypeArity>_<Mode>
 proc_label_to_c_string(special_proc(Module, SpecialPredId, TypeModule,
-		TypeName, TypeArity, ModeNum0), AddPrefix) = ProcLabelString :-
+		TypeName, TypeArity, ModeInt), AddPrefix) = ProcLabelString :-
 	% figure out the LabelName
 	DummyArity = -1,	% not used by make_pred_or_func_name.
 	TypeCtor = qualified(TypeModule, TypeName) - TypeArity,
@@ -150,7 +149,6 @@
 
 	% figure out the ModeNumString
 	string__int_to_string(TypeArity, TypeArityString),
-	proc_id_to_int(ModeNum0, ModeInt),
 	string__int_to_string(ModeInt, ModeNumString),
 
 	% mangle all the relevent names
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.145
diff -u -r1.145 opt_debug.m
--- compiler/opt_debug.m	20 Oct 2004 09:44:58 -0000	1.145
+++ compiler/opt_debug.m	14 Jan 2005 03:38:03 -0000
@@ -15,12 +15,12 @@
 :- interface.
 
 :- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__proc_label.
 :- import_module backend_libs__rtti.
 :- import_module hlds__code_model.
 :- import_module ll_backend__layout.
 :- import_module ll_backend__livemap.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module io, bool, list, assoc_list, std_util.
 
@@ -100,6 +100,7 @@
 :- implementation.
 
 :- import_module backend_libs__name_mangle.
+:- import_module backend_libs__proc_label.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
@@ -655,7 +656,7 @@
 	dump_proclabel(ProcLabel, Str).
 
 dump_proclabel(proc(Module, _PredOrFunc, PredModule,
-		PredName, Arity, ProcId), Str) :-
+		PredName, Arity, Mode), Str) :-
 	( Module = PredModule ->
 		ExtraModule = ""
 	;
@@ -664,17 +665,15 @@
 	),
 	ModuleName = sym_name_mangle(Module),
 	string__int_to_string(Arity, A_str),
-	proc_id_to_int(ProcId, Mode),
 	string__int_to_string(Mode, M_str),
 	string__append_list([ExtraModule, ModuleName, "_", PredName,
 		"_", A_str, "_", M_str], Str).
 dump_proclabel(special_proc(Module, SpecialPredId, TypeModule,
-		TypeName, TypeArity, ProcId), Str) :-
+		TypeName, TypeArity, Mode), Str) :-
 	ModuleName = sym_name_mangle(Module),
 	TypeModuleName = sym_name_mangle(TypeModule),
 	QualTypeName = qualify_name(TypeModuleName, TypeName),
 	string__int_to_string(TypeArity, A_str),
-	proc_id_to_int(ProcId, Mode),
 	string__int_to_string(Mode, M_str),
 	TypeCtor = qualified(TypeModule, TypeName) - TypeArity,
 	SpecialPredStr = special_pred_name(SpecialPredId, TypeCtor),
Index: compiler/opt_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/opt_util.m,v
retrieving revision 1.127
diff -u -r1.127 opt_util.m
--- compiler/opt_util.m	9 Dec 2004 02:02:23 -0000	1.127
+++ compiler/opt_util.m	14 Jan 2005 03:38:30 -0000
@@ -294,6 +294,7 @@
 :- import_module hlds__special_pred.
 :- import_module ll_backend__exprn_aux.
 :- import_module ll_backend__llds_out.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module int, string, set, require.
@@ -1438,15 +1439,13 @@
 
 :- pred format_proclabel(proc_label::in, string::out) is det.
 
-format_proclabel(proc(_Module, _PredOrFunc, _, Name, Arity, ProcId), Str) :-
+format_proclabel(proc(_Module, _PredOrFunc, _, Name, Arity, Mode), Str) :-
 	string__int_to_string(Arity, ArityStr),
-	proc_id_to_int(ProcId, Mode),
 	string__int_to_string(Mode, ModeStr),
 	string__append_list([Name, "/", ArityStr, " mode ", ModeStr], Str).
 format_proclabel(special_proc(_Module, SpecialPredId, TypeModule,
-		TypeName, TypeArity, ProcId), Str) :-
+		TypeName, TypeArity, Mode), Str) :-
 	string__int_to_string(TypeArity, TypeArityStr),
-	proc_id_to_int(ProcId, Mode),
 	string__int_to_string(Mode, ModeStr),
 	TypeCtor = qualified(TypeModule, TypeName) - TypeArity,
 	PredName = special_pred_name(SpecialPredId, TypeCtor),
Index: compiler/optimize.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/optimize.m,v
retrieving revision 1.43
diff -u -r1.43 optimize.m
--- compiler/optimize.m	14 Jun 2004 04:16:25 -0000	1.43
+++ compiler/optimize.m	14 Jan 2005 03:23:48 -0000
@@ -48,6 +48,7 @@
 :- import_module ll_backend__reassign.
 :- import_module ll_backend__use_local_vars.
 :- import_module ll_backend__wrap_blocks.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_out.
 
 :- import_module bool, int, string.
Index: compiler/options_file.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options_file.m,v
retrieving revision 1.23
diff -u -r1.23 options_file.m
--- compiler/options_file.m	30 Jun 2004 02:48:08 -0000	1.23
+++ compiler/options_file.m	13 Jan 2005 05:43:05 -0000
@@ -14,7 +14,7 @@
 
 :- interface.
 
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, io, std_util.
 
Index: compiler/parse_tree.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/parse_tree.m,v
retrieving revision 1.7
diff -u -r1.7 parse_tree.m
--- compiler/parse_tree.m	14 Jun 2004 04:16:26 -0000	1.7
+++ compiler/parse_tree.m	13 Jan 2005 05:21:06 -0000
@@ -16,6 +16,7 @@
 
 :- import_module libs.
 :- import_module backend_libs. % XXX for `foreign'
+:- import_module mdbcomp.
 :- import_module recompilation.
 
 % The parse tree data type itself.
Index: compiler/passes_aux.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/passes_aux.m,v
retrieving revision 1.64
diff -u -r1.64 passes_aux.m
--- compiler/passes_aux.m	23 Dec 2004 06:49:18 -0000	1.64
+++ compiler/passes_aux.m	13 Jan 2005 05:10:21 -0000
@@ -15,6 +15,7 @@
 
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module io, std_util, list, bool.
Index: compiler/pd_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pd_info.m,v
retrieving revision 1.15
diff -u -r1.15 pd_info.m
--- compiler/pd_info.m	2 Sep 2004 23:49:33 -0000	1.15
+++ compiler/pd_info.m	14 Jan 2005 03:43:35 -0000
@@ -106,6 +106,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
 :- import_module transform_hlds__pd_debug.
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.256
diff -u -r1.256 polymorphism.m
--- compiler/polymorphism.m	23 Dec 2004 06:49:18 -0000	1.256
+++ compiler/polymorphism.m	14 Jan 2005 03:15:05 -0000
@@ -164,7 +164,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
-:- import_module hlds__special_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module io, list, term, map, std_util.
@@ -371,8 +371,10 @@
 :- import_module hlds__instmap.
 :- import_module hlds__passes_aux.
 :- import_module hlds__quantification.
+:- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_out.
Index: compiler/post_typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/post_typecheck.m,v
retrieving revision 1.66
diff -u -r1.66 post_typecheck.m
--- compiler/post_typecheck.m	23 Dec 2004 06:49:19 -0000	1.66
+++ compiler/post_typecheck.m	13 Jan 2005 05:12:41 -0000
@@ -34,6 +34,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, io, bool, std_util, term.
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.71
diff -u -r1.71 pragma_c_gen.m
--- compiler/pragma_c_gen.m	9 Dec 2004 02:02:23 -0000	1.71
+++ compiler/pragma_c_gen.m	13 Jan 2005 05:36:50 -0000
@@ -26,6 +26,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module ll_backend__code_info.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list.
Index: compiler/proc_label.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/proc_label.m,v
retrieving revision 1.7
diff -u -r1.7 proc_label.m
--- compiler/proc_label.m	14 Jun 2004 04:16:28 -0000	1.7
+++ compiler/proc_label.m	14 Jan 2005 00:51:43 -0000
@@ -20,38 +20,11 @@
 
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
-:- import_module hlds__special_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool.
 
-	% A proc_label is a data structure a backend can use to as the basis
-	% of the label used as the entry point of a procedure.
-	%
-	% The defining module is the module that provides the code for the
-	% predicate, the declaring module contains the `:- pred' declaration.
-	% When these are different, as for specialised versions of predicates
-	% from `.opt' files, the defining module's name may need to be added
-	% as a qualifier to the label.
-
-:- type proc_label
-	--->	proc(
-			module_name,	% defining module
-			pred_or_func,
-			module_name,	% declaring module
-			string,		% name
-			int,		% arity
-			proc_id		% mode number
-		)
-	;	special_proc(
-			module_name,	% defining module
-			special_pred_id,% indirectly defines pred name
-			module_name,	% type module
-			string,		% type name
-			int,		% type arity
-			proc_id		% mode number
-		).
-
 	% Return the id of the procedure specified by the rtti_proc_label.
 
 :- func make_proc_label_from_rtti(rtti_proc_label) = proc_label.
@@ -113,8 +86,9 @@
 			;
 				DefiningModule = TypeModule
 			),
+			proc_id_to_int(ProcId, ProcIdInt),
 			ProcLabel = special_proc(DefiningModule, SpecialPred,
-				TypeModule, TypeName, TypeArity, ProcId)
+				TypeModule, TypeName, TypeArity, ProcIdInt)
 		;
 			string__append_list(["make_proc_label:\n",
 				"cannot make label for special pred `",
@@ -144,8 +118,9 @@
 	;
 		DefiningModule = PredModule
 	),
+	proc_id_to_int(ProcId, ProcIdInt),
 	ProcLabel = proc(DefiningModule, PredOrFunc,
-		PredModule, PredName, PredArity, ProcId).
+		PredModule, PredName, PredArity, ProcIdInt).
 
 make_uni_label(ModuleInfo, TypeCtor, UniModeNum) = ProcLabel :-
 	module_info_name(ModuleInfo, ModuleName),
@@ -155,8 +130,9 @@
 		;
 			Module = ModuleName
 		),
+		proc_id_to_int(UniModeNum, UniModeNumInt),
 		ProcLabel = special_proc(Module, unify, TypeModule,
-			TypeName, Arity, UniModeNum)
+			TypeName, Arity, UniModeNumInt)
 	;
 		error("make_uni_label: unqualified type_ctor")
 	).
Index: compiler/prog_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.117
diff -u -r1.117 prog_data.m
--- compiler/prog_data.m	10 Dec 2004 07:03:42 -0000	1.117
+++ compiler/prog_data.m	14 Jan 2005 04:59:45 -0000
@@ -20,6 +20,7 @@
 
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module recompilation.
 
 :- import_module bool, list, assoc_list, map, set, varset, term, std_util.
@@ -173,10 +174,6 @@
 	--->	type_only(type)
 	;	type_and_mode(type, mode).
 
-:- type pred_or_func
-	--->	predicate
-	;	function.
-
 	% Purity indicates whether a goal can have side effects or can
 	% depend on global state.  See purity.m and the "Purity" section
 	% of the Mercury language reference manual.
@@ -1637,14 +1634,10 @@
 :- type sym_name_specifier
 	--->	name(sym_name)
 	;	name_arity(sym_name, arity).
-:- type sym_name
-	--->	unqualified(string)
-	;	qualified(module_specifier, string).
 :- type sym_name_and_arity
 	--->	sym_name / arity.
 
 :- type module_specifier ==	sym_name.
-:- type module_name 	== 	sym_name.
 :- type arity		==	int.
 
 	% Describes whether an item can be used without an
Index: compiler/prog_io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io.m,v
retrieving revision 1.232
diff -u -r1.232 prog_io.m
--- compiler/prog_io.m	23 Dec 2004 06:49:19 -0000	1.232
+++ compiler/prog_io.m	13 Jan 2005 05:15:32 -0000
@@ -56,6 +56,7 @@
 :- interface.
 
 :- import_module libs__timestamp.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io_util.
 
Index: compiler/prog_io_dcg.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_dcg.m,v
retrieving revision 1.26
diff -u -r1.26 prog_io_dcg.m
--- compiler/prog_io_dcg.m	23 Dec 2004 06:49:19 -0000	1.26
+++ compiler/prog_io_dcg.m	13 Jan 2005 05:54:50 -0000
@@ -19,6 +19,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io_util.
 :- import_module varset, term.
Index: compiler/prog_io_goal.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_goal.m,v
retrieving revision 1.29
diff -u -r1.29 prog_io_goal.m
--- compiler/prog_io_goal.m	23 Dec 2004 06:49:20 -0000	1.29
+++ compiler/prog_io_goal.m	14 Jan 2005 03:26:58 -0000
@@ -93,6 +93,7 @@
 
 :- implementation.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_io_util.
 :- import_module parse_tree__prog_mode.
Index: compiler/prog_io_pragma.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
retrieving revision 1.76
diff -u -r1.76 prog_io_pragma.m
--- compiler/prog_io_pragma.m	23 Dec 2004 06:49:20 -0000	1.76
+++ compiler/prog_io_pragma.m	13 Jan 2005 05:15:39 -0000
@@ -15,6 +15,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io_util.
 
Index: compiler/prog_io_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_typeclass.m,v
retrieving revision 1.31
diff -u -r1.31 prog_io_typeclass.m
--- compiler/prog_io_typeclass.m	23 Dec 2004 06:49:20 -0000	1.31
+++ compiler/prog_io_typeclass.m	13 Jan 2005 05:51:52 -0000
@@ -14,6 +14,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io_util.
 
Index: compiler/prog_io_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_util.m,v
retrieving revision 1.31
diff -u -r1.31 prog_io_util.m
--- compiler/prog_io_util.m	23 Dec 2004 06:49:20 -0000	1.31
+++ compiler/prog_io_util.m	13 Jan 2005 05:15:53 -0000
@@ -23,6 +23,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, map, std_util, term.
Index: compiler/prog_mode.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_mode.m,v
retrieving revision 1.2
diff -u -r1.2 prog_mode.m
--- compiler/prog_mode.m	5 Sep 2004 23:52:42 -0000	1.2
+++ compiler/prog_mode.m	14 Jan 2005 03:40:48 -0000
@@ -122,6 +122,7 @@
 
 :- implementation.
 
+:- import_module mdbcomp__proc_id. 
 :- import_module parse_tree__prog_util.
 
 :- import_module map, set, require, std_util, varset, term.
Index: compiler/prog_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_out.m,v
retrieving revision 1.53
diff -u -r1.53 prog_out.m
--- compiler/prog_out.m	20 Jul 2004 04:41:05 -0000	1.53
+++ compiler/prog_out.m	13 Jan 2005 05:10:36 -0000
@@ -19,6 +19,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, io.
Index: compiler/prog_rep.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.28
diff -u -r1.28 prog_rep.m
--- compiler/prog_rep.m	24 Nov 2004 05:18:48 -0000	1.28
+++ compiler/prog_rep.m	14 Jan 2005 03:23:58 -0000
@@ -47,6 +47,7 @@
 :- implementation.
 
 :- import_module hlds__hlds_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
 
Index: compiler/prog_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_util.m,v
retrieving revision 1.69
diff -u -r1.69 prog_util.m
--- compiler/prog_util.m	5 Sep 2004 23:52:43 -0000	1.69
+++ compiler/prog_util.m	14 Jan 2005 04:18:07 -0000
@@ -13,6 +13,7 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module std_util, list, varset, term.
@@ -93,13 +94,6 @@
 :- pred sym_name_get_module_name(sym_name::in, module_name::in,
 	module_name::out) is det.
 
-	% string_to_sym_name(String, Separator, SymName):
-	%	Convert a string, possibly prefixed with
-	%	module qualifiers (separated by Separator),
-	%	into a symbol name.
-	%
-:- pred string_to_sym_name(string::in, string::in, sym_name::out) is det.
-
 	% match_sym_name(PartialSymName, CompleteSymName):
 	%	succeeds iff there is some sequence of module qualifiers
 	%	which when prefixed to PartialSymName gives CompleteSymName.
@@ -139,12 +133,6 @@
 	%	TransformFunc to the unqualified part of SymName0.
 :- func transform_sym_base_name(func(string) = string, sym_name) = sym_name.
 
-	% insert_module_qualifier(ModuleName, SymName0, SymName):
-	%	prepend the specified ModuleName onto the module
-	%	qualifiers in SymName0, giving SymName.
-:- pred insert_module_qualifier(string::in, sym_name::in, sym_name::out)
-	is det.
-
 	% Given a possible module qualified sym_name and a list of
 	% argument types and a context, construct a term. This is
 	% used to construct types.
@@ -467,36 +455,6 @@
 		Var = Var0
 	),
 	prog_util__rename_in_vars(OldVar, NewVar, Vars0, Vars).
-
-%-----------------------------------------------------------------------------%
-
-% 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,
-% and construct the resulting symbol directly.
-% Instead, we search for them left-to-right, and then call
-% insert_module_qualifier to fix things up.
-
-string_to_sym_name(String, ModuleSeparator, Result) :-
-	(
-		string__sub_string_search(String, ModuleSeparator, LeftLength),
-		LeftLength > 0
-	->
-		string__left(String, LeftLength, ModuleName),
-		string__length(String, StringLength),
-		string__length(ModuleSeparator, SeparatorLength),
-		RightLength = StringLength - LeftLength - SeparatorLength,
-		string__right(String, RightLength, Name),
-		string_to_sym_name(Name, ModuleSeparator, NameSym),
-		insert_module_qualifier(ModuleName, NameSym, Result)
-	;
-		Result = unqualified(String)
-	).
-
-insert_module_qualifier(ModuleName, unqualified(PlainName),
-		qualified(unqualified(ModuleName), PlainName)).
-insert_module_qualifier(ModuleName, qualified(ModuleQual0, PlainName),
-		qualified(ModuleQual, PlainName)) :-
-	insert_module_qualifier(ModuleName, ModuleQual0, ModuleQual).
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/pseudo_type_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pseudo_type_info.m,v
retrieving revision 1.13
diff -u -r1.13 pseudo_type_info.m
--- compiler/pseudo_type_info.m	23 Oct 2003 02:02:09 -0000	1.13
+++ compiler/pseudo_type_info.m	14 Jan 2005 01:26:26 -0000
@@ -61,6 +61,7 @@
 :- implementation.
 
 :- import_module check_hlds__type_util.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_util.
 
 :- import_module int, list, term, std_util, require.
Index: compiler/purity.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.67
diff -u -r1.67 purity.m
--- compiler/purity.m	5 Sep 2004 23:52:43 -0000	1.67
+++ compiler/purity.m	14 Jan 2005 03:06:30 -0000
@@ -175,6 +175,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__module_qual.
Index: compiler/recompilation.check.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation.check.m,v
retrieving revision 1.10
diff -u -r1.10 recompilation.check.m
--- compiler/recompilation.check.m	23 Dec 2004 06:49:20 -0000	1.10
+++ compiler/recompilation.check.m	13 Jan 2005 05:56:46 -0000
@@ -12,8 +12,8 @@
 
 :- interface.
 
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__modules.
-:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io.
 
 :- import_module list, io.
Index: compiler/recompilation.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/recompilation.m,v
retrieving revision 1.10
diff -u -r1.10 recompilation.m
--- compiler/recompilation.m	23 Dec 2004 06:49:20 -0000	1.10
+++ compiler/recompilation.m	13 Jan 2005 05:55:12 -0000
@@ -27,9 +27,11 @@
 :- import_module check_hlds.
 :- import_module hlds.
 :- import_module libs.
+:- import_module mdbcomp.
 :- import_module parse_tree.
 
 :- import_module libs__timestamp.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module io, map, set, std_util, term.
Index: compiler/rl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl.m,v
retrieving revision 1.29
diff -u -r1.29 rl.m
--- compiler/rl.m	16 Oct 2004 15:05:51 -0000	1.29
+++ compiler/rl.m	13 Jan 2005 05:07:28 -0000
@@ -21,6 +21,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__instmap.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module assoc_list, list, std_util, map, set.
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.43
diff -u -r1.43 rl_exprn.m
--- compiler/rl_exprn.m	20 Oct 2004 09:44:59 -0000	1.43
+++ compiler/rl_exprn.m	13 Jan 2005 06:26:17 -0000
@@ -149,6 +149,7 @@
 :- import_module libs__tree.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_out.
 :- import_module parse_tree__prog_util.
 :- import_module transform_hlds__inlining.
Index: compiler/rl_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_gen.m,v
retrieving revision 1.16
diff -u -r1.16 rl_gen.m
--- compiler/rl_gen.m	14 Jun 2004 04:16:34 -0000	1.16
+++ compiler/rl_gen.m	13 Jan 2005 06:27:56 -0000
@@ -41,6 +41,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__tree.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module transform_hlds__dependency_graph.
Index: compiler/rl_key.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_key.m,v
retrieving revision 1.18
diff -u -r1.18 rl_key.m
--- compiler/rl_key.m	14 Jun 2004 04:16:34 -0000	1.18
+++ compiler/rl_key.m	13 Jan 2005 06:28:40 -0000
@@ -59,6 +59,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__special_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_util.
 
 :- import_module assoc_list, bool, int, require, set, std_util.
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.52
diff -u -r1.52 rtti.m
--- compiler/rtti.m	14 Dec 2004 01:07:15 -0000	1.52
+++ compiler/rtti.m	13 Jan 2005 05:11:50 -0000
@@ -27,6 +27,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, list, set, map, std_util.
Index: compiler/rtti_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti_out.m,v
retrieving revision 1.49
diff -u -r1.49 rtti_out.m
--- compiler/rtti_out.m	20 Oct 2004 09:44:59 -0000	1.49
+++ compiler/rtti_out.m	14 Jan 2005 03:24:09 -0000
@@ -93,6 +93,7 @@
 :- import_module ll_backend__code_util.
 :- import_module ll_backend__layout_out.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
Index: compiler/rtti_to_mlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti_to_mlds.m,v
retrieving revision 1.56
diff -u -r1.56 rtti_to_mlds.m
--- compiler/rtti_to_mlds.m	20 Oct 2004 09:44:59 -0000	1.56
+++ compiler/rtti_to_mlds.m	14 Jan 2005 03:26:45 -0000
@@ -55,6 +55,7 @@
 :- import_module hlds__code_model.
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module ml_backend__ml_closure_gen.
 :- import_module ml_backend__ml_code_util.
 :- import_module ml_backend__ml_unify_gen.
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.134
diff -u -r1.134 simplify.m
--- compiler/simplify.m	10 Jan 2005 05:23:41 -0000	1.134
+++ compiler/simplify.m	14 Jan 2005 03:06:41 -0000
@@ -97,6 +97,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__options.
 :- import_module libs__trace_params.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
 :- import_module parse_tree__prog_util.
Index: compiler/size_prof.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/size_prof.m,v
retrieving revision 1.10
diff -u -r1.10 size_prof.m
--- compiler/size_prof.m	13 Jan 2005 07:09:24 -0000	1.10
+++ compiler/size_prof.m	14 Jan 2005 04:01:42 -0000
@@ -115,6 +115,7 @@
 :- import_module hlds__quantification.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module check_hlds__mode_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_util.
Index: compiler/source_file_map.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/source_file_map.m,v
retrieving revision 1.10
diff -u -r1.10 source_file_map.m
--- compiler/source_file_map.m	30 Jun 2004 02:48:13 -0000	1.10
+++ compiler/source_file_map.m	13 Jan 2005 05:52:01 -0000
@@ -13,7 +13,7 @@
 
 :- interface.
 
-:- import_module parse_tree__prog_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 
 :- import_module bool, io, list.
Index: compiler/special_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/special_pred.m,v
retrieving revision 1.46
diff -u -r1.46 special_pred.m
--- compiler/special_pred.m	5 Sep 2004 23:52:45 -0000	1.46
+++ compiler/special_pred.m	13 Jan 2005 05:53:10 -0000
@@ -19,6 +19,7 @@
 :- import_module hlds__hlds_data.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, map, std_util.
@@ -26,12 +27,6 @@
 :- type special_pred_map	==	map(special_pred, pred_id).
 
 :- type special_pred		==	pair(special_pred_id, type_ctor).
-
-:- type special_pred_id
-	--->	unify
-	;	index
-	;	compare
-	;	initialise.
 
 	% Return the predicate name we should use for the given special_pred
 	% for the given type constructor.
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.97
diff -u -r1.97 stack_layout.m
--- compiler/stack_layout.m	24 Nov 2004 05:18:49 -0000	1.97
+++ compiler/stack_layout.m	13 Jan 2005 05:42:38 -0000
@@ -27,11 +27,11 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module hlds__hlds_module.
 :- import_module ll_backend__continuation_info.
 :- import_module ll_backend__global_data.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module list, assoc_list, map.
Index: compiler/stratify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stratify.m,v
retrieving revision 1.34
diff -u -r1.34 stratify.m
--- compiler/stratify.m	30 Jun 2004 02:48:16 -0000	1.34
+++ compiler/stratify.m	14 Jan 2005 03:06:48 -0000
@@ -55,6 +55,7 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
 :- import_module transform_hlds__dependency_graph.
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.72
diff -u -r1.72 table_gen.m
--- compiler/table_gen.m	10 Jan 2005 05:30:24 -0000	1.72
+++ compiler/table_gen.m	14 Jan 2005 03:43:52 -0000
@@ -72,6 +72,7 @@
 :- import_module libs__options.
 :- import_module ll_backend.
 :- import_module ll_backend__continuation_info.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_mode.
Index: compiler/termination.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.44
diff -u -r1.44 termination.m
--- compiler/termination.m	5 Sep 2004 23:52:46 -0000	1.44
+++ compiler/termination.m	14 Jan 2005 03:44:01 -0000
@@ -78,6 +78,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__modules.
Index: compiler/trace.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trace.m,v
retrieving revision 1.69
diff -u -r1.69 trace.m
--- compiler/trace.m	19 Nov 2004 05:46:10 -0000	1.69
+++ compiler/trace.m	14 Jan 2005 05:37:09 -0000
@@ -225,6 +225,7 @@
 :- import_module ll_backend__continuation_info.
 :- import_module ll_backend__layout_out.
 :- import_module ll_backend__llds_out.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, bool, int, string, map, std_util, require, term, varset.
 
Index: compiler/trace_params.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trace_params.m,v
retrieving revision 1.20
diff -u -r1.20 trace_params.m
--- compiler/trace_params.m	6 Dec 2004 01:35:14 -0000	1.20
+++ compiler/trace_params.m	14 Jan 2005 05:08:12 -0000
@@ -37,32 +37,13 @@
 
 :- import_module hlds.
 :- import_module hlds__hlds_pred.
+:- import_module mdbcomp__proc_id.
 
 :- import_module bool, std_util.
 
 :- type trace_level.
 :- type trace_suppress_items.
 
-	% The kinds of events with which MR_trace may be called, either
-	% by compiler-generated code, or by code in the standard library
-	% referring to compiler-generated data structures.
-:- type trace_port
-	--->	call
-	;	exit
-	;	fail
-	;	redo
-	;	exception
-	;	ite_cond
-	;	ite_then
-	;	ite_else
-	;	neg_enter
-	;	neg_success
-	;	neg_failure
-	;	switch
-	;	disj
-	;	nondet_pragma_first
-	;	nondet_pragma_later.
-
 	% The string should be the value of the --trace-level option;
 	% two bools should be the values of the `--require-tracing' and
 	% `--decl-debug' grade options.
@@ -124,6 +105,8 @@
 :- implementation.
 
 :- import_module hlds__special_pred.
+:- import_module mdbcomp.
+:- import_module mdbcomp__proc_id.
 
 :- import_module int, char, string, list, set.
 
Index: compiler/trans_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.24
diff -u -r1.24 trans_opt.m
--- compiler/trans_opt.m	16 Oct 2004 15:07:33 -0000	1.24
+++ compiler/trans_opt.m	14 Jan 2005 03:59:51 -0000
@@ -52,8 +52,8 @@
 :- interface.
 
 :- import_module hlds__hlds_module.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__modules.
-:- import_module parse_tree__prog_data.
 
 :- import_module io, bool, list.
 
@@ -75,7 +75,9 @@
 :- import_module hlds__passes_aux.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
+:- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_out.
 :- import_module transform_hlds__intermod.
Index: compiler/transform_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/transform_hlds.m,v
retrieving revision 1.11
diff -u -r1.11 transform_hlds.m
--- compiler/transform_hlds.m	16 Oct 2004 15:07:33 -0000	1.11
+++ compiler/transform_hlds.m	13 Jan 2005 05:02:04 -0000
@@ -14,6 +14,7 @@
 :- import_module hlds.
 :- import_module parse_tree.
 :- import_module libs.
+:- import_module mdbcomp.
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/transform_llds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/transform_llds.m,v
retrieving revision 1.13
diff -u -r1.13 transform_llds.m
--- compiler/transform_llds.m	23 May 2004 23:14:35 -0000	1.13
+++ compiler/transform_llds.m	14 Jan 2005 03:40:05 -0000
@@ -40,6 +40,7 @@
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module ll_backend__opt_util.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, int, string, list, require, std_util, counter.
@@ -104,7 +105,7 @@
 	PredId = hlds_pred__initial_pred_id,
 	PredName = "ACCURATE_GC_END_LABEL",
 	ProcLabel = proc(ModuleName, predicate, ModuleName, PredName,
-		Arity, ProcId),
+		Arity, proc_id_to_int(ProcId)),
 	Instrs = [label(entry(local, ProcLabel)) -
 		"label to indicate end of previous procedure"],
 	DummyProc = c_procedure(PredName, Arity, proc(PredId, ProcId),
Index: compiler/type_class_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_class_info.m,v
retrieving revision 1.5
diff -u -r1.5 type_class_info.m
--- compiler/type_class_info.m	14 Jun 2004 04:16:40 -0000	1.5
+++ compiler/type_class_info.m	14 Jan 2005 01:27:08 -0000
@@ -41,6 +41,7 @@
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_io.
 :- import_module parse_tree__prog_out.
 :- import_module backend_libs__pseudo_type_info.
Index: compiler/type_ctor_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.60
diff -u -r1.60 type_ctor_info.m
--- compiler/type_ctor_info.m	14 Dec 2004 01:07:15 -0000	1.60
+++ compiler/type_ctor_info.m	14 Jan 2005 03:09:42 -0000
@@ -74,6 +74,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__prog_data.
 :- import_module parse_tree__prog_out.
Index: compiler/type_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/type_util.m,v
retrieving revision 1.145
diff -u -r1.145 type_util.m
--- compiler/type_util.m	23 Dec 2004 04:52:27 -0000	1.145
+++ compiler/type_util.m	13 Jan 2005 05:07:58 -0000
@@ -22,6 +22,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module libs__globals.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module term.
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.358
diff -u -r1.358 typecheck.m
--- compiler/typecheck.m	5 Sep 2004 23:52:48 -0000	1.358
+++ compiler/typecheck.m	13 Jan 2005 05:12:54 -0000
@@ -81,6 +81,7 @@
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
 :- import_module hlds__hlds_data.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, io, list, map.
Index: compiler/unify_proc.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unify_proc.m,v
retrieving revision 1.141
diff -u -r1.141 unify_proc.m
--- compiler/unify_proc.m	23 Dec 2004 04:52:28 -0000	1.141
+++ compiler/unify_proc.m	14 Jan 2005 03:17:42 -0000
@@ -52,7 +52,7 @@
 :- import_module hlds__hlds_goal.
 :- import_module hlds__hlds_module.
 :- import_module hlds__hlds_pred.
-:- import_module hlds__special_pred.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__prog_data.
 
 :- import_module bool, std_util, io, list.
@@ -147,9 +147,11 @@
 :- import_module hlds__instmap.
 :- import_module hlds__make_hlds.
 :- import_module hlds__quantification.
+:- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
 :- import_module libs__tree.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__error_util.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__prog_mode.
Index: compiler/unused_args.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.97
diff -u -r1.97 unused_args.m
--- compiler/unused_args.m	15 Oct 2004 17:22:38 -0000	1.97
+++ compiler/unused_args.m	13 Jan 2005 05:48:25 -0000
@@ -82,6 +82,7 @@
 :- import_module hlds__special_pred.
 :- import_module libs__globals.
 :- import_module libs__options.
+:- import_module mdbcomp__proc_id.
 :- import_module parse_tree__mercury_to_mercury.
 :- import_module parse_tree__modules.
 :- import_module parse_tree__prog_data.
Index: compiler/use_local_vars.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/use_local_vars.m,v
retrieving revision 1.10
diff -u -r1.10 use_local_vars.m
--- compiler/use_local_vars.m	14 Jun 2004 04:16:43 -0000	1.10
+++ compiler/use_local_vars.m	13 Jan 2005 05:42:46 -0000
@@ -61,8 +61,8 @@
 
 :- interface.
 
-:- import_module backend_libs__proc_label.
 :- import_module ll_backend__llds.
+:- import_module mdbcomp__proc_id.
 
 :- import_module list, counter.
 
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.59
diff -u -r1.59 mercury_trace_base.c
--- runtime/mercury_trace_base.c	10 Jan 2005 05:23:50 -0000	1.59
+++ runtime/mercury_trace_base.c	14 Jan 2005 05:32:25 -0000
@@ -200,6 +200,9 @@
 
 static MR_PathPort MR_named_count_port[MR_PORT_NONE + 1];
 
+static void
+MR_trace_write_quoted_atom(FILE *fp, const char *atom);
+
 void
 MR_trace_write_label_exec_counts(FILE *fp)
 {
@@ -252,11 +255,15 @@
                 {
                     id = &proc->MR_sle_user;
                     if (proc != prev_proc) {
-                        fprintf(fp, "proc %c %s %s %d %d\n",
+                        fprintf(fp, "proc %c ",
                             ( id->MR_user_pred_or_func == MR_PREDICATE
-                                ? 'p' : 'f'),
-                            id->MR_user_decl_module,
-                            id->MR_user_name,
+                                ? 'p' : 'f'));
+                        MR_trace_write_quoted_atom(fp,
+                            id->MR_user_decl_module);
+                        fputc(' ', fp);
+                        MR_trace_write_quoted_atom(fp,
+                            id->MR_user_name);
+                        fprintf(fp, " %d %d\n",
                             id->MR_user_arity,
                             id->MR_user_mode);
                     }
@@ -293,6 +300,56 @@
             }
         }
     }
+}
+
+/*
+** The output of this is supposed to be equivalent to term_io__quote_atom
+** except that it always uses quotes, even if not strictly necessary.
+*/
+static void
+MR_trace_write_quoted_atom(FILE *fp, const char *atom)
+{
+    const char *c;
+
+    fputc('\'', fp);
+    for (c = atom; *c != '\0'; c++) {
+        switch (*c) {
+            case '\'':
+                fputs("\\'", fp);
+                break;
+            case '"':
+                fputs("\\\"", fp);
+                break;
+            case '\\':
+                fputs("\\\\", fp);
+                break;
+            case '\n':
+                fputs("\\n", fp);
+                break;
+            case '\t':
+                fputs("\\t", fp);
+                break;
+            case '\b':
+                fputs("\\b", fp);
+                break;
+            default:
+                /* This assumes isalnum is the same as char__isalnum.
+                ** The line noise is the equivalent of 
+                ** is_mercury_punctuation_char in library/term_io.m
+                ** and compiler/mercury_to_mercury.m; any changes here
+                ** may require similar changes there.
+                */
+                if (isalnum(*c) ||
+                    strchr(" !@#$%^&*()-_+=`~{}[];:'\"<>.,/?\\|", *c))
+                {
+                    fputc(*c, fp);
+                } else {
+                    fprintf(fp, "\\%03o\\", *c);
+                }
+                break;
+        }
+    }
+    fputc('\'', fp);
 }
 
 #ifdef  MR_TABLE_DEBUG


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