[m-dev.] for review: reduce intermodule dependencies

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jul 8 15:07:09 AEST 1999


To avoid warnings about "module `foo' is imported in the interface section,
but not used", I had to make a number of additional changes.
These changes were all quite trivial.  For completeness I have included
a relative diff.  I will commit this together with the stuff that I posted
earlier which Simon reviewed.  The only non-trivial part of the relative
diff is that I added a comment.

----------

compiler/prog_io_util.m:
	Add an XXX comment explaining why we need to import hlds_data.m.

The relevant part of the diff is this:
+% XXX we should not need to import hlds*.m here.
+% But currently we need to import hlds_data.m for the `cons_id' type
+% that is used in insts.
 :- import_module hlds_data.m.

----------

compiler/call_gen.m:
compiler/common.m:
compiler/continuation_info.m:
compiler/det_report.m:
compiler/hlds_pred.m:
compiler/lambda.m:
compiler/magic_util.m:
compiler/make_hlds.m:
compiler/modecheck_call.m:
compiler/prog_io_goal.m:
compiler/prog_io_util.m:
compiler/prog_util.m:
compiler/term_util.m:
compiler/termination.m:
        Delete imports of modules purity, rl, and hlds_pred, or
	move them from the interface section to the implementation section.

--- backup2/call_gen.m	Wed Jul  7 18:22:22 1999
+++ call_gen.m	Wed Jul  7 18:59:27 1999
@@ -18,7 +18,7 @@
 
 :- interface.
 
-:- import_module prog_data, hlds_pred, hlds_data, hlds_goal, llds, code_info.
+:- import_module prog_data, hlds_pred, hlds_goal, llds, code_info.
 :- import_module list, set, assoc_list.
 
 :- pred call_gen__generate_higher_order_call(code_model, prog_var,
@@ -61,7 +61,7 @@
 
 :- implementation.
 
-:- import_module hlds_module, code_util.
+:- import_module hlds_module, hlds_data, code_util.
 :- import_module arg_info, type_util, mode_util, unify_proc, instmap.
 :- import_module trace, globals, options.
 :- import_module std_util, bool, int, tree, map.
--- backup2/common.m	Wed Jul  7 18:22:24 1999
+++ common.m	Wed Jul  7 18:58:44 1999
@@ -29,7 +29,7 @@
 :- module common.
 :- interface.
 
-:- import_module hlds_pred, hlds_goal, hlds_data, prog_data, simplify.
+:- import_module hlds_pred, hlds_goal, prog_data, simplify.
 :- import_module list.
 
 	% If we find a deconstruction or a construction we cannot optimize,
@@ -81,7 +81,7 @@
 
 :- import_module quantification, mode_util, type_util, prog_util.
 :- import_module det_util, det_report, globals, options, inst_match, instmap.
-:- import_module hlds_module, (inst), pd_cost, term.
+:- import_module hlds_data, hlds_module, (inst), pd_cost, term.
 :- import_module bool, map, set, eqvclass, require, std_util, string.
 
 :- type structure
--- backup2/continuation_info.m	Wed Jul  7 18:22:24 1999
+++ continuation_info.m	Wed Jul  7 18:27:37 1999
@@ -52,7 +52,7 @@
 
 :- interface.
 
-:- import_module llds, hlds_module, hlds_pred, hlds_data, prog_data.
+:- import_module llds, hlds_module, hlds_pred, prog_data.
 :- import_module (inst), instmap, trace, globals.
 :- import_module std_util, bool, list, assoc_list, set, map.
 
--- backup2/det_report.m	Wed Jul  7 18:22:25 1999
+++ det_report.m	Wed Jul  7 18:27:45 1999
@@ -14,7 +14,7 @@
 
 :- interface.
 
-:- import_module hlds_module, hlds_pred, hlds_goal, hlds_data.
+:- import_module hlds_module, hlds_pred, hlds_goal.
 :- import_module det_util, prog_data.
 :- import_module io, list.
 
--- backup2/hlds_pred.m	Wed Jul  7 18:22:30 1999
+++ hlds_pred.m	Wed Jul  7 18:35:17 1999
@@ -13,8 +13,8 @@
 
 :- interface.
 
-:- import_module hlds_data, hlds_goal, hlds_module, prog_data, instmap.
-:- import_module purity, rl, term_util.
+:- import_module hlds_data, hlds_goal, hlds_module, llds, prog_data, instmap.
+:- import_module term_util.
 :- import_module bool, list, set, map, std_util, term, varset.
 
 :- implementation.
--- backup2/lambda.m	Wed Jul  7 18:22:33 1999
+++ lambda.m	Wed Jul  7 18:54:53 1999
@@ -69,7 +69,7 @@
 
 :- interface. 
 
-:- import_module hlds_module, hlds_pred, hlds_goal, hlds_data, prog_data.
+:- import_module hlds_module, hlds_pred, hlds_goal, prog_data.
 :- import_module list, map, set.
 
 :- pred lambda__process_module(module_info, module_info).
@@ -92,10 +92,10 @@
 
 :- implementation.
 
-:- import_module make_hlds, globals, options, term, varset, type_util.
+:- import_module hlds_data, make_hlds, globals, options, type_util.
 :- import_module goal_util, prog_util, mode_util, inst_match, llds, arg_info.
 
-:- import_module bool, string, std_util, require.
+:- import_module term, varset, bool, string, std_util, require.
 
 :- type lambda_info --->
 		lambda_info(
--- backup2/magic_util.m	Wed Jul  7 18:22:36 1999
+++ magic_util.m	Wed Jul  7 18:28:27 1999
@@ -15,7 +15,7 @@
 :- interface.
 
 :- import_module hlds_data, hlds_goal, hlds_module, hlds_pred, prog_data.
-:- import_module (inst), rl.
+:- import_module (inst).
 :- import_module bool, io, list, map, set, std_util.
 
 	% Check that the argument types and modes are legal for
--- backup2/make_hlds.m	Wed Jul  7 18:22:36 1999
+++ make_hlds.m	Wed Jul  7 19:01:49 1999
@@ -62,7 +62,7 @@
 :- import_module make_tags, quantification, (inst), globals.
 :- import_module code_util, unify_proc, special_pred, type_util, mode_util.
 :- import_module mercury_to_mercury, passes_aux, clause_to_proc, inst_match.
-:- import_module fact_table, purity, goal_util, term_util, export, llds, rl.
+:- import_module fact_table, purity, goal_util, term_util, export, llds.
 
 :- import_module string, char, int, set, bintree, map, multi_map, require.
 :- import_module term, varset, getopt, assoc_list, term_io.
--- backup2/modecheck_call.m	Wed Jul  7 18:22:37 1999
+++ modecheck_call.m	Wed Jul  7 19:10:06 1999
@@ -21,7 +21,7 @@
 :- module modecheck_call.
 :- interface.
 
-:- import_module hlds_goal, hlds_pred, hlds_module, hlds_data.
+:- import_module hlds_goal, hlds_pred, hlds_module.
 :- import_module prog_data, modes, mode_info.
 :- import_module list, std_util.
 
@@ -73,7 +73,7 @@
 %-----------------------------------------------------------------------------%
 
 :- implementation.
-:- import_module prog_data, instmap, (inst).
+:- import_module hlds_data, instmap, prog_data, (inst).
 :- import_module mode_info, mode_debug, modes, mode_util, mode_errors.
 :- import_module clause_to_proc, inst_match, make_hlds.
 :- import_module det_report, unify_proc.
--- backup2/prog_io_goal.m	Wed Jul  7 18:22:39 1999
+++ prog_io_goal.m	Wed Jul  7 18:28:45 1999
@@ -13,7 +13,7 @@
 
 :- interface.
 
-:- import_module prog_data, hlds_data.
+:- import_module prog_data.
 :- import_module list, term.
 
 	% Convert a single term into a goal.
--- backup2/prog_io_util.m	Wed Jul  7 18:22:40 1999
+++ prog_io_util.m	Wed Jul  7 19:07:24 1999
@@ -25,8 +25,7 @@
 
 :- interface.
 
-:- import_module prog_data, hlds_data, (inst).
-:- import_module term.
+:- import_module prog_data, (inst).
 :- import_module list, map, term, io.
 
 :- type maybe2(T1, T2)	--->	error(string, term)
@@ -108,7 +107,13 @@
 
 :- implementation.
 
-:- import_module prog_io, prog_io_goal, hlds_pred, options, globals.
+:- import_module prog_io, prog_io_goal, options, globals.
+
+% XXX we should not need to import hlds*.m here.
+% But currently we need to import hlds_data.m for the `cons_id' type
+% that is used in insts.
+:- import_module hlds_data.
+
 :- import_module bool, string, std_util, term.
 
 add_context(error(M, T), _, error(M, T)).
--- backup2/prog_util.m	Wed Jul  7 18:22:40 1999
+++ prog_util.m	Wed Jul  7 18:29:21 1999
@@ -13,7 +13,7 @@
 
 :- interface.
 
-:- import_module hlds_pred, prog_data, term.
+:- import_module prog_data, term.
 :- import_module std_util, list.
 
 %-----------------------------------------------------------------------------%
--- backup2/term_util.m	Wed Jul  7 18:22:43 1999
+++ term_util.m	Thu Jul  8 14:48:04 1999
@@ -188,15 +188,15 @@
 
 %-----------------------------------------------------------------------------%
 
-% Convert a prog_data:pragma_termination_info into a
-% term_util:termination_info, by adding the appropriate context.
+% Convert a prog_data__pragma_termination_info into a
+% term_util__termination_info, by adding the appropriate context.
 
 :- pred add_context_to_termination_info(maybe(pragma_termination_info),
 		prog_context, maybe(termination_info)).
 :- mode add_context_to_termination_info(in, in, out) is det.
 
-% Convert a prog_data:pragma_arg_size_info into a
-% term_util:arg_size_info, by adding the appropriate context.
+% Convert a prog_data__pragma_arg_size_info into a
+% term_util__arg_size_info, by adding the appropriate context.
 
 :- pred add_context_to_arg_size_info(maybe(pragma_arg_size_info),
 		prog_context, maybe(arg_size_info)).
--- backup2/termination.m	Wed Jul  7 18:22:43 1999
+++ termination.m	Wed Jul  7 19:13:50 1999
@@ -48,7 +48,7 @@
 :- interface.
 
 :- import_module io, bool, std_util, list.
-:- import_module prog_data, hlds_module, hlds_pred, term_util.
+:- import_module prog_data, hlds_module, term_util.
 
 	% Perform termination analysis on the module.
 
@@ -79,7 +79,7 @@
 
 :- import_module term_pass1, term_pass2, term_errors.
 :- import_module inst_match, passes_aux, options, globals.
-:- import_module hlds_data, hlds_goal, dependency_graph, varset.
+:- import_module hlds_data, hlds_goal, hlds_pred, dependency_graph, varset.
 :- import_module mode_util, hlds_out, code_util, prog_out, prog_util.
 :- import_module mercury_to_mercury, type_util, special_pred.
 :- import_module modules.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list