From b4c3bb138718ee2cdfd44889d112d7c9cb15cc39 Mon Sep 17 00:00:00 2001 From: Julien Fischer Date: Fri, 1 Dec 2006 15:04:40 +0000 Subject: [PATCH] Clean up in unused module imports in the Mercury system detected Estimated hours taken: 3 Branches: main Clean up in unused module imports in the Mercury system detected by --warn-unused-imports. analysis/*.m: browser/*.m: deep_profiler/*.m: compiler/*.m: library/*.m: mdbcomp/*.m: profiler/*.m: slice/*.m: Remove unused module imports. Fix some minor departures from our coding standards. analysis/Mercury.options: browser/Mercury.options: deep_profiler/Mercury.options: compiler/Mercury.options: library/Mercury.options: mdbcomp/Mercury.options: profiler/Mercury.options: slice/Mercury.options: Set --no-warn-unused-imports for those modules that are used as packages or otherwise break --warn-unused-imports, e.g. because they contain predicates with both foreign and Mercury clauses and some of the imports only depend on the latter. --- analysis/Mercury.options | 2 +- analysis/analysis.m | 11 +++++----- browser/Mercury.options | 4 +++- browser/browse.m | 3 --- browser/browser_info.m | 5 ++--- browser/collect_lib.m | 5 +++-- browser/debugger_interface.m | 1 - browser/declarative_analyser.m | 1 - browser/declarative_debugger.m | 7 +------ browser/declarative_edt.m | 8 +++---- browser/declarative_execution.m | 2 -- browser/declarative_oracle.m | 8 +++---- browser/declarative_tree.m | 3 --- browser/diff.m | 17 ++++++++------- browser/frame.m | 3 ++- browser/io_action.m | 6 ------ browser/listing.m | 5 ----- browser/parse.m | 6 +----- browser/sized_pretty.m | 12 +++++------ browser/term_rep.m | 1 - browser/util.m | 2 -- compiler/Mercury.options | 11 ++++++++++ compiler/accumulator.m | 2 -- compiler/add_class.m | 2 -- compiler/add_clause.m | 2 -- compiler/add_heap_ops.m | 6 ------ compiler/add_mode.m | 2 -- compiler/add_pragma.m | 1 - compiler/add_pred.m | 2 -- compiler/add_solver.m | 1 - compiler/add_trail_ops.m | 6 ------ compiler/add_type.m | 4 ---- compiler/assertion.m | 5 ----- compiler/atsort.m | 2 -- compiler/basic_block.m | 1 - compiler/call_gen.m | 7 ------- compiler/check_typeclass.m | 4 +--- compiler/closure_analysis.m | 2 -- compiler/code_gen.m | 2 -- compiler/code_info.m | 6 ------ compiler/code_model.m | 1 - compiler/code_util.m | 8 ------- compiler/commit_gen.m | 3 --- compiler/complexity.m | 3 --- compiler/const_prop.m | 12 ----------- compiler/constraint.m | 5 ----- compiler/ctgc.fixpoint_table.m | 2 -- compiler/ctgc.selector.m | 1 - compiler/ctgc.util.m | 6 +++--- compiler/dead_proc_elim.m | 1 - compiler/deep_profiling.m | 6 ------ compiler/deforest.m | 6 ------ compiler/delay_construct.m | 1 - compiler/dense_switch.m | 3 --- compiler/dep_par_conj.m | 2 -- compiler/dependency_graph.m | 8 ------- compiler/det_report.m | 2 -- compiler/disj_gen.m | 2 -- compiler/dupelim.m | 1 - compiler/equiv_type.m | 1 - compiler/equiv_type_hlds.m | 1 - compiler/error_util.m | 1 - compiler/exception_analysis.m | 6 ------ compiler/fact_table.m | 6 ------ compiler/follow_code.m | 5 ----- compiler/follow_vars.m | 7 ------- compiler/frameopt.m | 2 -- compiler/global_data.m | 3 --- compiler/goal_form.m | 2 -- compiler/goal_store.m | 2 -- compiler/goal_util.m | 2 -- compiler/granularity.m | 1 - compiler/handle_options.m | 1 - compiler/hhf.m | 2 -- compiler/higher_order.m | 4 ---- compiler/hlds_clauses.m | 14 ++----------- compiler/hlds_code_util.m | 5 ----- compiler/hlds_data.m | 11 +++++----- compiler/hlds_error_util.m | 1 - compiler/hlds_goal.m | 3 --- compiler/hlds_module.m | 6 ------ compiler/hlds_out.m | 2 -- compiler/hlds_pred.m | 4 ---- compiler/hlds_rtti.m | 16 ++++---------- compiler/il_peephole.m | 1 - compiler/inlining.m | 3 --- compiler/inst_graph.m | 1 - compiler/instmap.m | 2 -- compiler/intermod.m | 3 --- compiler/java_util.m | 6 ------ compiler/jumpopt.m | 1 - compiler/lambda.m | 3 --- compiler/layout_out.m | 8 ++----- compiler/lco.m | 1 - compiler/live_vars.m | 17 +++++---------- compiler/liveness.m | 6 ------ compiler/ll_pseudo_type_info.m | 2 -- compiler/llds_out.m | 7 ------- compiler/lookup_switch.m | 7 ++----- compiler/loop_inv.m | 2 -- compiler/lp.m | 18 +++++++--------- compiler/lp_rational.m | 1 - compiler/make.dependencies.m | 3 +++ compiler/make.m | 16 -------------- compiler/make.module_dep_file.m | 13 ++++++++++++ compiler/make.module_target.m | 6 +++++- compiler/make.program_target.m | 6 +++++- compiler/make.util.m | 7 +++++++ compiler/make_hlds_error.m | 2 -- compiler/make_hlds_passes.m | 1 - compiler/make_hlds_warn.m | 2 -- compiler/mark_static_terms.m | 3 --- compiler/mercury_compile.m | 7 ------- compiler/mercury_to_mercury.m | 2 -- compiler/middle_rec.m | 4 ---- compiler/ml_call_gen.m | 3 --- compiler/ml_code_gen.m | 6 ------ compiler/ml_code_util.m | 4 +--- compiler/ml_elim_nested.m | 10 ++------- compiler/ml_optimize.m | 3 --- compiler/ml_string_switch.m | 6 ------ compiler/ml_switch_gen.m | 3 --- compiler/ml_tag_switch.m | 4 ---- compiler/ml_tailcall.m | 3 --- compiler/ml_type_gen.m | 3 --- compiler/ml_unify_gen.m | 2 -- compiler/ml_util.m | 3 --- compiler/mlds.m | 1 - compiler/mlds_to_c.m | 3 --- compiler/mlds_to_gcc.m | 19 +++++------------ compiler/mlds_to_il.m | 9 -------- compiler/mlds_to_ilasm.m | 18 ---------------- compiler/mlds_to_java.m | 7 ------- compiler/mlds_to_managed.m | 13 ------------ compiler/mmc_analysis.m | 2 -- compiler/mode_robdd.equiv_vars.m | 1 - compiler/mode_robdd.implications.m | 1 - compiler/module_qual.m | 5 ----- compiler/modules.m | 2 -- compiler/opt_debug.m | 15 ++++++------- compiler/opt_util.m | 9 +++----- compiler/optimize.m | 11 +++------- compiler/options.m | 1 - compiler/options_file.m | 1 - compiler/par_conj_gen.m | 3 --- compiler/passes_aux.m | 7 +++---- compiler/pd_cost.m | 11 +++++----- compiler/pd_info.m | 11 +++------- compiler/pd_term.m | 8 +++---- compiler/pd_util.m | 11 +++------- compiler/peephole.m | 8 +++---- compiler/polyhedron.m | 21 ++++++++----------- compiler/post_term_analysis.m | 6 ++---- compiler/pragma_c_gen.m | 7 +++---- compiler/pred_table.m | 8 +++---- compiler/proc_gen.m | 6 ------ compiler/process_util.m | 1 - compiler/prog_ctgc.m | 4 ++-- compiler/prog_foreign.m | 2 +- compiler/prog_io.m | 1 - compiler/prog_io_dcg.m | 8 +++---- compiler/prog_io_goal.m | 2 -- compiler/prog_io_pragma.m | 2 -- compiler/prog_io_typeclass.m | 9 +++----- compiler/prog_io_util.m | 10 +++------ compiler/prog_mode.m | 2 -- compiler/prog_mutable.m | 4 +--- compiler/prog_out.m | 10 ++++----- compiler/prog_rep.m | 9 +++----- compiler/prog_type.m | 2 -- compiler/prog_type_subst.m | 3 --- compiler/prog_util.m | 2 -- compiler/qual_info.m | 6 +++--- compiler/quantification.m | 1 - compiler/rat.m | 7 +++++-- compiler/recompilation.usage.m | 2 -- compiler/recompilation.version.m | 6 ++++-- compiler/rtti_out.m | 7 ------- compiler/rtti_to_mlds.m | 8 ------- compiler/saved_vars.m | 1 - compiler/size_prof.m | 2 -- compiler/source_file_map.m | 2 -- compiler/special_pred.m | 3 --- compiler/stack_alloc.m | 6 ------ compiler/stack_layout.m | 6 ------ compiler/stack_opt.m | 9 -------- compiler/stdlabel.m | 1 - compiler/store_alloc.m | 2 -- compiler/string_switch.m | 2 -- compiler/structure_reuse.analysis.m | 1 - .../structure_reuse.direct.choose_reuse.m | 4 ++++ .../structure_reuse.direct.detect_garbage.m | 6 +++++- compiler/structure_reuse.direct.m | 7 ------- compiler/structure_reuse.lbu.m | 1 - compiler/structure_reuse.lfu.m | 1 - compiler/structure_reuse.versions.m | 8 ++++--- compiler/structure_sharing.analysis.m | 1 - compiler/structure_sharing.domain.m | 5 +---- compiler/superhomogeneous.m | 3 --- compiler/switch_gen.m | 2 -- compiler/table_gen.m | 10 --------- compiler/tabling_analysis.m | 8 ------- compiler/tag_switch.m | 3 --- compiler/term_constr_build.m | 12 ++--------- compiler/term_constr_data.m | 2 -- compiler/term_constr_fixpoint.m | 7 ------- compiler/term_constr_initial.m | 18 ---------------- compiler/term_constr_main.m | 11 ---------- compiler/term_constr_pass2.m | 5 ----- compiler/term_constr_util.m | 10 ++------- compiler/term_errors.m | 7 ------- compiler/term_norm.m | 8 +------ compiler/term_pass1.m | 6 ------ compiler/term_pass2.m | 3 --- compiler/term_traversal.m | 3 --- compiler/term_util.m | 7 ------- compiler/termination.m | 12 ----------- compiler/trace_params.m | 1 - compiler/trailing_analysis.m | 5 ----- compiler/trans_opt.m | 4 ---- compiler/transform.m | 6 ------ compiler/transform_llds.m | 5 ----- compiler/tupling.m | 4 ---- compiler/type_util.m | 2 -- compiler/typecheck.m | 1 - compiler/typeclasses.m | 3 ++- compiler/unify_gen.m | 3 --- compiler/unify_proc.m | 1 - compiler/unneeded_code.m | 1 - compiler/untupling.m | 1 - compiler/unused_args.m | 7 ------- compiler/unused_imports.m | 5 ----- compiler/var_locn.m | 2 -- compiler/xml_documentation.m | 5 +---- deep_profiler/Mercury.options | 7 ++++++- deep_profiler/array_util.m | 1 - deep_profiler/canonical.m | 4 +++- deep_profiler/dense_bitset.m | 5 ++--- deep_profiler/dump.m | 5 +++-- deep_profiler/exclude.m | 3 +-- deep_profiler/html_format.m | 3 +-- deep_profiler/interface.m | 2 -- deep_profiler/mdprof_cgi.m | 7 ++----- deep_profiler/mdprof_test.m | 4 ++-- deep_profiler/query.m | 5 +---- deep_profiler/startup.m | 6 ++---- deep_profiler/timeout.m | 7 ++----- deep_profiler/top_procs.m | 5 ++--- deep_profiler/util.m | 5 ++--- library/Mercury.options | 8 +++++++ library/assoc_list.m | 5 +++-- library/lexer.m | 1 - library/relation.m | 1 - library/set.m | 1 - mdbcomp/Mercury.options | 4 ++-- mdbcomp/rtti_access.m | 4 +++- mdbcomp/slice_and_dice.m | 6 ++---- mdbcomp/trace_counts.m | 7 +++---- profiler/call_graph.m | 2 -- profiler/demangle.m | 8 +++---- profiler/generate_output.m | 8 +++---- profiler/mercury_profile.m | 5 ----- profiler/options.m | 1 - profiler/output.m | 4 ++-- profiler/output_prof_info.m | 3 --- profiler/prof_debug.m | 3 ++- profiler/prof_info.m | 4 ++-- profiler/read.m | 5 +---- slice/mtc_diff.m | 13 +++++------- slice/mtc_union.m | 11 +++++----- 270 files changed, 301 insertions(+), 1038 deletions(-) diff --git a/analysis/Mercury.options b/analysis/Mercury.options index 70a643b60..07ef886d6 100644 --- a/analysis/Mercury.options +++ b/analysis/Mercury.options @@ -6,7 +6,7 @@ # Mercury.options - module-specific flags for Mmake and `mmc --make'. #-----------------------------------------------------------------------------# -MCFLAGS-mer_analysis = --no-warn-nothing-exported +MCFLAGS-mer_analysis = --no-warn-nothing-exported --no-warn-unused-imports # XXX work around a bug that sometimes appears at -O4 and above. # mmc -r analysis.file.c -s asm_fast.gc -O4 --intermodule-optimisation diff --git a/analysis/analysis.m b/analysis/analysis.m index d00e5c5ba..17aed0e53 100644 --- a/analysis/analysis.m +++ b/analysis/analysis.m @@ -22,14 +22,12 @@ :- module analysis. :- interface. -:- import_module assoc_list. :- import_module bool. :- import_module io. :- import_module list. :- import_module maybe. :- import_module set. :- import_module unit. -:- import_module univ. %-----------------------------------------------------------------------------% @@ -266,14 +264,15 @@ :- implementation. -:- include_module analysis__file. -:- import_module analysis__file. +:- include_module analysis.file. +:- import_module analysis.file. -:- import_module bool. :- import_module map. :- import_module require. -:- import_module set. :- import_module string. +:- import_module univ. + +%-----------------------------------------------------------------------------% :- type analysis_info ---> some [Compiler] analysis_info( diff --git a/browser/Mercury.options b/browser/Mercury.options index a1780bbe7..808d4e99c 100644 --- a/browser/Mercury.options +++ b/browser/Mercury.options @@ -6,9 +6,11 @@ # Mercury.options - module-specific flags for Mmake and `mmc --make'. #-----------------------------------------------------------------------------# -MCFLAGS-mer_browser = --no-warn-nothing-exported +MCFLAGS-mer_browser = --no-warn-nothing-exported --no-warn-unused-imports MCFLAGS-mdb.dice = --no-warn-nothing-exported +MCFLAGS-mdb = --no-warn-unused-imports + # XXX Disable higher order specialization for declarative_edt since this # optimization has a suspected bug that mdb.declarative_edt.revise_root/3 # exposes. diff --git a/browser/browse.m b/browser/browse.m index b821132c3..774901974 100644 --- a/browser/browse.m +++ b/browser/browse.m @@ -20,7 +20,6 @@ % - Node expansion and contraction in the style of Windows Explorer. % %---------------------------------------------------------------------------% -%---------------------------------------------------------------------------% :- module mdb.browse. :- interface. @@ -175,13 +174,11 @@ :- import_module bool. :- import_module char. -:- import_module construct. :- import_module deconstruct. :- import_module getopt. :- import_module int. :- import_module map. :- import_module pair. -:- import_module parser. :- import_module pprint. :- import_module require. :- import_module string. diff --git a/browser/browser_info.m b/browser/browser_info.m index ab66d8d3c..8e6f68e2b 100644 --- a/browser/browser_info.m +++ b/browser/browser_info.m @@ -334,19 +334,18 @@ int::out, bool::out) is cc_multi. %---------------------------------------------------------------------------% +%---------------------------------------------------------------------------% :- implementation. :- import_module mdb.term_rep. :- import_module deconstruct. -:- import_module int. -:- import_module io. -:- import_module maybe. :- import_module require. :- import_module string. :- import_module type_desc. +%---------------------------------------------------------------------------% :- pragma foreign_export("C", init_persistent_state(out), "ML_BROWSE_init_persistent_state"). diff --git a/browser/collect_lib.m b/browser/collect_lib.m index a3c4ab84d..ef3427598 100644 --- a/browser/collect_lib.m +++ b/browser/collect_lib.m @@ -62,6 +62,7 @@ :- pred dummy_pred_to_avoid_warning_about_nothing_exported is det. +%------------------------------------------------------------------------------% %------------------------------------------------------------------------------% :- implementation. @@ -69,9 +70,9 @@ :- import_module mdb.dl. :- import_module char. -:- import_module int. :- import_module io. -:- import_module list. + +%------------------------------------------------------------------------------% dummy_pred_to_avoid_warning_about_nothing_exported. diff --git a/browser/debugger_interface.m b/browser/debugger_interface.m index 39f1c4490..1ce1e1c47 100644 --- a/browser/debugger_interface.m +++ b/browser/debugger_interface.m @@ -45,7 +45,6 @@ :- import_module mdbcomp.prim_data. :- import_module mdbcomp.program_representation. -:- import_module bool. :- import_module io. :- import_module list. :- import_module require. diff --git a/browser/declarative_analyser.m b/browser/declarative_analyser.m index ef1677d2d..a0acf85f4 100644 --- a/browser/declarative_analyser.m +++ b/browser/declarative_analyser.m @@ -153,7 +153,6 @@ :- import_module array. :- import_module bool. -:- import_module counter. :- import_module exception. :- import_module float. :- import_module int. diff --git a/browser/declarative_debugger.m b/browser/declarative_debugger.m index d8ed00a71..72959c2d7 100644 --- a/browser/declarative_debugger.m +++ b/browser/declarative_debugger.m @@ -72,7 +72,6 @@ :- import_module io. :- import_module list. :- import_module maybe. -:- import_module string. :- import_module unit. %-----------------------------------------------------------------------------% @@ -311,17 +310,13 @@ :- import_module mdb.declarative_edt. :- import_module mdb.declarative_oracle. -:- import_module mdb.util. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.rtti_access. -:- import_module mdbcomp.slice_and_dice. -:- import_module mdbcomp.trace_counts. :- import_module bool. :- import_module exception. :- import_module int. -:- import_module map. -:- import_module require. +:- import_module string. :- import_module univ. %-----------------------------------------------------------------------------% diff --git a/browser/declarative_edt.m b/browser/declarative_edt.m index 7014aeb42..f37c7156c 100644 --- a/browser/declarative_edt.m +++ b/browser/declarative_edt.m @@ -576,17 +576,17 @@ :- implementation. +:- import_module mdb.declarative_execution. +:- import_module mdb.term_rep. + :- import_module bimap. -:- import_module char. :- import_module counter. :- import_module exception. -:- import_module float. :- import_module int. :- import_module svmap. :- import_module string. -:- import_module mdb.declarative_execution. -:- import_module mdb.term_rep. +%-----------------------------------------------------------------------------% % A suspect is an edt node with some additional information relevant % to the bug search. diff --git a/browser/declarative_execution.m b/browser/declarative_execution.m index 7b8d1d044..429426100 100644 --- a/browser/declarative_execution.m +++ b/browser/declarative_execution.m @@ -468,14 +468,12 @@ :- implementation. :- import_module mdb.declarative_debugger. -:- import_module mdb.declarative_edt. :- import_module exception. :- import_module int. :- import_module map. :- import_module require. :- import_module store. -:- import_module string. :- import_module univ. %-----------------------------------------------------------------------------% diff --git a/browser/declarative_oracle.m b/browser/declarative_oracle.m index 446f105fb..8def8eaba 100644 --- a/browser/declarative_oracle.m +++ b/browser/declarative_oracle.m @@ -39,7 +39,8 @@ :- import_module bool. :- import_module io. -:- import_module string. + +%-----------------------------------------------------------------------------% % A response that the oracle gives to a query about the % truth of an EDT node. @@ -163,19 +164,16 @@ :- implementation. :- import_module mdb.declarative_execution. -:- import_module mdb.util. :- import_module mdbcomp.prim_data. -:- import_module assoc_list. :- import_module bimap. -:- import_module bool. :- import_module counter. -:- import_module exception. :- import_module int. :- import_module library. :- import_module list. :- import_module map. :- import_module set. +:- import_module string. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/browser/declarative_tree.m b/browser/declarative_tree.m index 30c688b3f..cbeeefa8c 100644 --- a/browser/declarative_tree.m +++ b/browser/declarative_tree.m @@ -58,7 +58,6 @@ :- import_module mdb.declarative_debugger. :- import_module mdb.io_action. :- import_module mdb.term_rep. -:- import_module mdb.util. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.program_representation. :- import_module mdbcomp.rtti_access. @@ -68,9 +67,7 @@ :- import_module deconstruct. :- import_module exception. :- import_module int. -:- import_module io. :- import_module list. -:- import_module map. :- import_module maybe. :- import_module pair. :- import_module string. diff --git a/browser/diff.m b/browser/diff.m index 2e68e3c5a..4a9fd227c 100644 --- a/browser/diff.m +++ b/browser/diff.m @@ -1,39 +1,40 @@ -%---------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% % vim: ft=mercury ts=4 sw=4 et -%---------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% % Copyright (C) 2005-2006 The University of Melbourne. % This file may only be copied under the terms of the GNU Library General % Public License - see the file COPYING.LIB in the Mercury distribution. -%---------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% % % File: diff.m. % % This module computes diffs between terms. % -%---------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% :- module mdb.diff. :- interface. -:- import_module int. :- import_module io. :- import_module univ. :- pred report_diffs(int::in, int::in, univ::in, univ::in, io::di, io::uo) is cc_multi. -%---------------------------------------------------------------------------% -%---------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% :- implementation. :- import_module mdbcomp.program_representation. :- import_module deconstruct. +:- import_module int. :- import_module list. :- import_module require. :- import_module string. -:- import_module type_desc. + +%-----------------------------------------------------------------------------% :- pragma foreign_export("C", report_diffs(in, in, in, in, di, uo), "ML_report_diffs"). diff --git a/browser/frame.m b/browser/frame.m index 0e3722fcc..5426b6708 100644 --- a/browser/frame.m +++ b/browser/frame.m @@ -69,9 +69,10 @@ :- import_module assoc_list. :- import_module int. :- import_module list. -:- import_module require. :- import_module string. +%---------------------------------------------------------------------------% + from_string(Str) = [Str]. vglue(TopFrame, BottomFrame) = StackedFrame :- diff --git a/browser/io_action.m b/browser/io_action.m index 32fae194f..057561958 100644 --- a/browser/io_action.m +++ b/browser/io_action.m @@ -56,14 +56,8 @@ :- implementation. -:- import_module mdb.declarative_debugger. - :- import_module bool. -:- import_module exception. -:- import_module int. :- import_module maybe. -:- import_module require. -:- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/browser/listing.m b/browser/listing.m index c88db8545..8fe4929e2 100644 --- a/browser/listing.m +++ b/browser/listing.m @@ -25,7 +25,6 @@ :- import_module io. :- import_module list. -:- import_module string. %-----------------------------------------------------------------------------% @@ -86,11 +85,7 @@ :- implementation. -:- import_module array. -:- import_module char. :- import_module dir. -:- import_module int. -:- import_module map. :- import_module maybe. :- import_module type_desc. diff --git a/browser/parse.m b/browser/parse.m index b383fb609..fd3467a0d 100644 --- a/browser/parse.m +++ b/browser/parse.m @@ -124,7 +124,6 @@ :- import_module io. :- import_module list. :- import_module maybe. -:- import_module string. %---------------------------------------------------------------------------% @@ -193,13 +192,10 @@ :- import_module mdb.util. -:- import_module assoc_list. :- import_module bool. :- import_module char. :- import_module int. -:- import_module list. -:- import_module map. -:- import_module pair. +:- import_module string. :- type token ---> (.) diff --git a/browser/sized_pretty.m b/browser/sized_pretty.m index 4f010e3c4..80bb2f5b2 100644 --- a/browser/sized_pretty.m +++ b/browser/sized_pretty.m @@ -5,14 +5,14 @@ % This file may only be copied under the terms of the GNU Library General % Public License - see the file COPYING.LIB in the Mercury distribution. %---------------------------------------------------------------------------% - +% % File: sized_pretty.m: % Author: sthur. - +% % When printing a term during debugging this module allows the user to put % a limit on the size of the term displayed. This limit is specified by % setting the number of lines you want and the width of these lines. - +% % How to use sized_pretty.m : % --------------------------- % @@ -165,8 +165,6 @@ :- import_module mdb.browser_info. :- import_module mdb.browser_term. -:- import_module int. -:- import_module string. :- import_module univ. %---------------------------------------------------------------------------% @@ -190,15 +188,15 @@ :- implementation. -:- import_module assoc_list. :- import_module bool. :- import_module deconstruct. +:- import_module int. :- import_module list. :- import_module maybe. :- import_module pair. :- import_module pprint. -:- import_module require. :- import_module std_util. +:- import_module string. %---------------------------------------------------------------------------% diff --git a/browser/term_rep.m b/browser/term_rep.m index dd1fa8110..d61c2af98 100644 --- a/browser/term_rep.m +++ b/browser/term_rep.m @@ -63,7 +63,6 @@ :- import_module int. :- import_module list. :- import_module maybe. -:- import_module string. :- import_module type_desc. %-----------------------------------------------------------------------------% diff --git a/browser/util.m b/browser/util.m index d7259fac6..d16e2a715 100644 --- a/browser/util.m +++ b/browser/util.m @@ -14,7 +14,6 @@ :- import_module bool. :- import_module io. :- import_module list. -:- import_module string. %---------------------------------------------------------------------------% @@ -59,7 +58,6 @@ :- implementation. -:- import_module int. :- import_module require. is_predicate(predicate) = yes. diff --git a/compiler/Mercury.options b/compiler/Mercury.options index efcb31bea..2a49a8765 100644 --- a/compiler/Mercury.options +++ b/compiler/Mercury.options @@ -31,6 +31,17 @@ MCFLAGS-make.module_dep_file = --no-ansi-c MCFLAGS-make.module_target = --no-ansi-c MCFLAGS-make.program_target = --no-ansi-c +MCFLAGS-hlds = --no-warn-unused-imports +MCFLAGS-ll_backend = --no-warn-unused-imports +MCFLAGS-make = --no-warn-unused-imports +MCFLAGS-ml_backend = --no-warn-unused-imports +MCFLAGS-parse_tree = --no-warn-unused-imports +MCFLAGS-recompilation = --no-warn-unused-imports +MCFLAGS-top_level = --no-warn-unused-imports +MCFLAGS-transform_hlds = --no-warn-unused-imports +MCFLAGS-transform_hlds.ctgc.structure_reuse = --no-warn-unused-imports +MCFLAGS-transform_hlds.ctgc.structure_sharing = --no-warn-unused-imports + # Bug workarounds # This is the same bug as tests/valid/ho_and_type_spec_bug diff --git a/compiler/accumulator.m b/compiler/accumulator.m index 03cd60e88..4a6e27003 100644 --- a/compiler/accumulator.m +++ b/compiler/accumulator.m @@ -159,7 +159,6 @@ :- implementation. -:- import_module check_hlds.inst_match. :- import_module hlds.assertion. :- import_module hlds.goal_util. :- import_module hlds.hlds_data. @@ -184,7 +183,6 @@ :- import_module int. :- import_module list. :- import_module map. -:- import_module multi_map. :- import_module pair. :- import_module set. :- import_module solutions. diff --git a/compiler/add_class.m b/compiler/add_class.m index 214aad881..d42f9d973 100644 --- a/compiler/add_class.m +++ b/compiler/add_class.m @@ -61,7 +61,6 @@ :- import_module hlds.make_hlds.state_var. :- import_module hlds.pred_table. :- import_module libs.compiler_util. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. @@ -69,7 +68,6 @@ :- import_module bool. :- import_module int. :- import_module map. -:- import_module multi_map. :- import_module pair. :- import_module set. :- import_module solutions. diff --git a/compiler/add_clause.m b/compiler/add_clause.m index 2b925ab30..2583132e7 100644 --- a/compiler/add_clause.m +++ b/compiler/add_clause.m @@ -66,7 +66,6 @@ :- import_module hlds.make_hlds.add_pragma. :- import_module hlds.make_hlds.add_pred. :- import_module hlds.make_hlds.field_access. -:- import_module hlds.make_hlds.make_hlds_error. :- import_module hlds.make_hlds.make_hlds_warn. :- import_module hlds.make_hlds.superhomogeneous. :- import_module hlds.pred_table. @@ -88,7 +87,6 @@ :- import_module pair. :- import_module set. :- import_module string. -:- import_module term_io. :- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/add_heap_ops.m b/compiler/add_heap_ops.m index f311af178..195c1f45d 100644 --- a/compiler/add_heap_ops.m +++ b/compiler/add_heap_ops.m @@ -46,17 +46,13 @@ :- import_module hlds.code_model. :- import_module hlds.goal_form. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.instmap. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. @@ -64,8 +60,6 @@ :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module set. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/add_mode.m b/compiler/add_mode.m index 775c66c55..7a8ef3c34 100644 --- a/compiler/add_mode.m +++ b/compiler/add_mode.m @@ -46,8 +46,6 @@ :- import_module parse_tree.prog_mode. :- import_module map. -:- import_module pair. -:- import_module string. %----------------------------------------------------------------------------% diff --git a/compiler/add_pragma.m b/compiler/add_pragma.m index 4f06ccaa5..9195bb4c4 100644 --- a/compiler/add_pragma.m +++ b/compiler/add_pragma.m @@ -125,7 +125,6 @@ :- implementation. -:- import_module analysis. :- import_module backend_libs. :- import_module backend_libs.foreign. :- import_module backend_libs.rtti. diff --git a/compiler/add_pred.m b/compiler/add_pred.m index a4975cd83..40c3390d3 100644 --- a/compiler/add_pred.m +++ b/compiler/add_pred.m @@ -75,12 +75,10 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.make_hlds.make_hlds_error. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module libs.options. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_out. diff --git a/compiler/add_solver.m b/compiler/add_solver.m index f8cb62faa..26d7581a5 100644 --- a/compiler/add_solver.m +++ b/compiler/add_solver.m @@ -61,7 +61,6 @@ :- import_module libs.globals. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module map. diff --git a/compiler/add_trail_ops.m b/compiler/add_trail_ops.m index fe9e4f363..f38f4544f 100644 --- a/compiler/add_trail_ops.m +++ b/compiler/add_trail_ops.m @@ -71,27 +71,21 @@ :- import_module hlds.code_model. :- import_module hlds.goal_form. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.instmap. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module list. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module set. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/add_type.m b/compiler/add_type.m index 5a6a83c68..e0abd8f87 100644 --- a/compiler/add_type.m +++ b/compiler/add_type.m @@ -56,7 +56,6 @@ :- import_module backend_libs. :- import_module backend_libs.foreign. -:- import_module check_hlds.type_util. :- import_module hlds.make_hlds.add_special_pred. :- import_module hlds.make_hlds.make_hlds_error. :- import_module hlds.make_hlds.make_hlds_passes. @@ -68,14 +67,11 @@ :- import_module libs.options. :- import_module parse_tree.module_qual. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module int. :- import_module map. :- import_module multi_map. -:- import_module pair. :- import_module string. :- import_module svmap. :- import_module term. diff --git a/compiler/assertion.m b/compiler/assertion.m index 61ab8c844..48507ede1 100644 --- a/compiler/assertion.m +++ b/compiler/assertion.m @@ -132,22 +132,17 @@ :- implementation. -:- import_module check_hlds.type_util. :- import_module hlds.goal_util. :- import_module hlds.hlds_clauses. :- import_module libs.compiler_util. -:- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. :- import_module assoc_list. -:- import_module bool. :- import_module list. :- import_module map. :- import_module maybe. :- import_module set. :- import_module solutions. -:- import_module string. :- type subst == map(prog_var, prog_var). diff --git a/compiler/atsort.m b/compiler/atsort.m index d22518570..02ee0be1f 100644 --- a/compiler/atsort.m +++ b/compiler/atsort.m @@ -49,8 +49,6 @@ :- import_module libs.compiler_util. -:- import_module string. - % :- pred main1(list(list(int))). % :- mode main1(out) is det. % diff --git a/compiler/basic_block.m b/compiler/basic_block.m index 79574e94a..6557a80ca 100644 --- a/compiler/basic_block.m +++ b/compiler/basic_block.m @@ -102,7 +102,6 @@ :- import_module libs.compiler_util. :- import_module ll_backend.opt_util. -:- import_module int. :- import_module pair. :- import_module svmap. :- import_module svset. diff --git a/compiler/call_gen.m b/compiler/call_gen.m index e8207815a..a79d64fa9 100644 --- a/compiler/call_gen.m +++ b/compiler/call_gen.m @@ -64,12 +64,7 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.polymorphism. -:- import_module check_hlds.type_util. -:- import_module check_hlds.unify_proc. :- import_module hlds.arg_info. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.instmap. @@ -83,11 +78,9 @@ :- import_module bool. :- import_module int. -:- import_module map. :- import_module pair. :- import_module set. :- import_module string. -:- import_module varset. %---------------------------------------------------------------------------% %---------------------------------------------------------------------------% diff --git a/compiler/check_typeclass.m b/compiler/check_typeclass.m index fa3f26fb1..c3e377534 100644 --- a/compiler/check_typeclass.m +++ b/compiler/check_typeclass.m @@ -7,7 +7,7 @@ %---------------------------------------------------------------------------% % % File: check_typeclass.m. -% Author: dgj, mark +% Author: dgj, mark. % % This module checks conformance of instance declarations to the typeclass % declaration. It takes various steps to do this. @@ -116,9 +116,7 @@ :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module bool. -:- import_module io. :- import_module map. :- import_module maybe. :- import_module multi_map. diff --git a/compiler/closure_analysis.m b/compiler/closure_analysis.m index 4675048a1..fbf6ddf83 100644 --- a/compiler/closure_analysis.m +++ b/compiler/closure_analysis.m @@ -47,8 +47,6 @@ :- import_module assoc_list. :- import_module bool. -:- import_module counter. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. diff --git a/compiler/code_gen.m b/compiler/code_gen.m index 0f56aad22..ba17cad30 100644 --- a/compiler/code_gen.m +++ b/compiler/code_gen.m @@ -48,11 +48,9 @@ :- import_module libs.globals. :- import_module libs.tree. :- import_module ll_backend.call_gen. -:- import_module ll_backend.code_util. :- import_module ll_backend.commit_gen. :- import_module ll_backend.disj_gen. :- import_module ll_backend.ite_gen. -:- import_module ll_backend.middle_rec. :- import_module ll_backend.par_conj_gen. :- import_module ll_backend.pragma_c_gen. :- import_module ll_backend.switch_gen. diff --git a/compiler/code_info.m b/compiler/code_info.m index 33f2a9c9c..742abe54e 100644 --- a/compiler/code_info.m +++ b/compiler/code_info.m @@ -60,10 +60,8 @@ :- 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.goal_form. :- import_module hlds.hlds_code_util. :- import_module hlds.hlds_rtti. :- import_module libs.compiler_util. @@ -71,13 +69,9 @@ :- import_module libs.trace_params. :- import_module libs.tree. :- import_module ll_backend.code_util. -:- import_module ll_backend.exprn_aux. -:- import_module ll_backend.llds_out. :- import_module ll_backend.var_locn. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module char. :- import_module int. :- import_module pair. :- import_module set. diff --git a/compiler/code_model.m b/compiler/code_model.m index a38e9bc1f..ca83965b5 100644 --- a/compiler/code_model.m +++ b/compiler/code_model.m @@ -57,7 +57,6 @@ :- implementation. :- import_module mdbcomp.program_representation. -:- import_module int. determinism_to_code_model(detism_det, model_det). determinism_to_code_model(detism_semi, model_semi). diff --git a/compiler/code_util.m b/compiler/code_util.m index 0f0808c83..676731e47 100644 --- a/compiler/code_util.m +++ b/compiler/code_util.m @@ -96,18 +96,10 @@ :- import_module backend_libs.proc_label. :- import_module backend_libs.rtti. :- import_module hlds.code_model. -:- import_module hlds.goal_form. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. -:- import_module libs.options. -:- import_module parse_tree.prog_util. -:- import_module char. :- import_module int. -:- import_module set. -:- import_module string. :- import_module term. -:- import_module varset. %---------------------------------------------------------------------------% diff --git a/compiler/commit_gen.m b/compiler/commit_gen.m index bfd0aad4c..592ddb640 100644 --- a/compiler/commit_gen.m +++ b/compiler/commit_gen.m @@ -31,16 +31,13 @@ :- implementation. -:- import_module backend_libs.builtin_ops. :- import_module libs.compiler_util. :- import_module libs.tree. :- import_module ll_backend.code_gen. -:- import_module parse_tree.prog_data. :- import_module list. :- import_module maybe. :- import_module pair. -:- import_module set. :- import_module string. %---------------------------------------------------------------------------% diff --git a/compiler/complexity.m b/compiler/complexity.m index fa9e2ed4b..f69978a64 100644 --- a/compiler/complexity.m +++ b/compiler/complexity.m @@ -60,10 +60,8 @@ :- import_module check_hlds.mode_util. :- import_module check_hlds.polymorphism. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.instmap. :- import_module hlds.pred_table. @@ -76,7 +74,6 @@ :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.term_norm. :- import_module assoc_list. diff --git a/compiler/const_prop.m b/compiler/const_prop.m index 6286ee9aa..803e53ef4 100644 --- a/compiler/const_prop.m +++ b/compiler/const_prop.m @@ -50,20 +50,8 @@ :- implementation. -:- import_module check_hlds.det_analysis. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.modes. -:- import_module check_hlds.type_util. -:- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. -:- import_module hlds.quantification. -:- import_module libs.globals. -:- import_module libs.options. :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_data. diff --git a/compiler/constraint.m b/compiler/constraint.m index 866b97dc3..2026700b2 100644 --- a/compiler/constraint.m +++ b/compiler/constraint.m @@ -52,12 +52,8 @@ :- implementation. :- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.purity. :- import_module hlds.goal_form. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -67,7 +63,6 @@ :- import_module map. :- import_module pair. :- import_module set. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/ctgc.fixpoint_table.m b/compiler/ctgc.fixpoint_table.m index 45a4fb175..09e279b9c 100644 --- a/compiler/ctgc.fixpoint_table.m +++ b/compiler/ctgc.fixpoint_table.m @@ -91,11 +91,9 @@ :- import_module libs.compiler_util. -:- import_module bool. :- import_module int. :- import_module list. :- import_module map. -:- import_module require. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/compiler/ctgc.selector.m b/compiler/ctgc.selector.m index c3286ae68..f459090e4 100644 --- a/compiler/ctgc.selector.m +++ b/compiler/ctgc.selector.m @@ -73,7 +73,6 @@ :- import_module check_hlds.type_util. :- import_module libs.compiler_util. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_type_subst. :- import_module assoc_list. :- import_module map. diff --git a/compiler/ctgc.util.m b/compiler/ctgc.util.m index 2c80861b2..73db9880c 100644 --- a/compiler/ctgc.util.m +++ b/compiler/ctgc.util.m @@ -51,17 +51,17 @@ list(mer_type), tvarset) = tsubst. %-----------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% :- implementation. -:- import_module libs.compiler_util. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_type_subst. :- import_module bool. :- import_module list. :- import_module map. -:- import_module string. + +%-----------------------------------------------------------------------------% pred_requires_no_analysis(ModuleInfo, PredId) :- module_info_get_special_pred_map(ModuleInfo, SpecialPredMap), diff --git a/compiler/dead_proc_elim.m b/compiler/dead_proc_elim.m index 17d1f87ee..0118f1278 100644 --- a/compiler/dead_proc_elim.m +++ b/compiler/dead_proc_elim.m @@ -80,7 +80,6 @@ :- import_module libs.options. :- import_module parse_tree.error_util. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module int. diff --git a/compiler/deep_profiling.m b/compiler/deep_profiling.m index 108a584a9..2773164f2 100644 --- a/compiler/deep_profiling.m +++ b/compiler/deep_profiling.m @@ -32,23 +32,17 @@ :- import_module backend_libs.rtti. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module hlds.pred_table. -:- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. -:- import_module ll_backend.code_util. -:- import_module ll_backend.trace_gen. :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module transform_hlds. :- import_module transform_hlds.dependency_graph. diff --git a/compiler/deforest.m b/compiler/deforest.m index 251e37a37..4c7ba4373 100644 --- a/compiler/deforest.m +++ b/compiler/deforest.m @@ -51,16 +51,11 @@ :- import_module check_hlds.det_analysis. :- import_module check_hlds.det_report. :- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_info. :- import_module check_hlds.mode_util. :- import_module check_hlds.modes. -:- import_module check_hlds.purity. :- import_module check_hlds.simplify. -:- import_module check_hlds.unique_modes. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module hlds.passes_aux. @@ -71,7 +66,6 @@ :- import_module mdbcomp.prim_data. :- import_module parse_tree.error_util. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. :- import_module transform_hlds.dependency_graph. diff --git a/compiler/delay_construct.m b/compiler/delay_construct.m index 0611caeaa..a52061f07 100644 --- a/compiler/delay_construct.m +++ b/compiler/delay_construct.m @@ -43,7 +43,6 @@ :- implementation. :- import_module check_hlds.inst_match. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. diff --git a/compiler/dense_switch.m b/compiler/dense_switch.m index 3c7c1cef2..3b5cb35d4 100644 --- a/compiler/dense_switch.m +++ b/compiler/dense_switch.m @@ -58,15 +58,12 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. -:- import_module hlds.hlds_module. :- import_module libs.tree. :- import_module ll_backend.code_gen. :- import_module ll_backend.trace_gen. -:- import_module char. :- import_module int. :- import_module list. -:- import_module map. :- import_module pair. %-----------------------------------------------------------------------------% diff --git a/compiler/dep_par_conj.m b/compiler/dep_par_conj.m index 0f4ebd57b..412a1bced 100644 --- a/compiler/dep_par_conj.m +++ b/compiler/dep_par_conj.m @@ -94,7 +94,6 @@ :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. -:- import_module transform_hlds.dependency_graph. :- import_module assoc_list. :- import_module bool. @@ -107,7 +106,6 @@ :- import_module std_util. :- import_module string. :- import_module svmap. -:- import_module svset. :- import_module svvarset. :- import_module term. :- import_module varset. diff --git a/compiler/dependency_graph.m b/compiler/dependency_graph.m index e99b5e3cc..c54385958 100644 --- a/compiler/dependency_graph.m +++ b/compiler/dependency_graph.m @@ -115,20 +115,13 @@ :- import_module backend_libs. :- import_module backend_libs.name_mangle. :- import_module backend_libs.proc_label. -:- import_module check_hlds.mode_util. -:- import_module hlds.goal_util. :- import_module hlds.hlds_clauses. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. :- import_module mdbcomp.prim_data. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_data. :- import_module bool. -:- import_module eqvclass. :- import_module int. :- import_module map. :- import_module maybe. @@ -137,7 +130,6 @@ :- import_module relation. :- import_module set. :- import_module std_util. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/det_report.m b/compiler/det_report.m index 36ea8d0b1..c6c690c84 100644 --- a/compiler/det_report.m +++ b/compiler/det_report.m @@ -141,7 +141,6 @@ :- import_module mdbcomp.prim_data. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. :- import_module assoc_list. @@ -150,7 +149,6 @@ :- import_module int. :- import_module map. :- import_module maybe. -:- import_module set. :- import_module solutions. :- import_module string. :- import_module term. diff --git a/compiler/disj_gen.m b/compiler/disj_gen.m index c59fe6273..e56679065 100644 --- a/compiler/disj_gen.m +++ b/compiler/disj_gen.m @@ -34,7 +34,6 @@ :- implementation. :- import_module hlds.goal_form. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -46,7 +45,6 @@ :- import_module parse_tree.prog_data. :- import_module bool. -:- import_module map. :- import_module maybe. :- import_module pair. :- import_module set. diff --git a/compiler/dupelim.m b/compiler/dupelim.m index b1447f6d8..05dacb3f6 100644 --- a/compiler/dupelim.m +++ b/compiler/dupelim.m @@ -65,7 +65,6 @@ :- import_module ll_backend.basic_block. :- import_module ll_backend.opt_util. -:- import_module assoc_list. :- import_module bool. :- import_module map. :- import_module maybe. diff --git a/compiler/equiv_type.m b/compiler/equiv_type.m index b20f386fc..c22388a2a 100644 --- a/compiler/equiv_type.m +++ b/compiler/equiv_type.m @@ -113,7 +113,6 @@ :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_mode. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. diff --git a/compiler/equiv_type_hlds.m b/compiler/equiv_type_hlds.m index cdfeea236..d02b4f05c 100644 --- a/compiler/equiv_type_hlds.m +++ b/compiler/equiv_type_hlds.m @@ -54,7 +54,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module svmap. :- import_module svset. :- import_module term. diff --git a/compiler/error_util.m b/compiler/error_util.m index f78e231fe..885a3d24f 100644 --- a/compiler/error_util.m +++ b/compiler/error_util.m @@ -415,7 +415,6 @@ :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module libs.compiler_util. :- import_module char. diff --git a/compiler/exception_analysis.m b/compiler/exception_analysis.m index f4d66b1ee..62d53181f 100644 --- a/compiler/exception_analysis.m +++ b/compiler/exception_analysis.m @@ -128,13 +128,9 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. -:- import_module hlds.make_hlds. -:- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -143,7 +139,6 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.dependency_graph. :- import_module transform_hlds.mmc_analysis. @@ -153,7 +148,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module term. %----------------------------------------------------------------------------% diff --git a/compiler/fact_table.m b/compiler/fact_table.m index f00f556e8..28d28360d 100644 --- a/compiler/fact_table.m +++ b/compiler/fact_table.m @@ -97,13 +97,10 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.export. :- import_module backend_libs.foreign. -:- import_module backend_libs.name_mangle. :- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. :- import_module hlds.arg_info. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. -:- import_module hlds.hlds_out. :- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -114,7 +111,6 @@ :- import_module parse_tree.error_util. :- import_module parse_tree.modules. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_io. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. @@ -122,11 +118,9 @@ :- import_module bool. :- import_module char. :- import_module float. -:- import_module getopt_io. :- import_module int. :- import_module library. :- import_module map. -:- import_module math. :- import_module maybe. :- import_module pair. :- import_module parser. diff --git a/compiler/follow_code.m b/compiler/follow_code.m index a9f04ad41..88d4bfcbb 100644 --- a/compiler/follow_code.m +++ b/compiler/follow_code.m @@ -52,10 +52,8 @@ :- implementation. -:- import_module check_hlds.det_analysis. :- import_module check_hlds.mode_util. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -63,10 +61,7 @@ :- import_module parse_tree.prog_data. :- import_module bool. -:- import_module map. :- import_module pair. -:- import_module set. -:- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/follow_vars.m b/compiler/follow_vars.m index 3cc4671e6..89351d1a4 100644 --- a/compiler/follow_vars.m +++ b/compiler/follow_vars.m @@ -51,16 +51,10 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.arg_info. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. -:- import_module hlds.quantification. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module ll_backend.call_gen. -:- import_module ll_backend.code_util. -:- import_module ll_backend.llds. :- import_module parse_tree.prog_data. :- import_module assoc_list. @@ -70,7 +64,6 @@ :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module set. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/compiler/frameopt.m b/compiler/frameopt.m index 6400e6448..5fc3fdc9f 100644 --- a/compiler/frameopt.m +++ b/compiler/frameopt.m @@ -157,8 +157,6 @@ :- import_module libs.compiler_util. :- import_module libs.options. -:- import_module ll_backend.code_util. -:- import_module ll_backend.livemap. :- import_module ll_backend.opt_debug. :- import_module ll_backend.opt_util. :- import_module parse_tree.prog_data. diff --git a/compiler/global_data.m b/compiler/global_data.m index c09d577f8..2df451d09 100644 --- a/compiler/global_data.m +++ b/compiler/global_data.m @@ -131,10 +131,8 @@ :- implementation. -:- import_module backend_libs.rtti. :- import_module libs.compiler_util. :- import_module ll_backend.layout. -:- import_module ll_backend.llds_out. :- import_module bimap. :- import_module counter. @@ -142,7 +140,6 @@ :- import_module map. :- import_module pair. :- import_module require. -:- import_module set. :- import_module svbimap. :- import_module svmap. diff --git a/compiler/goal_form.m b/compiler/goal_form.m index e12837d80..7ba9fb4aa 100644 --- a/compiler/goal_form.m +++ b/compiler/goal_form.m @@ -172,12 +172,10 @@ :- implementation. -:- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. :- import_module transform_hlds.exception_analysis. :- import_module transform_hlds.term_constr_main. -:- import_module transform_hlds.term_util. :- import_module bool. :- import_module int. diff --git a/compiler/goal_store.m b/compiler/goal_store.m index 402e67d6d..89d31ba1b 100644 --- a/compiler/goal_store.m +++ b/compiler/goal_store.m @@ -14,7 +14,6 @@ % that are specific to hlds_goals. % %-----------------------------------------------------------------------------% -%-----------------------------------------------------------------------------% :- module transform_hlds.goal_store. :- interface. @@ -54,7 +53,6 @@ :- import_module hlds.goal_util. -:- import_module int. :- import_module list. :- import_module map. :- import_module solutions. diff --git a/compiler/goal_util.m b/compiler/goal_util.m index 79831d22b..1bec7290e 100644 --- a/compiler/goal_util.m +++ b/compiler/goal_util.m @@ -383,10 +383,8 @@ :- implementation. :- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module hlds.goal_form. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. diff --git a/compiler/granularity.m b/compiler/granularity.m index 3827a6884..85676bdbc 100644 --- a/compiler/granularity.m +++ b/compiler/granularity.m @@ -28,7 +28,6 @@ :- import_module hlds.goal_util. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_goal. -:- import_module hlds.instmap. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module libs.compiler_util. diff --git a/compiler/handle_options.m b/compiler/handle_options.m index 4edb6ec7c..42272718f 100644 --- a/compiler/handle_options.m +++ b/compiler/handle_options.m @@ -83,7 +83,6 @@ :- import_module libs.trace_params. :- import_module parse_tree. :- import_module parse_tree.error_util. -:- import_module parse_tree.prog_io_util. :- import_module char. :- import_module dir. diff --git a/compiler/hhf.m b/compiler/hhf.m index ae4d2d5db..bfb971186 100644 --- a/compiler/hhf.m +++ b/compiler/hhf.m @@ -43,10 +43,8 @@ :- implementation. :- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.passes_aux. -:- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. diff --git a/compiler/higher_order.m b/compiler/higher_order.m index 55d3f0970..e69a05e81 100644 --- a/compiler/higher_order.m +++ b/compiler/higher_order.m @@ -55,7 +55,6 @@ :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module hlds.special_pred. @@ -63,18 +62,15 @@ :- import_module libs.globals. :- import_module libs.options. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.inlining. :- import_module assoc_list. :- import_module bool. -:- import_module char. :- import_module counter. :- import_module int. :- import_module list. diff --git a/compiler/hlds_clauses.m b/compiler/hlds_clauses.m index f1b3c8aad..040137ad4 100644 --- a/compiler/hlds_clauses.m +++ b/compiler/hlds_clauses.m @@ -172,25 +172,15 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.goal_form. -:- import_module hlds.goal_util. -:- import_module hlds.make_hlds. -:- import_module libs.compiler_util. -:- import_module libs.options. -:- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. :- import_module int. :- import_module map. -:- import_module string. -:- import_module svmap. :- import_module term. :- import_module varset. +%-----------------------------------------------------------------------------% + clauses_info_init(Arity, ClausesInfo) :- map.init(VarTypes), map.init(TVarNameMap), diff --git a/compiler/hlds_code_util.m b/compiler/hlds_code_util.m index 9616b87b2..620448a04 100644 --- a/compiler/hlds_code_util.m +++ b/compiler/hlds_code_util.m @@ -50,23 +50,18 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module bool. :- import_module char. :- import_module map. -:- import_module pair. :- import_module set. :- import_module string. -:- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/hlds_data.m b/compiler/hlds_data.m index 0aff062e7..44e48efa9 100644 --- a/compiler/hlds_data.m +++ b/compiler/hlds_data.m @@ -5,14 +5,16 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% +% File: hlds_data.m. +% Main authors: fjh, conway. +% % This module defines the part of the HLDS that deals with issues related % to data and its representation: function symbols, types, insts, modes. - -% Main authors: fjh, conway. +% +%-----------------------------------------------------------------------------% :- module hlds.hlds_data. - :- interface. :- import_module hlds.hlds_pred. @@ -32,7 +34,6 @@ :- import_module check_hlds.type_util. :- import_module libs.compiler_util. -:- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. :- import_module int. diff --git a/compiler/hlds_error_util.m b/compiler/hlds_error_util.m index 1902e00bb..3c64f10de 100644 --- a/compiler/hlds_error_util.m +++ b/compiler/hlds_error_util.m @@ -69,7 +69,6 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.special_pred. :- import_module mdbcomp.prim_data. :- import_module libs.compiler_util. diff --git a/compiler/hlds_goal.m b/compiler/hlds_goal.m index 6d0e479a6..1d95d9982 100644 --- a/compiler/hlds_goal.m +++ b/compiler/hlds_goal.m @@ -1442,12 +1442,9 @@ :- implementation. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module libs.compiler_util. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module map. diff --git a/compiler/hlds_module.m b/compiler/hlds_module.m index e18600a5d..290b9b9b3 100644 --- a/compiler/hlds_module.m +++ b/compiler/hlds_module.m @@ -50,17 +50,11 @@ :- implementation. -:- import_module hlds.hlds_out. :- import_module transform_hlds.mmc_analysis. :- import_module parse_tree.modules. -:- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module int. :- import_module string. -:- import_module svmap. -:- import_module svmulti_map. %-----------------------------------------------------------------------------% diff --git a/compiler/hlds_out.m b/compiler/hlds_out.m index 31db692b6..f379a36f0 100644 --- a/compiler/hlds_out.m +++ b/compiler/hlds_out.m @@ -260,7 +260,6 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_rtti. @@ -283,7 +282,6 @@ :- import_module int. :- import_module map. :- import_module maybe. -:- import_module multi_map. :- import_module pair. :- import_module set. :- import_module string. diff --git a/compiler/hlds_pred.m b/compiler/hlds_pred.m index acffc576f..51b8b89f7 100644 --- a/compiler/hlds_pred.m +++ b/compiler/hlds_pred.m @@ -52,17 +52,13 @@ :- import_module hlds.goal_form. :- import_module hlds.goal_util. :- import_module hlds.hlds_rtti. -:- import_module hlds.make_hlds. :- import_module libs.compiler_util. :- import_module libs.options. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. -% Standard library modules. :- import_module int. :- import_module string. -:- import_module svmap. :- import_module term. :- import_module unit. :- import_module varset. diff --git a/compiler/hlds_rtti.m b/compiler/hlds_rtti.m index fcdca77e3..bcd2d649f 100644 --- a/compiler/hlds_rtti.m +++ b/compiler/hlds_rtti.m @@ -13,7 +13,6 @@ % relating to RTTI. % %-----------------------------------------------------------------------------% -%-----------------------------------------------------------------------------% :- module hlds.hlds_rtti. :- interface. @@ -28,6 +27,8 @@ :- import_module map. :- import_module set. +%-----------------------------------------------------------------------------% + :- type prog_var_name == string. % The rtti_proc_label type holds all the information about a procedure @@ -309,24 +310,15 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.goal_form. -:- import_module hlds.goal_util. -:- import_module hlds.make_hlds. :- import_module libs.compiler_util. -:- import_module libs.options. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. -:- import_module parse_tree.prog_util. -:- import_module int. :- import_module solutions. -:- import_module string. :- import_module svmap. :- import_module term. -:- import_module varset. + +%-----------------------------------------------------------------------------% type_info_locn_var(type_info(Var), Var). type_info_locn_var(typeclass_info(Var, _), Var). diff --git a/compiler/il_peephole.m b/compiler/il_peephole.m index 4584e4f64..7eebe6496 100644 --- a/compiler/il_peephole.m +++ b/compiler/il_peephole.m @@ -61,7 +61,6 @@ :- import_module assoc_list. :- import_module bool. :- import_module int. -:- import_module map. :- import_module pair. :- import_module string. diff --git a/compiler/inlining.m b/compiler/inlining.m index 01115c821..a8aba050b 100644 --- a/compiler/inlining.m +++ b/compiler/inlining.m @@ -151,7 +151,6 @@ :- import_module check_hlds.mode_util. :- import_module check_hlds.purity. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.passes_aux. :- import_module hlds.quantification. :- import_module libs.compiler_util. @@ -166,10 +165,8 @@ :- import_module transform_hlds.dead_proc_elim. :- import_module transform_hlds.dependency_graph. -:- import_module assoc_list. :- import_module bool. :- import_module int. -:- import_module io. :- import_module list. :- import_module maybe. :- import_module pair. diff --git a/compiler/inst_graph.m b/compiler/inst_graph.m index 970bd76e6..e22491f5d 100644 --- a/compiler/inst_graph.m +++ b/compiler/inst_graph.m @@ -185,7 +185,6 @@ :- implementation. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_out. :- import_module libs.compiler_util. diff --git a/compiler/instmap.m b/compiler/instmap.m index 886cc0725..667dd365b 100644 --- a/compiler/instmap.m +++ b/compiler/instmap.m @@ -322,8 +322,6 @@ :- import_module check_hlds.inst_util. :- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. -:- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. diff --git a/compiler/intermod.m b/compiler/intermod.m index 5effdd3ca..28a2a262e 100644 --- a/compiler/intermod.m +++ b/compiler/intermod.m @@ -103,8 +103,6 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. -:- import_module hlds.instmap. -:- import_module hlds.passes_aux. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module libs.compiler_util. @@ -121,7 +119,6 @@ :- import_module transform_hlds.inlining. :- import_module assoc_list. -:- import_module dir. :- import_module getopt_io. :- import_module int. :- import_module list. diff --git a/compiler/java_util.m b/compiler/java_util.m index 0c303a2f7..3fcfbeeea 100644 --- a/compiler/java_util.m +++ b/compiler/java_util.m @@ -20,8 +20,6 @@ :- import_module backend_libs.builtin_ops. -:- import_module string. - %-----------------------------------------------------------------------------% % Succeeds iff the given string matches a reserved word in Java. @@ -66,10 +64,6 @@ :- implementation. -:- import_module parse_tree.error_util. - -:- import_module list. - %-----------------------------------------------------------------------------% % Tags are not used in the Java back-end, as such, all of the tagging diff --git a/compiler/jumpopt.m b/compiler/jumpopt.m index 20f3cac71..6df3b65b8 100644 --- a/compiler/jumpopt.m +++ b/compiler/jumpopt.m @@ -67,7 +67,6 @@ :- import_module ll_backend.code_util. :- import_module ll_backend.opt_util. -:- import_module int. :- import_module map. :- import_module maybe. :- import_module pair. diff --git a/compiler/lambda.m b/compiler/lambda.m index ccac41949..0fefae2c1 100644 --- a/compiler/lambda.m +++ b/compiler/lambda.m @@ -83,9 +83,7 @@ :- implementation. -:- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.goal_util. :- import_module hlds.hlds_data. @@ -107,7 +105,6 @@ :- import_module map. :- import_module pair. :- import_module set. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/layout_out.m b/compiler/layout_out.m index 1d01daf6d..dc0172781 100644 --- a/compiler/layout_out.m +++ b/compiler/layout_out.m @@ -31,6 +31,8 @@ :- import_module bool. :- import_module io. +%-----------------------------------------------------------------------------% + % Given a Mercury representation of a layout structure, output its % definition in the appropriate C global variable. % @@ -97,22 +99,16 @@ :- 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. :- import_module hlds.hlds_rtti. :- import_module hlds.special_pred. :- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. :- import_module libs.trace_params. -:- import_module ll_backend.code_util. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_out. -:- import_module char. :- import_module int. :- import_module list. :- import_module maybe. diff --git a/compiler/lco.m b/compiler/lco.m index c3f1b2638..73a9f2034 100644 --- a/compiler/lco.m +++ b/compiler/lco.m @@ -116,7 +116,6 @@ :- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.arg_info. :- import_module hlds.goal_util. :- import_module hlds.hlds_code_util. diff --git a/compiler/live_vars.m b/compiler/live_vars.m index c02cc8d22..afa262f9d 100644 --- a/compiler/live_vars.m +++ b/compiler/live_vars.m @@ -22,19 +22,17 @@ :- module ll_backend.live_vars. :- interface. -% Parse tree modules -:- import_module parse_tree.prog_data. - -% HLDS modules :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module parse_tree.prog_data. -% Standard library modules :- import_module bool. :- import_module set. +%-----------------------------------------------------------------------------% + :- type alloc_data ---> alloc_data( module_info :: module_info, @@ -62,25 +60,20 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.arg_info. :- import_module hlds.code_model. -:- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module libs.compiler_util. -:- import_module ll_backend.liveness. -:- import_module ll_backend.llds. -:- import_module assoc_list. -:- import_module int. :- import_module list. :- import_module map. :- import_module pair. +%-----------------------------------------------------------------------------% + % Information about which variables in a parallel conjunction need stack % slots. % diff --git a/compiler/liveness.m b/compiler/liveness.m index dcc436d74..e48537053 100644 --- a/compiler/liveness.m +++ b/compiler/liveness.m @@ -184,29 +184,23 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.polymorphism. :- import_module hlds.arg_info. :- import_module hlds.code_model. :- import_module hlds.goal_form. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_out. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module libs.trace_params. -:- import_module ll_backend.llds. :- import_module ll_backend.trace_gen. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. diff --git a/compiler/ll_pseudo_type_info.m b/compiler/ll_pseudo_type_info.m index cc6c689d6..50ecde26e 100644 --- a/compiler/ll_pseudo_type_info.m +++ b/compiler/ll_pseudo_type_info.m @@ -63,8 +63,6 @@ :- import_module backend_libs.pseudo_type_info. :- import_module backend_libs.rtti. -:- import_module bool. -:- import_module int. :- import_module list. :- import_module maybe. diff --git a/compiler/llds_out.m b/compiler/llds_out.m index b22f7db84..4048bc863 100644 --- a/compiler/llds_out.m +++ b/compiler/llds_out.m @@ -180,20 +180,15 @@ :- implementation. :- import_module backend_libs.c_util. -:- import_module backend_libs.compile_target_code. :- import_module backend_libs.export. -:- import_module backend_libs.foreign. :- import_module backend_libs.name_mangle. :- import_module backend_libs.proc_label. :- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.options. :- import_module libs.trace_params. -:- import_module ll_backend.exprn_aux. :- import_module ll_backend.layout. :- import_module ll_backend.layout_out. :- import_module ll_backend.pragma_c_gen. @@ -202,12 +197,10 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module char. :- import_module deconstruct. -:- import_module dir. :- import_module int. :- import_module library. % for the version number. :- import_module maybe. diff --git a/compiler/lookup_switch.m b/compiler/lookup_switch.m index 07be0b398..2e16f181e 100644 --- a/compiler/lookup_switch.m +++ b/compiler/lookup_switch.m @@ -74,19 +74,15 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module hlds.goal_form. :- import_module hlds.hlds_data. -:- import_module hlds.instmap. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module libs.tree. -:- import_module ll_backend.code_gen. :- import_module ll_backend.continuation_info. :- import_module ll_backend.dense_switch. -:- import_module ll_backend.exprn_aux. :- import_module ll_backend.global_data. :- import_module ll_backend.lookup_util. :- import_module parse_tree.prog_data. @@ -99,9 +95,10 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module solutions. :- import_module string. +%-----------------------------------------------------------------------------% + :- type case_consts ---> all_one_soln( assoc_list(int, list(rval)) diff --git a/compiler/loop_inv.m b/compiler/loop_inv.m index 8a2eec649..1871db657 100644 --- a/compiler/loop_inv.m +++ b/compiler/loop_inv.m @@ -120,9 +120,7 @@ :- import_module check_hlds.inst_match. :- import_module check_hlds.inst_util. :- import_module check_hlds.mode_util. -:- import_module check_hlds.purity. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.instmap. :- import_module hlds.quantification. diff --git a/compiler/lp.m b/compiler/lp.m index 55de6cdbe..00e216d11 100644 --- a/compiler/lp.m +++ b/compiler/lp.m @@ -34,7 +34,6 @@ :- module libs.lp. :- interface. -:- import_module float. :- import_module io. :- import_module list. :- import_module map. @@ -86,6 +85,7 @@ :- import_module libs.compiler_util. :- import_module bool. +:- import_module float. :- import_module int. :- import_module maybe. :- import_module set. @@ -97,19 +97,17 @@ %-----------------------------------------------------------------------------% -:- type lp_info ---> - lp( - varset :: varset, - urs_map :: map(var, pair(var)), +:- type lp_info + ---> lp( + varset :: varset, + urs_map :: map(var, pair(var)), % Map from variables with URS to the % corresponding pair of variables that % represent that variable in the standard % form (x = x' - x'', x', x'' >= 0). - - slack_vars :: list(var), % slack variables - - artificial_vars :: list(var) % artificial variables - ). + slack_vars :: list(var), % slack variables + artificial_vars :: list(var) % artificial variables + ). %-----------------------------------------------------------------------------% diff --git a/compiler/lp_rational.m b/compiler/lp_rational.m index d5b5822b8..e96499138 100644 --- a/compiler/lp_rational.m +++ b/compiler/lp_rational.m @@ -326,7 +326,6 @@ :- import_module assoc_list. :- import_module bool. -:- import_module exception. :- import_module int. :- import_module solutions. :- import_module string. diff --git a/compiler/make.dependencies.m b/compiler/make.dependencies.m index 0415159e6..4dd4dd906 100644 --- a/compiler/make.dependencies.m +++ b/compiler/make.dependencies.m @@ -115,9 +115,12 @@ :- implementation. +:- import_module parse_tree.prog_data. :- import_module transform_hlds. :- import_module transform_hlds.mmc_analysis. +:- import_module assoc_list. +:- import_module dir. :- import_module solutions. %-----------------------------------------------------------------------------% diff --git a/compiler/make.m b/compiler/make.m index b8a81a4e6..28405a088 100644 --- a/compiler/make.m +++ b/compiler/make.m @@ -68,34 +68,18 @@ :- import_module backend_libs.compile_target_code. :- import_module libs.globals. -:- import_module libs.handle_options. :- import_module libs.options. -:- import_module libs.process_util. :- import_module libs.timestamp. -:- import_module parse_tree.error_util. -:- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_io_util. -:- import_module parse_tree.prog_out. :- import_module top_level.mercury_compile. % XXX unwanted dependency -:- import_module assoc_list. :- import_module bool. -:- import_module char. -:- import_module dir. -:- import_module exception. -:- import_module getopt_io. :- import_module int. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module parser. :- import_module set. :- import_module solutions. :- import_module string. -:- import_module term. -:- import_module term_io. %-----------------------------------------------------------------------------% diff --git a/compiler/make.module_dep_file.m b/compiler/make.module_dep_file.m index 99ac49e3b..29b6fadf3 100644 --- a/compiler/make.module_dep_file.m +++ b/compiler/make.module_dep_file.m @@ -39,7 +39,20 @@ :- implementation. +:- import_module libs.globals. +:- import_module libs.process_util. +:- import_module parse_tree.error_util. +:- import_module parse_tree.mercury_to_mercury. +:- import_module parse_tree.prog_data. :- import_module parse_tree.prog_item. +:- import_module parse_tree.prog_out. + +:- import_module assoc_list. +:- import_module dir. +:- import_module getopt_io. +:- import_module parser. +:- import_module term. +:- import_module term_io. %-----------------------------------------------------------------------------% diff --git a/compiler/make.module_target.m b/compiler/make.module_target.m index d111770dd..e70780d8b 100644 --- a/compiler/make.module_target.m +++ b/compiler/make.module_target.m @@ -72,9 +72,13 @@ :- import_module analysis. :- import_module hlds.passes_aux. :- import_module libs.compiler_util. +:- import_module libs.process_util. +:- import_module parse_tree.prog_foreign. :- import_module transform_hlds. :- import_module transform_hlds.mmc_analysis. +:- import_module dir. + %-----------------------------------------------------------------------------% :- pred make_module_target(dependency_file::in, bool::in, bool::out, @@ -513,7 +517,7 @@ forkable_module_compilation_task_type(task_make_xml_doc) = yes. foreign_code_file(ModuleName, PIC, Lang, ForeignCodeFile, !IO) :- globals.io_get_globals(Globals, !IO), ( - ForeignModName0 = foreign_language_module_name( ModuleName, Lang), + ForeignModName0 = foreign_language_module_name(ModuleName, Lang), SrcExt0 = foreign_language_file_extension(Lang) -> ForeignModName = ForeignModName0, diff --git a/compiler/make.program_target.m b/compiler/make.program_target.m index af8f39088..782c88a68 100644 --- a/compiler/make.program_target.m +++ b/compiler/make.program_target.m @@ -42,11 +42,15 @@ :- import_module analysis. :- import_module hlds.passes_aux. :- import_module libs.compiler_util. +:- import_module libs.handle_options. +:- import_module libs.process_util. +:- import_module parse_tree.prog_foreign. :- import_module transform_hlds. :- import_module transform_hlds.mmc_analysis. +:- import_module dir. +:- import_module getopt_io. :- import_module relation. -:- import_module svrelation. %-----------------------------------------------------------------------------% diff --git a/compiler/make.util.m b/compiler/make.util.m index 86dd0d74b..e78c71492 100644 --- a/compiler/make.util.m +++ b/compiler/make.util.m @@ -16,6 +16,8 @@ :- module make.util. :- interface. +:- import_module assoc_list. + %-----------------------------------------------------------------------------% % % Versions of foldl which stop if the supplied predicate returns `no' @@ -271,9 +273,14 @@ :- import_module analysis. :- import_module libs.compiler_util. +:- import_module libs.handle_options. +:- import_module parse_tree.prog_foreign. :- import_module transform_hlds. :- import_module transform_hlds.mmc_analysis. +:- import_module char. +:- import_module dir. + %-----------------------------------------------------------------------------% foldl2_maybe_stop_at_error(KeepGoing, MakeTarget, Targets, Success, diff --git a/compiler/make_hlds_error.m b/compiler/make_hlds_error.m index 9359b19e0..5b8edca43 100644 --- a/compiler/make_hlds_error.m +++ b/compiler/make_hlds_error.m @@ -66,13 +66,11 @@ :- import_module check_hlds.mode_errors. :- import_module hlds.hlds_error_util. -:- import_module hlds.hlds_out. :- import_module libs.options. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_out. -:- import_module string. :- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/make_hlds_passes.m b/compiler/make_hlds_passes.m index 3bdc0c181..551c40964 100644 --- a/compiler/make_hlds_passes.m +++ b/compiler/make_hlds_passes.m @@ -124,7 +124,6 @@ :- import_module parse_tree.prog_util. :- import_module recompilation. -:- import_module int. :- import_module map. :- import_module pair. :- import_module set. diff --git a/compiler/make_hlds_warn.m b/compiler/make_hlds_warn.m index ace1ee716..2ceea5d66 100644 --- a/compiler/make_hlds_warn.m +++ b/compiler/make_hlds_warn.m @@ -72,8 +72,6 @@ :- import_module check_hlds.mode_util. :- import_module hlds.goal_util. -:- import_module hlds.hlds_out. -:- import_module libs.compiler_util. :- import_module libs.options. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_out. diff --git a/compiler/mark_static_terms.m b/compiler/mark_static_terms.m index 5318d047c..3daaea5be 100644 --- a/compiler/mark_static_terms.m +++ b/compiler/mark_static_terms.m @@ -35,13 +35,10 @@ :- implementation. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. -:- import_module bool. -:- import_module int. :- import_module list. :- import_module map. :- import_module pair. diff --git a/compiler/mercury_compile.m b/compiler/mercury_compile.m index 0090ceeaf..b3d278d8f 100644 --- a/compiler/mercury_compile.m +++ b/compiler/mercury_compile.m @@ -106,7 +106,6 @@ :- import_module ll_backend.follow_code. :- import_module ll_backend.global_data. :- import_module ll_backend.liveness. -:- import_module ll_backend.live_vars. :- import_module ll_backend.llds_out. :- import_module ll_backend.optimize. :- import_module ll_backend.proc_gen. @@ -143,7 +142,6 @@ :- import_module check_hlds.unused_imports. :- import_module check_hlds.xml_documentation. :- import_module hlds.arg_info. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. @@ -159,7 +157,6 @@ :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_item. -:- import_module parse_tree.prog_util. :- import_module recompilation. :- import_module recompilation.check. :- import_module recompilation.usage. @@ -174,7 +171,6 @@ :- import_module backend_libs.compile_target_code. :- import_module backend_libs.export. :- import_module backend_libs.foreign. -:- import_module backend_libs.name_mangle. :- import_module backend_libs.proc_label. :- import_module backend_libs.rtti. :- import_module backend_libs.type_class_info. @@ -190,11 +186,9 @@ :- import_module assoc_list. :- import_module benchmarking. :- import_module bool. -:- import_module dir. :- import_module gc. :- import_module getopt_io. :- import_module int. -:- import_module library. :- import_module list. :- import_module map. :- import_module maybe. @@ -203,7 +197,6 @@ :- import_module set. :- import_module string. :- import_module term. -:- import_module varset. :- import_module unit. %-----------------------------------------------------------------------------% diff --git a/compiler/mercury_to_mercury.m b/compiler/mercury_to_mercury.m index 0c9314152..e184f4e33 100644 --- a/compiler/mercury_to_mercury.m +++ b/compiler/mercury_to_mercury.m @@ -401,14 +401,12 @@ :- import_module libs.globals. :- import_module libs.options. :- import_module libs.rat. -:- import_module parse_tree.error_util. :- import_module parse_tree.prog_ctgc. :- import_module parse_tree.prog_io_util. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. :- import_module recompilation.version. -:- import_module assoc_list. :- import_module int. :- import_module lexer. :- import_module map. diff --git a/compiler/middle_rec.m b/compiler/middle_rec.m index 791ecae4a..0f150f912 100644 --- a/compiler/middle_rec.m +++ b/compiler/middle_rec.m @@ -32,10 +32,7 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds.code_model. -:- import_module hlds.goal_form. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. -:- import_module hlds.hlds_module. :- import_module libs.compiler_util. :- import_module libs.tree. :- import_module ll_backend.code_gen. @@ -45,7 +42,6 @@ :- import_module ll_backend.proc_gen. :- import_module ll_backend.unify_gen. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module assoc_list. :- import_module bool. diff --git a/compiler/ml_call_gen.m b/compiler/ml_call_gen.m index 1496ac324..077e4e9da 100644 --- a/compiler/ml_call_gen.m +++ b/compiler/ml_call_gen.m @@ -122,7 +122,6 @@ :- import_module backend_libs.builtin_ops. :- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -135,10 +134,8 @@ :- import_module int. :- import_module map. :- import_module maybe. -:- import_module pair. :- import_module string. :- import_module term. -:- import_module varset. %-----------------------------------------------------------------------------% % diff --git a/compiler/ml_code_gen.m b/compiler/ml_code_gen.m index ccff900b3..d2c0024f0 100644 --- a/compiler/ml_code_gen.m +++ b/compiler/ml_code_gen.m @@ -764,7 +764,6 @@ :- import_module backend_libs.builtin_ops. :- import_module backend_libs.c_util. -:- import_module backend_libs.export. :- import_module backend_libs.foreign. % XXX needed for pragma foreign code :- import_module backend_libs.rtti. :- import_module check_hlds.mode_util. @@ -784,19 +783,14 @@ :- import_module ml_backend.ml_type_gen. :- import_module ml_backend.ml_unify_gen. :- import_module ml_backend.ml_util. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module bool. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module require. :- import_module set. :- import_module solutions. :- import_module string. diff --git a/compiler/ml_code_util.m b/compiler/ml_code_util.m index 75a17bdb4..a147f4981 100644 --- a/compiler/ml_code_util.m +++ b/compiler/ml_code_util.m @@ -28,7 +28,6 @@ :- import_module parse_tree.prog_data. :- import_module bool. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. @@ -747,7 +746,6 @@ :- import_module check_hlds.type_util. :- import_module hlds.hlds_goal. :- import_module hlds.instmap. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -755,11 +753,11 @@ :- import_module ml_backend.ml_call_gen. :- import_module ml_backend.ml_code_gen. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_io. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. :- import_module counter. +:- import_module int. :- import_module pair. :- import_module stack. :- import_module string. diff --git a/compiler/ml_elim_nested.m b/compiler/ml_elim_nested.m index a399739b6..c637a58c7 100644 --- a/compiler/ml_elim_nested.m +++ b/compiler/ml_elim_nested.m @@ -437,20 +437,14 @@ :- implementation. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. +:- import_module hlds.hlds_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. +:- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_code_util. :- import_module ml_backend.ml_util. -:- import_module parse_tree.prog_util. - -% The following imports are needed for mangling pred names. -:- import_module hlds.hlds_pred. -:- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module bool. :- import_module counter. diff --git a/compiler/ml_optimize.m b/compiler/ml_optimize.m index 1ce156a2a..8659c20c9 100644 --- a/compiler/ml_optimize.m +++ b/compiler/ml_optimize.m @@ -45,15 +45,12 @@ :- implementation. -:- import_module backend_libs.builtin_ops. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_code_util. :- import_module ml_backend.ml_util. -:- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module int. diff --git a/compiler/ml_string_switch.m b/compiler/ml_string_switch.m index d53bf279d..9532333b1 100644 --- a/compiler/ml_string_switch.m +++ b/compiler/ml_string_switch.m @@ -36,17 +36,11 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. :- import_module ml_backend.ml_code_gen. :- import_module ml_backend.ml_simplify_switch. -:- import_module ml_backend.ml_switch_gen. -:- import_module parse_tree.error_util. -:- import_module assoc_list. :- import_module bool. :- import_module int. :- import_module list. diff --git a/compiler/ml_switch_gen.m b/compiler/ml_switch_gen.m index 6207633a9..1435386dd 100644 --- a/compiler/ml_switch_gen.m +++ b/compiler/ml_switch_gen.m @@ -107,7 +107,6 @@ :- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module libs.options. -:- import_module libs.tree. :- import_module ml_backend.ml_code_gen. :- import_module ml_backend.ml_code_util. :- import_module ml_backend.ml_simplify_switch. @@ -117,10 +116,8 @@ :- import_module bool. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module pair. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/ml_tag_switch.m b/compiler/ml_tag_switch.m index 3e1b21ca2..eff9ebb03 100644 --- a/compiler/ml_tag_switch.m +++ b/compiler/ml_tag_switch.m @@ -40,10 +40,7 @@ :- import_module backend_libs.builtin_ops. :- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_goal. -:- import_module hlds.hlds_module. :- import_module libs.compiler_util. :- import_module ml_backend.ml_code_gen. :- import_module ml_backend.ml_simplify_switch. @@ -54,7 +51,6 @@ :- import_module int. :- import_module map. :- import_module pair. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/ml_tailcall.m b/compiler/ml_tailcall.m index 6df407291..1b4a42ea7 100644 --- a/compiler/ml_tailcall.m +++ b/compiler/ml_tailcall.m @@ -77,20 +77,17 @@ :- implementation. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_util. :- import_module parse_tree.error_util. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module int. :- import_module list. :- import_module maybe. :- import_module pair. :- import_module solutions. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/ml_type_gen.m b/compiler/ml_type_gen.m index f87d6c392..2dfbbd5f8 100644 --- a/compiler/ml_type_gen.m +++ b/compiler/ml_type_gen.m @@ -81,7 +81,6 @@ :- implementation. :- import_module check_hlds.polymorphism. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -98,9 +97,7 @@ :- import_module list. :- import_module map. :- import_module maybe. -:- import_module pair. :- import_module set. -:- import_module string. :- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/ml_unify_gen.m b/compiler/ml_unify_gen.m index 78dddf990..cb62b1871 100644 --- a/compiler/ml_unify_gen.m +++ b/compiler/ml_unify_gen.m @@ -109,11 +109,9 @@ :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module int. :- import_module map. :- import_module pair. -:- import_module set. :- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/ml_util.m b/compiler/ml_util.m index 7b82c7217..172c063fc 100644 --- a/compiler/ml_util.m +++ b/compiler/ml_util.m @@ -195,12 +195,9 @@ :- implementation. :- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_unify_gen. -:- import_module parse_tree.prog_io. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module list. diff --git a/compiler/mlds.m b/compiler/mlds.m index 8c5f5b24b..56b17e535 100644 --- a/compiler/mlds.m +++ b/compiler/mlds.m @@ -1716,7 +1716,6 @@ :- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module libs.globals. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_type. :- import_module char. diff --git a/compiler/mlds_to_c.m b/compiler/mlds_to_c.m index 30edbb976..e65b78d17 100644 --- a/compiler/mlds_to_c.m +++ b/compiler/mlds_to_c.m @@ -78,7 +78,6 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.foreign. :- import_module backend_libs.name_mangle. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. % for pred_proc_id. @@ -93,14 +92,12 @@ % handles derived classes :- import_module ml_backend.ml_type_gen. % for ml_gen_type_name :- import_module ml_backend.ml_util. -:- import_module ml_backend.rtti_to_mlds.% for mlds_rtti_type_name. :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module assoc_list. :- import_module bool. :- import_module int. :- import_module library. diff --git a/compiler/mlds_to_gcc.m b/compiler/mlds_to_gcc.m index ed954e208..a2ae0e410 100644 --- a/compiler/mlds_to_gcc.m +++ b/compiler/mlds_to_gcc.m @@ -3,10 +3,10 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % mlds_to_gcc - Convert MLDS to the GCC back-end representation. % Main author: fjh. - +% % Note that this does *not* compile to GNU C -- instead it % actually generates GCC's internal "Tree" representation, % and then invokes the GCC back-end to compile it to assembler, @@ -32,9 +32,9 @@ % Trailing will probably work too, but since trailing % is currently implemented using the C interface, % it will end up compiling everything via C. - +% % See also gcc/mercury/README. - +% % TODO: % Fix configuration issues: % - document installation procedure better @@ -85,7 +85,7 @@ % - improve symbol table handling % % See also the TODO list in ml_code_gen.m. - +% %-----------------------------------------------------------------------------% :- module mlds_to_gcc. @@ -149,20 +149,14 @@ :- use_module gcc. :- import_module backend_libs. -:- import_module check_hlds. :- import_module hlds. :- import_module libs. :- import_module parse_tree. -% XXX some of these imports might be unused - :- import_module backend_libs.builtin_ops. -:- import_module backend_libs.name_mangle. -:- import_module backend_libs.pseudo_type_info. :- import_module backend_libs.rtti. % for rtti.addr_to_string. :- import_module hlds.code_model. :- import_module hlds.hlds_pred. % for proc_id_to_int and invalid_pred_id -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -177,11 +171,8 @@ :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module int. -:- import_module library. :- import_module list. :- import_module map. :- import_module maybe. diff --git a/compiler/mlds_to_il.m b/compiler/mlds_to_il.m index e8446c5e2..a78e6513a 100644 --- a/compiler/mlds_to_il.m +++ b/compiler/mlds_to_il.m @@ -149,26 +149,18 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module backend_libs.c_util. :- import_module backend_libs.foreign. -:- import_module backend_libs.name_mangle. -:- import_module backend_libs.pseudo_type_info. :- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.options. :- import_module libs.tree. :- import_module mdbcomp.prim_data. -:- import_module ml_backend.il_peephole. :- import_module ml_backend.ml_code_util. :- import_module ml_backend.ml_type_gen. :- import_module ml_backend.ml_util. :- import_module parse_tree.error_util. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. @@ -176,7 +168,6 @@ :- import_module counter. :- import_module deconstruct. :- import_module int. -:- import_module library. :- import_module map. :- import_module pair. :- import_module string. diff --git a/compiler/mlds_to_ilasm.m b/compiler/mlds_to_ilasm.m index 31c2057cf..1a683951d 100644 --- a/compiler/mlds_to_ilasm.m +++ b/compiler/mlds_to_ilasm.m @@ -33,40 +33,22 @@ :- implementation. -:- import_module backend_libs.builtin_ops. -:- import_module backend_libs.c_util. -:- import_module backend_libs.foreign. -:- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_pred. % for `pred_proc_id'. :- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. -:- import_module libs.tree. :- import_module ml_backend.ilasm. -:- import_module ml_backend.ilds. :- import_module ml_backend.il_peephole. -:- import_module ml_backend.ml_code_util. :- import_module ml_backend.mlds_to_il. :- import_module ml_backend.mlds_to_managed. -:- import_module ml_backend.ml_util. :- import_module parse_tree.modules. -:- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_out. -:- import_module assoc_list. :- import_module bool. -:- import_module counter. -:- import_module int. -:- import_module library. :- import_module list. -:- import_module map. :- import_module maybe. :- import_module set. :- import_module string. -:- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/mlds_to_java.m b/compiler/mlds_to_java.m index 61e34c449..96f2ff375 100644 --- a/compiler/mlds_to_java.m +++ b/compiler/mlds_to_java.m @@ -103,9 +103,6 @@ % c_util.make_float_literal. :- import_module backend_libs.builtin_ops. :- import_module backend_libs.c_util. -:- import_module backend_libs.export. % for export.type_to_type_string -:- import_module backend_libs.foreign. -:- import_module backend_libs.name_mangle. :- import_module backend_libs.rtti. :- import_module check_hlds.type_util. :- import_module hlds.hlds_pred. % for pred_proc_id. @@ -118,19 +115,15 @@ :- 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 :- import_module ml_backend.ml_util. -:- import_module ml_backend.rtti_to_mlds. % for mlds_rtti_type_name. -:- import_module parse_tree.error_util. :- import_module parse_tree.modules. % for mercury_std_library_name. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_io. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. -:- import_module char. :- import_module int. :- import_module library. :- import_module list. diff --git a/compiler/mlds_to_managed.m b/compiler/mlds_to_managed.m index d87ad518b..41b0c2407 100644 --- a/compiler/mlds_to_managed.m +++ b/compiler/mlds_to_managed.m @@ -44,21 +44,11 @@ :- implementation. -:- import_module backend_libs.builtin_ops. :- import_module backend_libs.c_util. -:- import_module backend_libs.foreign. -:- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_pred. % for `pred_proc_id'. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.options. -:- import_module libs.tree. :- import_module mdbcomp.prim_data. -:- import_module ml_backend.ilasm. :- import_module ml_backend.ilds. -:- import_module ml_backend.il_peephole. -:- import_module ml_backend.ml_code_util. :- import_module ml_backend.mlds_to_il. :- import_module ml_backend.ml_util. :- import_module parse_tree.modules. @@ -66,11 +56,8 @@ :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_out. -:- import_module assoc_list. :- import_module bool. -:- import_module counter. :- import_module deconstruct. -:- import_module int. :- import_module library. :- import_module list. :- import_module map. diff --git a/compiler/mmc_analysis.m b/compiler/mmc_analysis.m index e749f4867..876e32506 100644 --- a/compiler/mmc_analysis.m +++ b/compiler/mmc_analysis.m @@ -49,7 +49,6 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_io. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.exception_analysis. :- import_module transform_hlds.tabling_analysis. :- import_module transform_hlds.trailing_analysis. @@ -58,7 +57,6 @@ :- import_module bool. :- import_module list. :- import_module maybe. -:- import_module pair. :- import_module string. :- import_module io. :- import_module unit. diff --git a/compiler/mode_robdd.equiv_vars.m b/compiler/mode_robdd.equiv_vars.m index da57329ef..3aaaa8448 100644 --- a/compiler/mode_robdd.equiv_vars.m +++ b/compiler/mode_robdd.equiv_vars.m @@ -69,7 +69,6 @@ :- implementation. -:- import_module assoc_list. :- import_module list. :- import_module map. :- import_module pair. diff --git a/compiler/mode_robdd.implications.m b/compiler/mode_robdd.implications.m index 3c699379b..ccb42a0f6 100644 --- a/compiler/mode_robdd.implications.m +++ b/compiler/mode_robdd.implications.m @@ -69,7 +69,6 @@ :- import_module list. :- import_module map. :- import_module pair. -:- import_module require. :- import_module sparse_bitset. :- import_module term. diff --git a/compiler/module_qual.m b/compiler/module_qual.m index a4ab7a51d..a8cf69988 100644 --- a/compiler/module_qual.m +++ b/compiler/module_qual.m @@ -130,23 +130,18 @@ :- import_module libs.compiler_util. :- import_module libs.options. -:- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.modules. :- import_module parse_tree.prog_io. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_type. :- import_module parse_tree.prog_util. :- import_module assoc_list. -:- import_module int. :- import_module map. :- import_module pair. :- import_module set. :- import_module solutions. -:- import_module string. :- import_module svmap. :- import_module term. -:- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/modules.m b/compiler/modules.m index c88f11c2b..917879e4b 100644 --- a/compiler/modules.m +++ b/compiler/modules.m @@ -792,8 +792,6 @@ :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.module_qual. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_io_util. -:- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_mutable. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. diff --git a/compiler/opt_debug.m b/compiler/opt_debug.m index 0f7737eff..b811edb6e 100644 --- a/compiler/opt_debug.m +++ b/compiler/opt_debug.m @@ -5,11 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - -% Debugging support for LLDS to LLDS peephole optimization. - +% +% File: opt_debug.m. % Main author: zs. - +% +% Debugging support for LLDS to LLDS peephole optimization. +% %-----------------------------------------------------------------------------% :- module ll_backend.opt_debug. @@ -118,24 +119,20 @@ :- func dump_fullinstrs(proc_label, bool, list(instruction)) = string. +%-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% :- implementation. -:- import_module backend_libs.name_mangle. :- import_module backend_libs.proc_label. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.special_pred. :- import_module libs.globals. :- import_module libs.options. -:- import_module ll_backend.code_util. :- import_module ll_backend.llds_out. -:- import_module ll_backend.opt_util. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_out. :- import_module char. :- import_module int. diff --git a/compiler/opt_util.m b/compiler/opt_util.m index 60f95d9df..68ed53404 100644 --- a/compiler/opt_util.m +++ b/compiler/opt_util.m @@ -5,12 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: opt_util.m. % Main author: zs. - +% % Utilities for LLDS to LLDS optimization. - +% %-----------------------------------------------------------------------------% :- module ll_backend.opt_util. @@ -309,12 +309,9 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module backend_libs.proc_label. -:- import_module hlds.hlds_pred. :- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module ll_backend.exprn_aux. -:- import_module ll_backend.llds_out. :- import_module parse_tree.prog_data. :- import_module int. diff --git a/compiler/optimize.m b/compiler/optimize.m index ded3bff8a..b9163a17d 100644 --- a/compiler/optimize.m +++ b/compiler/optimize.m @@ -5,12 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: optimize.m. % Main author: zs. - +% % This module contains LLDS to LLDS optimizations. - +% %-----------------------------------------------------------------------------% :- module ll_backend.optimize. @@ -35,11 +35,8 @@ :- implementation. -:- import_module backend_libs.name_mangle. -:- import_module backend_libs.proc_label. :- import_module hlds.code_model. :- import_module hlds.hlds_pred. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -50,7 +47,6 @@ :- import_module ll_backend.jumpopt. :- import_module ll_backend.labelopt. :- import_module ll_backend.stdlabel. -:- import_module ll_backend.llds_out. :- import_module ll_backend.opt_debug. :- import_module ll_backend.opt_util. :- import_module ll_backend.peephole. @@ -58,7 +54,6 @@ :- import_module ll_backend.use_local_vars. :- import_module ll_backend.wrap_blocks. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_out. :- import_module bool. diff --git a/compiler/options.m b/compiler/options.m index 49a9d0012..a50cf69c9 100644 --- a/compiler/options.m +++ b/compiler/options.m @@ -813,7 +813,6 @@ :- import_module libs.compiler_util. :- import_module libs.handle_options. -:- import_module assoc_list. :- import_module bool. :- import_module dir. :- import_module int. diff --git a/compiler/options_file.m b/compiler/options_file.m index 031c6a25b..d16ffbcc8 100644 --- a/compiler/options_file.m +++ b/compiler/options_file.m @@ -81,7 +81,6 @@ :- import_module libs.options. :- import_module parse_tree.error_util. :- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_out. :- import_module assoc_list. :- import_module bool. diff --git a/compiler/par_conj_gen.m b/compiler/par_conj_gen.m index 713c3b8fc..3c6ef9652 100644 --- a/compiler/par_conj_gen.m +++ b/compiler/par_conj_gen.m @@ -106,7 +106,6 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. @@ -117,7 +116,6 @@ :- import_module libs.tree. :- import_module ll_backend.code_gen. :- import_module ll_backend.code_info. -:- import_module ll_backend.code_util. :- import_module ll_backend.continuation_info. :- import_module ll_backend.exprn_aux. :- import_module parse_tree.prog_data. @@ -129,7 +127,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module unit. %---------------------------------------------------------------------------% diff --git a/compiler/passes_aux.m b/compiler/passes_aux.m index 3637c5b3b..0b7c9e2d2 100644 --- a/compiler/passes_aux.m +++ b/compiler/passes_aux.m @@ -5,13 +5,13 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: passes_aux.m. % Author: zs - +% % This file contains auxiliary routines for the passes of the front and back % ends of the compiler. - +% %-----------------------------------------------------------------------------% :- module hlds.passes_aux. @@ -216,7 +216,6 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.hlds_out. :- import_module libs.compiler_util. :- import_module libs.globals. diff --git a/compiler/pd_cost.m b/compiler/pd_cost.m index 81ef03b91..28a297437 100644 --- a/compiler/pd_cost.m +++ b/compiler/pd_cost.m @@ -5,14 +5,14 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - -% File: pd_cost.m -% Main author: stayl - +% +% File: pd_cost.m. +% Main author: stayl. +% % goal_cost gives a very rough guess as to how much work a given goal % will cause at runtime. This only counts the local cost not including % the time taken by called predicates. - +% %-----------------------------------------------------------------------------% :- module transform_hlds.pd_cost. @@ -42,7 +42,6 @@ :- implementation. -:- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. diff --git a/compiler/pd_info.m b/compiler/pd_info.m index 83ad276b3..ccf6ec516 100644 --- a/compiler/pd_info.m +++ b/compiler/pd_info.m @@ -5,12 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: pd_info.m. % Main author: stayl. - +% % Types for deforestation. - +% %-----------------------------------------------------------------------------% :- module transform_hlds.pd_info. @@ -117,23 +117,18 @@ :- implementation. -:- import_module check_hlds.det_util. :- import_module check_hlds.inst_match. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_util. :- import_module transform_hlds.pd_debug. :- import_module transform_hlds.pd_util. -:- import_module assoc_list. :- import_module bool. :- import_module int. -:- import_module string. :- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/pd_term.m b/compiler/pd_term.m index 18d40f216..529bcc8ef 100644 --- a/compiler/pd_term.m +++ b/compiler/pd_term.m @@ -5,10 +5,10 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: pd_term.m. % Main author: stayl. - +% % Termination checking for the deforestation process. % There are two places where care must be taken to ensure % termination of the process: @@ -34,7 +34,7 @@ % - Use homeomorphic embedding instead of term sizes as suggested in % the papers on partial deduction from K.U. Leuven. This will be % useful (necessary?) if we start propagating equality constraints. - +% %-----------------------------------------------------------------------------% :- module transform_hlds.pd_term. @@ -102,7 +102,6 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. @@ -112,7 +111,6 @@ :- import_module bool. :- import_module int. :- import_module map. -:- import_module set. %-----------------------------------------------------------------------------% diff --git a/compiler/pd_util.m b/compiler/pd_util.m index 30463c546..23e32f00b 100644 --- a/compiler/pd_util.m +++ b/compiler/pd_util.m @@ -5,12 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File pd_util.m. % Main author: stayl. - +% % Utility predicates for deforestation and partial evaluation. - +% %-----------------------------------------------------------------------------% :- module transform_hlds.pd_util. @@ -162,11 +162,8 @@ :- import_module check_hlds.inst_util. :- import_module check_hlds.mode_info. :- import_module check_hlds.mode_util. -:- import_module check_hlds.purity. :- import_module check_hlds.unique_modes. -:- import_module hlds.goal_form. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.instmap. :- import_module hlds.quantification. :- import_module libs.compiler_util. @@ -175,9 +172,7 @@ :- import_module parse_tree.error_util. :- import_module parse_tree.prog_type. :- import_module transform_hlds.constraint. -:- import_module transform_hlds.pd_cost. :- import_module transform_hlds.pd_debug. -:- import_module transform_hlds.unused_args. :- import_module assoc_list. :- import_module int. diff --git a/compiler/peephole.m b/compiler/peephole.m index 40fc65dde..819a3a1dd 100644 --- a/compiler/peephole.m +++ b/compiler/peephole.m @@ -5,12 +5,12 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: peeophole.m: % Authors: fjh, zs. - +% % Local LLDS to LLDS optimizations based on pattern-matching. - +% %-----------------------------------------------------------------------------% :- module ll_backend.peephole. @@ -35,8 +35,6 @@ :- implementation. :- import_module backend_libs.builtin_ops. -:- import_module ll_backend.code_util. -:- import_module ll_backend.opt_debug. :- import_module ll_backend.opt_util. :- import_module int. diff --git a/compiler/polyhedron.m b/compiler/polyhedron.m index 5c0e5dfca..5d2ecf5ee 100644 --- a/compiler/polyhedron.m +++ b/compiler/polyhedron.m @@ -6,17 +6,17 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % -% file: polyhedron.m -% main author: juliensf - +% File: polyhedron.m. +% Main author: juliensf. +% % Provides closed convex polyhedra over Q^n. % These are useful as an abstract domain for describing numerical relational % information. - +% % The set of closed convex polyhedra is partially ordered by subset inclusion. % It forms a lattice with intersection as the binary meet operation and convex % hull as the binary join operation. - +% % This module includes procedures for: % - computing the intersection of two convex polyhedra % - computing the convex hull of two convex polyhedra @@ -25,9 +25,9 @@ % expensive. % - converting a convex polyhedron to and from an equivalent system % of linear constraints. - +% % It also includes an implementation of widening for convex polyhedra. - +% % NOTE: many of the operations in this module require you to pass in % the varset that the variables in the constraints that define the polyhedron % were allocated from. This because the code for computing the convex hull @@ -35,10 +35,10 @@ % variables. % % XXX We could avoid this with some extra work. - +% % TODO: % * See if using the double description method is any faster. - +% %-----------------------------------------------------------------------------% :- module libs.polyhedron. @@ -187,10 +187,7 @@ :- import_module libs.compiler_util. :- import_module libs.rat. -:- import_module bool. -:- import_module int. :- import_module pair. -:- import_module string. :- import_module svmap. :- import_module svvarset. :- import_module varset. diff --git a/compiler/post_term_analysis.m b/compiler/post_term_analysis.m index 9ed96feaa..9591104e4 100644 --- a/compiler/post_term_analysis.m +++ b/compiler/post_term_analysis.m @@ -6,8 +6,8 @@ % Public License - see the file COPYING in the Mercury distribution. %----------------------------------------------------------------------------% % -% File: post_term_analysis.m -% Main author: juliensf +% File: post_term_analysis.m. +% Main author: juliensf. % % This module contains various checks that rely on the information produced by % termination analysis. @@ -35,9 +35,7 @@ :- import_module backend_libs. :- import_module backend_libs.foreign. :- import_module hlds.goal_form. -:- import_module hlds.goal_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_error_util. :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. diff --git a/compiler/pragma_c_gen.m b/compiler/pragma_c_gen.m index 97c6b29d5..1fb58d589 100644 --- a/compiler/pragma_c_gen.m +++ b/compiler/pragma_c_gen.m @@ -5,10 +5,10 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %---------------------------------------------------------------------------% - +% % File: pragma_c_gen.m % Main authors: dgj, conway, zs. - +% % The code in this module generates code for pragma_c_code goals. % % The schemes we use to generate code for model_det and model_semi @@ -17,7 +17,7 @@ % % The scheme for model_non pragma_c_codes is substantially different, % so we handle them separately. - +% %---------------------------------------------------------------------------% :- module ll_backend.pragma_c_gen. @@ -76,7 +76,6 @@ :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_type. -:- import_module assoc_list. :- import_module bool. :- import_module int. :- import_module map. diff --git a/compiler/pred_table.m b/compiler/pred_table.m index a8a20258e..58136a3de 100644 --- a/compiler/pred_table.m +++ b/compiler/pred_table.m @@ -5,14 +5,14 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: pred_table.m. % Main authors: fjh, conway. - +% % This module defines the part of the High Level Data Structure or HLDS % that allows the compiler to look up predicates by name (qualified, % unqualified or some mixture) and/or arity. - +% %-----------------------------------------------------------------------------% :- module hlds.pred_table. @@ -31,10 +31,8 @@ :- implementation. :- import_module libs.compiler_util. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module int. diff --git a/compiler/proc_gen.m b/compiler/proc_gen.m index 07c8ec417..bd65fb66c 100644 --- a/compiler/proc_gen.m +++ b/compiler/proc_gen.m @@ -68,8 +68,6 @@ :- import_module backend_libs.builtin_ops. :- import_module backend_libs.proc_label. :- import_module backend_libs.rtti. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.goal_util. :- import_module hlds.hlds_clauses. @@ -77,8 +75,6 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_out. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -98,7 +94,6 @@ :- import_module mdbcomp.program_representation. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. @@ -111,7 +106,6 @@ :- import_module solutions. :- import_module string. :- import_module term. -:- import_module varset. %---------------------------------------------------------------------------% diff --git a/compiler/process_util.m b/compiler/process_util.m index 260cc173c..1dbb51bf5 100644 --- a/compiler/process_util.m +++ b/compiler/process_util.m @@ -86,7 +86,6 @@ :- implementation. -:- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/prog_ctgc.m b/compiler/prog_ctgc.m index 8afbbe2ef..2158d12c3 100644 --- a/compiler/prog_ctgc.m +++ b/compiler/prog_ctgc.m @@ -21,7 +21,6 @@ :- import_module parse_tree.prog_data. :- import_module bool. -:- import_module int. :- import_module io. :- import_module list. :- import_module map. @@ -187,9 +186,10 @@ :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. -:- import_module string. +:- import_module int. :- import_module pair. :- import_module set. +:- import_module string. :- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/prog_foreign.m b/compiler/prog_foreign.m index 9885ab41c..d58b6cc07 100644 --- a/compiler/prog_foreign.m +++ b/compiler/prog_foreign.m @@ -33,7 +33,6 @@ :- import_module bool. :- import_module list. -:- import_module string. :- import_module term. %-----------------------------------------------------------------------------% @@ -194,6 +193,7 @@ :- import_module char. :- import_module int. +:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/prog_io.m b/compiler/prog_io.m index 970ef3318..fadf97caf 100644 --- a/compiler/prog_io.m +++ b/compiler/prog_io.m @@ -297,7 +297,6 @@ :- import_module set. :- import_module string. :- import_module term_io. -:- import_module time. :- import_module unit. %-----------------------------------------------------------------------------% diff --git a/compiler/prog_io_dcg.m b/compiler/prog_io_dcg.m index 6c8cec398..4ba7fb05b 100644 --- a/compiler/prog_io_dcg.m +++ b/compiler/prog_io_dcg.m @@ -5,10 +5,10 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: prog_io_dcg.m. % Main authors: fjh, zs. - +% % This module handles the parsing of clauses in Definite Clause Grammar % notation. % @@ -16,7 +16,7 @@ % XXX It may be an idea to recode this as a state variable transformation: % roughly Head --> G1, G2, {G3}, G4. % becomes Head(!DCG) :- G1(!DCG), G2(!DCG), G3, G4(!DCG). - +% %-----------------------------------------------------------------------------% :- module parse_tree.prog_io_dcg. @@ -53,9 +53,7 @@ :- import_module parse_tree.prog_out. :- import_module counter. -:- import_module int. :- import_module list. -:- import_module map. :- import_module pair. :- import_module string. diff --git a/compiler/prog_io_goal.m b/compiler/prog_io_goal.m index 6af9f52d7..ff900ca8b 100644 --- a/compiler/prog_io_goal.m +++ b/compiler/prog_io_goal.m @@ -90,8 +90,6 @@ :- import_module assoc_list. :- import_module char. -:- import_module int. -:- import_module map. :- import_module maybe. :- import_module pair. :- import_module string. diff --git a/compiler/prog_io_pragma.m b/compiler/prog_io_pragma.m index c25331d63..b73fe3b06 100644 --- a/compiler/prog_io_pragma.m +++ b/compiler/prog_io_pragma.m @@ -47,14 +47,12 @@ :- import_module parse_tree.prog_ctgc. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_io_goal. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module pair. :- import_module set. diff --git a/compiler/prog_io_typeclass.m b/compiler/prog_io_typeclass.m index 7ce9f8604..dc7246df3 100644 --- a/compiler/prog_io_typeclass.m +++ b/compiler/prog_io_typeclass.m @@ -5,13 +5,13 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: prog_io_typeclass.m. % Main authors: dgj. - +% % This module handles the parsing of typeclass declarations. % Perhaps some of this should go into prog_io_util.m? - +% %-----------------------------------------------------------------------------% :- module parse_tree.prog_io_typeclass. @@ -58,16 +58,13 @@ :- import_module libs.compiler_util. :- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_io_goal. :- import_module parse_tree.prog_util. :- import_module parse_tree.prog_type. :- import_module assoc_list. -:- import_module int. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module set. :- import_module solutions. :- import_module string. :- import_module term. diff --git a/compiler/prog_io_util.m b/compiler/prog_io_util.m index 71fbd5185..bbfff2fec 100644 --- a/compiler/prog_io_util.m +++ b/compiler/prog_io_util.m @@ -182,25 +182,21 @@ :- pred list_term_to_term_list(term::in, list(term)::out) is semidet. +%-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% :- implementation. :- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. -:- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.error_util. :- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_io_goal. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. -:- import_module bool. :- import_module set. -:- import_module string. :- import_module term. +%-----------------------------------------------------------------------------% + get_any_errors1(ok1(_)) = []. get_any_errors1(error1(Errors)) = Errors. diff --git a/compiler/prog_mode.m b/compiler/prog_mode.m index af2657fbb..51d4fc7e4 100644 --- a/compiler/prog_mode.m +++ b/compiler/prog_mode.m @@ -131,10 +131,8 @@ :- import_module libs.compiler_util. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_util. :- import_module map. -:- import_module pair. :- import_module set. :- import_module term. :- import_module varset. diff --git a/compiler/prog_mutable.m b/compiler/prog_mutable.m index e8bd76955..cb0632ba3 100644 --- a/compiler/prog_mutable.m +++ b/compiler/prog_mutable.m @@ -169,8 +169,6 @@ :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_item. -:- import_module string. - %-----------------------------------------------------------------------------% % Create predmode declarations for the four primitive operations. @@ -269,10 +267,10 @@ :- import_module parse_tree.prog_foreign. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_type. -:- import_module libs.compiler_util. :- import_module list. :- import_module maybe. +:- import_module string. :- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/prog_out.m b/compiler/prog_out.m index 1df1c0067..386241d2d 100644 --- a/compiler/prog_out.m +++ b/compiler/prog_out.m @@ -5,17 +5,16 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: prog_out.m. % Main author: fjh. - +% % This module defines some predicates which output various parts % of the parse tree created by prog_io. - +% % WARNING - this module is mostly junk at the moment! % Only the first hundred lines or so are meaningful. - -%-----------------------------------------------------------------------------% +% %-----------------------------------------------------------------------------% :- module parse_tree.prog_out. @@ -158,7 +157,6 @@ :- import_module parse_tree.error_util. :- import_module parse_tree.prog_util. -:- import_module int. :- import_module pair. :- import_module string. :- import_module term. diff --git a/compiler/prog_rep.m b/compiler/prog_rep.m index ff93c9e55..3d88d6601 100644 --- a/compiler/prog_rep.m +++ b/compiler/prog_rep.m @@ -5,16 +5,16 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %---------------------------------------------------------------------------% - +% % File: prog_rep.m. % Authors: zs, maclarty. - +% % This module generates a representation of HLDS goals for the declarative % debugger. Since this representation is to be included in debuggable % executables, it should be as compact as possible, and therefore contains % only the information required by the declarative debugger. The structure % of this representation is defined by mdbcomp/program_representation.m. - +% %---------------------------------------------------------------------------% :- module ll_backend.prog_rep. @@ -57,14 +57,11 @@ :- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.program_representation. -:- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module int. :- import_module maybe. diff --git a/compiler/prog_type.m b/compiler/prog_type.m index 510119db3..2df61b9d0 100644 --- a/compiler/prog_type.m +++ b/compiler/prog_type.m @@ -409,12 +409,10 @@ :- import_module libs.options. :- import_module libs.compiler_util. -:- import_module parse_tree.prog_io. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. :- import_module parse_tree.prog_type_subst. -:- import_module pair. :- import_module string. :- import_module svmap. diff --git a/compiler/prog_type_subst.m b/compiler/prog_type_subst.m index 6e97eac0f..425295433 100644 --- a/compiler/prog_type_subst.m +++ b/compiler/prog_type_subst.m @@ -122,9 +122,6 @@ :- implementation. :- import_module libs.compiler_util. -:- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module map. :- import_module maybe. diff --git a/compiler/prog_util.m b/compiler/prog_util.m index 6efabc013..eec8f7947 100644 --- a/compiler/prog_util.m +++ b/compiler/prog_util.m @@ -280,8 +280,6 @@ :- import_module libs.compiler_util. :- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.prog_io. -:- import_module parse_tree.prog_out. :- import_module bool. :- import_module int. diff --git a/compiler/qual_info.m b/compiler/qual_info.m index 67de2f00f..30126ba54 100644 --- a/compiler/qual_info.m +++ b/compiler/qual_info.m @@ -5,10 +5,10 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% - +% % File: qual_info.m. % Main author: fjh. - +% %-----------------------------------------------------------------------------% :- module hlds.make_hlds.qual_info. @@ -90,11 +90,11 @@ is det. %-----------------------------------------------------------------------------% +%-----------------------------------------------------------------------------% :- implementation. :- import_module hlds.hlds_data. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. diff --git a/compiler/quantification.m b/compiler/quantification.m index eb62ce624..0a020b875 100644 --- a/compiler/quantification.m +++ b/compiler/quantification.m @@ -124,7 +124,6 @@ :- import_module libs.compiler_util. :- import_module bool. -:- import_module enum. :- import_module map. :- import_module maybe. :- import_module pair. diff --git a/compiler/rat.m b/compiler/rat.m index 3d4635db5..eaa96ae4d 100644 --- a/compiler/rat.m +++ b/compiler/rat.m @@ -26,9 +26,7 @@ :- module libs.rat. :- interface. -:- import_module int. :- import_module io. -:- import_module string. %-----------------------------------------------------------------------------% @@ -83,6 +81,11 @@ :- import_module libs.compiler_util. +:- import_module int. +:- import_module string. + +%-----------------------------------------------------------------------------% + % The normal form of a rat number has the following % properties: % - numerator and denominator have no common factors. diff --git a/compiler/recompilation.usage.m b/compiler/recompilation.usage.m index b2f5503a1..6b0c09d90 100644 --- a/compiler/recompilation.usage.m +++ b/compiler/recompilation.usage.m @@ -82,9 +82,7 @@ :- implementation. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. :- import_module hlds.pred_table. diff --git a/compiler/recompilation.version.m b/compiler/recompilation.version.m index ec9cedc94..5b89d01f3 100644 --- a/compiler/recompilation.version.m +++ b/compiler/recompilation.version.m @@ -24,6 +24,8 @@ :- import_module maybe. :- import_module term. +%-----------------------------------------------------------------------------% + % compute_version_numbers(SourceFileModTime, NewItems, MaybeOldItems, % VersionNumbers). % @@ -44,8 +46,6 @@ :- implementation. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_out. :- import_module libs.compiler_util. :- import_module parse_tree.mercury_to_mercury. @@ -60,6 +60,8 @@ :- import_module string. :- import_module varset. +%-----------------------------------------------------------------------------% + compute_version_numbers(SourceFileTime, Items, MaybeOldItems, version_numbers(ItemVersionNumbers, InstanceVersionNumbers)) :- gather_items(section_implementation, Items, GatheredItems, diff --git a/compiler/rtti_out.m b/compiler/rtti_out.m index f69587cf3..a43f5ce05 100644 --- a/compiler/rtti_out.m +++ b/compiler/rtti_out.m @@ -99,23 +99,16 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.name_mangle. -:- import_module backend_libs.proc_label. -:- import_module backend_libs.pseudo_type_info. :- import_module backend_libs.type_ctor_info. -:- import_module hlds.code_model. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module libs.compiler_util. :- import_module libs.globals. -:- import_module libs.options. :- import_module ll_backend.code_util. :- import_module ll_backend.layout_out. :- import_module ll_backend.llds. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. -:- import_module parse_tree.prog_out. :- import_module assoc_list. :- import_module counter. diff --git a/compiler/rtti_to_mlds.m b/compiler/rtti_to_mlds.m index b690bfd73..2bc27a04d 100644 --- a/compiler/rtti_to_mlds.m +++ b/compiler/rtti_to_mlds.m @@ -57,23 +57,16 @@ :- implementation. :- import_module backend_libs.foreign. -:- import_module backend_libs.pseudo_type_info. :- import_module backend_libs.type_ctor_info. -:- import_module check_hlds.type_util. -:- import_module hlds.code_model. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module libs.compiler_util. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_closure_gen. :- import_module ml_backend.ml_code_util. -:- import_module ml_backend.ml_unify_gen. :- import_module ml_backend.ml_util. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module assoc_list. :- import_module bool. @@ -83,7 +76,6 @@ :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module string. :- import_module term. :- import_module univ. diff --git a/compiler/saved_vars.m b/compiler/saved_vars.m index ba871ee88..d1c178ca8 100644 --- a/compiler/saved_vars.m +++ b/compiler/saved_vars.m @@ -47,7 +47,6 @@ :- import_module check_hlds.polymorphism. :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_rtti. :- import_module hlds.passes_aux. :- import_module hlds.quantification. diff --git a/compiler/size_prof.m b/compiler/size_prof.m index 66baa43fd..0be394d56 100644 --- a/compiler/size_prof.m +++ b/compiler/size_prof.m @@ -113,7 +113,6 @@ :- import_module check_hlds.simplify. :- import_module check_hlds.type_util. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.hlds_rtti. @@ -125,7 +124,6 @@ :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.term_norm. :- import_module assoc_list. diff --git a/compiler/source_file_map.m b/compiler/source_file_map.m index 2e5583046..fd590a320 100644 --- a/compiler/source_file_map.m +++ b/compiler/source_file_map.m @@ -48,10 +48,8 @@ :- implementation. :- import_module libs.globals. -:- import_module libs.options. :- import_module parse_tree.modules. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module char. :- import_module dir. diff --git a/compiler/special_pred.m b/compiler/special_pred.m index cfc2fe6e6..c56d9e6ec 100644 --- a/compiler/special_pred.m +++ b/compiler/special_pred.m @@ -110,15 +110,12 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module parse_tree.prog_mode. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. :- import_module bool. :- import_module maybe. diff --git a/compiler/stack_alloc.m b/compiler/stack_alloc.m index bd39e38a3..1e877971b 100644 --- a/compiler/stack_alloc.m +++ b/compiler/stack_alloc.m @@ -40,10 +40,7 @@ :- implementation. -:- import_module check_hlds.goal_path. -:- import_module check_hlds.type_util. :- import_module hlds.code_model. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module libs.globals. @@ -52,12 +49,9 @@ :- import_module libs.trace_params. :- import_module ll_backend.live_vars. :- import_module ll_backend.liveness. -:- import_module ll_backend.llds. -:- import_module ll_backend.stack_opt. :- import_module ll_backend.trace_gen. :- import_module parse_tree.prog_data. -:- import_module assoc_list. :- import_module bool. :- import_module int. :- import_module list. diff --git a/compiler/stack_layout.m b/compiler/stack_layout.m index 15e5eea6a..5530671df 100644 --- a/compiler/stack_layout.m +++ b/compiler/stack_layout.m @@ -84,7 +84,6 @@ :- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.goal_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. @@ -93,20 +92,15 @@ :- import_module libs.globals. :- import_module libs.options. :- import_module libs.trace_params. -:- import_module ll_backend.code_util. :- import_module ll_backend.layout. :- import_module ll_backend.layout_out. -:- import_module ll_backend.llds_out. :- import_module ll_backend.ll_pseudo_type_info. :- import_module ll_backend.prog_rep. :- import_module ll_backend.trace_gen. :- import_module mdbcomp.program_representation. :- import_module parse_tree.prog_event. -:- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module bool. -:- import_module char. :- import_module counter. :- import_module int. :- import_module map. diff --git a/compiler/stack_opt.m b/compiler/stack_opt.m index 05a78606a..3a9921f7c 100644 --- a/compiler/stack_opt.m +++ b/compiler/stack_opt.m @@ -89,23 +89,17 @@ :- import_module backend_libs.interval. :- import_module backend_libs.matching. :- import_module check_hlds.goal_path. -:- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. :- import_module check_hlds.simplify. -:- import_module check_hlds.type_util. :- import_module hlds.arg_info. -:- import_module hlds.code_model. -:- import_module hlds.goal_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_out. -:- import_module hlds.instmap. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. -:- import_module ll_backend.call_gen. :- import_module ll_backend.live_vars. :- import_module ll_backend.liveness. :- import_module ll_backend.store_alloc. @@ -113,7 +107,6 @@ :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. -:- import_module assoc_list. :- import_module bool. :- import_module counter. :- import_module int. @@ -124,9 +117,7 @@ :- import_module set. :- import_module svmap. :- import_module svset. -:- import_module svvarset. :- import_module term. -:- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/stdlabel.m b/compiler/stdlabel.m index fbeb4e6bf..b5013d0a2 100644 --- a/compiler/stdlabel.m +++ b/compiler/stdlabel.m @@ -45,7 +45,6 @@ :- import_module mdbcomp.prim_data. :- import_module bool. -:- import_module int. :- import_module map. :- import_module pair. :- import_module svmap. diff --git a/compiler/store_alloc.m b/compiler/store_alloc.m index 9082fbbd0..94a6456e9 100644 --- a/compiler/store_alloc.m +++ b/compiler/store_alloc.m @@ -45,14 +45,12 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.instmap. :- import_module libs.compiler_util. :- import_module libs.globals. -:- import_module libs.options. :- import_module libs.trace_params. :- import_module ll_backend.code_util. :- import_module ll_backend.follow_vars. diff --git a/compiler/string_switch.m b/compiler/string_switch.m index 4646f8edc..6bd3693d8 100644 --- a/compiler/string_switch.m +++ b/compiler/string_switch.m @@ -43,8 +43,6 @@ :- import_module ll_backend.code_gen. :- import_module ll_backend.trace_gen. -:- import_module assoc_list. -:- import_module bool. :- import_module int. :- import_module list. :- import_module map. diff --git a/compiler/structure_reuse.analysis.m b/compiler/structure_reuse.analysis.m index 611a27f46..a8be1ec1d 100644 --- a/compiler/structure_reuse.analysis.m +++ b/compiler/structure_reuse.analysis.m @@ -100,7 +100,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/compiler/structure_reuse.direct.choose_reuse.m b/compiler/structure_reuse.direct.choose_reuse.m index ae985cc71..f34aae416 100644 --- a/compiler/structure_reuse.direct.choose_reuse.m +++ b/compiler/structure_reuse.direct.choose_reuse.m @@ -109,12 +109,16 @@ :- import_module check_hlds.type_util. :- import_module hlds.hlds_data. +:- import_module libs.compiler_util. +:- import_module parse_tree.prog_data. :- import_module float. :- import_module int. :- import_module maybe. :- import_module multi_map. :- import_module pair. +:- import_module set. +:- import_module string. :- import_module svmulti_map. %-----------------------------------------------------------------------------% diff --git a/compiler/structure_reuse.direct.detect_garbage.m b/compiler/structure_reuse.direct.detect_garbage.m index 56545ac72..2dab396e0 100644 --- a/compiler/structure_reuse.direct.detect_garbage.m +++ b/compiler/structure_reuse.direct.detect_garbage.m @@ -32,9 +32,13 @@ :- implementation. -:- import_module check_hlds.type_util. +:- import_module libs.compiler_util. +:- import_module parse_tree.prog_data. +:- import_module transform_hlds.ctgc.datastruct. :- import_module pair. +:- import_module set. +:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/structure_reuse.direct.m b/compiler/structure_reuse.direct.m index 52387d0a9..aa97b2e58 100644 --- a/compiler/structure_reuse.direct.m +++ b/compiler/structure_reuse.direct.m @@ -45,26 +45,19 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. -:- import_module libs.compiler_util. :- 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_out. -:- import_module transform_hlds.ctgc.datastruct. :- import_module transform_hlds.ctgc.structure_reuse.direct.choose_reuse. :- import_module transform_hlds.ctgc.structure_reuse.direct.detect_garbage. :- import_module transform_hlds.ctgc.util. :- import_module bool. -:- import_module int. :- import_module list. :- import_module map. -:- import_module set. -:- import_module string. :- import_module svmap. :- import_module term. -:- import_module varset. :- include_module transform_hlds.ctgc.structure_reuse.direct.detect_garbage. :- include_module transform_hlds.ctgc.structure_reuse.direct.choose_reuse. diff --git a/compiler/structure_reuse.lbu.m b/compiler/structure_reuse.lbu.m index b76559b6e..c3d9ed4d9 100644 --- a/compiler/structure_reuse.lbu.m +++ b/compiler/structure_reuse.lbu.m @@ -48,7 +48,6 @@ :- import_module list. :- import_module pair. :- import_module set. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/structure_reuse.lfu.m b/compiler/structure_reuse.lfu.m index 67b09bb74..50b64c1c9 100644 --- a/compiler/structure_reuse.lfu.m +++ b/compiler/structure_reuse.lfu.m @@ -42,7 +42,6 @@ :- import_module map. :- import_module set. :- import_module pair. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/structure_reuse.versions.m b/compiler/structure_reuse.versions.m index 0817973f1..b57730ed6 100644 --- a/compiler/structure_reuse.versions.m +++ b/compiler/structure_reuse.versions.m @@ -15,7 +15,6 @@ %------------------------------------------------------------------------------% :- module structure_reuse.versions. - :- interface. :- import_module hlds.hlds_module. @@ -24,6 +23,8 @@ :- import_module io. +%------------------------------------------------------------------------------% + % For each of the entries in the reuse table: % * if the listed reuse is conditional, then duplicate the @@ -52,6 +53,7 @@ module_info::in, module_info::out) is det. %------------------------------------------------------------------------------% +%------------------------------------------------------------------------------% :- implementation. @@ -65,11 +67,11 @@ :- import_module bool. :- import_module map. -:- import_module maybe. :- import_module pair. -:- import_module string. :- import_module list. +%------------------------------------------------------------------------------% + :- type reuse_name == sym_name. :- func generate_reuse_name(module_info, pred_proc_id) = reuse_name. diff --git a/compiler/structure_sharing.analysis.m b/compiler/structure_sharing.analysis.m index f32604ae4..7f8f736f5 100644 --- a/compiler/structure_sharing.analysis.m +++ b/compiler/structure_sharing.analysis.m @@ -41,7 +41,6 @@ :- implementation. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_goal. :- import_module hlds.passes_aux. :- import_module libs.compiler_util. diff --git a/compiler/structure_sharing.domain.m b/compiler/structure_sharing.domain.m index 727547611..721a450cc 100644 --- a/compiler/structure_sharing.domain.m +++ b/compiler/structure_sharing.domain.m @@ -61,7 +61,6 @@ :- import_module list. :- import_module map. :- import_module set. -:- import_module string. %-----------------------------------------------------------------------------% @@ -289,7 +288,6 @@ :- import_module parse_tree.prog_ctgc. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_type_subst. :- import_module transform_hlds.ctgc.datastruct. :- import_module transform_hlds.ctgc.selector. :- import_module transform_hlds.ctgc.util. @@ -298,9 +296,8 @@ :- import_module int. :- import_module maybe. :- import_module pair. -:- import_module require. -:- import_module solutions. :- import_module string. +:- import_module solutions. :- import_module svmap. :- import_module svset. :- import_module varset. diff --git a/compiler/superhomogeneous.m b/compiler/superhomogeneous.m index 252473d3d..faafbbab1 100644 --- a/compiler/superhomogeneous.m +++ b/compiler/superhomogeneous.m @@ -114,7 +114,6 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.purity. :- import_module hlds.goal_util. :- import_module hlds.make_hlds.add_clause. :- import_module hlds.make_hlds.field_access. @@ -126,7 +125,6 @@ :- import_module parse_tree.prog_io_dcg. :- import_module parse_tree.prog_io_goal. :- import_module parse_tree.prog_io_util. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_util. :- import_module bool. @@ -134,7 +132,6 @@ :- import_module map. :- import_module pair. :- import_module set. -:- import_module string. :- import_module svvarset. :- import_module svset. :- import_module term. diff --git a/compiler/switch_gen.m b/compiler/switch_gen.m index c9578f4f0..1f3cc323f 100644 --- a/compiler/switch_gen.m +++ b/compiler/switch_gen.m @@ -82,10 +82,8 @@ :- import_module bool. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module pair. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/compiler/table_gen.m b/compiler/table_gen.m index 4ac57236b..bae86f9ad 100644 --- a/compiler/table_gen.m +++ b/compiler/table_gen.m @@ -52,11 +52,6 @@ :- implementation. -:- import_module backend_libs. -:- import_module backend_libs.rtti. -:- import_module check_hlds.det_analysis. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.modes. :- import_module check_hlds.mode_util. :- import_module check_hlds.polymorphism. :- import_module check_hlds.purity. @@ -67,12 +62,9 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. :- import_module hlds.pred_table. -:- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -84,8 +76,6 @@ :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module parse_tree.prog_util. -:- import_module transform_hlds.const_prop. :- import_module assoc_list. :- import_module bool. diff --git a/compiler/tabling_analysis.m b/compiler/tabling_analysis.m index 351e4c055..be500ce23 100644 --- a/compiler/tabling_analysis.m +++ b/compiler/tabling_analysis.m @@ -86,15 +86,9 @@ :- implementation. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.code_model. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. -:- import_module hlds.make_hlds. -:- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -104,8 +98,6 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. -:- import_module parse_tree.prog_type. :- import_module transform_hlds.dependency_graph. :- import_module transform_hlds.mmc_analysis. diff --git a/compiler/tag_switch.m b/compiler/tag_switch.m index 6d3913af5..05809775a 100644 --- a/compiler/tag_switch.m +++ b/compiler/tag_switch.m @@ -41,10 +41,8 @@ :- import_module backend_libs.builtin_ops. :- import_module backend_libs.rtti. -:- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. -:- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. @@ -56,7 +54,6 @@ :- import_module parse_tree.prog_data. :- import_module assoc_list. -:- import_module bool. :- import_module int. :- import_module map. :- import_module maybe. diff --git a/compiler/term_constr_build.m b/compiler/term_constr_build.m index ae97cc777..86e446773 100644 --- a/compiler/term_constr_build.m +++ b/compiler/term_constr_build.m @@ -6,8 +6,8 @@ % Public License - see the file COPYING in the Mercury distribution. %------------------------------------------------------------------------------% % -% File: term_constr_build.m -% Main author: juliensf +% File: term_constr_build.m. +% Main author: juliensf. % (partially based on code written by vjteag) % % This module is responsible for building the abstract representation (AR) @@ -60,18 +60,12 @@ :- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.quantification. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module libs.lp_rational. -:- import_module libs.options. :- import_module libs.polyhedron. :- import_module libs.rat. -:- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. :- import_module transform_hlds.dependency_graph. @@ -80,8 +74,6 @@ :- import_module transform_hlds.term_constr_main. :- import_module transform_hlds.term_constr_util. -:- import_module assoc_list. -:- import_module counter. :- import_module int. :- import_module map. :- import_module maybe. diff --git a/compiler/term_constr_data.m b/compiler/term_constr_data.m index f002c7407..9c75d3676 100644 --- a/compiler/term_constr_data.m +++ b/compiler/term_constr_data.m @@ -389,9 +389,7 @@ :- import_module hlds.hlds_out. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. -:- import_module transform_hlds.term_constr_util. -:- import_module counter. :- import_module int. :- import_module std_util. :- import_module string. diff --git a/compiler/term_constr_fixpoint.m b/compiler/term_constr_fixpoint.m index d890bd8da..47707a19b 100644 --- a/compiler/term_constr_fixpoint.m +++ b/compiler/term_constr_fixpoint.m @@ -55,24 +55,17 @@ :- implementation. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. -:- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module libs.lp_rational. -:- import_module libs.options. :- import_module libs.polyhedron. :- import_module parse_tree.prog_data. :- import_module transform_hlds.term_constr_data. :- import_module transform_hlds.term_constr_main. :- import_module transform_hlds.term_constr_util. -:- import_module assoc_list. :- import_module bool. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module set. :- import_module string. diff --git a/compiler/term_constr_initial.m b/compiler/term_constr_initial.m index 0114904cf..f4cf8522e 100644 --- a/compiler/term_constr_initial.m +++ b/compiler/term_constr_initial.m @@ -55,15 +55,8 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. -:- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.lp_rational. @@ -72,35 +65,24 @@ :- import_module libs.rat. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.program_representation. -:- 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. -:- import_module transform_hlds.dependency_graph. :- import_module transform_hlds.term_constr_data. :- import_module transform_hlds.term_constr_errors. :- import_module transform_hlds.term_constr_main. :- import_module transform_hlds.term_constr_util. -:- import_module transform_hlds.term_norm. :- import_module transform_hlds.term_util. :- import_module bool. -:- import_module bag. -:- import_module char. :- import_module int. :- import_module list. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module relation. :- import_module set. :- import_module std_util. :- import_module string. :- import_module svmap. -:- import_module svvarset. :- import_module term. -:- import_module varset. %----------------------------------------------------------------------------% % diff --git a/compiler/term_constr_main.m b/compiler/term_constr_main.m index 586befa7d..7b758a4df 100644 --- a/compiler/term_constr_main.m +++ b/compiler/term_constr_main.m @@ -198,20 +198,10 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. -:- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. -:- import_module hlds.hlds_out. -:- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.globals. :- import_module libs.lp_rational. :- import_module libs.options. -:- import_module libs.rat. -:- import_module parse_tree.error_util. :- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. @@ -228,7 +218,6 @@ :- import_module transform_hlds.term_norm. :- import_module bool. -:- import_module char. :- import_module int. :- import_module map. :- import_module set. diff --git a/compiler/term_constr_pass2.m b/compiler/term_constr_pass2.m index bf5739228..789eaf08a 100644 --- a/compiler/term_constr_pass2.m +++ b/compiler/term_constr_pass2.m @@ -49,17 +49,13 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module libs.lp_rational. -:- import_module libs.options. :- import_module libs.polyhedron. :- import_module libs.rat. -:- import_module parse_tree.mercury_to_mercury. :- import_module parse_tree.prog_data. :- import_module transform_hlds.term_constr_data. :- import_module transform_hlds.term_constr_errors. @@ -73,7 +69,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module term. :- import_module varset. diff --git a/compiler/term_constr_util.m b/compiler/term_constr_util.m index 23a6335ea..34bb0cb85 100644 --- a/compiler/term_constr_util.m +++ b/compiler/term_constr_util.m @@ -6,8 +6,8 @@ % Public License - see the file COPYING in the Mercury distribution. %------------------------------------------------------------------------------% % -% File: term_constr_util.m -% Main author: juliensf +% File: term_constr_util.m. +% Main author: juliensf. % % This module defines some utility predicates used by the termination analyser. % @@ -196,23 +196,17 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. -:- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. -:- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. :- import_module libs.rat. -:- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.prog_type. :- import_module transform_hlds.term_constr_errors. :- import_module transform_hlds.term_norm. -:- import_module int. :- import_module pair. :- import_module set. :- import_module std_util. diff --git a/compiler/term_errors.m b/compiler/term_errors.m index e55993160..c8b642795 100644 --- a/compiler/term_errors.m +++ b/compiler/term_errors.m @@ -160,20 +160,13 @@ :- implementation. :- import_module hlds.hlds_error_util. -:- import_module hlds.hlds_out. -:- import_module hlds.passes_aux. :- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. :- import_module parse_tree.error_util. -:- import_module parse_tree.mercury_to_mercury. -:- import_module parse_tree.prog_out. :- import_module transform_hlds.term_util. :- import_module bag. :- import_module bool. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module string. :- import_module term. diff --git a/compiler/term_norm.m b/compiler/term_norm.m index c3a2f71bd..46ad7a74d 100644 --- a/compiler/term_norm.m +++ b/compiler/term_norm.m @@ -21,7 +21,6 @@ :- import_module libs.globals. :- import_module parse_tree.prog_data. -:- import_module int. :- import_module list. %-----------------------------------------------------------------------------% @@ -71,20 +70,15 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module hlds.hlds_data. :- import_module libs.compiler_util. -:- import_module libs.options. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module assoc_list. :- import_module bool. +:- import_module int. :- import_module map. :- import_module pair. -:- import_module string. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/compiler/term_pass1.m b/compiler/term_pass1.m index 88e5a5b62..c762fdb13 100644 --- a/compiler/term_pass1.m +++ b/compiler/term_pass1.m @@ -55,9 +55,6 @@ :- implementation. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module libs.compiler_util. :- import_module libs.lp. @@ -66,13 +63,10 @@ :- import_module bag. :- import_module bool. -:- import_module char. :- import_module float. -:- import_module int. :- import_module map. :- import_module maybe. :- import_module set. -:- import_module string. :- import_module svmap. :- import_module svset. :- import_module svvarset. diff --git a/compiler/term_pass2.m b/compiler/term_pass2.m index 895549cda..faca05149 100644 --- a/compiler/term_pass2.m +++ b/compiler/term_pass2.m @@ -41,8 +41,6 @@ :- implementation. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_goal. :- import_module libs.compiler_util. :- import_module parse_tree.prog_data. :- import_module transform_hlds.term_errors. @@ -56,7 +54,6 @@ :- import_module maybe. :- import_module pair. :- import_module set. -:- import_module string. :- import_module term. :- import_module unit. diff --git a/compiler/term_traversal.m b/compiler/term_traversal.m index 03187ad89..5bb5fd9bd 100644 --- a/compiler/term_traversal.m +++ b/compiler/term_traversal.m @@ -112,8 +112,6 @@ :- implementation. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module libs.compiler_util. :- import_module parse_tree.prog_type. @@ -121,7 +119,6 @@ :- import_module bool. :- import_module int. :- import_module map. -:- import_module string. :- import_module svset. %-----------------------------------------------------------------------------% diff --git a/compiler/term_util.m b/compiler/term_util.m index 4f0bc96f5..be95782be 100644 --- a/compiler/term_util.m +++ b/compiler/term_util.m @@ -28,7 +28,6 @@ :- import_module bag. :- import_module bool. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. @@ -174,16 +173,10 @@ :- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module libs.compiler_util. -:- import_module libs.globals. -:- import_module libs.options. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. -:- import_module assoc_list. :- import_module pair. -:- import_module string. %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% diff --git a/compiler/termination.m b/compiler/termination.m index 578c65eae..cc63f2db0 100644 --- a/compiler/termination.m +++ b/compiler/termination.m @@ -56,15 +56,9 @@ :- implementation. -:- import_module check_hlds.inst_match. -:- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. -:- import_module hlds.hlds_data. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -74,7 +68,6 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module transform_hlds.dependency_graph. :- import_module transform_hlds.post_term_analysis. :- import_module transform_hlds.term_errors. @@ -83,21 +76,16 @@ :- import_module transform_hlds.term_pass2. :- import_module transform_hlds.term_util. -:- import_module bag. :- import_module bool. -:- import_module char. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. :- import_module pair. -:- import_module relation. :- import_module set. :- import_module string. :- import_module svmap. :- import_module term. :- import_module unit. -:- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/trace_params.m b/compiler/trace_params.m index d3bab558b..769d02e80 100644 --- a/compiler/trace_params.m +++ b/compiler/trace_params.m @@ -118,7 +118,6 @@ :- implementation. -:- import_module hlds.special_pred. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/trailing_analysis.m b/compiler/trailing_analysis.m index 3fc0997f8..a90851417 100644 --- a/compiler/trailing_analysis.m +++ b/compiler/trailing_analysis.m @@ -84,15 +84,11 @@ :- implementation. -:- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. :- import_module hlds.code_model. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. -:- import_module hlds.make_hlds. -:- import_module hlds.passes_aux. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -102,7 +98,6 @@ :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_out. -:- import_module parse_tree.prog_util. :- import_module parse_tree.prog_type. :- import_module transform_hlds.dependency_graph. :- import_module transform_hlds.mmc_analysis. diff --git a/compiler/trans_opt.m b/compiler/trans_opt.m index b2982d92c..fac03909a 100644 --- a/compiler/trans_opt.m +++ b/compiler/trans_opt.m @@ -83,7 +83,6 @@ :- implementation. :- import_module hlds.hlds_pred. -:- import_module hlds.passes_aux. :- import_module libs.globals. :- import_module libs.options. :- import_module mdbcomp.prim_data. @@ -107,10 +106,7 @@ :- import_module list. :- import_module map. :- import_module pair. -:- import_module set. -:- import_module string. :- import_module term. -:- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/transform.m b/compiler/transform.m index 8d1820b03..bd467a5eb 100644 --- a/compiler/transform.m +++ b/compiler/transform.m @@ -50,15 +50,9 @@ :- implementation. :- import_module check_hlds.delay_info. -:- import_module check_hlds.mode_util. :- import_module hlds.instmap. -:- import_module parse_tree.prog_data. -:- import_module map. :- import_module pair. -:- import_module set. -:- import_module term. -:- import_module varset. %-----------------------------------------------------------------------------% diff --git a/compiler/transform_llds.m b/compiler/transform_llds.m index 8c627b4c3..80de274ff 100644 --- a/compiler/transform_llds.m +++ b/compiler/transform_llds.m @@ -37,20 +37,15 @@ :- import_module hlds.hlds_pred. :- import_module backend_libs.builtin_ops. -:- import_module backend_libs.proc_label. :- import_module hlds.code_model. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. -:- import_module ll_backend.opt_util. :- import_module mdbcomp.prim_data. -:- import_module parse_tree.prog_data. -:- import_module bool. :- import_module counter. :- import_module int. :- import_module list. -:- import_module maybe. :- import_module pair. :- import_module set. :- import_module string. diff --git a/compiler/tupling.m b/compiler/tupling.m index 56b4566b8..1dd038fac 100644 --- a/compiler/tupling.m +++ b/compiler/tupling.m @@ -100,16 +100,13 @@ :- import_module backend_libs.interval. :- import_module check_hlds.goal_path. :- import_module check_hlds.mode_util. -:- import_module check_hlds.type_util. :- import_module hlds.arg_info. -:- import_module hlds.code_model. :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. -:- import_module hlds.instmap. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. @@ -141,7 +138,6 @@ :- import_module set. :- import_module string. :- import_module svmap. -:- import_module svset. :- import_module svvarset. :- import_module term. :- import_module unit. diff --git a/compiler/type_util.m b/compiler/type_util.m index 240f1f15c..6aec2a519 100644 --- a/compiler/type_util.m +++ b/compiler/type_util.m @@ -309,12 +309,10 @@ :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_subst. -:- import_module assoc_list. :- import_module bool. :- import_module char. :- import_module int. :- import_module map. -:- import_module pair. :- import_module term. %-----------------------------------------------------------------------------% diff --git a/compiler/typecheck.m b/compiler/typecheck.m index 1440723db..ab7ea66fd 100644 --- a/compiler/typecheck.m +++ b/compiler/typecheck.m @@ -132,7 +132,6 @@ :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_util. -:- import_module assoc_list. :- import_module int. :- import_module map. :- import_module maybe. diff --git a/compiler/typeclasses.m b/compiler/typeclasses.m index 8eabfe089..a124d5063 100644 --- a/compiler/typeclasses.m +++ b/compiler/typeclasses.m @@ -24,6 +24,8 @@ :- import_module parse_tree. :- import_module parse_tree.prog_data. +%-----------------------------------------------------------------------------% + % perform_context_reduction(OrigTypeAssignSet, !Info) is true % iff either % (a) !:Info is the typecheck_info that results from performing @@ -98,7 +100,6 @@ :- import_module list. :- import_module map. :- import_module multi_map. -:- import_module pair. :- import_module set. :- import_module svmap. :- import_module term. diff --git a/compiler/unify_gen.m b/compiler/unify_gen.m index 668a2ea04..621e82961 100644 --- a/compiler/unify_gen.m +++ b/compiler/unify_gen.m @@ -50,7 +50,6 @@ :- import_module backend_libs.type_class_info. :- import_module check_hlds.mode_util. :- import_module check_hlds.type_util. -:- import_module hlds.arg_info. :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. @@ -63,11 +62,9 @@ :- import_module ll_backend.code_util. :- import_module ll_backend.continuation_info. :- import_module ll_backend.layout. -:- import_module ll_backend.llds_out. :- import_module ll_backend.stack_layout. :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_out. :- import_module parse_tree.prog_type. :- import_module assoc_list. diff --git a/compiler/unify_proc.m b/compiler/unify_proc.m index 0d7717c8b..24e20ad0c 100644 --- a/compiler/unify_proc.m +++ b/compiler/unify_proc.m @@ -165,7 +165,6 @@ :- import_module parse_tree.prog_util. :- import_module recompilation. -:- import_module assoc_list. :- import_module int. :- import_module map. :- import_module queue. diff --git a/compiler/unneeded_code.m b/compiler/unneeded_code.m index 6ca36565d..4cf0d6988 100644 --- a/compiler/unneeded_code.m +++ b/compiler/unneeded_code.m @@ -82,7 +82,6 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.instmap. -:- import_module hlds.passes_aux. :- import_module hlds.quantification. :- import_module libs.compiler_util. :- import_module libs.globals. diff --git a/compiler/untupling.m b/compiler/untupling.m index 8fba0b32e..49b38a9ed 100644 --- a/compiler/untupling.m +++ b/compiler/untupling.m @@ -102,7 +102,6 @@ :- implementation. -:- import_module check_hlds.det_analysis. :- import_module check_hlds.mode_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. diff --git a/compiler/unused_args.m b/compiler/unused_args.m index beb5312b5..139e33882 100644 --- a/compiler/unused_args.m +++ b/compiler/unused_args.m @@ -79,20 +79,15 @@ :- import_module check_hlds.inst_match. :- import_module check_hlds.mode_util. -:- import_module check_hlds.polymorphism. :- import_module check_hlds.type_util. :- import_module hlds.goal_util. :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_out. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. -:- import_module hlds.make_hlds. -:- import_module hlds.passes_aux. :- import_module hlds.pred_table. :- import_module hlds.quantification. -:- import_module hlds.special_pred. :- import_module libs.compiler_util. :- import_module libs.globals. :- import_module libs.options. @@ -106,9 +101,7 @@ :- import_module parse_tree.prog_util. :- import_module transform_hlds.mmc_analysis. -:- import_module assoc_list. :- import_module bool. -:- import_module char. :- import_module int. :- import_module list. :- import_module map. diff --git a/compiler/unused_imports.m b/compiler/unused_imports.m index ca85138c0..430f74814 100644 --- a/compiler/unused_imports.m +++ b/compiler/unused_imports.m @@ -45,16 +45,11 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. - :- import_module mdbcomp. :- import_module mdbcomp.prim_data. - :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. -:- import_module libs. -:- import_module libs.compiler_util. - :- import_module bool. :- import_module map. :- import_module maybe. diff --git a/compiler/var_locn.m b/compiler/var_locn.m index 0dac09afa..929985435 100644 --- a/compiler/var_locn.m +++ b/compiler/var_locn.m @@ -362,13 +362,11 @@ :- import_module check_hlds.type_util. :- import_module libs.compiler_util. -:- import_module libs.globals. :- import_module libs.options. :- import_module libs.tree. :- import_module ll_backend.code_util. :- import_module ll_backend.exprn_aux. -:- import_module bag. :- import_module getopt_io. :- import_module int. :- import_module pair. diff --git a/compiler/xml_documentation.m b/compiler/xml_documentation.m index b13ac967d..e49615682 100644 --- a/compiler/xml_documentation.m +++ b/compiler/xml_documentation.m @@ -6,7 +6,7 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % -% Module: xml_documentation.m +% Module: xml_documentation.m. % Main authors: petdr. % % This module outputs an XML representation of a module, @@ -16,7 +16,6 @@ %-----------------------------------------------------------------------------% :- module check_hlds.xml_documentation. - :- interface. :- import_module hlds. @@ -46,7 +45,6 @@ :- import_module parse_tree.error_util. :- import_module parse_tree.modules. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_item. :- import_module parse_tree.source_file_map. :- import_module bool. @@ -55,7 +53,6 @@ :- import_module list. :- import_module map. :- import_module maybe. -:- import_module pair. :- import_module set. :- import_module string. :- import_module svmap. diff --git a/deep_profiler/Mercury.options b/deep_profiler/Mercury.options index 22d635442..7555d8ba6 100644 --- a/deep_profiler/Mercury.options +++ b/deep_profiler/Mercury.options @@ -1,5 +1,5 @@ #-----------------------------------------------------------------------------# -# Copyright (C) 2002, 2005 The University of Melbourne. +# Copyright (C) 2002, 2005-2006 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. #-----------------------------------------------------------------------------# @@ -35,3 +35,8 @@ MCFLAGS-query = --no-optimize-duplicate-calls MCFLAGS-read_profile = --no-optimize-duplicate-calls MCFLAGS-startup = --no-optimize-duplicate-calls MCFLAGS-top_procs = --no-optimize-duplicate-calls + +MCFLAGS-canonical = --no-warn-unused-imports +MCFLAGS-mdprof_test = --no-warn-unused-imports +MCFLAGS-mdprof_dump = --no-warn-unused-imports +MCFLAGS-mdprof_feedback = --no-warn-unused-imports diff --git a/deep_profiler/array_util.m b/deep_profiler/array_util.m index a5630d938..5dd20d14e 100644 --- a/deep_profiler/array_util.m +++ b/deep_profiler/array_util.m @@ -121,7 +121,6 @@ :- implementation. :- import_module int. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/deep_profiler/canonical.m b/deep_profiler/canonical.m index 4e100a65d..e54ee951b 100644 --- a/deep_profiler/canonical.m +++ b/deep_profiler/canonical.m @@ -6,13 +6,15 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % +% File: canonical.m. % Authors: conway, zs. % % This module contains code for recursively merging sets of ProcDynamic and % CallSiteDynamic nodes. +% +%-----------------------------------------------------------------------------% :- module canonical. - :- interface. :- import_module profile. diff --git a/deep_profiler/dense_bitset.m b/deep_profiler/dense_bitset.m index c7bc31221..b30db292b 100644 --- a/deep_profiler/dense_bitset.m +++ b/deep_profiler/dense_bitset.m @@ -1,7 +1,7 @@ %-----------------------------------------------------------------------------% % vim: ft=mercury ts=4 sw=4 et %-----------------------------------------------------------------------------% -% Copyright (C) 2001, 2003, 2005 The University of Melbourne. +% Copyright (C) 2001, 2003, 2005-2006 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. %-----------------------------------------------------------------------------% @@ -17,11 +17,9 @@ %-----------------------------------------------------------------------------% :- module dense_bitset. - :- interface. :- import_module array. -:- import_module int. %-----------------------------------------------------------------------------% @@ -62,6 +60,7 @@ :- implementation. +:- import_module int. :- import_module list. :- import_module require. diff --git a/deep_profiler/dump.m b/deep_profiler/dump.m index 0be35ab2a..b0efdc7c8 100644 --- a/deep_profiler/dump.m +++ b/deep_profiler/dump.m @@ -6,13 +6,15 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % +% File: dump.m. % Authors: juliensf, zs. % % This module contains code for dumping out the deep profiler's data structures % for use in debugging the deep profiler. +% +%-----------------------------------------------------------------------------% :- module dump. - :- interface. :- import_module profile. @@ -60,7 +62,6 @@ :- import_module pair. :- import_module require. :- import_module set. -:- import_module std_util. :- import_module string. :- import_module svset. diff --git a/deep_profiler/exclude.m b/deep_profiler/exclude.m index 333336629..618c26b03 100644 --- a/deep_profiler/exclude.m +++ b/deep_profiler/exclude.m @@ -6,6 +6,7 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % +% File: exclude.m. % Author: zs. % % This module handles contour exclusion. @@ -40,7 +41,6 @@ %-----------------------------------------------------------------------------% :- module exclude. - :- interface. :- import_module profile. @@ -67,7 +67,6 @@ :- import_module char. :- import_module list. :- import_module map. -:- import_module require. :- import_module set. :- import_module string. diff --git a/deep_profiler/html_format.m b/deep_profiler/html_format.m index 3d5fd1ff5..5764b5fa7 100644 --- a/deep_profiler/html_format.m +++ b/deep_profiler/html_format.m @@ -6,6 +6,7 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % +% File: html_format.m. % Author: zs. % % This module contains code that sets the format of the HTML tables @@ -14,7 +15,6 @@ %-----------------------------------------------------------------------------% :- module html_format. - :- interface. :- import_module interface. @@ -145,7 +145,6 @@ :- import_module char. :- import_module float. :- import_module int. -:- import_module map. :- import_module maybe. :- import_module require. :- import_module string. diff --git a/deep_profiler/interface.m b/deep_profiler/interface.m index 087e3ef7d..97dbfea37 100644 --- a/deep_profiler/interface.m +++ b/deep_profiler/interface.m @@ -46,7 +46,6 @@ %-----------------------------------------------------------------------------% :- module interface. - :- interface. :- import_module profile. @@ -334,7 +333,6 @@ :- import_module int. :- import_module list. :- import_module require. -:- import_module set. :- import_module string. %-----------------------------------------------------------------------------% diff --git a/deep_profiler/mdprof_cgi.m b/deep_profiler/mdprof_cgi.m index 65a8305f4..c333af520 100644 --- a/deep_profiler/mdprof_cgi.m +++ b/deep_profiler/mdprof_cgi.m @@ -5,7 +5,8 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: mdprof_cgi.m. % Author of initial version: conway. % Author of this version: zs. % @@ -15,7 +16,6 @@ %-----------------------------------------------------------------------------% :- module mdprof_cgi. - :- interface. :- import_module io. @@ -37,10 +37,8 @@ :- import_module timeout. :- import_module util. -:- import_module array. :- import_module bool. :- import_module char. -:- import_module exception. :- import_module getopt. :- import_module int. :- import_module library. @@ -48,7 +46,6 @@ :- import_module map. :- import_module maybe. :- import_module require. -:- import_module set. :- import_module string. %-----------------------------------------------------------------------------% diff --git a/deep_profiler/mdprof_test.m b/deep_profiler/mdprof_test.m index 53dc8fda4..c7bbf06b5 100644 --- a/deep_profiler/mdprof_test.m +++ b/deep_profiler/mdprof_test.m @@ -5,14 +5,14 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: mdprof_test.m. % Author: zs. % % This file contains a tool for testing the behavior of the deep profiler. %-----------------------------------------------------------------------------% :- module mdprof_test. - :- interface. :- import_module io. diff --git a/deep_profiler/query.m b/deep_profiler/query.m index 3ff7792b6..6fb0323e2 100644 --- a/deep_profiler/query.m +++ b/deep_profiler/query.m @@ -6,6 +6,7 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % +% File: query.m. % Authors: conway, zs. % % This module contains the top level predicates for servicing individual @@ -13,7 +14,6 @@ %-----------------------------------------------------------------------------% :- module query. - :- interface. :- import_module profile. @@ -39,16 +39,13 @@ :- import_module array. :- import_module assoc_list. :- import_module bool. -:- import_module char. :- import_module exception. -:- import_module float. :- import_module int. :- import_module list. :- import_module map. :- import_module maybe. :- import_module pair. :- import_module require. -:- import_module set. :- import_module string. :- import_module univ. :- import_module unit. diff --git a/deep_profiler/startup.m b/deep_profiler/startup.m index dd57cc58b..8515b4866 100644 --- a/deep_profiler/startup.m +++ b/deep_profiler/startup.m @@ -5,7 +5,8 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: startup.m. % Authors: conway, zs. % % This module contains the code for turning the raw list of nodes read in by @@ -16,7 +17,6 @@ %-----------------------------------------------------------------------------% :- module startup. - :- interface. :- import_module profile. @@ -46,11 +46,9 @@ :- import_module read_profile. :- import_module array. -:- import_module assoc_list. :- import_module int. :- import_module map. :- import_module require. -:- import_module set. :- import_module string. :- import_module svarray. :- import_module svmap. diff --git a/deep_profiler/timeout.m b/deep_profiler/timeout.m index 4d3dc376b..be6d6c9f8 100644 --- a/deep_profiler/timeout.m +++ b/deep_profiler/timeout.m @@ -5,7 +5,8 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: timeout.m. % Author: zs. % % This module implements timeouts and cleanup for the deep profiler. @@ -25,7 +26,6 @@ %-----------------------------------------------------------------------------% :- module timeout. - :- interface. :- import_module bool. @@ -87,9 +87,6 @@ :- implementation. -:- import_module int. -:- import_module string. - %-----------------------------------------------------------------------------% :- pragma foreign_decl("C", diff --git a/deep_profiler/top_procs.m b/deep_profiler/top_procs.m index 6ff581a63..f878bfa83 100644 --- a/deep_profiler/top_procs.m +++ b/deep_profiler/top_procs.m @@ -5,7 +5,8 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: top_procs.m. % Author: zs. % % This module contains code to find the top procedures by several criteria. @@ -15,7 +16,6 @@ %-----------------------------------------------------------------------------% :- module top_procs. - :- interface. :- import_module interface. @@ -62,7 +62,6 @@ :- import_module bool. :- import_module float. :- import_module int. -:- import_module require. %-----------------------------------------------------------------------------% diff --git a/deep_profiler/util.m b/deep_profiler/util.m index b00d16fc8..8c34ddc7e 100644 --- a/deep_profiler/util.m +++ b/deep_profiler/util.m @@ -5,14 +5,14 @@ % This file may only be copied under the terms of the GNU General % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% -% +% +% File: util.m. % Authors: conway, zs. % % This module defines utility predicates for the CGI program. %-----------------------------------------------------------------------------% :- module util. - :- interface. :- import_module char. @@ -32,7 +32,6 @@ :- implementation. -:- import_module require. :- import_module string. %-----------------------------------------------------------------------------% diff --git a/library/Mercury.options b/library/Mercury.options index c9cdb38ec..d562f57e5 100644 --- a/library/Mercury.options +++ b/library/Mercury.options @@ -46,3 +46,11 @@ MCFLAGS-mer_std = --no-warn-nothing-exported # MCFLAGS-array += --no-warn-insts-without-matching-type MCFLAGS-io += --no-warn-insts-without-matching-type + +# Avoid warnings about unused imports. +# +MCFLAGS-builtin += --no-warn-unused-imports +MCFLAGS-construct += --no-warn-unused-imports +MCFLAGS-deconstruct += --no-warn-unused-imports +MCFLAGS-library += --no-warn-unused-imports +MCFLAGS-mer_std += --no-warn-unused-imports diff --git a/library/assoc_list.m b/library/assoc_list.m index bb9f5a87a..786fce2ac 100644 --- a/library/assoc_list.m +++ b/library/assoc_list.m @@ -91,10 +91,11 @@ :- implementation. -:- import_module type_desc. :- import_module require. -:- import_module set. :- import_module string. +:- import_module type_desc. + +%-----------------------------------------------------------------------------% assoc_list.reverse_members([], []). assoc_list.reverse_members([K - V | KVs], [V - K | VKs]) :- diff --git a/library/lexer.m b/library/lexer.m index b20f13dec..f10053978 100644 --- a/library/lexer.m +++ b/library/lexer.m @@ -120,7 +120,6 @@ :- import_module list. :- import_module require. :- import_module string. -:- import_module term. % Note that there are two implementations of most predicates here: % one which deals with strings, the other that deals with io.states. diff --git a/library/relation.m b/library/relation.m index de5bae485..a223c772e 100644 --- a/library/relation.m +++ b/library/relation.m @@ -312,7 +312,6 @@ :- import_module pair. :- import_module queue. :- import_module require. -:- import_module stack. %------------------------------------------------------------------------------% diff --git a/library/set.m b/library/set.m index 5700ecef0..9689d0485 100644 --- a/library/set.m +++ b/library/set.m @@ -341,7 +341,6 @@ :- implementation. :- import_module set_ordlist. -:- import_module set_unordlist. :- type set(T) == set_ordlist(T). diff --git a/mdbcomp/Mercury.options b/mdbcomp/Mercury.options index 6deeecf58..582c0ca0f 100644 --- a/mdbcomp/Mercury.options +++ b/mdbcomp/Mercury.options @@ -1,9 +1,9 @@ #-----------------------------------------------------------------------------# -# Copyright (C) 2005 University of Melbourne. +# Copyright (C) 2005-2006 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. #-----------------------------------------------------------------------------# # Mercury.options - module-specific flags for Mmake and `mmc --make'. #-----------------------------------------------------------------------------# -MCFLAGS-mer_mdbcomp = --no-warn-nothing-exported +MCFLAGS-mer_mdbcomp = --no-warn-nothing-exported --no-warn-unused-imports diff --git a/mdbcomp/rtti_access.m b/mdbcomp/rtti_access.m index 69a583625..212a16611 100644 --- a/mdbcomp/rtti_access.m +++ b/mdbcomp/rtti_access.m @@ -11,6 +11,8 @@ % % This module contains an interface to the label_layout and proc_layout % types which are used in the C backend of the debugger. +% +%-----------------------------------------------------------------------------% :- module mdbcomp.rtti_access. :- interface. @@ -63,12 +65,12 @@ :- func get_all_modes_for_layout(proc_layout) = list(proc_layout). +%-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% :- implementation. :- import_module require. -:- import_module string. :- pragma foreign_type("C", label_layout, "const MR_LabelLayout *", [can_pass_as_mercury_type, stable]). diff --git a/mdbcomp/slice_and_dice.m b/mdbcomp/slice_and_dice.m index 4fbac5591..f270eff7f 100644 --- a/mdbcomp/slice_and_dice.m +++ b/mdbcomp/slice_and_dice.m @@ -12,9 +12,10 @@ % This module contains code for generating and manipulating slices and dices. % A dice is the difference between one or more passing test runs % and one (or more, but that is not yet implemented) failing test runs. +% +%-----------------------------------------------------------------------------% :- module mdbcomp.slice_and_dice. - :- interface. :- import_module mdbcomp.prim_data. @@ -174,9 +175,6 @@ :- import_module mdbcomp.program_representation. :- import_module mdbcomp.rtti_access. -:- import_module assoc_list. -:- import_module bool. -:- import_module char. :- import_module float. :- import_module int. :- import_module list. diff --git a/mdbcomp/trace_counts.m b/mdbcomp/trace_counts.m index fe372bde0..3e28126a4 100644 --- a/mdbcomp/trace_counts.m +++ b/mdbcomp/trace_counts.m @@ -5,14 +5,14 @@ % 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. % Main author: wangp. % Modifications by zs and maclarty. - +% % This module defines predicates to read in the execution trace summaries % generated by programs compiled using the compiler's tracing options. - +% %-----------------------------------------------------------------------------% :- module mdbcomp.trace_counts. @@ -185,7 +185,6 @@ :- implementation. -:- import_module char. :- import_module exception. :- import_module int. :- import_module io. diff --git a/profiler/call_graph.m b/profiler/call_graph.m index 50c235d67..bfefbe495 100644 --- a/profiler/call_graph.m +++ b/profiler/call_graph.m @@ -21,7 +21,6 @@ :- import_module io. :- import_module list. :- import_module relation. -:- import_module string. %-----------------------------------------------------------------------------% @@ -40,7 +39,6 @@ :- import_module bool. :- import_module maybe. -:- import_module require. :- import_module svrelation. %-----------------------------------------------------------------------------% diff --git a/profiler/demangle.m b/profiler/demangle.m index 29ce136bf..fc7186255 100644 --- a/profiler/demangle.m +++ b/profiler/demangle.m @@ -6,8 +6,8 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % -% File: demangle.m -% Author: fjh +% File: demangle.m. +% Author: fjh. % % A Mercury symbol demangler. This is used to convert symbol names back % into a form that users can understand. @@ -20,8 +20,6 @@ :- module demangle. :- interface. -:- import_module string. - %-----------------------------------------------------------------------------% :- pred demangle(string::in, string::out) is det. @@ -36,8 +34,8 @@ :- import_module int. :- import_module list. :- import_module maybe. +:- import_module string. :- import_module pair. -:- import_module require. %-----------------------------------------------------------------------------% diff --git a/profiler/generate_output.m b/profiler/generate_output.m index 956cd22cc..8eeb5805b 100644 --- a/profiler/generate_output.m +++ b/profiler/generate_output.m @@ -15,17 +15,13 @@ %-----------------------------------------------------------------------------% :- module generate_output. - :- interface. :- import_module output_prof_info. :- import_module prof_info. -:- import_module float. -:- import_module int. :- import_module io. :- import_module map. -:- import_module string. %-----------------------------------------------------------------------------% @@ -43,9 +39,11 @@ :- import_module options. :- import_module bool. +:- import_module float. +:- import_module int. :- import_module list. :- import_module rbtree. -:- import_module relation. +:- import_module string. :- import_module svmap. %-----------------------------------------------------------------------------% diff --git a/profiler/mercury_profile.m b/profiler/mercury_profile.m index 87e6e0de3..f041cc472 100644 --- a/profiler/mercury_profile.m +++ b/profiler/mercury_profile.m @@ -20,7 +20,6 @@ %-----------------------------------------------------------------------------% :- module mercury_profile. - :- interface. :- import_module io. @@ -38,8 +37,6 @@ :- import_module options. :- import_module output. :- import_module process_file. -:- import_module prof_debug. -:- import_module prof_info. :- import_module propagate. :- import_module bool. @@ -47,8 +44,6 @@ :- import_module library. :- import_module list. :- import_module maybe. -:- import_module relation. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/profiler/options.m b/profiler/options.m index ad49678af..50b8cbcb3 100644 --- a/profiler/options.m +++ b/profiler/options.m @@ -21,7 +21,6 @@ :- import_module bool. :- import_module getopt. :- import_module io. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/profiler/output.m b/profiler/output.m index 27fb48c18..4cb6f5743 100644 --- a/profiler/output.m +++ b/profiler/output.m @@ -19,10 +19,8 @@ :- import_module output_prof_info. -:- import_module int. :- import_module io. :- import_module map. -:- import_module string. %-----------------------------------------------------------------------------% @@ -41,9 +39,11 @@ :- import_module assoc_list. :- import_module bool. :- import_module float. +:- import_module int. :- import_module list. :- import_module pair. :- import_module require. +:- import_module string. %-----------------------------------------------------------------------------% diff --git a/profiler/output_prof_info.m b/profiler/output_prof_info.m index 24221b0ec..4188e1e3d 100644 --- a/profiler/output_prof_info.m +++ b/profiler/output_prof_info.m @@ -21,11 +21,8 @@ :- interface. -:- import_module float. -:- import_module int. :- import_module list. :- import_module map. -:- import_module string. %-----------------------------------------------------------------------------% diff --git a/profiler/prof_debug.m b/profiler/prof_debug.m index fee807be5..9a8b59ff6 100644 --- a/profiler/prof_debug.m +++ b/profiler/prof_debug.m @@ -21,7 +21,8 @@ :- import_module io. :- import_module list. :- import_module set. -:- import_module string. + +%-----------------------------------------------------------------------------% % output_cliques: % diff --git a/profiler/prof_info.m b/profiler/prof_info.m index 5efed6481..9027a373e 100644 --- a/profiler/prof_info.m +++ b/profiler/prof_info.m @@ -18,7 +18,6 @@ %-----------------------------------------------------------------------------% :- module prof_info. - :- interface. :- import_module list. @@ -166,7 +165,8 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module require, std_util. + +:- import_module require. :- type prof ---> prof( diff --git a/profiler/read.m b/profiler/read.m index 5d10a61f5..e574d4a34 100644 --- a/profiler/read.m +++ b/profiler/read.m @@ -19,10 +19,8 @@ :- import_module globals. -:- import_module int. :- import_module io. :- import_module maybe. -:- import_module string. %-----------------------------------------------------------------------------% @@ -51,9 +49,8 @@ :- import_module options. :- import_module bool. -:- import_module char. -:- import_module list. :- import_module require. +:- import_module string. %-----------------------------------------------------------------------------% diff --git a/slice/mtc_diff.m b/slice/mtc_diff.m index 438caaf8a..ce91c6783 100644 --- a/slice/mtc_diff.m +++ b/slice/mtc_diff.m @@ -6,14 +6,14 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % -% Tool to take the difference of two trace counts. -% +% File: mtc_diff.m. % Author: Zoltan Somogyi. % +% A tool to take the difference of two trace counts. +% %-----------------------------------------------------------------------------% :- module mtc_diff. - :- interface. :- import_module io. @@ -28,15 +28,12 @@ :- import_module mdbcomp. :- import_module mdbcomp.trace_counts. -:- import_module assoc_list. -:- import_module bool. :- import_module getopt. -:- import_module int. :- import_module list. :- import_module map. -:- import_module require. :- import_module string. -:- import_module std_util. + +%-----------------------------------------------------------------------------% main(!IO) :- io.command_line_arguments(Args0, !IO), diff --git a/slice/mtc_union.m b/slice/mtc_union.m index 14bfa7ecb..3cc959bf4 100644 --- a/slice/mtc_union.m +++ b/slice/mtc_union.m @@ -6,14 +6,14 @@ % Public License - see the file COPYING in the Mercury distribution. %-----------------------------------------------------------------------------% % -% Tool to combine several trace counts into one. -% +% File: mtc_union.m. % Main Author: Ian MacLarty. % +% A tool to combine several trace counts into one. +% %-----------------------------------------------------------------------------% :- module mtc_union. - :- interface. :- import_module io. @@ -28,17 +28,16 @@ :- import_module mdbcomp. :- import_module mdbcomp.trace_counts. -:- import_module assoc_list. :- import_module bool. :- import_module getopt. -:- import_module int. :- import_module list. :- import_module map. :- import_module maybe. -:- import_module require. :- import_module set. :- import_module string. +%-----------------------------------------------------------------------------% + main(!IO) :- io.command_line_arguments(Args0, !IO), OptionOps = option_ops_multi(short_option, long_option, option_default),