diff --git a/compiler/accumulator.m b/compiler/accumulator.m index 17501ec9d..b1d44960a 100644 --- a/compiler/accumulator.m +++ b/compiler/accumulator.m @@ -129,7 +129,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, io. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module io. :- pred accumulator__process_proc(pred_id::in, proc_id::in, proc_info::in, proc_info::out, module_info::in, module_info::out, @@ -140,14 +142,22 @@ :- implementation. -:- import_module (hlds__assertion), hlds__error_util. -:- import_module transform_hlds__goal_store, hlds__goal_util, libs__globals. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_out. -:- import_module (parse_tree__inst). -:- import_module check_hlds__inst_match, hlds__instmap, check_hlds__mode_util. -:- import_module libs__options. -:- import_module parse_tree__prog_data, parse_tree__prog_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module hlds__assertion. +:- import_module hlds__error_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__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__goal_store. :- import_module assoc_list, bool, int, list, map, multi_map. :- import_module require, set, std_util, string, term, varset. diff --git a/compiler/add_heap_ops.m b/compiler/add_heap_ops.m index 0b951d2bc..75e0c9b37 100644 --- a/compiler/add_heap_ops.m +++ b/compiler/add_heap_ops.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -29,7 +29,9 @@ :- module ml_backend__add_heap_ops. :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_module. + +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- pred add_heap_ops(proc_info::in, module_info::in, proc_info::out) is det. @@ -37,18 +39,22 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_util. -:- import_module (parse_tree__inst). -:- import_module hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__goal_util, hlds__quantification, parse_tree__modules. +:- import_module backend_libs__code_model. :- import_module check_hlds__type_util. -:- import_module hlds__instmap, backend_libs__code_model. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module hlds__quantification. :- import_module ll_backend__code_util. +:- import_module parse_tree__inst. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. :- import_module bool, string. :- import_module assoc_list, list, map, set, varset, std_util, require, term. - % % As we traverse the goal, we add new variables to hold the % saved values of the heap pointer. diff --git a/compiler/add_trail_ops.m b/compiler/add_trail_ops.m index 3d5c95750..efcad9f75 100644 --- a/compiler/add_trail_ops.m +++ b/compiler/add_trail_ops.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -29,7 +29,9 @@ :- module ml_backend__add_trail_ops. :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_module. + +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- pred add_trail_ops(proc_info::in, module_info::in, proc_info::out) is det. @@ -37,17 +39,21 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_util. -:- import_module (parse_tree__inst). -:- import_module hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__goal_util, hlds__quantification, parse_tree__modules. +:- import_module backend_libs__code_model. :- import_module check_hlds__type_util. -:- import_module backend_libs__code_model, hlds__instmap. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module hlds__quantification. +:- import_module parse_tree__inst. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. :- import_module bool, string. :- import_module assoc_list, list, map, set, varset, std_util, require, term. - % % As we traverse the goal, we add new variables to hold the % trail tickets (i.e. saved values of the trail pointer) diff --git a/compiler/aditi_backend.pp b/compiler/aditi_backend.pp index 407c9e84f..045debce7 100644 --- a/compiler/aditi_backend.pp +++ b/compiler/aditi_backend.pp @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -19,8 +19,9 @@ %:- module aditi_hlds. % :- interface. :- include_module dnf. - :- include_module magic, magic_util. :- include_module context. + :- include_module magic. + :- include_module magic_util. %:- end_module aditi_hlds. % @@ -43,17 +44,25 @@ % Phase 6-rl: Low-level (RL -> RL) optimizations % :- include_module rl_opt. - :- include_module rl_block, rl_analyse, rl_liveness, rl_loop, rl_block_opt. - :- include_module rl_key, rl_sort, rl_stream. + :- include_module rl_analyse. + :- include_module rl_block. + :- include_module rl_block_opt. + :- include_module rl_key. + :- include_module rl_liveness. + :- include_module rl_loop. + :- include_module rl_sort. + :- include_module rl_stream. % % Phase 7-rl: Emit RL bytecodes. % %:- module aditi_rl_out. - :- include_module rl_out, rl_file. + :- include_module rl_out. + :- include_module rl_file. #if INCLUDE_ADITI_OUTPUT - :- include_module rl_exprn, rl_code. + :- include_module rl_exprn. + :- include_module rl_code. #else #endif diff --git a/compiler/arg_info.m b/compiler/arg_info.m index 26c8ddca0..d18861eae 100644 --- a/compiler/arg_info.m +++ b/compiler/arg_info.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2000,2002 The University of Melbourne. +% Copyright (C) 1994-2000,2002-2003 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,8 +17,13 @@ :- module ll_backend__arg_info. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_module, hlds__hlds_pred. -:- import_module backend_libs__code_model, ll_backend__llds. + +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module list, assoc_list, set. % Annotate every non-aditi procedure in the module with information @@ -95,7 +100,9 @@ :- implementation. -:- import_module ll_backend__code_util, check_hlds__mode_util. +:- import_module check_hlds__mode_util. +:- import_module ll_backend__code_util. + :- import_module std_util, map, int, require. %-----------------------------------------------------------------------------% diff --git a/compiler/assertion.m b/compiler/assertion.m index cadb14be9..e1cd8f8eb 100644 --- a/compiler/assertion.m +++ b/compiler/assertion.m @@ -18,8 +18,12 @@ :- interface. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module io, std_util. % @@ -140,9 +144,14 @@ :- implementation. -:- import_module libs__globals, hlds__goal_util, hlds__hlds_out. -:- import_module libs__options, parse_tree__prog_out, parse_tree__prog_util. :- import_module check_hlds__type_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_out. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. + :- import_module assoc_list, bool, list, map, require, set, std_util. :- type subst == map(prog_var, prog_var). diff --git a/compiler/base_typeclass_info.m b/compiler/base_typeclass_info.m index 735cd3649..881144e7c 100644 --- a/compiler/base_typeclass_info.m +++ b/compiler/base_typeclass_info.m @@ -20,9 +20,12 @@ :- interface. -:- import_module hlds__hlds_module, list, backend_libs__rtti. +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_module. :- import_module parse_tree__prog_data. +:- import_module list. + :- pred base_typeclass_info__generate_rtti(module_info, list(rtti_data)). :- mode base_typeclass_info__generate_rtti(in, out) is det. @@ -34,11 +37,17 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_out. -:- import_module hlds__hlds_data, hlds__hlds_pred, hlds__hlds_out. -:- import_module ll_backend__code_util, libs__globals, libs__options, term. -:- import_module bool, string, map, std_util, require, assoc_list. -:- import_module check_hlds__type_util, int. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. + +:- import_module bool, int, string, map, std_util, require, term, assoc_list. %---------------------------------------------------------------------------% diff --git a/compiler/builtin_ops.m b/compiler/builtin_ops.m index 518d19257..54df96013 100644 --- a/compiler/builtin_ops.m +++ b/compiler/builtin_ops.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1999-2001 The University of Melbourne. +% Copyright (C) 1999-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -16,9 +16,11 @@ :- module backend_libs__builtin_ops. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_pred. -:- import_module list. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + +:- import_module list. :- type unary_op ---> mktag diff --git a/compiler/bytecode.m b/compiler/bytecode.m index 5be17fce0..9c159f2c4 100644 --- a/compiler/bytecode.m +++ b/compiler/bytecode.m @@ -14,8 +14,11 @@ :- interface. -:- import_module hlds__hlds_data, parse_tree__prog_data, libs__tree. :- import_module backend_libs__builtin_ops. +:- import_module hlds__hlds_data. +:- import_module libs__tree. +:- import_module parse_tree__prog_data. + :- import_module char, list, std_util, io. :- type byte_tree == tree(list(byte_code)). @@ -138,8 +141,11 @@ :- implementation. -:- import_module backend_libs__bytecode_data, hlds__hlds_pred. -:- import_module parse_tree__prog_out, backend_libs__c_util. +:- import_module backend_libs__bytecode_data. +:- import_module backend_libs__c_util. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_out. + :- import_module library, int, string, require. :- pred bytecode__version(int::out) is det. diff --git a/compiler/bytecode_backend.m b/compiler/bytecode_backend.m index 0f146e9c2..e0fec34fb 100644 --- a/compiler/bytecode_backend.m +++ b/compiler/bytecode_backend.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -11,12 +11,18 @@ % :- module bytecode_backend. :- interface. -:- import_module transform_hlds, check_hlds. % are these needed? -:- import_module hlds, parse_tree, libs, backend_libs. + +:- import_module backend_libs. +:- import_module check_hlds. % is this needed? +:- import_module hlds. +:- import_module libs. +:- import_module parse_tree. +:- import_module transform_hlds. % is this needed? %-----------------------------------------------------------------------------% -:- include_module bytecode, bytecode_gen. +:- include_module bytecode. +:- include_module bytecode_gen. %-----------------------------------------------------------------------------% diff --git a/compiler/bytecode_gen.m b/compiler/bytecode_gen.m index 3e8181552..eae2d9990 100644 --- a/compiler/bytecode_gen.m +++ b/compiler/bytecode_gen.m @@ -15,7 +15,9 @@ :- interface. -:- import_module hlds__hlds_module, bytecode_backend__bytecode. +:- import_module bytecode_backend__bytecode. +:- import_module hlds__hlds_module. + :- import_module io, list. :- pred bytecode_gen__module(module_info::in, list(byte_code)::out, @@ -36,16 +38,22 @@ % in call_gen.m that we use here into arg_info.m, and to then rework % arg_info.m so that it didn't depend on the LLDS. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__code_model. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__tree. :- import_module ll_backend__arg_info. -:- import_module ll_backend__call_gen. % XXX for arg passing convention +:- import_module ll_backend__call_gen. % XXX for arg passing convention :- import_module ll_backend__code_util. % XXX for cons_id_to_tag - :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal, hlds__hlds_data. -:- import_module check_hlds__type_util, check_hlds__mode_util, hlds__goal_util. -:- import_module backend_libs__builtin_ops, backend_libs__code_model. -:- import_module hlds__passes_aux, hlds__error_util. -:- import_module libs__globals, libs__tree. :- import_module parse_tree__prog_out. :- import_module bool, int, string, list, assoc_list, set, map, varset. diff --git a/compiler/c_util.m b/compiler/c_util.m index eb5a894cc..1f12bc5c2 100644 --- a/compiler/c_util.m +++ b/compiler/c_util.m @@ -17,8 +17,9 @@ :- module backend_libs__c_util. :- interface. -:- import_module io, char, string, int. + :- import_module backend_libs__builtin_ops. +:- import_module io, char, string, int. %-----------------------------------------------------------------------------% % @@ -137,7 +138,10 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module libs__globals, libs__options. + +:- import_module libs__globals. +:- import_module libs__options. + :- import_module list, bool. %-----------------------------------------------------------------------------% diff --git a/compiler/call_gen.m b/compiler/call_gen.m index 229d780bc..2ec15c145 100644 --- a/compiler/call_gen.m +++ b/compiler/call_gen.m @@ -18,9 +18,13 @@ :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_pred, hlds__hlds_goal. -:- import_module backend_libs__code_model, ll_backend__llds. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. :- import_module ll_backend__code_info. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module list, assoc_list. :- pred call_gen__generate_call(code_model::in, pred_id::in, proc_id::in, @@ -55,14 +59,22 @@ :- implementation. -:- import_module hlds__hlds_module, hlds__hlds_data, hlds__hlds_llds. -:- import_module check_hlds__polymorphism, check_hlds__type_util. -:- import_module check_hlds__mode_util, check_hlds__unify_proc, hlds__instmap. -:- import_module ll_backend__arg_info, ll_backend__code_util. -:- import_module ll_backend__trace. :- import_module aditi_backend__rl. :- import_module backend_libs__builtin_ops. -:- import_module libs__globals, libs__options, libs__tree. +:- 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__hlds_data. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__code_util. +:- import_module ll_backend__trace. :- import_module bool, int, string, map, set, std_util, require, varset. diff --git a/compiler/check_hlds.m b/compiler/check_hlds.m index 20d55a55c..e84a73d7d 100644 --- a/compiler/check_hlds.m +++ b/compiler/check_hlds.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -10,49 +10,67 @@ :- module check_hlds. :- interface. -:- import_module hlds, parse_tree, libs. + +:- import_module hlds. +:- import_module parse_tree. +:- import_module libs. :- import_module backend_libs. % for base_typeclass_info, etc. -%:- import_module check_hlds__type_analysis, check_hlds__mode_analysis. + +% :- import_module check_hlds__type_analysis. +% :- import_module check_hlds__mode_analysis. %-----------------------------------------------------------------------------% % Type checking %:- module type_analysis. - :- include_module check_typeclass, typecheck, purity, post_typecheck. + :- include_module check_typeclass. + :- include_module post_typecheck. + :- include_module purity. :- include_module type_util. + :- include_module typecheck. %:- end_module type_analysis. % Polymorphism transformation. -:- include_module polymorphism. :- include_module clause_to_proc. +:- include_module polymorphism. % Mode analysis %:- module mode_analysis. - :- include_module modes, modecheck_unify, modecheck_call. - :- include_module mode_info, delay_info, inst_match. - :- include_module inst_util, mode_errors, mode_util, mode_debug. - :- include_module unique_modes. + :- include_module delay_info. + :- include_module inst_match. + :- include_module inst_util. + :- include_module mode_debug. + :- include_module mode_errors. + :- include_module mode_info. + :- include_module mode_util. + :- include_module modecheck_call. + :- include_module modecheck_unify. + :- include_module modes. :- include_module unify_proc. + :- include_module unique_modes. %:- end_module mode_analysis. % Indexing and determinism analysis -:- include_module switch_detection, cse_detection, det_analysis. -:- include_module det_report, det_util. +:- include_module cse_detection. +:- include_module det_analysis. +:- include_module det_report. +:- include_module det_util. +:- include_module switch_detection. % Stratification. :- include_module stratify. % Warnings about simple code -:- include_module simplify. :- include_module common. +:- include_module simplify. :- include_module goal_path. %-----------------------------------------------------------------------------% :- implementation. -:- import_module transform_hlds. % for pd_cost, etc. -:- import_module ll_backend. % XXX for code_util, code_aux +:- import_module transform_hlds. % for pd_cost, etc. +:- import_module ll_backend. % XXX for code_util, code_aux :- end_module check_hlds. diff --git a/compiler/check_typeclass.m b/compiler/check_typeclass.m index 0e5eff332..f592b0db9 100644 --- a/compiler/check_typeclass.m +++ b/compiler/check_typeclass.m @@ -46,10 +46,11 @@ :- module check_hlds__check_typeclass. - :- interface. -:- import_module hlds__hlds_module, hlds__make_hlds. +:- import_module hlds__hlds_module. +:- import_module hlds__make_hlds. + :- import_module bool, io. :- pred check_typeclass__check_instance_decls(module_info, qual_info, @@ -59,15 +60,22 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module parse_tree__prog_util. -:- import_module hlds__hlds_pred, hlds__hlds_data, hlds__hlds_goal. -:- import_module hlds__hlds_out. -:- import_module check_hlds__type_util, check_hlds__typecheck. -:- import_module check_hlds__mode_util, check_hlds__inst_match. :- import_module backend_libs__base_typeclass_info. -:- import_module parse_tree__mercury_to_mercury, hlds__error_util. -:- import_module libs__globals, libs__options. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module int, string. :- import_module list, assoc_list, map, set, term, varset. diff --git a/compiler/clause_to_proc.m b/compiler/clause_to_proc.m index c19b27326..e451c0b86 100644 --- a/compiler/clause_to_proc.m +++ b/compiler/clause_to_proc.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-2002 The University of Melbourne. +% Copyright (C) 1995-2003 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. %-----------------------------------------------------------------------------% @@ -8,7 +8,9 @@ :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module list, std_util. % In the hlds, we initially record the clauses for a predicate @@ -48,9 +50,14 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_data. -:- import_module check_hlds__mode_util, hlds__make_hlds, check_hlds__purity. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__make_hlds. :- import_module libs__globals. +:- import_module parse_tree__prog_data. + :- import_module assoc_list, bool, int, set, map, varset. maybe_add_default_func_modes([], Preds, Preds). diff --git a/compiler/code_aux.m b/compiler/code_aux.m index 32ba1122b..3bcf94883 100644 --- a/compiler/code_aux.m +++ b/compiler/code_aux.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %---------------------------------------------------------------------------% @@ -15,9 +15,11 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_llds. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. :- import_module ll_backend__code_info. +:- import_module parse_tree__prog_data. + :- import_module bool. % code_aux__contains_simple_recursive_call(G, CI, Last) succeeds @@ -39,7 +41,9 @@ :- implementation. :- import_module hlds__goal_form. -:- import_module ll_backend__llds, ll_backend__llds_out. +:- import_module ll_backend__llds. +:- import_module ll_backend__llds_out. + :- import_module string, list, assoc_list, map, std_util, varset. %-----------------------------------------------------------------------------% diff --git a/compiler/code_exprn.m b/compiler/code_exprn.m index 1560b4d96..e96ed3569 100644 --- a/compiler/code_exprn.m +++ b/compiler/code_exprn.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-2000,2002 The University of Melbourne. +% Copyright (C) 1995-2000,2002-2003 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. %-----------------------------------------------------------------------------% @@ -36,9 +36,11 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_llds, ll_backend__llds. +:- import_module hlds__hlds_llds. :- import_module libs__options. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module map, set, list, assoc_list. :- type exprn_info. @@ -256,7 +258,10 @@ :- implementation. -:- import_module ll_backend__code_util, ll_backend__exprn_aux, libs__tree. +:- import_module libs__tree. +:- import_module ll_backend__code_util. +:- import_module ll_backend__exprn_aux. + :- import_module varset, term. :- import_module bool, bag, require, int, string, std_util. diff --git a/compiler/code_model.m b/compiler/code_model.m index 2b1e065e0..b21324db8 100644 --- a/compiler/code_model.m +++ b/compiler/code_model.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000 The University of Melbourne. +% Copyright (C) 2000, 2003 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. %-----------------------------------------------------------------------------% @@ -20,8 +20,10 @@ %-----------------------------------------------------------------------------% :- interface. + +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal. :- type code_model ---> model_det % functional & total diff --git a/compiler/commit_gen.m b/compiler/commit_gen.m index 0d5d4a597..d8e1f8ee9 100644 --- a/compiler/commit_gen.m +++ b/compiler/commit_gen.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 1997-1998 The University of Melbourne. +% Copyright (C) 1997-1998, 2003 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. %---------------------------------------------------------------------------% @@ -16,15 +16,19 @@ :- interface. -:- import_module hlds__hlds_goal, backend_libs__code_model, ll_backend__llds. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_goal. :- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- pred commit_gen__generate_commit(code_model::in, hlds_goal::in, code_tree::out, code_info::in, code_info::out) is det. :- implementation. -:- import_module ll_backend__code_gen, libs__tree. +:- import_module libs__tree. +:- import_module ll_backend__code_gen. + :- import_module std_util, require. commit_gen__generate_commit(OuterCodeModel, Goal, Code) --> diff --git a/compiler/common.m b/compiler/common.m index 5ed3115dc..e5d390044 100644 --- a/compiler/common.m +++ b/compiler/common.m @@ -29,8 +29,11 @@ :- module check_hlds__common. :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_goal, parse_tree__prog_data. :- import_module check_hlds__simplify. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module list. % If we find a deconstruction or a construction we cannot optimize, @@ -81,13 +84,22 @@ :- implementation. -:- import_module hlds__quantification, check_hlds__mode_util. -:- import_module check_hlds__type_util, parse_tree__prog_util. -:- import_module check_hlds__det_util, check_hlds__det_report, libs__globals. -:- import_module libs__options, check_hlds__inst_match, hlds__instmap. -:- import_module hlds__hlds_data, hlds__hlds_module, (parse_tree__inst). -:- import_module transform_hlds__pd_cost. +:- import_module check_hlds__det_report. +:- import_module check_hlds__det_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. :- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__pd_cost. + :- import_module bool, map, set, eqvclass, require, std_util, string, term. :- type structure diff --git a/compiler/compile_target_code.m b/compiler/compile_target_code.m index 085bc61ce..31282da89 100644 --- a/compiler/compile_target_code.m +++ b/compiler/compile_target_code.m @@ -13,7 +13,8 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. :- import_module parse_tree__modules. :- import_module libs__globals. @@ -165,13 +166,16 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module libs__globals, libs__options, libs__handle_options. -:- import_module hlds__error_util, hlds__passes_aux, libs__trace_params. -:- import_module parse_tree__prog_out. :- import_module backend_libs__foreign. - +:- import_module hlds__error_util. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__handle_options. +:- import_module libs__options. +:- import_module libs__trace_params. :- import_module ll_backend__llds_out. % for llds_out__make_init_name and % llds_out__make_rl_data_name +:- import_module parse_tree__prog_out. :- import_module char, dir, getopt, int, require, string. diff --git a/compiler/const_prop.m b/compiler/const_prop.m index 805468700..44733d339 100644 --- a/compiler/const_prop.m +++ b/compiler/const_prop.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 1997-2002 The University of Melbourne. +% Copyright (C) 1997-2003 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. %---------------------------------------------------------------------------% @@ -31,17 +31,28 @@ :- implementation. -:- import_module ll_backend__code_aux, check_hlds__det_analysis. -:- import_module ll_backend__follow_code, hlds__goal_util. -:- import_module hlds__hlds_goal, hlds__hlds_data, hlds__instmap. +:- import_module check_hlds__det_analysis. :- import_module check_hlds__inst_match. -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module parse_tree__prog_data, check_hlds__mode_util. -:- import_module check_hlds__type_util. -:- import_module ll_backend__code_util, hlds__quantification. +:- 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 ll_backend__code_aux. +:- import_module ll_backend__code_util. +:- import_module ll_backend__follow_code. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module bool, list, int, float, map, require. -:- import_module (parse_tree__inst), hlds__hlds_out, std_util. +:- import_module std_util. %------------------------------------------------------------------------------% diff --git a/compiler/constraint.m b/compiler/constraint.m index a4995fcb3..e2fae75a4 100644 --- a/compiler/constraint.m +++ b/compiler/constraint.m @@ -17,8 +17,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__instmap. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. :- import_module parse_tree__prog_data. + :- import_module bool, map. :- type constraint_info. @@ -45,12 +48,17 @@ :- implementation. -:- import_module hlds__goal_util, hlds__hlds_pred, hlds__hlds_module. -:- import_module hlds__hlds_data, hlds__passes_aux, hlds__goal_form. -:- import_module check_hlds__purity. -:- import_module check_hlds__mode_util. :- import_module check_hlds__inst_match. -:- import_module libs__options, libs__globals. +:- 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__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module assoc_list, list, require, set, std_util. :- import_module string, term, varset. diff --git a/compiler/context.m b/compiler/context.m index fcea6c74e..29d69e83f 100644 --- a/compiler/context.m +++ b/compiler/context.m @@ -30,8 +30,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_pred, aditi_backend__magic_util. +:- import_module aditi_backend__magic_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module list. % context__process_disjuncts(OrigPredProcId, Inputs, Outputs, @@ -48,9 +51,12 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, hlds__hlds_module, (parse_tree__inst). -:- import_module hlds__instmap. :- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. + :- import_module assoc_list, bool, map, require, set, std_util, term, varset. context__process_disjuncts(OldPredProcId, Inputs, Outputs, diff --git a/compiler/continuation_info.m b/compiler/continuation_info.m index 429f35895..e67f0a2ac 100644 --- a/compiler/continuation_info.m +++ b/compiler/continuation_info.m @@ -51,10 +51,17 @@ :- interface. -:- import_module ll_backend__llds, hlds__hlds_module, hlds__hlds_pred. -:- import_module hlds__hlds_goal, parse_tree__prog_data. -:- import_module (parse_tree__inst), hlds__instmap, ll_backend__trace. -:- import_module backend_libs__rtti, libs__globals. +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module ll_backend__llds. +:- import_module ll_backend__trace. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module bool, std_util, list, assoc_list, set, map. % @@ -332,10 +339,12 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_llds. -:- import_module check_hlds__type_util, check_hlds__inst_match. -:- import_module ll_backend__code_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. :- import_module libs__options. +:- import_module ll_backend__code_util. :- import_module string, require, term, varset. diff --git a/compiler/cse_detection.m b/compiler/cse_detection.m index 4774deaf9..e33fa15ca 100644 --- a/compiler/cse_detection.m +++ b/compiler/cse_detection.m @@ -18,7 +18,10 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, io. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + +:- import_module io. :- pred detect_cse(module_info::in, module_info::out, io__state::di, io__state::uo) is det. @@ -32,14 +35,24 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_data, libs__options. -:- import_module libs__globals, hlds__goal_util, hlds__hlds_out. -:- import_module check_hlds__type_util, check_hlds__modes. -:- import_module check_hlds__mode_util, hlds__quantification, hlds__instmap. -:- import_module parse_tree__prog_data, check_hlds__switch_detection. -:- import_module check_hlds__det_util, check_hlds__inst_match. -:- import_module check_hlds__switch_detection, term, varset. +:- import_module check_hlds__det_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modes. +:- import_module check_hlds__switch_detection. +:- import_module check_hlds__switch_detection. +:- 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__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_data. +:- import_module term, varset. :- import_module int, bool, list, assoc_list, map, multi_map. :- import_module set, std_util, require. diff --git a/compiler/dead_proc_elim.m b/compiler/dead_proc_elim.m index b1a5c1409..02d13ac09 100644 --- a/compiler/dead_proc_elim.m +++ b/compiler/dead_proc_elim.m @@ -18,7 +18,10 @@ :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module map, std_util, io. :- pred dead_proc_elim(module_info, module_info, io__state, io__state). @@ -50,9 +53,13 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module ll_backend__llds. -:- import_module hlds__passes_aux, libs__globals, libs__options. +:- import_module parse_tree__prog_util. :- import_module int, string, list, set, queue, bool, require. diff --git a/compiler/deep_profiling.m b/compiler/deep_profiling.m index f5643e6ca..f4dc5b235 100644 --- a/compiler/deep_profiling.m +++ b/compiler/deep_profiling.m @@ -16,7 +16,9 @@ :- interface. -:- import_module hlds__hlds_module, ll_backend__layout. +:- import_module hlds__hlds_module. +:- import_module ll_backend__layout. + :- import_module io, list. :- pred apply_deep_profiling_transformation(module_info::in, module_info::out, @@ -26,14 +28,24 @@ :- implementation. -:- import_module (parse_tree__inst), hlds__instmap, hlds__hlds_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal, parse_tree__prog_data. -:- import_module backend_libs__code_model, ll_backend__code_util. -:- import_module parse_tree__prog_util, check_hlds__type_util. +:- import_module backend_libs__code_model. +:- import_module backend_libs__rtti. :- import_module check_hlds__mode_util. -:- import_module hlds__quantification, transform_hlds__dependency_graph. -:- import_module backend_libs__rtti, ll_backend__trace. -:- import_module libs__options, libs__globals. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. +:- import_module ll_backend__trace. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__dependency_graph. + :- import_module bool, int, list, assoc_list, map, require, set. :- import_module std_util, string, term, varset, counter. diff --git a/compiler/deforest.m b/compiler/deforest.m index e82fcf40c..09d7ce57d 100644 --- a/compiler/deforest.m +++ b/compiler/deforest.m @@ -34,31 +34,46 @@ :- interface. :- import_module hlds__hlds_module. + :- import_module io. :- pred deforestation(module_info::in, module_info::out, - io__state::di, io__state::uo) is det. + io__state::di, io__state::uo) is det. %-----------------------------------------------------------------------------% :- implementation. -:- import_module transform_hlds__pd_cost, transform_hlds__pd_debug. -:- import_module transform_hlds__pd_info, transform_hlds__pd_term. -:- import_module transform_hlds__pd_util. -:- import_module hlds__hlds_pred, hlds__hlds_goal, transform_hlds__inlining. -:- import_module hlds__passes_aux. -:- import_module (parse_tree__inst), hlds__instmap, check_hlds__inst_match. -:- import_module check_hlds__simplify. -:- import_module transform_hlds__dependency_graph, hlds__hlds_data. -:- import_module check_hlds__det_analysis, libs__globals. -:- import_module check_hlds__mode_util, hlds__goal_util. -:- import_module parse_tree__prog_data, parse_tree__prog_util. -:- import_module check_hlds__purity. -:- import_module check_hlds__modes, check_hlds__mode_info. -:- import_module check_hlds__unique_modes, libs__options, hlds__hlds_out. -:- import_module parse_tree__prog_out, hlds__quantification. +:- 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. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- 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__inlining. +:- import_module transform_hlds__pd_cost. +:- import_module transform_hlds__pd_debug. +:- import_module transform_hlds__pd_info. +:- import_module transform_hlds__pd_term. +:- import_module transform_hlds__pd_util. :- import_module assoc_list, bool, getopt, int, list, map, require. :- import_module set, std_util, string, term, varset. diff --git a/compiler/delay_construct.m b/compiler/delay_construct.m index 430a59971..40e09a773 100644 --- a/compiler/delay_construct.m +++ b/compiler/delay_construct.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001-2002 The University of Melbourne. +% Copyright (C) 2001-2003 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. %-----------------------------------------------------------------------------% @@ -27,7 +27,8 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module io. :- pred delay_construct_proc(pred_id::in, proc_id::in, module_info::in, @@ -37,9 +38,14 @@ :- implementation. -:- import_module parse_tree__prog_data, hlds__hlds_data, hlds__hlds_goal. -:- import_module hlds__passes_aux, libs__globals. -:- import_module hlds__instmap, check_hlds__inst_match. +:- import_module check_hlds__inst_match. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module parse_tree__prog_data. + :- import_module bool, list, set, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/delay_info.m b/compiler/delay_info.m index a65897265..f95d06b9d 100644 --- a/compiler/delay_info.m +++ b/compiler/delay_info.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-1998 The University of Melbourne. +% Copyright (C) 1994-1998, 2003 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. %-----------------------------------------------------------------------------% @@ -20,8 +20,10 @@ :- interface. -:- import_module hlds__hlds_goal, parse_tree__prog_data. :- import_module check_hlds__mode_errors. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. + :- import_module list. %-----------------------------------------------------------------------------% @@ -90,9 +92,11 @@ %-----------------------------------------------------------------------------% :- implementation. + +:- import_module check_hlds__mode_errors. % for the mode_error_info + % and delay_info types. + :- import_module int, stack, set, map, require, std_util. -:- import_module check_hlds__mode_errors. % for the mode_error_info and delay_info - % types. % The delay_info structure is a tangled web of substructures % all of which are pointing at each other - debugging it diff --git a/compiler/delay_slot.m b/compiler/delay_slot.m index 8de706fa6..fcdec5271 100644 --- a/compiler/delay_slot.m +++ b/compiler/delay_slot.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-1998 The University of Melbourne. +% Copyright (C) 1997-1998, 2003 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. %-----------------------------------------------------------------------------% @@ -48,7 +48,9 @@ :- interface. -:- import_module ll_backend__llds, list. +:- import_module ll_backend__llds. + +:- import_module list. % Delay the construction of det stack frames as long as possible, % in order to avoid the construction in as many cases as possible. diff --git a/compiler/dense_switch.m b/compiler/dense_switch.m index 11552ad6b..43f6d7653 100644 --- a/compiler/dense_switch.m +++ b/compiler/dense_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -16,11 +16,14 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_goal. -:- import_module ll_backend__llds, ll_backend__code_info. :- import_module backend_libs__code_model. -:- import_module backend_libs__switch_util, check_hlds__type_util. +:- import_module backend_libs__switch_util. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. % Should this switch be implemented as a dense jump table? % If so, we return the starting and ending values for the table, @@ -53,9 +56,12 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_llds. -:- import_module ll_backend__code_gen, ll_backend__trace. :- import_module backend_libs__builtin_ops. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__trace. :- import_module char, map, libs__tree, int, std_util, require, list. diff --git a/compiler/dependency_graph.m b/compiler/dependency_graph.m index e73954451..b846ff9cc 100644 --- a/compiler/dependency_graph.m +++ b/compiler/dependency_graph.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-2002 The University of Melbourne. +% Copyright (C) 1995-2003 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. %-----------------------------------------------------------------------------% @@ -20,7 +20,9 @@ %-----------------------------------------------------------------------------% :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module bool, list, io. % Ensure that the module_info contains a version of the @@ -98,10 +100,15 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_data. -:- import_module check_hlds__mode_util, libs__globals, libs__options. -:- import_module ll_backend__code_util, hlds__goal_util. +:- import_module check_hlds__mode_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. :- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. % XXX we should not import llds here -- this should depend only on the HLDS, % not on the LLDS. But the LLDS stuff is unfortunately needed for producing diff --git a/compiler/det_analysis.m b/compiler/det_analysis.m index 383883951..d6b98fb73 100644 --- a/compiler/det_analysis.m +++ b/compiler/det_analysis.m @@ -52,10 +52,16 @@ :- interface. +:- import_module check_hlds__det_report. +:- import_module check_hlds__det_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. -:- import_module hlds__hlds_data, hlds__instmap. -:- import_module check_hlds__det_report, check_hlds__det_util, libs__globals. + :- import_module list, std_util, io. % Perform determinism inference for local predicates with no @@ -124,10 +130,15 @@ :- implementation. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modecheck_call. :- import_module check_hlds__purity. -:- import_module check_hlds__type_util, check_hlds__modecheck_call. -:- import_module check_hlds__mode_util, libs__options, hlds__passes_aux. -:- import_module hlds__hlds_out, parse_tree__mercury_to_mercury. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. + :- import_module assoc_list, bool, map, set, require, term. %-----------------------------------------------------------------------------% diff --git a/compiler/det_report.m b/compiler/det_report.m index 55e83cfad..6a4400d15 100644 --- a/compiler/det_report.m +++ b/compiler/det_report.m @@ -14,9 +14,11 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. :- import_module check_hlds__det_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. :- import_module io, list. @@ -135,12 +137,16 @@ :- implementation. -:- import_module parse_tree__prog_out. -:- import_module hlds__hlds_data, check_hlds__type_util. -:- import_module check_hlds__mode_util, check_hlds__inst_match. -:- import_module hlds__hlds_out, parse_tree__mercury_to_mercury. +:- 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_out. :- import_module hlds__passes_aux. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. :- import_module assoc_list, bool, int, map, set, std_util, require, string. :- import_module getopt, term, varset. diff --git a/compiler/det_util.m b/compiler/det_util.m index 4adb226a6..f4334666a 100644 --- a/compiler/det_util.m +++ b/compiler/det_util.m @@ -16,9 +16,14 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. -:- import_module hlds__hlds_data, libs__globals. -:- import_module hlds__instmap, parse_tree__prog_data. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module parse_tree__prog_data. + :- import_module bool, set, list. :- type maybe_changed ---> changed ; unchanged. @@ -97,9 +102,12 @@ :- implementation. -:- import_module check_hlds__inst_match, check_hlds__mode_util. -:- import_module check_hlds__type_util, libs__options, term. -:- import_module map, require, std_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module libs__options. + +:- import_module map, term, require, std_util. update_instmap(_Goal0 - GoalInfo0, InstMap0, InstMap) :- goal_info_get_instmap_delta(GoalInfo0, DeltaInstMap), diff --git a/compiler/disj_gen.m b/compiler/disj_gen.m index d56f59ab2..e1c5ac211 100644 --- a/compiler/disj_gen.m +++ b/compiler/disj_gen.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2000,2002 The University of Melbourne. +% Copyright (C) 1994-2000,2002-2003 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,8 +17,11 @@ :- interface. -:- import_module hlds__hlds_goal, backend_libs__code_model, ll_backend__llds. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_goal. :- import_module ll_backend__code_info. +:- import_module ll_backend__llds. + :- import_module list. :- pred disj_gen__generate_disj(code_model::in, list(hlds_goal)::in, @@ -29,11 +32,15 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_llds. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_llds. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. :- import_module ll_backend__code_gen. -:- import_module ll_backend__code_util, ll_backend__trace. -:- import_module libs__options, libs__globals, libs__tree. +:- import_module ll_backend__code_util. +:- import_module ll_backend__trace. +:- import_module parse_tree__prog_data. :- import_module bool, set, libs__tree, map, std_util, term, require. diff --git a/compiler/dnf.m b/compiler/dnf.m index 944fac698..e870afc13 100644 --- a/compiler/dnf.m +++ b/compiler/dnf.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -45,7 +45,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module set, list, bool, std_util. :- pred dnf__transform_module(module_info::in, bool::in, @@ -60,10 +62,16 @@ :- implementation. -:- import_module ll_backend__code_aux, ll_backend__code_util, hlds__hlds_goal. -:- import_module hlds__hlds_data, parse_tree__prog_data, hlds__instmap. -:- import_module transform_hlds__dependency_graph, check_hlds__det_analysis. +:- import_module check_hlds__det_analysis. :- import_module check_hlds__mode_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__code_util. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__dependency_graph. + :- import_module require, map, list, string, int, bool, std_util, term, varset. % Traverse the module structure. diff --git a/compiler/dupelim.m b/compiler/dupelim.m index 8c9905dd6..3c06c1642 100644 --- a/compiler/dupelim.m +++ b/compiler/dupelim.m @@ -45,6 +45,7 @@ :- import_module backend_libs__proc_label. :- import_module ll_backend__llds. + :- import_module list, counter. :- pred dupelim_main(list(instruction)::in, proc_label::in, diff --git a/compiler/equiv_type.m b/compiler/equiv_type.m index 8712ab052..5a6fbe3db 100644 --- a/compiler/equiv_type.m +++ b/compiler/equiv_type.m @@ -12,8 +12,11 @@ :- module parse_tree__equiv_type. :- interface. + +:- import_module parse_tree__prog_data. +:- import_module recompilation. + :- import_module bool, list, io, std_util. -:- import_module recompilation, parse_tree__prog_data. %-----------------------------------------------------------------------------% @@ -53,13 +56,18 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module assoc_list, bool, require, std_util, map, set, term, varset. -:- import_module parse_tree__prog_data, parse_tree__prog_util. -:- import_module parse_tree__prog_out, parse_tree__inst. % XXX we shouldn't import the HLDS here. -:- import_module hlds__error_util, check_hlds__mode_util. -:- import_module hlds__hlds_data, check_hlds__type_util. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. + +:- import_module assoc_list, bool, require, std_util, map, set, term, varset. %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% diff --git a/compiler/error_util.m b/compiler/error_util.m index 39dde3aa7..9d16f40ee 100644 --- a/compiler/error_util.m +++ b/compiler/error_util.m @@ -16,7 +16,10 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module assoc_list, char, io, list, std_util. % Given a context, a starting indentation level and a list of words, @@ -140,8 +143,11 @@ :- implementation. -:- import_module parse_tree__prog_out, parse_tree__prog_util, libs__globals. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module libs__globals. :- import_module libs__options. + :- import_module bool, io, list, term, char, string, int, require. error_util__list_to_pieces([], []). diff --git a/compiler/exprn_aux.m b/compiler/exprn_aux.m index df0e65ca7..9d9ac215c 100644 --- a/compiler/exprn_aux.m +++ b/compiler/exprn_aux.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-2002 The University of Melbourne. +% Copyright (C) 1995-2003 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. %------------------------------------------------------------------------------% @@ -8,7 +8,10 @@ :- interface. -:- import_module ll_backend__llds, libs__options, parse_tree__prog_data. +:- import_module libs__options. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module list, std_util, bool, assoc_list. :- type exprn_opts @@ -103,6 +106,7 @@ :- implementation. :- import_module libs__options. + :- import_module int, set, require, getopt. exprn_aux__init_exprn_opts(Options, ExprnOpts) :- diff --git a/compiler/fact_table.m b/compiler/fact_table.m index 9f639dac7..0e6b59fd0 100644 --- a/compiler/fact_table.m +++ b/compiler/fact_table.m @@ -49,8 +49,11 @@ :- interface. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module io, list. -:- import_module parse_tree__prog_data, hlds__hlds_pred, hlds__hlds_module. % compile the fact table into a separate .c file. % fact_table_compile_facts(PredName, Arity, FileName, PredInfo0, @@ -86,26 +89,35 @@ :- implementation. +% Parse tree modules +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +% HLDS modules +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__inst_match. +% LLDS back-end modules +:- import_module ll_backend__arg_info. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds. +:- import_module ll_backend__llds_out. +% Modules shared between different back-ends. +:- import_module backend_libs__code_model. +:- import_module backend_libs__export. +:- import_module backend_libs__foreign. +% Misc +:- import_module libs__globals. +:- import_module libs__options. + % Standard library modules :- import_module int, map, std_util, assoc_list, char, require, library, bool. :- import_module float, math, getopt, string. :- import_module parser, term, term_io. -% Parse tree modules -:- import_module parse_tree__prog_util, parse_tree__prog_io. -:- import_module parse_tree__prog_out, parse_tree__modules. -% HLDS modules -:- import_module hlds__hlds_out, hlds__hlds_data, check_hlds__mode_util. -:- import_module check_hlds__inst_match. -% LLDS back-end modules -:- import_module ll_backend__arg_info, ll_backend__llds, ll_backend__llds_out. -:- import_module ll_backend__code_util, backend_libs__export. -:- import_module backend_libs__foreign. -% Modules shared between different back-ends. -:- import_module hlds__passes_aux, backend_libs__code_model. -% Misc -:- import_module libs__globals, libs__options. - :- type fact_result ---> ok ; error. diff --git a/compiler/follow_code.m b/compiler/follow_code.m index 366100c17..21b653e8b 100644 --- a/compiler/follow_code.m +++ b/compiler/follow_code.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -13,7 +13,10 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module list. :- pred move_follow_code_in_proc(pred_id::in, proc_id::in, pred_info::in, @@ -29,10 +32,15 @@ :- implementation. -:- import_module hlds__hlds_data, hlds__goal_util, check_hlds__mode_util. -:- import_module parse_tree__prog_data. -:- import_module libs__globals, libs__options, check_hlds__det_analysis. +:- 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__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_data. + :- import_module bool, map, set, term, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/follow_vars.m b/compiler/follow_vars.m index 347929638..59a0003b0 100644 --- a/compiler/follow_vars.m +++ b/compiler/follow_vars.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -28,9 +28,11 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. +:- 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. :- import_module map. @@ -46,12 +48,16 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__quantification, check_hlds__mode_util. :- import_module backend_libs__code_model. -:- import_module ll_backend__llds, ll_backend__call_gen. -:- import_module ll_backend__code_util, ll_backend__arg_info. +:- import_module check_hlds__mode_util. +:- import_module hlds__hlds_data. +:- import_module hlds__quantification. :- import_module libs__globals. +:- import_module ll_backend__arg_info. +:- 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 bool, int, list, assoc_list, map, set, std_util, require. diff --git a/compiler/foreign.m b/compiler/foreign.m index 17f438a13..f6990a18d 100644 --- a/compiler/foreign.m +++ b/compiler/foreign.m @@ -18,8 +18,11 @@ :- interface. -:- import_module parse_tree__prog_data, libs__globals. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module parse_tree__prog_data. :- import_module bool, list, string, term. @@ -219,15 +222,20 @@ :- implementation. +:- import_module backend_libs__code_model. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_out. + :- import_module list, map, assoc_list, std_util, string, varset, int, term. :- import_module require. -:- import_module hlds__hlds_pred, hlds__hlds_module, check_hlds__type_util. -:- import_module check_hlds__mode_util, hlds__error_util. -:- import_module hlds__hlds_data, parse_tree__prog_out. -:- import_module backend_libs__code_model, libs__globals. -:- import_module parse_tree__modules. - % Currently we don't use the globals to compare foreign language % interfaces, but if we added appropriate options we might want % to do this later. diff --git a/compiler/frameopt.m b/compiler/frameopt.m index 13c70e87c..4f77e4988 100644 --- a/compiler/frameopt.m +++ b/compiler/frameopt.m @@ -90,6 +90,7 @@ :- import_module backend_libs__proc_label. :- import_module ll_backend__llds. + :- import_module bool, list, counter. % The first bool output says whether we performed any modifications. diff --git a/compiler/gcc.m b/compiler/gcc.m index 0a60e5aaf..d007e118d 100644 --- a/compiler/gcc.m +++ b/compiler/gcc.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001-2002 The University of Melbourne. +% Copyright (C) 2001-2003 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. %-----------------------------------------------------------------------------% @@ -64,6 +64,7 @@ :- module gcc. :- interface. + :- import_module io, bool. %-----------------------------------------------------------------------------% @@ -672,6 +673,7 @@ %-----------------------------------------------------------------------------% :- implementation. + :- import_module int, string. :- pragma c_header_code(" diff --git a/compiler/globals.m b/compiler/globals.m index 501cabb68..333de84ac 100644 --- a/compiler/globals.m +++ b/compiler/globals.m @@ -16,8 +16,12 @@ %-----------------------------------------------------------------------------% :- interface. -:- import_module libs__options, libs__trace_params. -:- import_module parse_tree, parse_tree__prog_data. % for module_name. + +:- import_module libs__options. +:- import_module libs__trace_params. +:- import_module parse_tree. +:- import_module parse_tree__prog_data. % for module_name. + :- import_module bool, getopt, list, map, io, std_util. :- type globals. @@ -220,6 +224,7 @@ :- implementation. :- import_module ll_backend__exprn_aux. + :- import_module map, std_util, require, string. convert_target(String, Target) :- diff --git a/compiler/goal_form.m b/compiler/goal_form.m index 6c69d3069..644452799 100644 --- a/compiler/goal_form.m +++ b/compiler/goal_form.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %---------------------------------------------------------------------------% @@ -16,7 +16,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_goal. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. + :- import_module list. % Succeeds if the goal cannot loop forever. @@ -60,6 +62,7 @@ :- import_module hlds__hlds_pred. :- import_module transform_hlds__term_util. + :- import_module std_util. %-----------------------------------------------------------------------------% diff --git a/compiler/goal_path.m b/compiler/goal_path.m index 1ec2110b8..4a9d5af03 100644 --- a/compiler/goal_path.m +++ b/compiler/goal_path.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-2002 University of Melbourne. +% Copyright (C) 1997-2003 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. %-----------------------------------------------------------------------------% @@ -13,15 +13,19 @@ :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- pred goal_path__fill_slots(proc_info::in, module_info::in, proc_info::out) is det. :- implementation. -:- import_module parse_tree__prog_data, hlds__hlds_data, hlds__hlds_goal. :- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. + :- import_module char, int, list, map, std_util, require. :- type slot_info diff --git a/compiler/goal_store.m b/compiler/goal_store.m index 8d997f493..4155b8b23 100644 --- a/compiler/goal_store.m +++ b/compiler/goal_store.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000 The University of Melbourne. +% Copyright (C) 2000, 2003 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. %-----------------------------------------------------------------------------% @@ -18,8 +18,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module hlds__instmap. + :- import_module bool, set, std_util. %-----------------------------------------------------------------------------% @@ -46,6 +49,7 @@ :- implementation. :- import_module hlds__goal_util. + :- import_module int, list, map, require. :- type goal_store(T) == map__map(T, goal). diff --git a/compiler/goal_util.m b/compiler/goal_util.m index f59b96874..3312c3450 100644 --- a/compiler/goal_util.m +++ b/compiler/goal_util.m @@ -14,9 +14,14 @@ :- module hlds__goal_util. :- interface. -:- import_module parse_tree__inst, parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, hlds__instmap. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module assoc_list, bool, list, set, map, term, std_util. % The predicates rename_var* take a structure and a mapping from var -> var @@ -239,11 +244,16 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__inst. -:- import_module hlds__hlds_data, hlds__goal_form, hlds__hlds_llds. -:- import_module check_hlds__purity, check_hlds__det_analysis. -:- import_module check_hlds__inst_match, check_hlds__mode_util. +:- import_module check_hlds__det_analysis. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. :- import_module check_hlds__type_util. +:- import_module hlds__goal_form. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. :- import_module int, string, require, varset. diff --git a/compiler/handle_options.m b/compiler/handle_options.m index 978c767fd..b7ef6eea1 100644 --- a/compiler/handle_options.m +++ b/compiler/handle_options.m @@ -17,8 +17,11 @@ :- module libs__handle_options. :- interface. + +:- import_module libs__globals. +:- import_module libs__options. + :- import_module list, bool, getopt, std_util, io. -:- import_module libs__globals, libs__options. % handle_options(Args, MaybeError, OptionArgs, NonOptionArgs, Link). :- pred handle_options(list(string), maybe(string), list(string), @@ -69,9 +72,12 @@ :- implementation. -:- import_module libs__options, libs__globals, parse_tree__prog_io_util. -:- import_module libs__trace_params, check_hlds__unify_proc. -:- import_module parse_tree__prog_data, backend_libs__foreign. +:- import_module backend_libs__foreign. +:- import_module check_hlds__unify_proc. +:- import_module libs__trace_params. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. + :- import_module char, dir, int, string, map, set, library. handle_options(Args0, MaybeError, OptionArgs, Args, Link) --> diff --git a/compiler/higher_order.m b/compiler/higher_order.m index fbe63d39d..084fa6b5d 100644 --- a/compiler/higher_order.m +++ b/compiler/higher_order.m @@ -26,6 +26,7 @@ :- interface. :- import_module hlds__hlds_module. + :- import_module io. :- pred specialize_higher_order(module_info::in, module_info::out, @@ -35,15 +36,26 @@ :- implementation. -:- import_module hlds__hlds_pred, hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__instmap, (parse_tree__inst). -:- import_module libs__globals, check_hlds__mode_util. +:- 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__goal_util. -:- import_module check_hlds__type_util, libs__options, parse_tree__prog_data. -:- import_module parse_tree__prog_out, hlds__quantification. -:- import_module parse_tree__mercury_to_mercury, transform_hlds__inlining. -:- import_module check_hlds__polymorphism, parse_tree__prog_util. -:- import_module hlds__special_pred, check_hlds__unify_proc, hlds__passes_aux. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__inlining. :- import_module assoc_list, bool, char, int, list, map, require, set. :- import_module std_util, string, varset, term. diff --git a/compiler/hlds.m b/compiler/hlds.m index 1e7c1f225..ab499dc44 100644 --- a/compiler/hlds.m +++ b/compiler/hlds.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -10,38 +10,47 @@ :- module hlds. :- interface. -:- import_module parse_tree, libs. -:- import_module check_hlds. % needed for unify_proc__unify_proc_id, +:- import_module backend_libs. % XXX needed for rtti, foreign, etc. +:- import_module check_hlds. % needed for unify_proc__unify_proc_id, % etc. -:- import_module transform_hlds. % needed for term_util, etc. -:- import_module backend_libs. % XXX needed for rtti, foreign, etc. -% :- import_module ll_backend. % XXX needed for `llds__lval', +:- import_module libs. +% :- import_module ll_backend. % XXX needed for `llds__lval', % which is used in various annotations % in the HLDS (stack_slots, follow_vars, etc.) +:- import_module parse_tree. +:- import_module transform_hlds. % needed for term_util, etc. %-----------------------------------------------------------------------------% % The HLDS data structure itself -:- include_module hlds_data, hlds_goal, hlds_pred, hlds_module. -:- include_module hlds_llds, instmap. -:- include_module (assertion), special_pred. +:- include_module assertion. +:- include_module hlds_data. +:- include_module hlds_goal. +:- include_module hlds_llds. +:- include_module hlds_module. +:- include_module hlds_pred. +:- include_module instmap. +:- include_module special_pred. % Modules for creating the HLDS -:- include_module make_hlds, make_tags. +:- include_module make_hlds. +:- include_module make_tags. :- include_module quantification. % Modules for pretty-printing it. :- include_module hlds_out. % Miscellaneous utilities. -:- include_module passes_aux, error_util. -:- include_module goal_form, goal_util. +:- include_module error_util. +:- include_module goal_form. +:- include_module goal_util. :- include_module hlds_code_util. % XXX currently code_util.m +:- include_module passes_aux. %-----------------------------------------------------------------------------% :- implementation. -:- import_module aditi_backend. % XXX for rl__get_entry_proc_name, +:- import_module aditi_backend. % XXX for rl__get_entry_proc_name, % which is used by hlds_out.m to dump % aditi_call goals. :- end_module hlds. diff --git a/compiler/hlds_code_util.m b/compiler/hlds_code_util.m index c18877bdc..5fc78f8c2 100644 --- a/compiler/hlds_code_util.m +++ b/compiler/hlds_code_util.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -11,7 +11,9 @@ % %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% + :- module hlds__hlds_code_util. + :- interface. :- import_module hlds__hlds_module. @@ -25,7 +27,9 @@ :- implementation. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. + :- import_module bool. are_equivalence_types_expanded(ModuleInfo) :- @@ -34,5 +38,3 @@ are_equivalence_types_expanded(ModuleInfo) :- HighLevelData = yes, globals__get_target(Globals, Target), ( Target = il ; Target = java). - - diff --git a/compiler/hlds_data.m b/compiler/hlds_data.m index 1c7d69658..48b491774 100644 --- a/compiler/hlds_data.m +++ b/compiler/hlds_data.m @@ -13,8 +13,11 @@ :- interface. -:- import_module hlds__hlds_pred, parse_tree__prog_data, (parse_tree__inst). :- import_module backend_libs__rtti. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module bool, list, map, std_util, term. %-----------------------------------------------------------------------------% @@ -166,8 +169,9 @@ :- implementation. -:- import_module parse_tree__prog_util, varset. -:- import_module require. +:- import_module parse_tree__prog_util. + +:- import_module require, varset. cons_id_and_args_to_term(int_const(Int), [], Term) :- term__context_init(Context), diff --git a/compiler/hlds_goal.m b/compiler/hlds_goal.m index 9d63166ff..b7b4567c1 100644 --- a/compiler/hlds_goal.m +++ b/compiler/hlds_goal.m @@ -12,9 +12,12 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__inst. -:- import_module hlds__hlds_data, hlds__hlds_pred, hlds__hlds_llds. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_pred. :- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. :- import_module bool, char, list, set, map, std_util. @@ -1128,9 +1131,11 @@ :- implementation. +:- import_module check_hlds__det_analysis. :- import_module check_hlds__purity. -:- import_module check_hlds__det_analysis, parse_tree__prog_util. :- import_module check_hlds__type_util. +:- import_module parse_tree__prog_util. + :- import_module require, string, term, varset. %-----------------------------------------------------------------------------% @@ -1153,6 +1158,7 @@ generic_call_pred_or_func(aditi_builtin(_, CallId)) = simple_call_id_pred_or_func(CallId). :- func simple_call_id_pred_or_func(simple_call_id) = pred_or_func. + simple_call_id_pred_or_func(PredOrFunc - _) = PredOrFunc. %-----------------------------------------------------------------------------% diff --git a/compiler/hlds_llds.m b/compiler/hlds_llds.m index af35b6a8f..0fd971a43 100644 --- a/compiler/hlds_llds.m +++ b/compiler/hlds_llds.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -13,7 +13,10 @@ :- interface. -:- import_module hlds__hlds_goal, parse_tree__prog_data, ll_backend__llds. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module bool, map, set, std_util. % @@ -251,6 +254,7 @@ :- implementation. :- import_module hlds__goal_util. + :- import_module list, assoc_list, require. % For the meaning of this type, see the documentation of the diff --git a/compiler/hlds_module.m b/compiler/hlds_module.m index a641bcf60..ebeacf975 100644 --- a/compiler/hlds_module.m +++ b/compiler/hlds_module.m @@ -21,18 +21,26 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__module_qual. -:- import_module recompilation. -:- import_module hlds__hlds_pred, hlds__hlds_data, check_hlds__unify_proc. -:- import_module hlds__special_pred. -:- import_module libs__globals, backend_libs__foreign. :- import_module analysis. +:- import_module backend_libs__foreign. +:- import_module check_hlds__unify_proc. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_pred. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_data. +:- import_module recompilation. + :- import_module relation, map, std_util, list, set, multi_map, counter. :- implementation. -:- import_module hlds__hlds_out, parse_tree__prog_out, parse_tree__prog_util. -:- import_module check_hlds__typecheck, parse_tree__modules. +:- import_module check_hlds__typecheck. +:- import_module hlds__hlds_out. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module transform_hlds__mmc_analysis. :- import_module bool, require, int, string. diff --git a/compiler/hlds_out.m b/compiler/hlds_out.m index c2fb2218a..1dc75be28 100644 --- a/compiler/hlds_out.m +++ b/compiler/hlds_out.m @@ -33,10 +33,14 @@ :- interface. % Parse tree modules -:- import_module parse_tree__prog_data, (parse_tree__inst). +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. % HLDS modules -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. -:- import_module hlds__hlds_data, hlds__instmap. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. :- import_module io, bool, list, term. @@ -257,26 +261,36 @@ :- implementation. % Parse tree modules. -:- import_module parse_tree__prog_out, parse_tree__prog_util. -:- import_module parse_tree__inst, parse_tree__mercury_to_mercury. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. % HLDS modules. -:- import_module hlds__special_pred, hlds__instmap, hlds__hlds_llds. -:- import_module check_hlds__purity, check_hlds__check_typeclass. +:- import_module check_hlds__check_typeclass. +:- import_module check_hlds__purity. :- import_module check_hlds__type_util. -:- import_module transform_hlds__termination, transform_hlds__term_errors. +:- import_module hlds__hlds_llds. +:- import_module hlds__instmap. +:- import_module hlds__special_pred. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__termination. % RL back-end modules (XXX should avoid using those here). :- import_module aditi_backend__rl. % LLDS back-end modules (XXX should avoid using those here). :- import_module ll_backend. -:- import_module ll_backend__code_util, ll_backend__llds. -:- import_module ll_backend__llds_out, ll_backend__trace. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds. +:- import_module ll_backend__llds_out. +:- import_module ll_backend__trace. % Misc -:- import_module backend_libs__rtti, backend_libs__foreign. -:- import_module libs__globals, libs__options. +:- import_module backend_libs__foreign. +:- import_module backend_libs__rtti. +:- import_module libs__globals. +:- import_module libs__options. % Standard library modules :- import_module int, string, set, assoc_list, map, multi_map. diff --git a/compiler/hlds_pred.m b/compiler/hlds_pred.m index 3fe9da0da..38b413c07 100644 --- a/compiler/hlds_pred.m +++ b/compiler/hlds_pred.m @@ -13,12 +13,15 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__instmap, hlds__hlds_llds. :- import_module check_hlds__mode_errors. -:- import_module transform_hlds__term_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. :- import_module libs__globals. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__term_util. :- import_module bool, list, set, map, std_util, term, varset. @@ -28,9 +31,12 @@ :- import_module parse_tree__prog_util. % HLDS modules. -:- import_module hlds__goal_util, hlds__make_hlds, hlds__goal_form. -:- import_module check_hlds__inst_match, check_hlds__mode_util. +:- 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. % Misc :- import_module libs__options. diff --git a/compiler/il_peephole.m b/compiler/il_peephole.m index 3f7649dc0..31480d0c0 100644 --- a/compiler/il_peephole.m +++ b/compiler/il_peephole.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2001 The University of Melbourne. +% Copyright (C) 2000-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -34,9 +34,10 @@ :- interface. -:- import_module list. :- import_module ml_backend__ilasm. +:- import_module list. + % Peephole optimize a list of instructions. :- pred il_peephole__optimize(list(ilasm__decl)::in, list(ilasm__decl)::out) @@ -46,8 +47,9 @@ :- type instrs == list(instr). -:- import_module assoc_list, bool, map, string, std_util, int. -:- import_module ml_backend__ilds, require. +:- import_module ml_backend__ilds. + +:- import_module assoc_list, bool, map, string, std_util, int, require. % We zip down to the end of the instruction list, and start attempting % to optimize instruction sequences. As long as we can continue diff --git a/compiler/ilasm.m b/compiler/ilasm.m index 1a77c86f1..7e62e5610 100644 --- a/compiler/ilasm.m +++ b/compiler/ilasm.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1999-2002 The University of Melbourne. +% Copyright (C) 1999-2003 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. %-----------------------------------------------------------------------------% @@ -24,9 +24,10 @@ :- interface. -:- import_module io, list, term, std_util, bool, integer. :- import_module ml_backend__ilds. +:- import_module io, list, term, std_util, bool, integer. + :- pred ilasm__output( list(decl)::in, io__state::di, io__state::uo) is det. @@ -271,11 +272,13 @@ :- implementation. +:- import_module backend_libs__c_util. % for output_float_literal +:- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module libs__options. + :- import_module char, string, pprint, getopt. :- import_module require, int, term_io, varset, bool. -:- import_module libs__globals, libs__options, hlds__error_util. -:- import_module backend_libs__c_util. % for output_float_literal - % Some versions of the IL assembler enforce a rule that if you output % .assembly foo { } diff --git a/compiler/ilds.m b/compiler/ilds.m index 72fcf1ecc..eaa2c9ca0 100644 --- a/compiler/ilds.m +++ b/compiler/ilds.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1999-2002 The University of Melbourne. +% Copyright (C) 1999-2003 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. %-----------------------------------------------------------------------------% @@ -386,9 +386,10 @@ :- implementation. -:- import_module int, require. :- import_module hlds__error_util. +:- import_module int, require. + get_class_suffix(structured_name(_, OuterClassFullName, NestedClass)) = SuffixName :- ( diff --git a/compiler/inlining.m b/compiler/inlining.m index 99c67a93b..71c02bf83 100644 --- a/compiler/inlining.m +++ b/compiler/inlining.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -83,8 +83,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module bool, io, list, map. :- pred inlining(module_info, module_info, io__state, io__state). @@ -151,16 +154,22 @@ :- import_module parse_tree__prog_data. % HLDS modules -:- import_module hlds__hlds_data, check_hlds__type_util. -:- import_module check_hlds__mode_util, hlds__goal_util. :- import_module check_hlds__det_analysis. -:- import_module hlds__quantification, ll_backend__code_aux. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module ll_backend__code_aux. :- import_module transform_hlds__dead_proc_elim. :- import_module transform_hlds__dependency_graph. -:- import_module hlds__passes_aux, check_hlds__purity. % Misc -:- import_module libs__globals, libs__options, libs__trace_params. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__trace_params. % Standard library modules :- import_module bool, int, list, assoc_list, set, std_util, require. diff --git a/compiler/inst.m b/compiler/inst.m index dca155055..6c3d836e4 100644 --- a/compiler/inst.m +++ b/compiler/inst.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997, 1999-2000, 2002 The University of Melbourne. +% Copyright (C) 1997, 1999-2000, 2002-2003 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. %-----------------------------------------------------------------------------% @@ -22,7 +22,9 @@ % of the `cons_id' type, and so we could define a new type % `abstract_cons_id' and use that here instead of `cons_id'. -:- import_module parse_tree__prog_data, hlds__hlds_data. +:- import_module hlds__hlds_data. +:- import_module parse_tree__prog_data. + :- import_module list, map, set. %-----------------------------------------------------------------------------% diff --git a/compiler/inst_match.m b/compiler/inst_match.m index 258b763d4..40cdfac6f 100644 --- a/compiler/inst_match.m +++ b/compiler/inst_match.m @@ -39,7 +39,10 @@ mode system to distinguish between different representations. :- interface. -:- import_module hlds__hlds_module, parse_tree__prog_data, (parse_tree__inst). +:- import_module hlds__hlds_module. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module list. %-----------------------------------------------------------------------------% @@ -285,9 +288,13 @@ mode system to distinguish between different representations. %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, check_hlds__mode_util. -:- import_module parse_tree__prog_data, check_hlds__inst_util. + +:- import_module check_hlds__inst_util. +:- import_module check_hlds__mode_util. :- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module parse_tree__prog_data. + :- import_module list, set, map, term, std_util, require, bool. inst_matches_initial(InstA, InstB, Type, ModuleInfo) :- diff --git a/compiler/inst_util.m b/compiler/inst_util.m index eb2dbb891..ffe2a9711 100644 --- a/compiler/inst_util.m +++ b/compiler/inst_util.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-2002 The University of Melbourne. +% Copyright (C) 1997-2003 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. %-----------------------------------------------------------------------------% @@ -41,8 +41,11 @@ in the general case. :- module check_hlds__inst_util. :- interface. -:- import_module hlds__hlds_module, hlds__hlds_data, parse_tree__prog_data. -:- import_module (parse_tree__inst). +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module list, std_util. :- pred abstractly_unify_inst(is_live, inst, inst, unify_is_real, module_info, @@ -130,9 +133,13 @@ in the general case. %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, check_hlds__inst_match. -:- import_module check_hlds__mode_util, check_hlds__det_analysis. + +:- import_module check_hlds__det_analysis. +:- 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 bool, std_util, require, map, list, set, int. % Abstractly unify two insts. diff --git a/compiler/instmap.m b/compiler/instmap.m index 6f265f6c1..7258c4d01 100644 --- a/compiler/instmap.m +++ b/compiler/instmap.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2001 The University of Melbourne. +% Copyright (C) 1996-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -19,10 +19,13 @@ :- interface. -:- import_module hlds__hlds_module, parse_tree__prog_data. -:- import_module check_hlds__mode_info, (parse_tree__inst). :- import_module check_hlds__mode_errors. -:- import_module hlds__hlds_data, hlds__hlds_pred. +:- import_module check_hlds__mode_info. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. :- import_module map, bool, set, list, assoc_list, std_util. @@ -308,9 +311,13 @@ :- implementation. -:- import_module check_hlds__mode_util, check_hlds__inst_match. -:- import_module parse_tree__prog_data, hlds__goal_util, check_hlds__type_util. -:- import_module hlds__hlds_data, check_hlds__inst_util. +:- import_module check_hlds__inst_match. +:- 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 parse_tree__prog_data. :- import_module std_util, require, string, term. diff --git a/compiler/intermod.m b/compiler/intermod.m index 6ca523f49..6238855c8 100644 --- a/compiler/intermod.m +++ b/compiler/intermod.m @@ -39,9 +39,12 @@ :- interface. -:- import_module io, bool. -:- import_module hlds__hlds_module, parse_tree__modules, parse_tree__prog_io. +:- import_module hlds__hlds_module. +:- import_module parse_tree__modules. :- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. + +:- import_module io, bool. :- pred intermod__write_optfile(module_info, module_info, io__state, io__state). @@ -86,21 +89,33 @@ :- implementation. +:- import_module backend_libs__foreign. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- 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. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__inlining. + :- import_module assoc_list, dir, getopt, int, list, map, multi_map, require. :- import_module set, std_util, string, term, varset. -:- import_module libs__globals, hlds__goal_util. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_pred. -:- import_module hlds__hlds_out, transform_hlds__inlining, ll_backend__llds. -:- import_module parse_tree__mercury_to_mercury, check_hlds__mode_util. -:- import_module parse_tree__modules. -:- import_module libs__options, hlds__passes_aux, parse_tree__prog_data. -:- import_module parse_tree__prog_io, parse_tree__prog_out. -:- import_module parse_tree__prog_util. -:- import_module hlds__special_pred, check_hlds__typecheck. -:- import_module check_hlds__type_util, hlds__instmap, (parse_tree__inst). -:- import_module backend_libs__foreign. - %-----------------------------------------------------------------------------% % Open the file ".opt.tmp", and write out the diff --git a/compiler/ite_gen.m b/compiler/ite_gen.m index 9ae2dbfa3..630e65567 100644 --- a/compiler/ite_gen.m +++ b/compiler/ite_gen.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %---------------------------------------------------------------------------% @@ -18,8 +18,10 @@ :- interface. -:- import_module hlds__hlds_goal, backend_libs__code_model, ll_backend__llds. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_goal. :- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- pred ite_gen__generate_ite(code_model::in, hlds_goal::in, hlds_goal::in, hlds_goal::in, hlds_goal_info::in, code_tree::out, @@ -33,12 +35,16 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__instmap, hlds__hlds_llds. -:- import_module ll_backend__code_gen, ll_backend__code_util. -:- import_module ll_backend__trace. :- import_module backend_libs__builtin_ops. -:- import_module libs__options, libs__globals, libs__tree. +:- import_module hlds__hlds_llds. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__code_util. +:- import_module ll_backend__trace. +:- import_module parse_tree__prog_data. :- import_module bool, set, term, list, map, std_util, require. diff --git a/compiler/java_util.m b/compiler/java_util.m index 298b089f6..49af20a86 100644 --- a/compiler/java_util.m +++ b/compiler/java_util.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -15,9 +15,11 @@ :- module ml_backend__java_util. :- interface. -:- import_module string. + :- import_module backend_libs__builtin_ops. +:- import_module string. + %-----------------------------------------------------------------------------% % Succeeds iff the given string matches a reserved @@ -71,9 +73,11 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module list. + :- import_module hlds__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 ba81dbfb7..e4b1e5a11 100644 --- a/compiler/jumpopt.m +++ b/compiler/jumpopt.m @@ -16,6 +16,7 @@ :- import_module backend_libs__proc_label. :- import_module ll_backend__llds. + :- import_module list, set, bool, counter. % Take an instruction list and optimize jumps. This includes jumps diff --git a/compiler/labelopt.m b/compiler/labelopt.m index ee0981a98..e037204ec 100644 --- a/compiler/labelopt.m +++ b/compiler/labelopt.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-1999 The University of Melbourne. +% Copyright (C) 1994-1999, 2003 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. %-----------------------------------------------------------------------------% @@ -14,9 +14,10 @@ :- interface. -:- import_module bool, list, set. :- import_module ll_backend__llds. +:- import_module bool, list, set. + % Build up a set showing which labels are branched to, % then traverse the instruction list removing unnecessary labels. % If the instruction before the label branches away, we also @@ -37,6 +38,7 @@ :- implementation. :- import_module ll_backend__opt_util. + :- import_module std_util. labelopt_main(Instrs0, Final, LayoutLabelSet, Instrs, Mod) :- diff --git a/compiler/lambda.m b/compiler/lambda.m index b99eb00ba..ad4d4a14d 100644 --- a/compiler/lambda.m +++ b/compiler/lambda.m @@ -69,7 +69,8 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- pred lambda__process_module(module_info, module_info). :- mode lambda__process_module(in, out) is det. @@ -82,16 +83,25 @@ :- implementation. -:- import_module backend_libs__code_model. % XXX for some back-end dependent optimizations +:- import_module backend_libs__code_model. % XXX for some back-end dependent + % optimizations % Parse tree modules -:- import_module parse_tree__prog_data, parse_tree__prog_util. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. + % HLDS modules -:- import_module hlds__hlds_goal, hlds__hlds_data, hlds__quantification. -:- import_module check_hlds__type_util, hlds__goal_util. -:- import_module check_hlds__mode_util, check_hlds__inst_match. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__quantification. + % Misc -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. % Standard library modules :- import_module list, map, set. diff --git a/compiler/lco.m b/compiler/lco.m index 965fc4b58..62718b91a 100644 --- a/compiler/lco.m +++ b/compiler/lco.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -15,7 +15,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io. :- pred lco_modulo_constructors(pred_id, proc_id, module_info, @@ -27,7 +29,10 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__passes_aux, hlds__hlds_out. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. + :- import_module list, require, std_util. %-----------------------------------------------------------------------------% diff --git a/compiler/libs.m b/compiler/libs.m index 937d14232..0ba449a9a 100644 --- a/compiler/libs.m +++ b/compiler/libs.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -9,18 +9,24 @@ :- module libs. :- interface. + :- import_module ll_backend. % XXX trace_params depends on llds__trace_port. % option handling -:- include_module globals, options, handle_options, trace_params. +:- include_module globals. +:- include_module handle_options. +:- include_module options. +:- include_module trace_params. % generic algorithms and data structures that are not % quite useful enough to go in the standard library -:- include_module tree, graph_colour, atsort. +:- include_module atsort. +:- include_module graph_colour. +:- include_module tree. % OS interfaces not provided by the standard library -:- include_module timestamp. :- include_module process_util. +:- include_module timestamp. :- end_module libs. diff --git a/compiler/live_vars.m b/compiler/live_vars.m index 692d573f9..29236464b 100644 --- a/compiler/live_vars.m +++ b/compiler/live_vars.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -26,8 +26,10 @@ :- import_module parse_tree__prog_data. % HLDS modules -:- import_module hlds__hlds_goal, hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_goal. :- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. % Standard library modules :- import_module bool, set. @@ -60,12 +62,16 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_llds, hlds__hlds_data. -:- import_module hlds__instmap. -:- import_module check_hlds__mode_util. -:- import_module ll_backend__llds, ll_backend__arg_info. -:- import_module ll_backend__liveness, ll_backend__code_aux. :- import_module backend_libs__code_model. +:- import_module check_hlds__mode_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module hlds__instmap. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__liveness. +:- import_module ll_backend__llds. :- import_module int, list, assoc_list, map, std_util, require. diff --git a/compiler/livemap.m b/compiler/livemap.m index 4dc989fcb..ba12eafe8 100644 --- a/compiler/livemap.m +++ b/compiler/livemap.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-2002 The University of Melbourne. +% Copyright (C) 1995-2003 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. %-----------------------------------------------------------------------------% @@ -16,9 +16,10 @@ :- interface. -:- import_module list, set, map, std_util. :- import_module ll_backend__llds. +:- import_module list, set, map, std_util. + :- type livemap == map(label, lvalset). :- type lvalset == set(lval). @@ -32,6 +33,7 @@ :- implementation. :- import_module ll_backend__opt_util. + :- import_module require, string, bool. %-----------------------------------------------------------------------------% diff --git a/compiler/liveness.m b/compiler/liveness.m index ba693fb32..35156ae9d 100644 --- a/compiler/liveness.m +++ b/compiler/liveness.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -155,7 +155,10 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module set, io. % Add liveness annotations to the goal of the procedure. @@ -176,23 +179,33 @@ :- implementation. % Parse tree modules -:- import_module parse_tree__prog_util, parse_tree__inst. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_util. % HLDS modules -:- import_module hlds__hlds_goal, hlds__hlds_llds. -:- import_module hlds__hlds_data, hlds__hlds_out. -:- import_module hlds__instmap, hlds__quantification, hlds__passes_aux. -:- import_module check_hlds__mode_util, check_hlds__polymorphism. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__polymorphism. +:- 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__passes_aux. +:- import_module hlds__quantification. % LLDS modules -:- import_module ll_backend__llds, ll_backend__code_util. -:- import_module ll_backend__arg_info, ll_backend__trace. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds. +:- import_module ll_backend__trace. % Modules shared between different back-ends. :- import_module backend_libs__code_model. % Misc -:- import_module libs__trace_params, libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__trace_params. % Standard library modules :- import_module bool, string, map, std_util, list, assoc_list, require. diff --git a/compiler/ll_pseudo_type_info.m b/compiler/ll_pseudo_type_info.m index 86a6f23f1..4613d948b 100644 --- a/compiler/ll_pseudo_type_info.m +++ b/compiler/ll_pseudo_type_info.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 2000,2002 The University of Melbourne. +% Copyright (C) 2000,2002-2003 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. %---------------------------------------------------------------------------% @@ -23,7 +23,9 @@ :- interface. -:- import_module parse_tree__prog_data, ll_backend__llds. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module counter. % ll_pseudo_type_info__construct_typed_pseudo_type_info(Type, @@ -57,7 +59,10 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module backend_libs__pseudo_type_info, backend_libs__rtti. + +:- import_module backend_libs__pseudo_type_info. +:- import_module backend_libs__rtti. + :- import_module std_util, list, bool, int. ll_pseudo_type_info__construct_llds_pseudo_type_info(Type, NumUnivQTvars, diff --git a/compiler/llds_common.m b/compiler/llds_common.m index 408ac09bb..49fb0be1e 100644 --- a/compiler/llds_common.m +++ b/compiler/llds_common.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -22,6 +22,7 @@ :- import_module ll_backend__llds. :- import_module parse_tree__prog_data. % for module_name + :- import_module list. :- pred llds_common(list(c_procedure)::in, list(comp_gen_c_data)::in, @@ -30,7 +31,10 @@ :- implementation. -:- import_module backend_libs__rtti, ll_backend__layout, ll_backend__llds_out. +:- import_module backend_libs__rtti. +:- import_module ll_backend__layout. +:- import_module ll_backend__llds_out. + :- import_module bool, int, assoc_list, map, std_util, require. :- type cell_info diff --git a/compiler/llds_out.m b/compiler/llds_out.m index bf44917dd..f028badd5 100644 --- a/compiler/llds_out.m +++ b/compiler/llds_out.m @@ -273,16 +273,23 @@ :- implementation. -:- import_module parse_tree__modules, parse_tree__prog_out. -:- import_module parse_tree__mercury_to_mercury. -:- import_module hlds__hlds_pred, hlds__passes_aux. -:- import_module ll_backend__layout, ll_backend__layout_out. -:- import_module ll_backend__rtti_out. -:- import_module ll_backend__exprn_aux, parse_tree__prog_util. -:- import_module backend_libs__rtti, backend_libs__export. -:- import_module backend_libs__c_util, backend_libs__foreign. +:- import_module backend_libs__c_util. :- import_module backend_libs__compile_target_code. -:- import_module libs__options, libs__trace_params. +:- import_module backend_libs__export. +:- import_module backend_libs__foreign. +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_pred. +:- import_module hlds__passes_aux. +:- 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__rtti_out. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module int, char, string, std_util. :- import_module set, bintree_set, assoc_list, require. diff --git a/compiler/lookup_switch.m b/compiler/lookup_switch.m index 0249d0f9f..f1f5d56bb 100644 --- a/compiler/lookup_switch.m +++ b/compiler/lookup_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -41,10 +41,14 @@ :- interface. +:- import_module backend_libs__code_model. +:- import_module backend_libs__switch_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_data, hlds__hlds_llds. -:- import_module ll_backend__llds, ll_backend__code_info. -:- import_module backend_libs__switch_util, backend_libs__code_model. :- import_module std_util, map, set, list. @@ -69,12 +73,17 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module check_hlds__type_util, check_hlds__mode_util, hlds__instmap. :- import_module backend_libs__builtin_ops. -:- import_module ll_backend__dense_switch, ll_backend__code_gen. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__dense_switch. :- import_module ll_backend__exprn_aux. -:- import_module libs__globals, libs__options, libs__tree. +:- import_module parse_tree__prog_data. :- import_module int, require, bool, assoc_list. diff --git a/compiler/loop_inv.m b/compiler/loop_inv.m index c03f48cff..ef870a143 100644 --- a/compiler/loop_inv.m +++ b/compiler/loop_inv.m @@ -99,7 +99,8 @@ :- interface. :- import_module hlds. -:- import_module hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__hlds_module. % hoist_loop_invariants(PredId, ProcId, PredInfo, % ProcInfo0, ProcInfo, ModuleInfo0, ModuleInfo) @@ -117,16 +118,21 @@ :- implementation. -:- import_module list, assoc_list, std_util, require, set, term, string, bool. -:- import_module parse_tree__prog_data, parse_tree__inst, parse_tree__prog_util. -:- import_module hlds__hlds_goal, hlds__instmap, hlds__error_util. -:- import_module hlds__quantification. -:- import_module check_hlds. -:- import_module check_hlds__mode_util, check_hlds__det_util. -:- import_module check_hlds__inst_match, check_hlds__purity. :- import_module backend_libs__code_model. +:- import_module check_hlds. +:- import_module check_hlds__det_util. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module hlds__error_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module hlds__quantification. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. - +:- import_module list, assoc_list, std_util, require, set, term, string, bool. :- func this_file = string. diff --git a/compiler/magic.m b/compiler/magic.m index 073bfccdc..9a706b4cd 100644 --- a/compiler/magic.m +++ b/compiler/magic.m @@ -163,6 +163,7 @@ :- interface. :- import_module hlds__hlds_module. + :- import_module io. :- pred magic__process_module(module_info, module_info, io__state, io__state). @@ -171,15 +172,29 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module aditi_backend__magic_util, aditi_backend__context. -:- import_module transform_hlds__dependency_graph, hlds__hlds_pred. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_data. -:- import_module hlds__passes_aux, check_hlds__mode_util, (parse_tree__inst). -:- import_module hlds__instmap, aditi_backend__rl_gen, aditi_backend__rl. -:- import_module libs__globals, libs__options, hlds__hlds_out. -:- import_module parse_tree__prog_out, hlds__goal_util, check_hlds__type_util. -:- import_module check_hlds__polymorphism, hlds__quantification. -:- import_module ll_backend__saved_vars, transform_hlds__dead_proc_elim. +:- import_module aditi_backend__context. +:- import_module aditi_backend__magic_util. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_gen. +:- 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__instmap. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__saved_vars. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module transform_hlds__dead_proc_elim. +:- import_module transform_hlds__dependency_graph. :- import_module int, list, map, require, set, std_util, string, term, varset. :- import_module assoc_list, bool, check_hlds__simplify. diff --git a/compiler/magic_util.m b/compiler/magic_util.m index c43e9542a..d0c1db907 100644 --- a/compiler/magic_util.m +++ b/compiler/magic_util.m @@ -14,8 +14,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module bool, io, list, map, set, std_util. % Check that the argument types and modes are legal for @@ -118,12 +121,19 @@ :- implementation. -:- import_module hlds__hlds_data, ll_backend__code_util. -:- import_module check_hlds__type_util, check_hlds__mode_util. :- import_module check_hlds__inst_match. -:- import_module hlds__instmap, hlds__goal_util, parse_tree__prog_out. -:- import_module hlds__hlds_out, hlds__error_util, parse_tree__prog_util. -:- import_module (parse_tree__inst), check_hlds__polymorphism. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__polymorphism. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module ll_backend__code_util. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module assoc_list, int, require, string, term, varset. diff --git a/compiler/make.m b/compiler/make.m index 35c3e56b9..7e9e49be2 100644 --- a/compiler/make.m +++ b/compiler/make.m @@ -19,11 +19,14 @@ :- interface. -:- include_module make__options_file, make__util. +:- include_module make__options_file. +:- include_module make__util. +:- import_module make__options_file. :- import_module parse_tree. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_io. -:- import_module make__options_file, parse_tree__modules, parse_tree__prog_io. :- import_module io, list. % make__process_args(OptionArgs, NonOptionArgs). @@ -40,22 +43,36 @@ %-----------------------------------------------------------------------------% :- implementation. -:- include_module make__dependencies, make__module_dep_file. -:- include_module make__module_target, make__program_target. +:- include_module make__dependencies. +:- include_module make__module_dep_file. +:- include_module make__module_target. +:- include_module make__program_target. -:- import_module hlds, libs, backend_libs. +:- import_module hlds. +:- import_module libs. +:- import_module backend_libs. :- import_module top_level. % XXX unwanted dependency -:- import_module make__dependencies, make__module_dep_file. -:- import_module make__module_target, make__program_target, make__util. +:- import_module make__dependencies. +:- import_module make__module_dep_file. +:- import_module make__module_target. +:- import_module make__program_target. +:- import_module make__util. -:- import_module parse_tree__prog_data, parse_tree__prog_io. -:- import_module parse_tree__modules, parse_tree__mercury_to_mercury. -:- import_module parse_tree__prog_out, parse_tree__prog_io_util. -:- import_module backend_libs__foreign, backend_libs__compile_target_code. -:- import_module libs__timestamp, libs__process_util. -:- import_module libs__globals, libs__options, libs__handle_options. +:- import_module backend_libs__compile_target_code. +:- import_module backend_libs__foreign. :- import_module hlds__error_util. +:- 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__mercury_to_mercury. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. +:- 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, bool, char, dir, exception, getopt, int, list. diff --git a/compiler/make.module_dep_file.m b/compiler/make.module_dep_file.m index 4d623707c..2556ef779 100644 --- a/compiler/make.module_dep_file.m +++ b/compiler/make.module_dep_file.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -9,11 +9,13 @@ % Code to read and write the `.module_dep' files, which contain % information about inter-module dependencies. %-----------------------------------------------------------------------------% + :- module make__module_dep_file. :- interface. :- import_module parse_tree__modules. + :- import_module std_util, io. % Get the dependencies for a given module. @@ -27,6 +29,7 @@ io__state::di, io__state::uo) is det. %-----------------------------------------------------------------------------% + :- implementation. get_module_dependencies(ModuleName, MaybeImports, Info0, Info) --> diff --git a/compiler/make.module_target.m b/compiler/make.module_target.m index 921be8673..3f4ad5efd 100644 --- a/compiler/make.module_target.m +++ b/compiler/make.module_target.m @@ -9,6 +9,7 @@ % Build targets which relate to a single module (e.g. C code, object code, % interface files). %-----------------------------------------------------------------------------% + :- module make__module_target. :- interface. diff --git a/compiler/make.program_target.m b/compiler/make.program_target.m index e272fec0f..e28e8dee5 100644 --- a/compiler/make.program_target.m +++ b/compiler/make.program_target.m @@ -8,6 +8,7 @@ % % Build targets which relate to whole programs or libraries. %-----------------------------------------------------------------------------% + :- module make__program_target. :- interface. diff --git a/compiler/make.util.m b/compiler/make.util.m index 12c7abbb3..091c3c14b 100644 --- a/compiler/make.util.m +++ b/compiler/make.util.m @@ -8,6 +8,7 @@ % % Assorted predicates used to implement `mmc --make'. %-----------------------------------------------------------------------------% + :- module make__util. :- interface. @@ -227,6 +228,7 @@ make_info::in, make_info::out, io__state::di, io__state::uo) is det. %-----------------------------------------------------------------------------% + :- implementation. foldl2_maybe_stop_at_error(KeepGoing, MakeTarget, diff --git a/compiler/make_hlds.m b/compiler/make_hlds.m index 61a26cc27..570fe8b2f 100644 --- a/compiler/make_hlds.m +++ b/compiler/make_hlds.m @@ -22,10 +22,13 @@ :- module hlds__make_hlds. :- interface. -:- import_module parse_tree__prog_data. -:- import_module parse_tree__equiv_type, parse_tree__module_qual. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module hlds__special_pred. +:- import_module parse_tree__equiv_type. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_data. :- import_module bool, list, io, std_util. @@ -97,25 +100,41 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_io_goal. -:- import_module parse_tree__prog_io_dcg, parse_tree__prog_io_util. -:- import_module parse_tree__prog_out, parse_tree__mercury_to_mercury. -:- import_module parse_tree__prog_util, parse_tree__inst. -:- import_module parse_tree__modules, parse_tree__module_qual. -:- import_module hlds__hlds_goal, hlds__goal_util, hlds__hlds_out. -:- import_module hlds__make_tags, hlds__quantification. -:- import_module hlds__error_util, hlds__passes_aux. -:- import_module check_hlds__typecheck, check_hlds__type_util. -:- import_module check_hlds__mode_util, check_hlds__mode_errors. -:- import_module check_hlds__clause_to_proc, check_hlds__inst_match. -:- import_module check_hlds__purity, check_hlds__unify_proc. -:- import_module transform_hlds__term_util. -:- import_module ll_backend, ll_backend__llds. -:- import_module ll_backend__fact_table. +:- import_module backend_libs__export. +:- import_module backend_libs__foreign. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_errors. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module check_hlds__unify_proc. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. :- import_module hlds__hlds_code_util. -:- import_module backend_libs__export, backend_libs__foreign. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__make_tags. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend. +:- import_module ll_backend__fact_table. +:- import_module ll_backend__llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_io. +:- 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 recompilation. -:- import_module libs__options, libs__globals. +:- import_module transform_hlds__term_util. :- import_module string, char, int, set, map, multi_map, require. :- import_module bag, term, varset, getopt, assoc_list, term_io. diff --git a/compiler/make_tags.m b/compiler/make_tags.m index 3b8074b5a..c2cb485ae 100644 --- a/compiler/make_tags.m +++ b/compiler/make_tags.m @@ -58,7 +58,10 @@ :- module hlds__make_tags. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_data, libs__globals. +:- import_module hlds__hlds_data. +:- import_module libs__globals. +:- import_module parse_tree__prog_data. + :- import_module bool, list. % assign_constructor_tags(Constructors, TypeCtor, ReservedTagPragma, Globals, @@ -77,8 +80,12 @@ :- implementation. -:- import_module parse_tree__prog_util, check_hlds__type_util. -:- import_module hlds__error_util, libs__globals, libs__options. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_util. + :- import_module int, map, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/mark_static_terms.m b/compiler/mark_static_terms.m index b80568686..6ca09ddaf 100644 --- a/compiler/mark_static_terms.m +++ b/compiler/mark_static_terms.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -18,7 +18,8 @@ :- interface. -:- import_module hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- pred mark_static_terms(proc_info::in, module_info::in, proc_info::out) is det. @@ -26,7 +27,11 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__prog_data, hlds__hlds_goal, hlds__hlds_data. + +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. + :- import_module map, list, bool. % diff --git a/compiler/matching.m b/compiler/matching.m index 5c7d8231c..e3cb8ad71 100644 --- a/compiler/matching.m +++ b/compiler/matching.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001-2002 The University of Melbourne. +% Copyright (C) 2001-2003 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. %-----------------------------------------------------------------------------% @@ -16,6 +16,7 @@ :- module backend_libs__matching. :- interface. + :- import_module parse_tree__prog_data. :- import_module bool, list, set. diff --git a/compiler/maybe_mlds_to_gcc.pp b/compiler/maybe_mlds_to_gcc.pp index 322b2f81d..03768a2fe 100644 --- a/compiler/maybe_mlds_to_gcc.pp +++ b/compiler/maybe_mlds_to_gcc.pp @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001 The University of Melbourne. +% Copyright (C) 2001, 2003 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,7 +17,9 @@ :- module ml_backend__maybe_mlds_to_gcc. :- interface. -:- import_module ml_backend__mlds, bool. +:- import_module ml_backend__mlds. + +:- import_module bool. :- use_module io. :- type frontend_callback(T) == pred(T, io__state, io__state). diff --git a/compiler/mercury_compile.m b/compiler/mercury_compile.m index 860a234dc..ebff43b96 100644 --- a/compiler/mercury_compile.m +++ b/compiler/mercury_compile.m @@ -39,48 +39,75 @@ % % semantic analysis -:- import_module libs__handle_options, parse_tree__prog_io. -:- import_module parse_tree__prog_out, parse_tree__modules. -:- import_module parse_tree__source_file_map, parse_tree__module_qual. -:- import_module parse_tree__equiv_type, hlds__make_hlds. -:- import_module check_hlds__typecheck, check_hlds__purity. -:- import_module check_hlds__polymorphism, check_hlds__modes. -:- import_module check_hlds__switch_detection, check_hlds__cse_detection. -:- import_module check_hlds__det_analysis, check_hlds__unique_modes. -:- import_module check_hlds__stratify, check_hlds__simplify. +:- import_module libs__handle_options. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__modules. +:- import_module parse_tree__source_file_map. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__equiv_type. +:- import_module hlds__make_hlds. +:- import_module check_hlds__typecheck. +:- import_module check_hlds__purity. +:- import_module check_hlds__polymorphism. +:- import_module check_hlds__modes. +:- import_module check_hlds__switch_detection. +:- import_module check_hlds__cse_detection. +:- import_module check_hlds__det_analysis. +:- import_module check_hlds__unique_modes. +:- import_module check_hlds__stratify. +:- import_module check_hlds__simplify. % high-level HLDS transformations -:- import_module check_hlds__check_typeclass, transform_hlds__intermod. -:- import_module transform_hlds__trans_opt, transform_hlds__table_gen. +:- import_module check_hlds__check_typeclass. +:- import_module transform_hlds__intermod. +:- import_module transform_hlds__trans_opt. +:- import_module transform_hlds__table_gen. :- import_module transform_hlds__lambda. -:- import_module backend_libs__type_ctor_info, transform_hlds__termination. -:- import_module transform_hlds__higher_order, transform_hlds__accumulator. -:- import_module transform_hlds__inlining, transform_hlds__loop_inv. +:- import_module backend_libs__type_ctor_info. +:- import_module transform_hlds__termination. +:- import_module transform_hlds__higher_order. +:- import_module transform_hlds__accumulator. +:- import_module transform_hlds__inlining. +:- import_module transform_hlds__loop_inv. :- import_module transform_hlds__deforest. -:- import_module aditi_backend__dnf, aditi_backend__magic. +:- import_module aditi_backend__dnf. +:- import_module aditi_backend__magic. :- import_module transform_hlds__dead_proc_elim. -:- import_module transform_hlds__delay_construct, transform_hlds__unused_args. -:- import_module transform_hlds__unneeded_code, transform_hlds__lco. +:- import_module transform_hlds__delay_construct. +:- import_module transform_hlds__unused_args. +:- import_module transform_hlds__unneeded_code. +:- import_module transform_hlds__lco. :- import_module ll_backend__deep_profiling. % the LLDS back-end -:- import_module ll_backend__saved_vars, ll_backend__stack_opt. -:- import_module ll_backend__stack_alloc, ll_backend__follow_code. -:- import_module ll_backend__liveness, ll_backend__live_vars. -:- import_module ll_backend__arg_info, ll_backend__store_alloc. -:- import_module ll_backend__code_gen, ll_backend__optimize. -:- import_module ll_backend__llds_common, ll_backend__transform_llds. +:- import_module ll_backend__saved_vars. +:- import_module ll_backend__stack_opt. +:- import_module ll_backend__stack_alloc. +:- import_module ll_backend__follow_code. +:- import_module ll_backend__liveness. +:- import_module ll_backend__live_vars. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__store_alloc. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__optimize. +:- import_module ll_backend__llds_common. +:- import_module ll_backend__transform_llds. :- import_module ll_backend__llds_out. -:- import_module ll_backend__continuation_info, ll_backend__stack_layout. -:- import_module backend_libs__foreign, backend_libs__export. +:- import_module ll_backend__continuation_info. +:- import_module ll_backend__stack_layout. +:- import_module backend_libs__foreign. +:- import_module backend_libs__export. :- import_module backend_libs__base_typeclass_info. % the Aditi-RL back-end -:- import_module aditi_backend__rl_gen, aditi_backend__rl_opt. +:- import_module aditi_backend__rl_gen. +:- import_module aditi_backend__rl_opt. :- import_module aditi_backend__rl_out. % the bytecode back-end -:- import_module bytecode_backend__bytecode_gen, bytecode_backend__bytecode. +:- import_module bytecode_backend__bytecode_gen. +:- import_module bytecode_backend__bytecode. % the MLDS back-end :- import_module ml_backend__add_trail_ops. % HLDS -> HLDS @@ -99,19 +126,31 @@ :- import_module ml_backend__ml_util. % MLDS utility predicates % miscellaneous compiler modules -:- import_module parse_tree__prog_data, hlds__hlds_module, hlds__hlds_pred. -:- import_module hlds__hlds_out, ll_backend__llds, aditi_backend__rl. -:- import_module parse_tree__mercury_to_mercury, hlds__hlds_data. -:- import_module ll_backend__layout, transform_hlds__dependency_graph. -:- import_module parse_tree__prog_util, aditi_backend__rl_dump. +:- import_module parse_tree__prog_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__hlds_out. +:- import_module ll_backend__llds. +:- import_module aditi_backend__rl. +:- import_module parse_tree__mercury_to_mercury. +:- import_module hlds__hlds_data. +:- import_module ll_backend__layout. +:- import_module transform_hlds__dependency_graph. +:- import_module parse_tree__prog_util. +:- import_module aditi_backend__rl_dump. :- import_module aditi_backend__rl_file. -:- import_module libs__options, libs__globals, libs__trace_params. +:- import_module libs__options. +:- import_module libs__globals. +:- import_module libs__trace_params. :- import_module check_hlds__goal_path. :- import_module hlds__passes_aux. -:- import_module recompilation, recompilation__usage. +:- import_module recompilation. +:- import_module recompilation__usage. :- import_module recompilation__check. :- import_module libs__timestamp. -:- import_module make, make__options_file, make__util. +:- import_module make. +:- import_module make__options_file. +:- import_module make__util. :- import_module backend_libs__compile_target_code. % inter-module analysis framework diff --git a/compiler/mercury_to_mercury.m b/compiler/mercury_to_mercury.m index e2c0e6e1b..2b7b3f25d 100644 --- a/compiler/mercury_to_mercury.m +++ b/compiler/mercury_to_mercury.m @@ -42,9 +42,12 @@ :- module parse_tree__mercury_to_mercury. :- interface. -:- import_module parse_tree__prog_data, (parse_tree__inst). -:- import_module hlds__hlds_goal, hlds__hlds_data, hlds__hlds_module. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. :- import_module libs__globals. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. :- import_module bool, std_util, list, io, varset, term. @@ -352,14 +355,20 @@ :- implementation. -:- import_module parse_tree__prog_out, parse_tree__prog_util, hlds__hlds_pred. -:- import_module parse_tree__prog_io_util. -:- import_module hlds__hlds_out, hlds__instmap. -:- import_module recompilation__version. -:- import_module check_hlds__purity, check_hlds__mode_util. -:- import_module transform_hlds__term_util. -:- import_module libs__globals, libs__options, transform_hlds__termination. :- import_module backend_libs__foreign. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- 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 transform_hlds__term_util. +:- import_module transform_hlds__termination. :- import_module assoc_list, char, int, string, set, lexer, ops, require. :- import_module term, term_io, varset. diff --git a/compiler/middle_rec.m b/compiler/middle_rec.m index ec2cb8862..27fdb004a 100644 --- a/compiler/middle_rec.m +++ b/compiler/middle_rec.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %---------------------------------------------------------------------------% @@ -14,7 +14,9 @@ :- interface. -:- import_module hlds__hlds_goal, ll_backend__llds, ll_backend__code_info. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- pred middle_rec__match_and_generate(hlds_goal, code_tree, code_info, code_info). @@ -25,14 +27,20 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module hlds__hlds_module, hlds__hlds_data, hlds__goal_form. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__code_model. +:- import_module hlds__goal_form. +:- import_module hlds__hlds_data. :- import_module hlds__hlds_llds. -:- import_module ll_backend__code_gen, ll_backend__unify_gen. -:- import_module ll_backend__code_util, ll_backend__opt_util. -:- import_module ll_backend__code_aux. -:- import_module backend_libs__builtin_ops, backend_libs__code_model. +:- import_module hlds__hlds_module. :- import_module libs__tree. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__code_util. +:- import_module ll_backend__opt_util. +:- import_module ll_backend__unify_gen. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module bool, int, string, list, assoc_list, set, std_util. :- import_module require. diff --git a/compiler/ml_backend.m b/compiler/ml_backend.m index 735c193b8..3c69473fc 100644 --- a/compiler/ml_backend.m +++ b/compiler/ml_backend.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -21,9 +21,14 @@ % :- module ml_backend. :- interface. -:- import_module transform_hlds, check_hlds. % are these needed? -:- import_module hlds, parse_tree, libs, backend_libs. -:- import_module ll_backend. % XXX needed for llds_out__name_mangle, etc. + +:- import_module backend_libs. +:- import_module check_hlds. % is this needed? +:- import_module hlds. +:- import_module libs. +:- import_module ll_backend. % XXX needed for llds_out__name_mangle, etc. +:- import_module parse_tree. +:- import_module transform_hlds. % is this needed? %-----------------------------------------------------------------------------% @@ -31,23 +36,27 @@ :- include_module ml_util. % Phase 4-ml: MLDS-specific HLDS to HLDS transformations and annotations. -:- include_module add_heap_ops, add_trail_ops. % transformations +:- include_module add_heap_ops. +:- include_module add_trail_ops. % transformations :- include_module mark_static_terms. % annotation % Phase 5-ml: compile HLDS to MLDS :- include_module ml_code_gen. - :- include_module ml_type_gen. :- include_module ml_call_gen. - :- include_module ml_unify_gen, ml_closure_gen. + :- include_module ml_closure_gen. :- include_module ml_switch_gen. - :- include_module ml_string_switch, ml_tag_switch, ml_simplify_switch. + :- include_module ml_simplify_switch. + :- include_module ml_string_switch. + :- include_module ml_tag_switch. + :- include_module ml_type_gen. + :- include_module ml_unify_gen. :- include_module ml_code_util. :- include_module rtti_to_mlds. % Phase 6-ml: MLDS -> MLDS transformations :- include_module ml_elim_nested. -:- include_module ml_tailcall. :- include_module ml_optimize. +:- include_module ml_tailcall. % Phase 7-ml: compile MLDS to target code @@ -59,15 +68,16 @@ % :- include_module mlds_to_gcc, gcc. % MLDS->Java back-end -:- include_module mlds_to_java, java_util. +:- include_module mlds_to_java. +:- include_module java_util. % MLDS->.NET CLR back-end +:- include_module il_peephole. +:- include_module ilasm. +:- include_module ilds. :- include_module mlds_to_il. :- include_module mlds_to_ilasm. :- include_module mlds_to_managed. -:- include_module ilds. -:- include_module ilasm. -:- include_module il_peephole. :- end_module ml_backend. diff --git a/compiler/ml_call_gen.m b/compiler/ml_call_gen.m index 2e8f09873..9fe62ee6c 100644 --- a/compiler/ml_call_gen.m +++ b/compiler/ml_call_gen.m @@ -16,10 +16,12 @@ :- module ml_backend__ml_call_gen. :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. :- import_module list, bool. @@ -113,12 +115,15 @@ :- implementation. -:- import_module ml_backend__ml_closure_gen. -:- import_module hlds__hlds_module, hlds__hlds_data. :- import_module backend_libs__builtin_ops. -:- import_module check_hlds__type_util, check_hlds__mode_util. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. :- import_module hlds__error_util. -:- import_module libs__options, libs__globals. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ml_backend__ml_closure_gen. :- import_module bool, int, string, std_util, term, varset, require, map. diff --git a/compiler/ml_closure_gen.m b/compiler/ml_closure_gen.m index b602765c8..4e8b76c9c 100644 --- a/compiler/ml_closure_gen.m +++ b/compiler/ml_closure_gen.m @@ -15,9 +15,11 @@ :- module ml_backend__ml_closure_gen. :- interface. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. :- import_module list. @@ -72,21 +74,26 @@ :- implementation. -:- import_module hlds__hlds_module. -:- import_module backend_libs__code_model, backend_libs__pseudo_type_info. +:- import_module backend_libs__code_model. +:- import_module backend_libs__pseudo_type_info. :- import_module backend_libs__rtti. -:- import_module ml_backend__ml_unify_gen, ml_backend__ml_call_gen. -:- import_module ml_backend__rtti_to_mlds. -:- import_module check_hlds__type_util, check_hlds__mode_util. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. :- import_module hlds__error_util. -:- import_module libs__options, libs__globals. +:- import_module hlds__hlds_module. +:- import_module libs__globals. +:- import_module libs__options. % XXX The following modules depend on the LLDS, % so ideally they should not be used here. :- import_module ll_backend__continuation_info. % needed for % `generate_closure_layout' -:- import_module ll_backend__stack_layout. % needed for `represent_locn_as_int' :- import_module ll_backend__llds. % needed for `layout_locn' +:- import_module ll_backend__stack_layout. % needed for `represent_locn_as_int' + +:- import_module ml_backend__ml_call_gen. +:- import_module ml_backend__ml_unify_gen. +:- import_module ml_backend__rtti_to_mlds. :- import_module assoc_list, bool, int, map, set, std_util, string, term. diff --git a/compiler/ml_code_gen.m b/compiler/ml_code_gen.m index 4ba22dec0..6e5d4993f 100644 --- a/compiler/ml_code_gen.m +++ b/compiler/ml_code_gen.m @@ -723,10 +723,13 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_goal. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. + :- import_module io, map. %-----------------------------------------------------------------------------% @@ -780,18 +783,25 @@ :- implementation. -:- import_module ml_backend__ml_type_gen, ml_backend__ml_call_gen. -:- import_module ml_backend__ml_unify_gen, ml_backend__ml_switch_gen. -:- import_module ml_backend__ml_code_util. +:- 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 hlds__hlds_pred, hlds__hlds_data. -:- import_module hlds__goal_util, check_hlds__type_util. -:- import_module check_hlds__mode_util, backend_libs__builtin_ops. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. :- import_module hlds__error_util. -:- import_module backend_libs__c_util. -:- import_module hlds__passes_aux, parse_tree__modules. -:- import_module libs__globals, libs__options. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_pred. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ml_backend__ml_call_gen. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__ml_switch_gen. +:- import_module ml_backend__ml_type_gen. +:- import_module ml_backend__ml_unify_gen. +:- import_module parse_tree__modules. :- import_module assoc_list, bool, string, list. :- import_module int, set, term, require, std_util. diff --git a/compiler/ml_elim_nested.m b/compiler/ml_elim_nested.m index 4ddd572b3..f59739669 100644 --- a/compiler/ml_elim_nested.m +++ b/compiler/ml_elim_nested.m @@ -435,6 +435,7 @@ :- interface. :- import_module ml_backend__mlds. + :- import_module io. %-----------------------------------------------------------------------------% @@ -453,15 +454,21 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module bool, counter, int, list, std_util, string, require. -:- import_module ml_backend__ml_code_util, ml_backend__ml_util. -:- import_module parse_tree__prog_util, check_hlds__type_util. +:- import_module check_hlds__type_util. +:- 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, parse_tree__prog_data, parse_tree__prog_out. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. + +:- import_module bool, counter, int, list, std_util, string, require. % Perform the specified action on the whole MLDS. % diff --git a/compiler/ml_optimize.m b/compiler/ml_optimize.m index eabdca252..bcd223295 100644 --- a/compiler/ml_optimize.m +++ b/compiler/ml_optimize.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -32,7 +32,9 @@ :- module ml_backend__ml_optimize. :- interface. -:- import_module ml_backend__mlds, io. +:- import_module ml_backend__mlds. + +:- import_module io. :- pred optimize(mlds, mlds, io__state, io__state). :- mode optimize(in, out, di, uo) is det. @@ -41,10 +43,14 @@ :- implementation. -:- import_module ml_backend__ml_util, ml_backend__ml_code_util. -:- import_module parse_tree__prog_data, parse_tree__prog_util. -:- import_module backend_libs__builtin_ops, libs__globals, libs__options. +:- import_module backend_libs__builtin_ops. :- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module libs__options. +:- 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, int, list, require, std_util, string. diff --git a/compiler/ml_simplify_switch.m b/compiler/ml_simplify_switch.m index d9647a7b4..7fbb1085a 100644 --- a/compiler/ml_simplify_switch.m +++ b/compiler/ml_simplify_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2001 The University of Melbourne. +% Copyright (C) 2000-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -23,19 +23,21 @@ :- module ml_backend__ml_simplify_switch. :- interface. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module ml_backend__ml_code_util. :- pred ml_simplify_switch(mlds__stmt::in, mlds__context::in, - mlds__statement::out, - ml_gen_info::in, ml_gen_info::out) is det. + mlds__statement::out, ml_gen_info::in, ml_gen_info::out) is det. %-----------------------------------------------------------------------------% :- implementation. -:- import_module ml_backend__ml_switch_gen, backend_libs__builtin_ops. +:- import_module backend_libs__builtin_ops. :- import_module check_hlds__type_util. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ml_backend__ml_switch_gen. :- import_module bool, int, list, map, require, std_util. diff --git a/compiler/ml_string_switch.m b/compiler/ml_string_switch.m index 217e046f6..6c449ac1f 100644 --- a/compiler/ml_string_switch.m +++ b/compiler/ml_string_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -19,10 +19,12 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, backend_libs__switch_util. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module backend_libs__switch_util. +:- import_module hlds__hlds_data. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. :- pred ml_string_switch__generate(cases_list::in, prog_var::in, code_model::in, can_fail::in, prog_context::in, @@ -33,10 +35,13 @@ :- implementation. -:- import_module ml_backend__ml_code_gen, ml_backend__ml_switch_gen. +:- import_module backend_libs__builtin_ops. +:- import_module check_hlds__type_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 backend_libs__builtin_ops, check_hlds__type_util. -:- import_module libs__globals, libs__options. +:- import_module ml_backend__ml_switch_gen. :- import_module bool, int, string, list, map, std_util, assoc_list, require. diff --git a/compiler/ml_switch_gen.m b/compiler/ml_switch_gen.m index 47ab14272..fc6e70690 100644 --- a/compiler/ml_switch_gen.m +++ b/compiler/ml_switch_gen.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -62,11 +62,13 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_data. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. :- import_module libs__globals. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. :- import_module list. @@ -96,11 +98,16 @@ :- implementation. -:- import_module ml_backend__ml_tag_switch, ml_backend__ml_string_switch. -:- import_module ml_backend__ml_code_gen, ml_backend__ml_unify_gen. -:- import_module ml_backend__ml_code_util, ml_backend__ml_simplify_switch. -:- import_module backend_libs__switch_util, check_hlds__type_util. -:- import_module backend_libs__foreign, libs__options. +:- import_module backend_libs__foreign. +:- import_module backend_libs__switch_util. +:- import_module check_hlds__type_util. +:- import_module libs__options. +:- import_module ml_backend__ml_code_gen. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__ml_simplify_switch. +:- import_module ml_backend__ml_string_switch. +:- import_module ml_backend__ml_tag_switch. +:- import_module ml_backend__ml_unify_gen. :- import_module bool, int, string, map, libs__tree, std_util, require. diff --git a/compiler/ml_tag_switch.m b/compiler/ml_tag_switch.m index b3599d5e0..e1f67a958 100644 --- a/compiler/ml_tag_switch.m +++ b/compiler/ml_tag_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000 The University of Melbourne. +% Copyright (C) 2000, 2003 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. %-----------------------------------------------------------------------------% @@ -15,10 +15,12 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, backend_libs__switch_util. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module backend_libs__switch_util. +:- import_module hlds__hlds_data. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. :- import_module list. @@ -31,10 +33,14 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_module. -:- import_module ml_backend__ml_code_gen, ml_backend__ml_switch_gen. -:- import_module ml_backend__ml_unify_gen, ml_backend__ml_simplify_switch. -:- import_module backend_libs__builtin_ops, check_hlds__type_util. +:- import_module backend_libs__builtin_ops. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module ml_backend__ml_code_gen. +:- import_module ml_backend__ml_simplify_switch. +:- import_module ml_backend__ml_switch_gen. +:- import_module ml_backend__ml_unify_gen. :- import_module assoc_list, map, int, string, require, std_util. diff --git a/compiler/ml_tailcall.m b/compiler/ml_tailcall.m index 7686da833..7912dc1cc 100644 --- a/compiler/ml_tailcall.m +++ b/compiler/ml_tailcall.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1999-2002 The University of Melbourne. +% Copyright (C) 1999-2003 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. %-----------------------------------------------------------------------------% @@ -56,7 +56,9 @@ :- module ml_backend__ml_tailcall. :- interface. + :- import_module ml_backend__mlds. + :- import_module io. % Traverse the MLDS, marking all optimizable tail calls @@ -75,8 +77,13 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__prog_data, hlds__hlds_pred, hlds__hlds_out. -:- import_module hlds__error_util, ml_backend__ml_util. + +:- import_module hlds__error_util. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module ml_backend__ml_util. +:- import_module parse_tree__prog_data. + :- import_module string, int, list, std_util. ml_mark_tailcalls(MLDS0, MLDS) --> diff --git a/compiler/ml_type_gen.m b/compiler/ml_type_gen.m index 8b2bd35a6..b5d34fdd4 100644 --- a/compiler/ml_type_gen.m +++ b/compiler/ml_type_gen.m @@ -25,8 +25,12 @@ :- module ml_backend__ml_type_gen. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_module, hlds__hlds_data. + +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. :- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. + :- import_module io. % Generate MLDS definitions for all the types in the HLDS. @@ -74,12 +78,17 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_pred, parse_tree__prog_data. -:- import_module parse_tree__prog_util, check_hlds__type_util. + :- import_module check_hlds__polymorphism. -:- import_module ml_backend__ml_code_util, hlds__error_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ml_backend__ml_code_util. :- import_module ml_backend__ml_util. -:- import_module libs__globals, libs__options. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. :- import_module bool, int, string, list, map, std_util, term, require. diff --git a/compiler/ml_unify_gen.m b/compiler/ml_unify_gen.m index 368d3f4a6..59d44957d 100644 --- a/compiler/ml_unify_gen.m +++ b/compiler/ml_unify_gen.m @@ -15,10 +15,13 @@ :- module ml_backend__ml_unify_gen. :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_data, hlds__hlds_goal. :- import_module backend_libs__code_model. -:- import_module ml_backend__mlds, ml_backend__ml_code_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__mlds. +:- import_module parse_tree__prog_data. :- import_module bool, list, std_util. @@ -83,14 +86,21 @@ :- implementation. -:- import_module hlds__hlds_pred, hlds__hlds_out, backend_libs__builtin_ops. -:- import_module ml_backend__ml_code_gen, ml_backend__ml_call_gen. -:- import_module ml_backend__ml_type_gen, ml_backend__ml_closure_gen. -:- import_module ml_backend__ml_util. -:- import_module parse_tree__prog_util, check_hlds__type_util. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__rtti. :- import_module check_hlds__mode_util. -:- import_module backend_libs__rtti, hlds__error_util. -:- import_module libs__globals, libs__options. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ml_backend__ml_call_gen. +:- import_module ml_backend__ml_closure_gen. +:- import_module ml_backend__ml_code_gen. +:- import_module ml_backend__ml_type_gen. +:- import_module ml_backend__ml_util. +:- import_module parse_tree__prog_util. % XXX The following modules depend on the LLDS, % so ideally they should not be used here. diff --git a/compiler/ml_util.m b/compiler/ml_util.m index b0fffb9f8..304c71f72 100644 --- a/compiler/ml_util.m +++ b/compiler/ml_util.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1999-2002 The University of Melbourne. +% Copyright (C) 1999-2003 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. %-----------------------------------------------------------------------------% @@ -14,10 +14,11 @@ :- module ml_backend__ml_util. :- interface. +:- import_module libs__globals. % for foreign_language :- import_module ml_backend__mlds. :- import_module parse_tree__prog_data. + :- import_module list, std_util. -:- import_module libs__globals. % for foreign_language %-----------------------------------------------------------------------------% % succeeds iff the definitions contain the entry point to @@ -161,8 +162,10 @@ :- implementation. :- import_module backend_libs__rtti. -:- import_module parse_tree__prog_io, parse_tree__prog_util. :- import_module check_hlds__type_util. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_util. + :- import_module bool, list, std_util. %-----------------------------------------------------------------------------% diff --git a/compiler/mlds.m b/compiler/mlds.m index d10f18874..6c1d1c51f 100644 --- a/compiler/mlds.m +++ b/compiler/mlds.m @@ -287,11 +287,16 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. -:- import_module parse_tree__prog_data, backend_libs__builtin_ops. -:- import_module backend_libs__rtti, backend_libs__code_model. -:- import_module backend_libs__foreign, check_hlds__type_util. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__code_model. +:- import_module backend_libs__foreign. +:- import_module backend_libs__rtti. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module libs__globals. +:- import_module parse_tree__prog_data. :- import_module bool, list, std_util, map. @@ -1654,8 +1659,12 @@ XXX Full exception handling support is not yet implemented. %-----------------------------------------------------------------------------% :- implementation. -:- import_module backend_libs__foreign, parse_tree__modules. -:- import_module hlds__error_util, libs__globals. + +:- import_module backend_libs__foreign. +:- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module parse_tree__modules. + :- import_module int, term, string, require. %-----------------------------------------------------------------------------% diff --git a/compiler/mlds_to_c.m b/compiler/mlds_to_c.m index ba9298c4b..a6f598d1d 100644 --- a/compiler/mlds_to_c.m +++ b/compiler/mlds_to_c.m @@ -24,6 +24,7 @@ :- interface. :- import_module ml_backend__mlds. + :- import_module io. % output_mlds(MLDS, Suffix): @@ -62,25 +63,30 @@ :- implementation. -:- import_module ml_backend__ml_util. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__c_util. +:- import_module backend_libs__code_model. +:- import_module backend_libs__foreign. +:- import_module backend_libs__rtti. % for rtti__addr_to_string. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_pred. % for pred_proc_id. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module ll_backend__llds_out. % XXX needed for llds_out__name_mangle, % llds_out__sym_name_mangle, % llds_out__make_base_typeclass_info_name, % output_c_file_intro_and_grade. -:- import_module backend_libs__rtti. % for rtti__addr_to_string. -:- import_module ml_backend__rtti_to_mlds. % for mlds_rtti_type_name. -:- import_module hlds__hlds_pred. % for pred_proc_id. :- import_module ml_backend__ml_code_util. % for ml_gen_public_field_decl_flags, which is % used by the code that handles derived classes :- import_module ml_backend__ml_type_gen. % for ml_gen_type_name -:- import_module backend_libs__foreign. -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops, backend_libs__c_util. +:- 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, parse_tree__prog_out. -:- import_module check_hlds__type_util, hlds__error_util. -:- import_module backend_libs__code_model. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module bool, int, string, library, list, map. :- import_module assoc_list, term, std_util, require. diff --git a/compiler/mlds_to_gcc.m b/compiler/mlds_to_gcc.m index 00950e58c..975291704 100644 --- a/compiler/mlds_to_gcc.m +++ b/compiler/mlds_to_gcc.m @@ -92,7 +92,10 @@ :- interface. :- import_module ml_backend. -:- import_module ml_backend__mlds, ml_backend__maybe_mlds_to_gcc, bool. +:- import_module ml_backend__maybe_mlds_to_gcc. +:- import_module ml_backend__mlds. + +:- import_module bool. :- use_module io. % run_gcc_backend(ModuleName, CallBack, CallBackOutput): @@ -143,30 +146,38 @@ :- implementation. :- use_module gcc. -:- import_module parse_tree. -:- import_module hlds. -:- import_module check_hlds. -:- import_module libs. + :- import_module backend_libs. +:- import_module check_hlds. +:- import_module hlds. +:- import_module libs. :- import_module ll_backend. % XXX +:- import_module parse_tree. % XXX some of these imports might be unused -:- import_module ml_backend__ml_util. -:- import_module ml_backend__mlds_to_c. % to handle C foreign_code +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__code_model. +:- import_module backend_libs__pseudo_type_info. +:- import_module backend_libs__rtti. % for rtti__addr_to_string. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_pred. % for proc_id_to_int and invalid_pred_id +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module ll_backend__llds_out. % XXX needed for llds_out__name_mangle, % llds_out__sym_name_mangle, % llds_out__make_base_typeclass_info_name, -:- import_module backend_libs__rtti. % for rtti__addr_to_string. -:- import_module ml_backend__ml_code_util. % for ml_gen_public_field_decl_flags, which is - % used by the code that handles derived classes -:- import_module hlds__hlds_pred. % for proc_id_to_int and invalid_pred_id -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops, parse_tree__modules. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module parse_tree__prog_util, check_hlds__type_util. -:- import_module hlds__error_util. -:- import_module backend_libs__pseudo_type_info, backend_libs__code_model. +:- import_module ml_backend__ml_code_util.% for ml_gen_public_field_decl_flags, + % which is used by the code that handles + % derived classes +:- import_module ml_backend__ml_util. +:- import_module ml_backend__mlds_to_c. % to handle C foreign_code +:- 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 bool, int, string, library, list, map. :- import_module assoc_list, term, std_util, require. diff --git a/compiler/mlds_to_il.m b/compiler/mlds_to_il.m index 92cf56226..4be67d601 100644 --- a/compiler/mlds_to_il.m +++ b/compiler/mlds_to_il.m @@ -58,10 +58,13 @@ :- module ml_backend__mlds_to_il. :- interface. -:- import_module ml_backend__mlds, ml_backend__ilasm, ml_backend__ilds. -:- import_module io, list, bool, std_util, set. :- import_module hlds__hlds_pred. % for `pred_proc_id'. :- import_module libs__globals. % for `foreign_language'. +:- import_module ml_backend__ilasm. +:- import_module ml_backend__ilds. +:- import_module ml_backend__mlds. + +:- import_module io, list, bool, std_util, set. %-----------------------------------------------------------------------------% @@ -74,7 +77,6 @@ io__state, io__state). :- mode generate_il(in, out, out, di, uo) is det. - %-----------------------------------------------------------------------------% % @@ -132,20 +134,29 @@ :- implementation. -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops, backend_libs__c_util. -:- import_module parse_tree__modules, libs__tree. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module parse_tree__prog_util, ll_backend__llds_out. -:- import_module backend_libs__pseudo_type_info, backend_libs__rtti. -:- import_module check_hlds__type_util, backend_libs__code_model. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__c_util. +:- import_module backend_libs__code_model. :- import_module backend_libs__foreign. - -:- import_module ml_backend__il_peephole. -:- import_module ml_backend__ml_util, ml_backend__ml_code_util. +:- import_module backend_libs__foreign. +:- import_module backend_libs__pseudo_type_info. +:- import_module backend_libs__rtti. +:- import_module check_hlds__type_util. :- import_module hlds__error_util. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__llds_out. +:- import_module ml_backend__il_peephole. +:- import_module ml_backend__ml_code_util. :- import_module ml_backend__ml_type_gen. -:- import_module backend_libs__foreign. +:- import_module ml_backend__ml_util. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. + :- use_module ll_backend__llds. /* for user_foreign_code */ :- import_module bool, int, map, string, set, list, assoc_list, term. diff --git a/compiler/mlds_to_ilasm.m b/compiler/mlds_to_ilasm.m index f7efb8c23..0978fb0f6 100644 --- a/compiler/mlds_to_ilasm.m +++ b/compiler/mlds_to_ilasm.m @@ -16,6 +16,7 @@ :- interface. :- import_module ml_backend__mlds. + :- import_module io. % Convert the MLDS to IL and write it to a file. @@ -28,17 +29,26 @@ :- implementation. -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops, backend_libs__c_util. -:- import_module parse_tree__modules, libs__tree. -:- import_module hlds__hlds_pred. % for `pred_proc_id'. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module backend_libs__rtti, check_hlds__type_util, hlds__error_util. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__c_util. :- import_module backend_libs__foreign. - -:- import_module ml_backend__ilds, ml_backend__ilasm, ml_backend__il_peephole. -:- import_module ml_backend__ml_util, ml_backend__ml_code_util. +:- import_module backend_libs__rtti. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_pred. % for `pred_proc_id'. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ml_backend__il_peephole. +:- import_module ml_backend__ilasm. +:- import_module ml_backend__ilds. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__ml_util. :- import_module ml_backend__mlds_to_managed. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module bool, int, map, string, set, list, assoc_list, term, std_util. :- import_module library, require, counter. diff --git a/compiler/mlds_to_java.m b/compiler/mlds_to_java.m index 1e5af64e2..f14f9ffc1 100644 --- a/compiler/mlds_to_java.m +++ b/compiler/mlds_to_java.m @@ -49,6 +49,7 @@ :- interface. :- import_module ml_backend__mlds. + :- import_module io. :- pred mlds_to_java__output_mlds(mlds, io__state, io__state). @@ -59,27 +60,31 @@ :- implementation. -:- import_module ml_backend__ml_util. -:- import_module ml_backend__java_util. -:- import_module backend_libs__c_util. % XXX needed for c_util__output_quoted_string, % c_util__output_quoted_multi_string, and % 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__rtti. % for rtti__addr_to_string. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_pred. % for pred_proc_id. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module ll_backend__llds_out. % XXX needed for llds_out__name_mangle, % llds_out__sym_name_mangle, % llds_out__make_base_typeclass_info_name, -:- import_module backend_libs__rtti. % for rtti__addr_to_string. -:- import_module ml_backend__rtti_to_mlds. % for mlds_rtti_type_name. -:- import_module hlds__hlds_pred. % for pred_proc_id. -:- import_module parse_tree__modules. % for mercury_std_library_name. -:- import_module ml_backend__ml_code_util. % for ml_gen_local_var_decl_flags. +:- import_module ml_backend__java_util. +:- import_module ml_backend__ml_code_util. % for ml_gen_local_var_decl_flags. :- import_module ml_backend__ml_type_gen. % for ml_gen_type_name -:- import_module backend_libs__export. % for export__type_to_type_string -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module check_hlds__type_util, hlds__error_util. -:- import_module backend_libs__foreign. +:- import_module ml_backend__ml_util. +:- import_module ml_backend__rtti_to_mlds. % for mlds_rtti_type_name. +:- import_module parse_tree__modules. % for mercury_std_library_name. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module bool, int, string, library, list, map, set. :- import_module assoc_list, term, std_util, require. diff --git a/compiler/mlds_to_managed.m b/compiler/mlds_to_managed.m index 74db92615..f36a4ca3c 100644 --- a/compiler/mlds_to_managed.m +++ b/compiler/mlds_to_managed.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -13,8 +13,9 @@ :- module ml_backend__mlds_to_managed. :- interface. -:- import_module ml_backend__mlds. :- import_module libs__globals. +:- import_module ml_backend__mlds. + :- import_module io. :- inst managed_lang == bound(csharp; managed_cplusplus). @@ -38,22 +39,30 @@ :- implementation. -:- import_module libs__globals, libs__options, hlds__passes_aux. -:- import_module backend_libs__builtin_ops, backend_libs__c_util. -:- import_module parse_tree__modules, libs__tree. +:- 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__error_util. :- import_module hlds__hlds_pred. % for `pred_proc_id'. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module backend_libs__foreign, backend_libs__rtti. -:- import_module check_hlds__type_util, hlds__error_util. - -:- import_module ml_backend__ilds, ml_backend__ilasm, ml_backend__il_peephole. -:- import_module ml_backend__ml_util, ml_backend__ml_code_util. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ml_backend__il_peephole. +:- import_module ml_backend__ilasm. +:- import_module ml_backend__ilds. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__ml_util. +:- import_module ml_backend__mlds_to_il. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module bool, int, map, string, list, assoc_list, term, std_util. :- import_module library, require, counter. -:- import_module ml_backend__mlds_to_il. - output_managed_code(Lang, MLDS) --> { MLDS = mlds(ModuleName, _ForeignCode, _Imports, _Defns) }, output_src_start(ModuleName), diff --git a/compiler/mmc_analysis.m b/compiler/mmc_analysis.m index af7a75fbc..609ebc453 100644 --- a/compiler/mmc_analysis.m +++ b/compiler/mmc_analysis.m @@ -13,9 +13,9 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred. :- import_module analysis. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. :- type mmc ---> mmc. @@ -29,9 +29,10 @@ :- implementation. -:- import_module parse_tree__prog_out, parse_tree__prog_util. -:- import_module parse_tree__modules. :- import_module hlds__hlds_out. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module transform_hlds__unused_args. :- import_module bool, std_util, string. diff --git a/compiler/mode_debug.m b/compiler/mode_debug.m index db2351188..a07e9d1bd 100644 --- a/compiler/mode_debug.m +++ b/compiler/mode_debug.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-1997 The University of Melbourne. +% Copyright (C) 1996-1997, 2003 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. %-----------------------------------------------------------------------------% @@ -33,12 +33,20 @@ %-----------------------------------------------------------------------------% :- implementation. + +:- import_module check_hlds__modes. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. + :- import_module std_util, list, assoc_list, io, bool, map. :- import_module term, varset. -:- import_module check_hlds__modes, libs__globals, libs__options. -:- import_module parse_tree__mercury_to_mercury, hlds__passes_aux. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__instmap. -:- import_module parse_tree__prog_data, (parse_tree__inst). %-----------------------------------------------------------------------------% diff --git a/compiler/mode_errors.m b/compiler/mode_errors.m index 930ddcc6d..b1082d440 100644 --- a/compiler/mode_errors.m +++ b/compiler/mode_errors.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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,10 +17,13 @@ :- interface. -:- import_module hlds__hlds_data, hlds__hlds_pred, hlds__hlds_module. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_pred. +:- import_module hlds__hlds_module. :- import_module hlds__hlds_goal. -:- import_module parse_tree__prog_data, check_hlds__mode_info. -:- import_module (parse_tree__inst). +:- import_module parse_tree__prog_data. +:- import_module check_hlds__mode_info. +:- import_module parse_tree__inst. :- import_module bool, set, assoc_list, list, io. @@ -188,10 +191,13 @@ :- implementation. +:- import_module check_hlds__mode_info. +:- import_module check_hlds__mode_util. :- import_module hlds__hlds_out. -:- import_module check_hlds__mode_info, check_hlds__mode_util. -:- import_module parse_tree__prog_out, parse_tree__mercury_to_mercury. -:- import_module libs__options, libs__globals. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. :- import_module int, map, term_io, varset, term. :- import_module std_util, require. diff --git a/compiler/mode_info.m b/compiler/mode_info.m index 99530e1df..e2ae0ac64 100644 --- a/compiler/mode_info.m +++ b/compiler/mode_info.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2001 The University of Melbourne. +% Copyright (C) 1994-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -16,10 +16,16 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. -:- import_module hlds__hlds_data, hlds__instmap. -:- import_module parse_tree__prog_data, check_hlds__mode_errors. -:- import_module check_hlds__delay_info, (parse_tree__inst). +:- import_module check_hlds__delay_info. +:- import_module check_hlds__mode_errors. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module map, list, set, bool, assoc_list, std_util, io. :- interface. @@ -341,8 +347,10 @@ :- implementation. -:- import_module check_hlds__delay_info, check_hlds__mode_errors. +:- import_module check_hlds__delay_info. +:- import_module check_hlds__mode_errors. :- import_module check_hlds__mode_util. + :- import_module term, varset. :- import_module require, std_util, queue. diff --git a/compiler/mode_util.m b/compiler/mode_util.m index 46856f05d..12f9fc6a2 100644 --- a/compiler/mode_util.m +++ b/compiler/mode_util.m @@ -14,9 +14,14 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. -:- import_module hlds__hlds_data, parse_tree__prog_data. -:- import_module (parse_tree__inst), hlds__instmap. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module bool, list. % mode_get_insts returns the initial instantiatedness and @@ -227,11 +232,14 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module require, int, map, set, std_util, assoc_list, varset. -:- import_module parse_tree__prog_util, parse_tree__prog_io. -:- import_module check_hlds__type_util. -:- import_module check_hlds__inst_match, check_hlds__inst_util. + +:- import_module check_hlds__inst_match. +:- import_module check_hlds__inst_util. :- import_module check_hlds__mode_info. +:- import_module check_hlds__type_util. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_util. + :- import_module require, int, map, set, term, std_util, assoc_list, varset. %-----------------------------------------------------------------------------% diff --git a/compiler/modecheck_call.m b/compiler/modecheck_call.m index 65cef8218..d7cb19bea 100644 --- a/compiler/modecheck_call.m +++ b/compiler/modecheck_call.m @@ -21,9 +21,13 @@ :- module check_hlds__modecheck_call. :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_pred, hlds__hlds_module. -:- import_module parse_tree__prog_data, check_hlds__modes. :- import_module check_hlds__mode_info. +:- import_module check_hlds__modes. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module list, std_util. :- pred modecheck_call_pred(pred_id, proc_id, list(prog_var), @@ -70,14 +74,23 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, hlds__instmap, parse_tree__prog_data. -:- import_module (parse_tree__inst), check_hlds__inst_util. -:- import_module check_hlds__type_util. -:- import_module check_hlds__mode_info, check_hlds__mode_debug. -:- import_module check_hlds__modes, check_hlds__mode_util. + +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__det_report. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__inst_util. +:- import_module check_hlds__mode_debug. :- import_module check_hlds__mode_errors. -:- import_module check_hlds__clause_to_proc, check_hlds__inst_match. -:- import_module check_hlds__det_report, check_hlds__unify_proc. +:- import_module check_hlds__mode_info. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modes. +:- import_module check_hlds__type_util. +:- import_module check_hlds__unify_proc. +:- import_module hlds__hlds_data. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module int, map, bool, set, require, term, varset. modecheck_higher_order_call(PredOrFunc, PredVar, Args0, Modes, Det, diff --git a/compiler/modecheck_unify.m b/compiler/modecheck_unify.m index 25cd177b1..cfe0410ae 100644 --- a/compiler/modecheck_unify.m +++ b/compiler/modecheck_unify.m @@ -20,7 +20,9 @@ :- module check_hlds__modecheck_unify. :- interface. -:- import_module hlds__hlds_goal, parse_tree__prog_data, check_hlds__mode_info. +:- import_module check_hlds__mode_info. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. % Modecheck a unification :- pred modecheck_unification(prog_var, unify_rhs, unification, unify_context, @@ -40,19 +42,30 @@ :- implementation. -:- import_module ll_backend__llds, parse_tree__prog_util. -:- import_module check_hlds__type_util, parse_tree__module_qual, hlds__instmap. -:- import_module hlds__hlds_module, hlds__hlds_goal, hlds__hlds_pred. -:- import_module hlds__hlds_data, hlds__hlds_out. -:- import_module check_hlds__mode_debug, check_hlds__mode_util. -:- import_module check_hlds__mode_info, check_hlds__modes. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__inst_util. +:- import_module check_hlds__mode_debug. :- import_module check_hlds__mode_errors. -:- import_module check_hlds__inst_match, check_hlds__inst_util. +:- import_module check_hlds__mode_info. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modecheck_call. +:- import_module check_hlds__modes. +:- import_module check_hlds__polymorphism. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. :- import_module check_hlds__unify_proc. :- import_module check_hlds__unique_modes. -:- import_module check_hlds__typecheck, check_hlds__modecheck_call. -:- import_module (parse_tree__inst), hlds__quantification, hlds__make_hlds. -:- import_module check_hlds__polymorphism. +:- import_module hlds__hlds_data. +:- 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__make_hlds. +:- import_module hlds__quantification. +:- import_module parse_tree__inst. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_util. :- import_module bool, list, map, std_util, int, set, require. :- import_module string, assoc_list. diff --git a/compiler/modes.m b/compiler/modes.m index 96f140145..1443233ee 100644 --- a/compiler/modes.m +++ b/compiler/modes.m @@ -131,8 +131,13 @@ a variable live if its value will be used later on in the computation. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, (parse_tree__inst), hlds__instmap. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module bool, list, io. % modecheck(HLDS0, HLDS, UnsafeToContinue): @@ -323,22 +328,34 @@ a variable live if its value will be used later on in the computation. :- implementation. -:- import_module hlds__make_hlds, hlds__hlds_data, check_hlds__unique_modes. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__delay_info. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__inst_util. :- import_module check_hlds__mode_debug. -:- import_module check_hlds__mode_info, check_hlds__delay_info. -:- import_module check_hlds__mode_errors, check_hlds__inst_match. +:- import_module check_hlds__mode_errors. +:- import_module check_hlds__mode_info. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modecheck_call. +:- import_module check_hlds__modecheck_unify. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module check_hlds__unify_proc. +:- import_module check_hlds__unique_modes. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. :- import_module hlds__instmap. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module ll_backend__code_util, check_hlds__unify_proc. +:- import_module hlds__make_hlds. +:- import_module hlds__passes_aux. :- import_module hlds__special_pred. -:- import_module libs__globals, libs__options, parse_tree__mercury_to_mercury. -:- import_module hlds__hlds_out, int, set. -:- import_module hlds__passes_aux, check_hlds__typecheck. -:- import_module parse_tree__module_qual, check_hlds__clause_to_proc. -:- import_module check_hlds__modecheck_unify, check_hlds__modecheck_call. -:- import_module check_hlds__inst_util, check_hlds__purity. -:- import_module parse_tree__prog_out, term, varset. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_out. +:- import_module int, set, term, varset. :- import_module list, map, string, require, std_util. :- import_module assoc_list. diff --git a/compiler/module_qual.m b/compiler/module_qual.m index d3943369b..53200afc1 100644 --- a/compiler/module_qual.m +++ b/compiler/module_qual.m @@ -19,7 +19,9 @@ % :- interface. -:- import_module parse_tree__prog_data, recompilation. +:- import_module parse_tree__prog_data. +:- import_module recompilation. + :- import_module bool, list, std_util, io. % module_qualify_items(Items0, Items, ModuleName, ReportUndefErrors, @@ -111,12 +113,18 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module check_hlds__type_util, parse_tree__prog_io. -:- import_module parse_tree__prog_out, hlds__hlds_out. -:- import_module parse_tree__prog_util, parse_tree__mercury_to_mercury. -:- import_module parse_tree__modules, libs__globals, libs__options. -:- import_module (parse_tree__inst), hlds__instmap. +:- import_module check_hlds__type_util. :- import_module hlds__hlds_data. % for cons_id. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- 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_util. :- import_module int, map, require, set, string, term, varset. :- import_module assoc_list. diff --git a/compiler/modules.m b/compiler/modules.m index 16f252df0..9c5333a24 100644 --- a/compiler/modules.m +++ b/compiler/modules.m @@ -39,8 +39,12 @@ :- interface. -:- import_module backend_libs__foreign, parse_tree__prog_data. -:- import_module parse_tree__prog_io, libs__globals, libs__timestamp. +:- import_module backend_libs__foreign. +:- import_module libs__globals. +:- import_module libs__timestamp. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. + :- import_module std_util, bool, list, map, set, io. %-----------------------------------------------------------------------------% @@ -738,13 +742,20 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module ll_backend__llds_out, hlds__passes_aux, parse_tree__prog_out. -:- import_module parse_tree__prog_util, parse_tree__mercury_to_mercury. -:- import_module parse_tree__prog_io_util, libs__options, libs__handle_options. + +:- import_module backend_libs__foreign. +:- import_module hlds__passes_aux. +:- import_module libs__handle_options. +:- import_module libs__options. +:- import_module ll_backend__llds_out. +:- import_module make. % XXX undesirable dependency +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_io_util. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module parse_tree__source_file_map. -:- import_module parse_tree__module_qual, backend_libs__foreign. :- import_module recompilation__version. -:- import_module make. % XXX undesirable dependency :- import_module string, map, term, varset, dir, library. :- import_module assoc_list, relation, char, require. diff --git a/compiler/opt_util.m b/compiler/opt_util.m index d244d8486..4b9823e14 100644 --- a/compiler/opt_util.m +++ b/compiler/opt_util.m @@ -13,7 +13,9 @@ :- module ll_backend__opt_util. :- interface. + :- import_module ll_backend__llds. + :- import_module bool, map, list, std_util. :- type instrmap == map(label, instruction). diff --git a/compiler/optimize.m b/compiler/optimize.m index a90ec181f..112fd8cc7 100644 --- a/compiler/optimize.m +++ b/compiler/optimize.m @@ -15,6 +15,7 @@ :- interface. :- import_module ll_backend__llds. + :- import_module io, list. :- pred optimize_main(list(c_procedure)::in, global_data::in, diff --git a/compiler/options.m b/compiler/options.m index e6a8678a3..f632cdfc6 100644 --- a/compiler/options.m +++ b/compiler/options.m @@ -18,6 +18,7 @@ :- module libs__options. :- interface. + :- import_module char, io, getopt. :- pred short_option(char::in, option::out) is semidet. @@ -660,9 +661,10 @@ :- implementation. +:- import_module libs__handle_options. + :- import_module string, bool, int, map, std_util, assoc_list, require, list. :- import_module dir. -:- import_module libs__handle_options. :- type option_category ---> warning_option diff --git a/compiler/options_file.m b/compiler/options_file.m index 3e440f639..018c35789 100644 --- a/compiler/options_file.m +++ b/compiler/options_file.m @@ -14,6 +14,7 @@ :- interface. :- import_module parse_tree__prog_data. + :- import_module list, io, std_util. :- type options_variables. @@ -50,8 +51,11 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_out. -:- import_module hlds__error_util, libs__globals, libs__options. +:- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. :- import_module assoc_list, bool, char, dir, exception, map. :- import_module require, string, term. diff --git a/compiler/par_conj_gen.m b/compiler/par_conj_gen.m index e6b02f1bd..57835cd6b 100644 --- a/compiler/par_conj_gen.m +++ b/compiler/par_conj_gen.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000,2002 University of Melbourne. +% Copyright (C) 1998-2000,2002-2003 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. %---------------------------------------------------------------------------% @@ -96,8 +96,11 @@ :- interface. -:- import_module hlds__hlds_goal, backend_libs__code_model, ll_backend__llds. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_goal. :- import_module ll_backend__code_info. +:- import_module ll_backend__llds. + :- import_module list. :- pred par_conj_gen__generate_par_conj(list(hlds_goal)::in, @@ -108,12 +111,19 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__inst. -:- import_module hlds__hlds_module, hlds__hlds_data, hlds__instmap. :- import_module check_hlds__mode_util. -:- import_module ll_backend__code_gen, ll_backend__code_util. -:- import_module ll_backend__code_info, ll_backend__continuation_info. -:- import_module libs__options, libs__globals, libs__tree. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- 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 parse_tree__inst. +:- import_module parse_tree__prog_data. :- import_module bool, int, list, set, map, std_util, require. diff --git a/compiler/parse_tree.m b/compiler/parse_tree.m index dc61fcd10..c0e5f1a3d 100644 --- a/compiler/parse_tree.m +++ b/compiler/parse_tree.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -13,21 +13,27 @@ :- module parse_tree. :- interface. + :- import_module libs. :- import_module hlds. % XXX for hlds_data__cons_id :- import_module backend_libs. % XXX for `foreign' % The parse tree data type itself. -:- include_module prog_data, (inst). +:- include_module prog_data. +:- include_module (inst). % XXX inst uses hlds_data__cons_id % The parser. :- include_module prog_io. - :- include_module prog_io_goal, prog_io_dcg, prog_io_pragma. - :- include_module prog_io_typeclass, prog_io_util. + :- include_module prog_io_dcg. + :- include_module prog_io_goal. + :- include_module prog_io_pragma. + :- include_module prog_io_typeclass. + :- include_module prog_io_util. % Pretty-printers. -:- include_module prog_out, mercury_to_mercury. +:- include_module mercury_to_mercury. +:- include_module prog_out. % Utility routines. :- include_module prog_util. @@ -35,12 +41,15 @@ % Transformations that act on the parse tree, % and stuff relating to the module system. :- include_module equiv_type. -:- include_module modules, module_qual, source_file_map. +:- include_module modules. +:- include_module module_qual. +:- include_module source_file_map. % (Note that intermod and trans_opt also contain routines that % act on the parse tree, but those modules are considered part % of the HLDS transformations package.) -% :- include_module intermod, trans_opt. +% :- include_module intermod. +% :- include_module trans_opt. % :- implementation. @@ -52,13 +61,13 @@ :- implementation. :- import_module check_hlds. % XXX for type_util.m -:- import_module transform_hlds. % XXX for write_pragma_termination_info - % in termination.m, which is used by - % mercury_to_mercury.m :- import_module ll_backend. % XXX for llds_out.m, which is used % by modules__append_to_init_list, % which creates the LLDS and RL % initialization code. +:- import_module transform_hlds. % XXX for write_pragma_termination_info + % in termination.m, which is used by + % mercury_to_mercury.m :- end_module parse_tree. %-----------------------------------------------------------------------------% diff --git a/compiler/passes_aux.m b/compiler/passes_aux.m index 1349fa477..22585e55d 100644 --- a/compiler/passes_aux.m +++ b/compiler/passes_aux.m @@ -13,7 +13,10 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module io, std_util, list, bool. %-----------------------------------------------------------------------------% @@ -242,9 +245,13 @@ about unbound type variables. :- implementation. -:- import_module libs__options, libs__globals, hlds__hlds_out. -:- import_module parse_tree__prog_out, check_hlds__mode_util. -:- import_module parse_tree__mercury_to_mercury, libs__process_util. +:- import_module check_hlds__mode_util. +:- import_module hlds__hlds_out. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__process_util. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. :- import_module int, string, map, require, varset. diff --git a/compiler/pd_cost.m b/compiler/pd_cost.m index 5c4e856df..bc8f6dab1 100644 --- a/compiler/pd_cost.m +++ b/compiler/pd_cost.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2002 University of Melbourne. +% Copyright (C) 1998-2003 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,7 +35,9 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, parse_tree__prog_data. +:- import_module hlds__hlds_data. +:- import_module parse_tree__prog_data. + :- import_module int, list, set, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/pd_debug.m b/compiler/pd_debug.m index 63aeeec01..12e4ddf5f 100644 --- a/compiler/pd_debug.m +++ b/compiler/pd_debug.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2002 University of Melbourne. +% Copyright (C) 1998-2003 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. %-----------------------------------------------------------------------------% @@ -12,8 +12,11 @@ :- interface. -:- import_module transform_hlds__pd_info, hlds__hlds_goal, hlds__hlds_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. +:- import_module transform_hlds__pd_info. + :- import_module list, string. :- pred pd_debug__do_io(pred(io__state, io__state)::pred(di, uo) is det, @@ -47,10 +50,16 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module libs__globals, hlds__hlds_module, hlds__hlds_out. -:- import_module hlds__instmap, libs__options. -:- import_module hlds__instmap, parse_tree__prog_out, hlds__goal_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. :- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. + :- import_module bool, io, set, std_util. pd_debug__do_io(Pred) --> diff --git a/compiler/pd_info.m b/compiler/pd_info.m index 90a819904..3cb7d0a04 100644 --- a/compiler/pd_info.m +++ b/compiler/pd_info.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2001 University of Melbourne. +% Copyright (C) 1998-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -13,9 +13,15 @@ :- interface. -:- import_module transform_hlds__pd_term, hlds__hlds_module, hlds__hlds_pred. -:- import_module libs__options, hlds__hlds_data, hlds__instmap. -:- import_module hlds__hlds_goal, parse_tree__prog_data. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__options. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__pd_term. + :- import_module bool, map, list, io, set, std_util, getopt. :- type pd_info @@ -159,11 +165,17 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_pred, parse_tree__prog_data. -:- import_module transform_hlds__pd_debug, transform_hlds__pd_util. -:- import_module check_hlds__det_util, libs__globals. -:- import_module check_hlds__inst_match, hlds__hlds_goal. -:- import_module parse_tree__prog_util, term. +:- import_module check_hlds__det_util. +:- import_module check_hlds__inst_match. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- 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 term. :- import_module assoc_list, bool, int, require, string. pd_info_init(ModuleInfo, ProcArgInfos, IO, PdInfo) :- diff --git a/compiler/pd_term.m b/compiler/pd_term.m index 3aeea7af2..f13f7c3dc 100644 --- a/compiler/pd_term.m +++ b/compiler/pd_term.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2001 University of Melbourne. +% Copyright (C) 1998-2001, 2003 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,8 +35,12 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. -:- import_module hlds__instmap, transform_hlds__pd_info. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module transform_hlds__pd_info. + :- import_module list, std_util. % pd_term__global_check(Module, CallGoal1, BetweenGoals, CallGoal2, @@ -87,8 +91,12 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_pred, (parse_tree__inst), check_hlds__mode_util. -:- import_module parse_tree__prog_data, transform_hlds__pd_util. +:- import_module check_hlds__mode_util. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__pd_util. + :- import_module assoc_list, bool, int, map, require, set. :- type global_term_info diff --git a/compiler/pd_util.m b/compiler/pd_util.m index 0d829215e..716b276c0 100644 --- a/compiler/pd_util.m +++ b/compiler/pd_util.m @@ -13,10 +13,15 @@ :- interface. -:- import_module transform_hlds__pd_info, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, check_hlds__mode_errors. -:- import_module parse_tree__prog_data, check_hlds__simplify. -:- import_module (parse_tree__inst). +:- import_module check_hlds__mode_errors. +:- import_module check_hlds__simplify. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__pd_info. + :- import_module bool, list, map, set, std_util. % Pick out the pred_proc_ids of the calls in a list of atomic goals. @@ -140,17 +145,28 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__inst. -:- import_module hlds__goal_util, hlds__hlds_data, hlds__instmap. -:- import_module hlds__quantification, hlds__goal_form. -:- import_module check_hlds__purity, check_hlds__type_util. -:- import_module check_hlds__mode_info, check_hlds__unique_modes. -:- import_module check_hlds__mode_util, check_hlds__inst_util. -:- import_module check_hlds__inst_match, check_hlds__det_report. -:- import_module check_hlds__det_util, check_hlds__det_analysis. -:- import_module transform_hlds__pd_cost, transform_hlds__pd_debug. -:- import_module transform_hlds__constraint, transform_hlds__unused_args. +:- import_module check_hlds__det_analysis. +:- import_module check_hlds__det_report. +:- import_module check_hlds__det_util. +:- import_module check_hlds__inst_match. +:- 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__type_util. +:- 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__options. +:- import_module parse_tree__inst. +:- 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, int, require, set, term. pd_util__goal_get_calls(Goal0, CalledPreds) :- diff --git a/compiler/peephole.m b/compiler/peephole.m index a80fb4ada..e92e742c8 100644 --- a/compiler/peephole.m +++ b/compiler/peephole.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-1998,2002 The University of Melbourne. +% Copyright (C) 1994-1998,2002-2003 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. %-----------------------------------------------------------------------------% @@ -14,8 +14,10 @@ :- interface. +:- import_module ll_backend__llds. +:- import_module libs__globals. + :- import_module bool, list. -:- import_module ll_backend__llds, libs__globals. % Peephole optimize a list of instructions. @@ -25,8 +27,11 @@ :- implementation. -:- import_module backend_libs__builtin_ops, ll_backend__code_util. -:- import_module ll_backend__opt_util, ll_backend__opt_debug. +:- 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, map, string, std_util. % Patterns that can be switched off. diff --git a/compiler/polymorphism.m b/compiler/polymorphism.m index a74d8c48f..a97cd0da7 100644 --- a/compiler/polymorphism.m +++ b/compiler/polymorphism.m @@ -160,8 +160,11 @@ :- module check_hlds__polymorphism. :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. -:- import_module parse_tree__prog_data, hlds__special_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__special_pred. +:- import_module parse_tree__prog_data. :- import_module io, list, term, map. @@ -297,18 +300,27 @@ :- implementation. -:- import_module hlds__hlds_data, check_hlds__typecheck, ll_backend__llds. -:- import_module parse_tree__prog_io. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module check_hlds__purity. -:- import_module hlds__quantification, hlds__instmap, parse_tree__prog_out. -:- import_module ll_backend__code_util, check_hlds__unify_proc. -:- import_module parse_tree__prog_util. -:- import_module (parse_tree__inst), hlds__hlds_out. -:- import_module backend_libs__base_typeclass_info, hlds__goal_util. -:- import_module hlds__passes_aux. +:- import_module backend_libs__base_typeclass_info. :- import_module check_hlds__clause_to_proc. -:- import_module libs__globals, libs__options. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module check_hlds__unify_proc. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- 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 ll_backend__code_util. +:- import_module ll_backend__llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module bool, int, string, set, map. :- import_module term, varset, std_util, require, assoc_list. diff --git a/compiler/post_typecheck.m b/compiler/post_typecheck.m index 4340a00a8..6f5c22739 100644 --- a/compiler/post_typecheck.m +++ b/compiler/post_typecheck.m @@ -30,8 +30,13 @@ :- module check_hlds__post_typecheck. :- interface. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, parse_tree__prog_data. + +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module list, io, bool, std_util. % post_typecheck__finish_preds(PredIds, ReportTypeErrors, @@ -120,15 +125,24 @@ :- implementation. -:- import_module (hlds__assertion). -:- import_module check_hlds__typecheck, check_hlds__clause_to_proc. -:- import_module check_hlds__mode_util, check_hlds__inst_match. -:- import_module (parse_tree__inst), parse_tree__prog_util, hlds__error_util. -:- import_module parse_tree__mercury_to_mercury, parse_tree__prog_out. -:- import_module check_hlds__mode_errors, check_hlds__modecheck_call. -:- import_module hlds__hlds_out, check_hlds__type_util, hlds__goal_util. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_errors. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modecheck_call. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module hlds__assertion. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_out. :- import_module hlds__special_pred. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module map, set, assoc_list, term, require, int. :- import_module string, varset. diff --git a/compiler/pragma_c_gen.m b/compiler/pragma_c_gen.m index 261156eff..e5ad30117 100644 --- a/compiler/pragma_c_gen.m +++ b/compiler/pragma_c_gen.m @@ -21,10 +21,12 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_pred. :- import_module backend_libs__code_model. -:- import_module ll_backend__llds, ll_backend__code_info. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. :- import_module list, std_util. @@ -41,12 +43,20 @@ :- implementation. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_llds. -:- import_module hlds__instmap, hlds__hlds_data, hlds__error_util. -:- import_module check_hlds__type_util. -:- import_module ll_backend__llds_out, ll_backend__trace, ll_backend__code_util. :- import_module backend_libs__foreign. -:- import_module libs__options, libs__globals, libs__tree. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds_out. +:- import_module ll_backend__trace. :- import_module bool, string, int, assoc_list, set, map, require, term. diff --git a/compiler/proc_label.m b/compiler/proc_label.m index f5b2e9610..100c2fc9c 100644 --- a/compiler/proc_label.m +++ b/compiler/proc_label.m @@ -17,6 +17,7 @@ :- module backend_libs__proc_label. :- interface. + :- import_module backend_libs__rtti. :- import_module hlds__hlds_module. :- import_module hlds__hlds_pred. diff --git a/compiler/process_util.m b/compiler/process_util.m index 06406132d..655bee229 100644 --- a/compiler/process_util.m +++ b/compiler/process_util.m @@ -72,7 +72,9 @@ :- implementation. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. + :- import_module std_util, require. build_with_check_for_interrupt(Build, Cleanup, Succeeded, Info0, Info) --> diff --git a/compiler/prog_data.m b/compiler/prog_data.m index bae1938c3..376c12d86 100644 --- a/compiler/prog_data.m +++ b/compiler/prog_data.m @@ -22,8 +22,11 @@ % Any types which are needed in both the parse tree and in the HLDS % should be defined here, rather than in hlds*.m. -:- import_module (parse_tree__inst), libs__options, libs__globals. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__inst. :- import_module recompilation. + :- import_module bool, list, assoc_list, map, set, varset, term, std_util. %-----------------------------------------------------------------------------% @@ -1137,9 +1140,10 @@ :- implementation. -:- import_module string. :- import_module check_hlds__purity. +:- import_module string. + :- type pragma_foreign_proc_attributes ---> attributes( foreign_language :: foreign_language, diff --git a/compiler/prog_io.m b/compiler/prog_io.m index f9bf02d09..06512f25c 100644 --- a/compiler/prog_io.m +++ b/compiler/prog_io.m @@ -55,8 +55,10 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io_util. -:- import_module libs__timestamp, (parse_tree__inst). +:- import_module libs__timestamp. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. :- import_module bool, varset, term, list, io, std_util. diff --git a/compiler/prog_io_dcg.m b/compiler/prog_io_dcg.m index 5bf05bd95..dde87f6eb 100644 --- a/compiler/prog_io_dcg.m +++ b/compiler/prog_io_dcg.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2001 The University of Melbourne. +% Copyright (C) 1996-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -19,7 +19,8 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io_util. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. :- import_module varset, term. :- pred parse_dcg_clause(module_name, varset, term, term, @@ -38,8 +39,11 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_io_goal. -:- import_module parse_tree__prog_util, check_hlds__purity. +:- import_module check_hlds__purity. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_goal. +:- import_module parse_tree__prog_util. + :- import_module int, map, string, std_util, list. %-----------------------------------------------------------------------------% diff --git a/compiler/prog_io_goal.m b/compiler/prog_io_goal.m index 28da856c7..cd589221b 100644 --- a/compiler/prog_io_goal.m +++ b/compiler/prog_io_goal.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -14,6 +14,7 @@ :- interface. :- import_module parse_tree__prog_data. + :- import_module list, term. % Convert a single term into a goal. @@ -96,9 +97,12 @@ :- implementation. -:- import_module check_hlds__mode_util, check_hlds__purity. -:- import_module parse_tree__prog_io, parse_tree__prog_io_util. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__purity. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_util. :- import_module transform_hlds__term_util. + :- import_module term. :- import_module int, map, string, std_util. diff --git a/compiler/prog_io_pragma.m b/compiler/prog_io_pragma.m index 92d63648f..2e74a9a55 100644 --- a/compiler/prog_io_pragma.m +++ b/compiler/prog_io_pragma.m @@ -13,7 +13,9 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io_util. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. + :- import_module list, varset, term. % parse the pragma declaration. @@ -22,9 +24,13 @@ :- implementation. -:- import_module libs__globals, parse_tree__prog_io, parse_tree__prog_io_goal. +:- import_module libs__globals. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_goal. :- import_module parse_tree__prog_util. -:- import_module transform_hlds__term_util, transform_hlds__term_errors. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__term_util. + :- import_module int, map, string, std_util, bool, require, set. parse_pragma(ModuleName, VarSet, PragmaTerms, Result) :- diff --git a/compiler/prog_io_typeclass.m b/compiler/prog_io_typeclass.m index 08110110b..9519dbd75 100644 --- a/compiler/prog_io_typeclass.m +++ b/compiler/prog_io_typeclass.m @@ -14,8 +14,9 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io_util. -:- import_module (parse_tree__inst). +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. :- import_module list, varset, term. @@ -42,8 +43,11 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_io_goal. -:- import_module parse_tree__prog_util, check_hlds__type_util, hlds__hlds_pred. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_goal. +:- import_module parse_tree__prog_util. :- import_module term, varset. :- import_module int, string, std_util, require, set, map. diff --git a/compiler/prog_io_util.m b/compiler/prog_io_util.m index 756e22cfc..a76bccae7 100644 --- a/compiler/prog_io_util.m +++ b/compiler/prog_io_util.m @@ -25,7 +25,9 @@ :- interface. -:- import_module parse_tree__prog_data, (parse_tree__inst). +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. + :- import_module list, map, std_util, term, io. :- type maybe2(T1, T2) ---> error(string, term) @@ -167,14 +169,15 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_io_goal. -:- import_module parse_tree__prog_util. -:- import_module libs__options, libs__globals. - % XXX we should not need to import hlds*.m here. % But currently we need to import hlds_data.m for the `cons_id' type % that is used in insts. :- import_module hlds__hlds_data. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_goal. +:- import_module parse_tree__prog_util. :- import_module bool, string, std_util, term, set. diff --git a/compiler/prog_out.m b/compiler/prog_out.m index 32c1307b9..bc6c97fe4 100644 --- a/compiler/prog_out.m +++ b/compiler/prog_out.m @@ -18,7 +18,9 @@ %-----------------------------------------------------------------------------% :- interface. + :- import_module parse_tree__prog_data. + :- import_module list, io. :- pred prog_out__write_messages(message_list, io__state, io__state). @@ -89,6 +91,7 @@ %-----------------------------------------------------------------------------% :- implementation. + :- import_module term, varset, term_io. :- import_module require, string, std_util, term, term_io, varset, int. diff --git a/compiler/prog_rep.m b/compiler/prog_rep.m index ba2efd82c..d98e97d34 100644 --- a/compiler/prog_rep.m +++ b/compiler/prog_rep.m @@ -18,10 +18,15 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_pred, hlds__hlds_goal, hlds__hlds_module. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module hlds__instmap. -:- import_module mdb, mdb__program_representation. +:- import_module parse_tree__prog_data. + +:- import_module mdb. +:- import_module mdb__program_representation. + :- import_module list. :- pred prog_rep__represent_proc(list(prog_var)::in, hlds_goal::in, @@ -29,8 +34,9 @@ :- implementation. -:- import_module parse_tree__prog_out. :- import_module hlds__hlds_data. +:- import_module parse_tree__prog_out. + :- import_module string, set, std_util, require, term. :- type prog_rep__info diff --git a/compiler/prog_util.m b/compiler/prog_util.m index 7a7580cdf..d3a6d8a6c 100644 --- a/compiler/prog_util.m +++ b/compiler/prog_util.m @@ -13,8 +13,9 @@ :- interface. -:- import_module parse_tree__prog_data, term. -:- import_module std_util, list. +:- import_module parse_tree__prog_data. + +:- import_module std_util, list, term. %-----------------------------------------------------------------------------% @@ -200,7 +201,10 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__mercury_to_mercury, (parse_tree__inst). + +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. + :- import_module bool, require, string, int, map, varset. %-----------------------------------------------------------------------------% diff --git a/compiler/pseudo_type_info.m b/compiler/pseudo_type_info.m index 7b339e373..b5c8a473f 100644 --- a/compiler/pseudo_type_info.m +++ b/compiler/pseudo_type_info.m @@ -16,7 +16,9 @@ :- module backend_libs__pseudo_type_info. :- interface. -:- import_module parse_tree__prog_data, backend_libs__rtti. + +:- import_module backend_libs__rtti. +:- import_module parse_tree__prog_data. % pseudo_type_info__construct_pseudo_type_info(Type, % NumUnivQTvars, ExistQVars, PseudoTypeInfo) @@ -58,7 +60,9 @@ :- implementation. -:- import_module parse_tree__prog_util, check_hlds__type_util. +:- import_module check_hlds__type_util. +:- import_module parse_tree__prog_util. + :- import_module int, list, term, std_util, require. %---------------------------------------------------------------------------% diff --git a/compiler/purity.m b/compiler/purity.m index 967101f12..224c531d4 100644 --- a/compiler/purity.m +++ b/compiler/purity.m @@ -118,8 +118,10 @@ :- module check_hlds__purity. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_module. +:- import_module hlds__hlds_module. :- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module io, bool. % The purity type itself is defined in prog_data.m as follows: @@ -180,16 +182,24 @@ :- implementation. -:- import_module hlds__hlds_data, hlds__hlds_goal, parse_tree__prog_io_util. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module parse_tree__prog_data. -:- import_module check_hlds__unify_proc. -:- import_module libs__globals, libs__options, parse_tree__mercury_to_mercury. -:- import_module hlds__hlds_out. -:- import_module hlds__passes_aux, check_hlds__typecheck. -:- import_module parse_tree__module_qual, check_hlds__clause_to_proc. -:- import_module check_hlds__inst_util, parse_tree__prog_out. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__inst_util. +:- import_module check_hlds__mode_util. :- import_module check_hlds__post_typecheck. +:- import_module check_hlds__type_util. +:- import_module check_hlds__typecheck. +:- import_module check_hlds__unify_proc. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__module_qual. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io_util. +:- import_module parse_tree__prog_out. :- import_module map, varset, term, string, require, std_util. :- import_module assoc_list, bool, int, list, set. diff --git a/compiler/quantification.m b/compiler/quantification.m index 40274fa89..28ef44b79 100644 --- a/compiler/quantification.m +++ b/compiler/quantification.m @@ -38,7 +38,10 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module list, set. % @@ -120,7 +123,8 @@ :- implementation. -:- import_module hlds__instmap, hlds__goal_util. +:- import_module hlds__goal_util. +:- import_module hlds__instmap. :- import_module map, term, varset. :- import_module std_util, bool, require. diff --git a/compiler/reassign.m b/compiler/reassign.m index 6c4e9b5d7..2f75a0df8 100644 --- a/compiler/reassign.m +++ b/compiler/reassign.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -99,6 +99,7 @@ :- interface. :- import_module ll_backend__llds. + :- import_module list. :- pred remove_reassign(list(instruction)::in, list(instruction)::out) is det. @@ -106,6 +107,7 @@ :- implementation. :- import_module ll_backend__code_util. + :- import_module std_util, set, map, require. %-----------------------------------------------------------------------------% diff --git a/compiler/recompilation.check.m b/compiler/recompilation.check.m index 81e1ed23b..e57b7da69 100644 --- a/compiler/recompilation.check.m +++ b/compiler/recompilation.check.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -12,8 +12,10 @@ :- interface. -:- import_module parse_tree__modules, parse_tree__prog_io. +:- import_module parse_tree__modules. :- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. + :- import_module list, io. :- type modules_to_recompile @@ -54,15 +56,18 @@ :- implementation. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. % for type field_access_type +:- import_module hlds__hlds_pred. % for field_access_function_name, + % type pred_id. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__timestamp. +:- import_module parse_tree__prog_io_util. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module recompilation__usage. :- import_module recompilation__version. -:- import_module libs__timestamp. -:- import_module parse_tree__prog_io_util, parse_tree__prog_util. -:- import_module parse_tree__prog_out, hlds__error_util. -:- import_module libs__globals, libs__options. -:- import_module hlds__hlds_pred. % for field_access_function_name, - % type pred_id. -:- import_module hlds__hlds_data. % for type field_access_type :- import_module assoc_list, bool, exception, int, map, parser, require. :- import_module set, std_util, string, term, term_io. diff --git a/compiler/recompilation.m b/compiler/recompilation.m index 0597e85d6..4e26f87aa 100644 --- a/compiler/recompilation.m +++ b/compiler/recompilation.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001-2002 University of Melbourne. +% Copyright (C) 2001-2003 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. %-----------------------------------------------------------------------------% @@ -24,17 +24,19 @@ :- interface. -:- import_module parse_tree. :- import_module hlds. :- import_module libs. +:- import_module parse_tree. + +:- import_module libs__timestamp. +:- import_module parse_tree__prog_data. + +:- import_module io, map, set, std_util, term. :- include_module recompilation__check. :- include_module recompilation__usage. :- include_module recompilation__version. -:- import_module parse_tree__prog_data, libs__timestamp. -:- import_module io, map, set, std_util, term. - % Identify a particular version of a program item. % This could be done using a timestamp or a hash value. :- type version_number == timestamp. @@ -242,9 +244,12 @@ :- implementation. -:- import_module parse_tree__prog_util. -:- import_module libs__globals, libs__options, hlds__passes_aux. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module parse_tree__modules. +:- import_module parse_tree__prog_util. + :- import_module int, time, bool, list, require, string. %-----------------------------------------------------------------------------% diff --git a/compiler/recompilation.usage.m b/compiler/recompilation.usage.m index 57d866fcd..60c6678ad 100644 --- a/compiler/recompilation.usage.m +++ b/compiler/recompilation.usage.m @@ -12,7 +12,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__modules. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__modules. :- import_module parse_tree__prog_data. :- import_module assoc_list, io, list, map, set, std_util. @@ -77,12 +79,19 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_data, hlds__hlds_pred, parse_tree__prog_util. -:- import_module check_hlds__type_util, (parse_tree__inst). -:- import_module hlds__hlds_out, parse_tree__mercury_to_mercury. -:- import_module hlds__passes_aux, parse_tree__prog_data. -:- import_module libs__globals, libs__options. -:- import_module recompilation__version, libs__timestamp. +:- 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 libs__globals. +:- import_module libs__options. +:- import_module libs__timestamp. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. +:- import_module recompilation__version. :- import_module assoc_list, bool, int, require. :- import_module queue, std_util, string. diff --git a/compiler/recompilation.version.m b/compiler/recompilation.version.m index ac24ba8f9..1b520c7db 100644 --- a/compiler/recompilation.version.m +++ b/compiler/recompilation.version.m @@ -12,8 +12,10 @@ :- interface. +:- import_module libs__timestamp. :- import_module parse_tree__prog_data. -:- import_module parse_tree__prog_io_util, libs__timestamp. +:- import_module parse_tree__prog_io_util. + :- import_module io, std_util, term. % recompilation__version__compute_version_numbers(SourceFileModTime, @@ -34,10 +36,13 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module parse_tree__mercury_to_mercury, check_hlds__mode_util. -:- import_module parse_tree__prog_io, parse_tree__prog_util. +:- import_module check_hlds__mode_util. :- import_module check_hlds__type_util. -:- import_module hlds__hlds_out, (parse_tree__inst). +:- import_module hlds__hlds_out. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_util. :- import_module assoc_list, bool, list, map, require, string, varset. diff --git a/compiler/rl_analyse.m b/compiler/rl_analyse.m index 80961e878..70e30611a 100644 --- a/compiler/rl_analyse.m +++ b/compiler/rl_analyse.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998,2002 University of Melbourne. +% Copyright (C) 1998,2002-2003 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. %-----------------------------------------------------------------------------% @@ -14,6 +14,7 @@ :- interface. :- import_module aditi_backend__rl_block. + :- import_module io, list, map, set, std_util. % rl_analyse(Blocks, Direction, Init, Confluence, Update, Results, @@ -106,7 +107,9 @@ :- implementation. -:- import_module libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. + :- import_module assoc_list, bool, relation, require, string. rl_analyse(Blocks, Analysis, BlockDataMap0, BlockDataMap, diff --git a/compiler/rl_block.m b/compiler/rl_block.m index 97dd3b2d9..b1247bbac 100644 --- a/compiler/rl_block.m +++ b/compiler/rl_block.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000 University of Melbourne. +% Copyright (C) 1998-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -14,8 +14,11 @@ :- interface. -:- import_module aditi_backend__rl, hlds__hlds_pred, hlds__hlds_module. +:- import_module aditi_backend__rl. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module bool, io, int, list, map, relation, set, std_util. :- pred rl_block__create_flow_graph(bool::in, module_info::in, @@ -37,7 +40,9 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_module, aditi_backend__rl_dump. +:- import_module aditi_backend__rl_dump. +:- import_module hlds__hlds_module. + :- import_module queue, require, string. rl_block__create_flow_graph(Debug, ModuleInfo, Proc, Info) --> diff --git a/compiler/rl_block_opt.m b/compiler/rl_block_opt.m index 37a648091..13a9fba95 100644 --- a/compiler/rl_block_opt.m +++ b/compiler/rl_block_opt.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000 University of Melbourne. +% Copyright (C) 1998-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -39,10 +39,17 @@ :- implementation. -:- import_module hlds__goal_util, hlds__hlds_goal, hlds__hlds_module. -:- import_module hlds__hlds_pred, transform_hlds__inlining. -:- import_module parse_tree__prog_data, aditi_backend__rl. -:- import_module aditi_backend__rl_key, libs__globals, libs__options. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_key. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__inlining. + :- import_module assoc_list, bool, int, map, multi_map. :- import_module relation, require, set, std_util, string. diff --git a/compiler/rl_dump.m b/compiler/rl_dump.m index 35143498e..10ed015e3 100644 --- a/compiler/rl_dump.m +++ b/compiler/rl_dump.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000 University of Melbourne. +% Copyright (C) 1998-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -13,7 +13,9 @@ :- interface. -:- import_module hlds__hlds_module, aditi_backend__rl. +:- import_module aditi_backend__rl. +:- import_module hlds__hlds_module. + :- import_module io. :- pred rl_dump__write_procedure(module_info, rl_proc, io__state, io__state). @@ -26,8 +28,11 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module hlds__hlds_out, hlds__hlds_pred. -:- import_module parse_tree__mercury_to_mercury, parse_tree__prog_data. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. + :- import_module bool, list, map, require, set, std_util. :- import_module term, term_io, varset. diff --git a/compiler/rl_exprn.m b/compiler/rl_exprn.m index d49a522dd..b929fad6e 100644 --- a/compiler/rl_exprn.m +++ b/compiler/rl_exprn.m @@ -51,9 +51,13 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, aditi_backend__rl. -:- import_module aditi_backend__rl_code, aditi_backend__rl_file. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_code. +:- import_module aditi_backend__rl_file. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module list. % rl_exprn__generate_compare_exprn(ModuleInfo, SortSpec, @@ -126,13 +130,20 @@ :- implementation. -:- import_module hlds__hlds_pred, hlds__hlds_data. -:- import_module check_hlds__inst_match. -:- import_module hlds__instmap, check_hlds__mode_util, libs__tree. -:- import_module check_hlds__type_util, parse_tree__prog_out. -:- import_module aditi_backend__rl_out, transform_hlds__inlining. -:- import_module hlds__hlds_goal, parse_tree__prog_util, hlds__error_util. +:- import_module aditi_backend__rl_out. :- import_module backend_libs__builtin_ops. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__tree. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__inlining. :- import_module assoc_list, bool, char, int, map. :- import_module require, set, std_util, string, term, varset. diff --git a/compiler/rl_gen.m b/compiler/rl_gen.m index f628db228..c8cc00d9c 100644 --- a/compiler/rl_gen.m +++ b/compiler/rl_gen.m @@ -16,7 +16,9 @@ :- interface. -:- import_module hlds__hlds_module, aditi_backend__rl. +:- import_module aditi_backend__rl. +:- import_module hlds__hlds_module. + :- import_module io. :- pred rl_gen__module(module_info, rl_code, io__state, io__state). @@ -25,15 +27,27 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module ll_backend__code_aux, ll_backend__code_util. -:- import_module check_hlds__det_analysis, hlds__hlds_data, hlds__hlds_goal. -:- import_module hlds__hlds_pred, hlds__instmap, check_hlds__mode_util. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module aditi_backend__rl_relops, aditi_backend__rl_info. -:- import_module libs__tree, check_hlds__type_util. +:- import_module aditi_backend__rl_info. +:- import_module aditi_backend__rl_relops. +:- import_module check_hlds__det_analysis. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- 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_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__code_util. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. :- import_module transform_hlds__dependency_graph. -:- import_module check_hlds__inst_match, (parse_tree__inst), hlds__goal_util. -:- import_module transform_hlds__inlining, libs__globals, libs__options. +:- import_module transform_hlds__inlining. :- import_module assoc_list, bool, char, int, list, map, queue. :- import_module relation, require, set, std_util, string, term, varset. diff --git a/compiler/rl_info.m b/compiler/rl_info.m index f48ed5572..aee6e095f 100644 --- a/compiler/rl_info.m +++ b/compiler/rl_info.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998 University of Melbourne. +% Copyright (C) 1998, 2003 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. %-----------------------------------------------------------------------------% @@ -12,8 +12,12 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__prog_data. -:- import_module aditi_backend__rl, libs__tree. +:- import_module aditi_backend__rl. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__tree. +:- import_module parse_tree__prog_data. + :- import_module bool, io, list, map, set, std_util, string. :- type rl_info. @@ -236,9 +240,15 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module ll_backend__code_util, libs__globals, ll_backend__llds_out. -:- import_module check_hlds__mode_util, libs__options, check_hlds__type_util. -:- import_module hlds__hlds_goal, parse_tree__prog_out. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_goal. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds_out. +:- import_module parse_tree__prog_out. + :- import_module int, require. :- type rl_info diff --git a/compiler/rl_key.m b/compiler/rl_key.m index 95137f139..04087412c 100644 --- a/compiler/rl_key.m +++ b/compiler/rl_key.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000,2002 University of Melbourne. +% Copyright (C) 1998-2000,2002-2003 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,8 +17,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, parse_tree__prog_data. :- import_module aditi_backend__rl. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module parse_tree__prog_data. + :- import_module list, map. % Work out the upper and lower bounds for the inputs to an @@ -52,8 +55,11 @@ :- implementation. -:- import_module hlds__hlds_data, hlds__hlds_pred, parse_tree__prog_util. :- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_util. + :- import_module assoc_list, bool, int, require, set, std_util. rl_key__extract_indexing(no_inputs, _, _, _, []). diff --git a/compiler/rl_liveness.m b/compiler/rl_liveness.m index 6a1964626..0f86e57a7 100644 --- a/compiler/rl_liveness.m +++ b/compiler/rl_liveness.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-1999 University of Melbourne. +% Copyright (C) 1998-1999, 2003 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. %-----------------------------------------------------------------------------% @@ -19,6 +19,7 @@ :- interface. :- import_module aditi_backend__rl_block. + :- import_module io. :- pred rl_liveness(rl_opt_info, rl_opt_info, io__state, io__state). @@ -27,7 +28,9 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module aditi_backend__rl, aditi_backend__rl_analyse. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_analyse. + :- import_module bool, int, list, map, relation, require, set, std_util. rl_liveness(Opt0, Opt, IO0, IO) :- diff --git a/compiler/rl_loop.m b/compiler/rl_loop.m index 85887689b..18d68e8e1 100644 --- a/compiler/rl_loop.m +++ b/compiler/rl_loop.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998 University of Melbourne. +% Copyright (C) 1998, 2003 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. %-----------------------------------------------------------------------------% @@ -27,6 +27,7 @@ :- implementation. :- import_module aditi_backend__rl. + :- import_module assoc_list, bimap, bool, int, list, map, queue, relation. :- import_module require, set, std_util. diff --git a/compiler/rl_opt.m b/compiler/rl_opt.m index 26f0aa4df..2f59c63f6 100644 --- a/compiler/rl_opt.m +++ b/compiler/rl_opt.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-1999 University of Melbourne. +% Copyright (C) 1998-1999, 2003 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. %-----------------------------------------------------------------------------% @@ -12,7 +12,9 @@ :- interface. -:- import_module hlds__hlds_module, aditi_backend__rl. +:- import_module aditi_backend__rl. +:- import_module hlds__hlds_module. + :- import_module io, list. :- pred rl_opt__procs(module_info, list(rl_proc), list(rl_proc), @@ -22,11 +24,17 @@ %-----------------------------------------------------------------------------% :- implementation. -:- import_module libs__globals, libs__options, hlds__passes_aux. +:- import_module aditi_backend__rl_block. +:- import_module aditi_backend__rl_block_opt. +:- import_module aditi_backend__rl_liveness. +:- import_module aditi_backend__rl_loop. +:- import_module aditi_backend__rl_sort. +:- import_module aditi_backend__rl_stream. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. :- import_module parse_tree__prog_out. -:- import_module aditi_backend__rl_block, aditi_backend__rl_liveness. -:- import_module aditi_backend__rl_block_opt, aditi_backend__rl_loop. -:- import_module aditi_backend__rl_sort, aditi_backend__rl_stream. + :- import_module bool, list. rl_opt__procs(ModuleInfo, Procs0, Procs) --> diff --git a/compiler/rl_relops.m b/compiler/rl_relops.m index b99d1b6b0..f0edb5af2 100644 --- a/compiler/rl_relops.m +++ b/compiler/rl_relops.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000 University of Melbourne. +% Copyright (C) 1998-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -12,8 +12,12 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__instmap, parse_tree__prog_data. -:- import_module aditi_backend__rl, aditi_backend__rl_info. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_info. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module parse_tree__prog_data. + :- import_module bool, list, std_util. /* @@ -96,10 +100,16 @@ :- implementation. -:- import_module ll_backend__code_aux, hlds__hlds_data, hlds__hlds_module. -:- import_module hlds__hlds_pred, check_hlds__mode_util. -:- import_module libs__tree, aditi_backend__rl_key, libs__globals. +:- import_module aditi_backend__rl_key. +:- import_module check_hlds__mode_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. :- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_aux. + :- import_module int, map, require, set. %-----------------------------------------------------------------------------% diff --git a/compiler/rl_sort.m b/compiler/rl_sort.m index 4b26bd254..f4c0d2083 100644 --- a/compiler/rl_sort.m +++ b/compiler/rl_sort.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2001 University of Melbourne. +% Copyright (C) 1998-2001, 2003 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,6 +35,7 @@ :- interface. :- import_module aditi_backend__rl_block. + :- import_module io. :- pred rl_sort__proc(rl_opt_info, rl_opt_info, io__state, io__state). @@ -44,8 +45,12 @@ :- implementation. -:- import_module hlds__hlds_module, parse_tree__prog_data, aditi_backend__rl. -:- import_module aditi_backend__rl_analyse, aditi_backend__rl_key. +:- import_module aditi_backend__rl. +:- import_module aditi_backend__rl_analyse. +:- import_module aditi_backend__rl_key. +:- import_module hlds__hlds_module. +:- import_module parse_tree__prog_data. + :- import_module assoc_list, bool, int, list, map, relation, require, set. :- import_module std_util. diff --git a/compiler/rl_stream.m b/compiler/rl_stream.m index 546e87c4a..efa7f2615 100644 --- a/compiler/rl_stream.m +++ b/compiler/rl_stream.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1998-2000 University of Melbourne. +% Copyright (C) 1998-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -42,6 +42,7 @@ :- implementation. :- import_module aditi_backend__rl. + :- import_module assoc_list, bag, int, list, map, multi_map. :- import_module relation, require, set, std_util. diff --git a/compiler/rtti.m b/compiler/rtti.m index ab2f652e8..e9d5afad8 100644 --- a/compiler/rtti.m +++ b/compiler/rtti.m @@ -24,9 +24,11 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. :- import_module backend_libs__code_model. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. :- import_module assoc_list, bool, list, set, map, std_util. @@ -629,10 +631,11 @@ :- implementation. -:- import_module parse_tree__prog_util. % for mercury_public_builtin_module +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. :- import_module hlds__hlds_data. -:- import_module check_hlds__type_util, check_hlds__mode_util. :- import_module ll_backend__llds_out. % for name_mangle and sym_name_mangle +:- import_module parse_tree__prog_util. % for mercury_public_builtin_module :- import_module int, string, require, varset. diff --git a/compiler/rtti_out.m b/compiler/rtti_out.m index 492a05462..767fb6131 100644 --- a/compiler/rtti_out.m +++ b/compiler/rtti_out.m @@ -23,8 +23,11 @@ :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_data. -:- import_module backend_libs__rtti, ll_backend__llds_out. +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_data. +:- import_module ll_backend__llds_out. +:- import_module parse_tree__prog_data. + :- import_module bool, io. % Output a C expression holding the address of the C name of @@ -79,12 +82,16 @@ :- implementation. -:- import_module parse_tree__prog_out. -:- import_module hlds__error_util. -:- import_module backend_libs__pseudo_type_info, backend_libs__type_ctor_info. :- import_module backend_libs__c_util. -:- import_module ll_backend__llds, ll_backend__code_util. -:- import_module libs__options, libs__globals. +:- import_module backend_libs__pseudo_type_info. +:- import_module backend_libs__type_ctor_info. +:- import_module hlds__error_util. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_out. + :- import_module int, string, list, assoc_list, map, require, std_util. %-----------------------------------------------------------------------------% diff --git a/compiler/rtti_to_mlds.m b/compiler/rtti_to_mlds.m index d050f2bd0..85d910373 100644 --- a/compiler/rtti_to_mlds.m +++ b/compiler/rtti_to_mlds.m @@ -16,21 +16,31 @@ :- module ml_backend__rtti_to_mlds. :- interface. -:- import_module hlds__hlds_module, backend_libs__rtti, ml_backend__mlds. + +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_module. +:- import_module ml_backend__mlds. + :- import_module list. % return a list of MLDS definitions for the given rtti_data list. :- func rtti_data_list_to_mlds(module_info, list(rtti_data)) = mlds__defns. :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_data. -:- import_module parse_tree__prog_out, parse_tree__prog_util. -:- import_module hlds__hlds_data. -:- import_module check_hlds__type_util. -:- import_module backend_libs__foreign, backend_libs__type_ctor_info. + +:- import_module backend_libs__foreign. :- import_module backend_libs__pseudo_type_info. -:- import_module ml_backend__ml_code_util, ml_backend__ml_unify_gen. +:- import_module backend_libs__type_ctor_info. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. :- import_module ml_backend__ml_closure_gen. +:- import_module ml_backend__ml_code_util. +:- import_module ml_backend__ml_unify_gen. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. + :- import_module bool, string, int, list, assoc_list, map. :- import_module std_util, term, require. diff --git a/compiler/saved_vars.m b/compiler/saved_vars.m index 34164b8b9..74395f448 100644 --- a/compiler/saved_vars.m +++ b/compiler/saved_vars.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1996-2002 The University of Melbourne. +% Copyright (C) 1996-2003 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. %-----------------------------------------------------------------------------% @@ -25,7 +25,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io. :- pred saved_vars_proc(pred_id::in, proc_id::in, @@ -39,9 +41,15 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_out, hlds__goal_util. -:- import_module hlds__quantification, hlds__passes_aux. -:- import_module check_hlds__mode_util, parse_tree__prog_data, term, varset. +:- import_module check_hlds__mode_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module parse_tree__prog_data. + +:- import_module term, varset. :- import_module bool, list, set, map, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/simplify.m b/compiler/simplify.m index 2077a7f00..c9c69d456 100644 --- a/compiler/simplify.m +++ b/compiler/simplify.m @@ -28,10 +28,16 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. -:- import_module check_hlds__det_report, check_hlds__det_util. -:- import_module check_hlds__common, hlds__instmap, libs__globals. +:- import_module check_hlds__common. +:- import_module check_hlds__det_report. :- import_module check_hlds__det_util. +:- import_module check_hlds__det_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__instmap. +:- import_module libs__globals. + :- import_module io, bool, list, map. :- pred simplify__pred(list(simplification), pred_id, module_info, module_info, @@ -75,21 +81,30 @@ :- implementation. -:- import_module parse_tree__inst, parse_tree__prog_data. -:- import_module parse_tree__prog_util. -:- import_module hlds__hlds_module, hlds__hlds_data, hlds__passes_aux. -:- import_module hlds__goal_util, hlds__goal_form, hlds__special_pred. -:- import_module hlds__quantification. -:- import_module check_hlds__type_util. -:- import_module check_hlds__mode_util, check_hlds__inst_match. :- import_module check_hlds__det_analysis. -:- import_module check_hlds__modes, check_hlds__purity. -:- import_module check_hlds__unify_proc. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modes. :- import_module check_hlds__polymorphism. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module check_hlds__unify_proc. +:- import_module hlds__goal_form. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module hlds__special_pred. +:- import_module libs__options. +:- import_module libs__trace_params. +:- import_module ll_backend__code_util. +:- import_module ll_backend__follow_code. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_util. :- import_module transform_hlds__const_prop. :- import_module transform_hlds__pd_cost. -:- import_module ll_backend__code_util, ll_backend__follow_code. -:- import_module libs__options, libs__trace_params. :- import_module int, set, require, std_util, string, varset, term. diff --git a/compiler/source_file_map.m b/compiler/source_file_map.m index b631c2298..878c8342b 100644 --- a/compiler/source_file_map.m +++ b/compiler/source_file_map.m @@ -12,7 +12,9 @@ :- interface. -:- import_module parse_tree__prog_data, parse_tree__prog_io. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_io. + :- import_module bool, io, list. % lookup_module_source_file(ModuleName, FileName, FileNameIsMapped). @@ -36,9 +38,12 @@ :- implementation. -:- import_module parse_tree__prog_out, parse_tree__prog_util. +:- import_module libs__globals. +:- import_module libs__options. :- import_module parse_tree__modules. -:- import_module libs__globals, libs__options. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. + :- import_module char, dir, map, std_util, string. lookup_module_source_file(ModuleName, FileName) --> diff --git a/compiler/special_pred.m b/compiler/special_pred.m index ee71a4b3b..ef186c3b5 100644 --- a/compiler/special_pred.m +++ b/compiler/special_pred.m @@ -15,8 +15,12 @@ :- module hlds__special_pred. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_data, hlds__hlds_module. + +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. :- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. + :- import_module list, map, std_util. :- type special_pred_map == map(special_pred, pred_id). @@ -105,9 +109,12 @@ :- implementation. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module libs__globals. +:- import_module libs__options. :- import_module parse_tree__prog_util. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module libs__globals, libs__options. + :- import_module bool, require. special_pred_list([unify, index, compare]). diff --git a/compiler/stack_alloc.m b/compiler/stack_alloc.m index da044076d..aa7cd087c 100644 --- a/compiler/stack_alloc.m +++ b/compiler/stack_alloc.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -25,7 +25,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io. :- pred allocate_stack_slots_in_proc(pred_id::in, proc_id::in, module_info::in, @@ -36,16 +38,21 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_llds. -:- import_module hlds__hlds_data. -:- import_module check_hlds__goal_path. -:- import_module ll_backend__llds, ll_backend__stack_opt. -:- import_module ll_backend__liveness, ll_backend__live_vars. -:- import_module ll_backend__trace. :- import_module backend_libs__code_model. -:- import_module libs__globals, libs__options. -:- import_module libs__trace_params, libs__graph_colour. +:- import_module check_hlds__goal_path. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module libs__globals. +:- import_module libs__graph_colour. +:- import_module libs__options. +:- 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. +:- import_module parse_tree__prog_data. :- import_module bool, int, list, assoc_list, map, set, std_util, require. diff --git a/compiler/stack_opt.m b/compiler/stack_opt.m index bf881e78d..d68dc78fc 100644 --- a/compiler/stack_opt.m +++ b/compiler/stack_opt.m @@ -71,7 +71,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io. :- pred stack_opt_cell(pred_id::in, proc_id::in, proc_info::in, proc_info::out, @@ -82,18 +84,28 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__mercury_to_mercury. -:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_llds. -:- import_module hlds__quantification, hlds__instmap. -:- import_module hlds__goal_util, hlds__hlds_out. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module check_hlds__inst_match, check_hlds__goal_path. -:- import_module ll_backend__arg_info, ll_backend__call_gen. -:- import_module ll_backend__liveness, ll_backend__live_vars. -:- import_module ll_backend__store_alloc. :- import_module backend_libs__code_model. :- import_module backend_libs__matching. -:- import_module libs__globals, libs__options. +:- import_module check_hlds__goal_path. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- 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_llds. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__call_gen. +:- import_module ll_backend__live_vars. +:- import_module ll_backend__liveness. +:- import_module ll_backend__store_alloc. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. :- import_module counter, bool, int, list, assoc_list. :- import_module map, set, std_util, require, term, varset. diff --git a/compiler/static_term.m b/compiler/static_term.m index c3b470820..0a2a2d0b8 100644 --- a/compiler/static_term.m +++ b/compiler/static_term.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 2000,2002 The University of Melbourne. +% Copyright (C) 2000,2002-2003 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. %---------------------------------------------------------------------------% @@ -18,6 +18,7 @@ :- interface. :- import_module ll_backend__llds. + :- import_module counter, std_util. :- pred static_term__term_to_rval(univ::in, maybe(rval)::out, @@ -28,6 +29,7 @@ :- implementation. :- import_module backend_libs__builtin_ops. + :- import_module deconstruct, list, require. static_term__term_to_rval(Univ, Rval, CellCounter0, CellCounter) :- diff --git a/compiler/store_alloc.m b/compiler/store_alloc.m index 077c5b74f..33cf25fc6 100644 --- a/compiler/store_alloc.m +++ b/compiler/store_alloc.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %-----------------------------------------------------------------------------% @@ -26,7 +26,8 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- type store_map_run_type ---> final_allocation @@ -40,13 +41,20 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_llds. -:- import_module hlds__goal_util, hlds__instmap. :- import_module check_hlds__mode_util. -:- import_module ll_backend__llds, ll_backend__trace, ll_backend__arg_info. -:- import_module ll_backend__follow_vars, ll_backend__liveness. -:- import_module libs__options, libs__globals, libs__trace_params. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_llds. +:- import_module hlds__instmap. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__trace_params. +:- import_module ll_backend__arg_info. +:- import_module ll_backend__follow_vars. +:- import_module ll_backend__liveness. +:- import_module ll_backend__llds. +:- import_module ll_backend__trace. +:- import_module parse_tree__prog_data. :- import_module bool, int, require. :- import_module list, map, set, std_util, assoc_list. diff --git a/compiler/stratify.m b/compiler/stratify.m index dd8d95b55..32b14511b 100644 --- a/compiler/stratify.m +++ b/compiler/stratify.m @@ -33,7 +33,9 @@ :- interface. -:- import_module hlds__hlds_module, io. +:- import_module hlds__hlds_module. + +:- import_module io. % Perform stratification analysis, for the given module. % If the "warn-non-stratification" option is set this @@ -46,12 +48,18 @@ :- implementation. -:- import_module transform_hlds__dependency_graph, hlds__hlds_pred. -:- import_module hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__hlds_module, check_hlds__type_util. -:- import_module check_hlds__mode_util, parse_tree__prog_data. +:- 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_module. +:- import_module hlds__hlds_pred. :- import_module hlds__passes_aux. -:- import_module parse_tree__prog_out, libs__globals, libs__options. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module transform_hlds__dependency_graph. :- import_module assoc_list, map, list, set, bool, std_util, relation, require. :- import_module string. diff --git a/compiler/string_switch.m b/compiler/string_switch.m index 663d63ba0..e0bb29fc8 100644 --- a/compiler/string_switch.m +++ b/compiler/string_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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,10 +17,13 @@ :- interface. +:- import_module backend_libs__code_model. +:- import_module backend_libs__switch_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_goal. -:- import_module ll_backend__llds, ll_backend__code_info. -:- import_module backend_libs__switch_util, backend_libs__code_model. :- pred string_switch__generate(cases_list, prog_var, code_model, can_fail, hlds_goal_info, label, branch_end, branch_end, code_tree, @@ -32,11 +35,12 @@ :- implementation. +:- import_module backend_libs__builtin_ops. :- import_module hlds__hlds_goal. :- import_module hlds__hlds_llds. -:- import_module ll_backend__code_gen, ll_backend__trace. -:- import_module backend_libs__builtin_ops. :- import_module libs__tree. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__trace. :- import_module bool, int, string, list, map, std_util, assoc_list, require. diff --git a/compiler/switch_detection.m b/compiler/switch_detection.m index 8cacc5ea9..b2b7b5588 100644 --- a/compiler/switch_detection.m +++ b/compiler/switch_detection.m @@ -16,8 +16,11 @@ :- interface. -:- import_module hlds__hlds_goal, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. + :- import_module bool, io, list. :- pred detect_switches(module_info::in, module_info::out, @@ -48,11 +51,18 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_data. -:- import_module hlds__instmap, check_hlds__inst_match. -:- import_module check_hlds__modes, check_hlds__mode_util. -:- import_module check_hlds__type_util, check_hlds__det_util. -:- import_module hlds__passes_aux, term. +:- import_module check_hlds__det_util. +:- 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__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__instmap. +:- import_module hlds__passes_aux. +:- import_module parse_tree__prog_data. + +:- import_module term. :- import_module char, int, assoc_list, map, set, std_util, require. %-----------------------------------------------------------------------------% diff --git a/compiler/switch_gen.m b/compiler/switch_gen.m index e93196373..254c256b2 100644 --- a/compiler/switch_gen.m +++ b/compiler/switch_gen.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2002 The University of Melbourne. +% Copyright (C) 1994-2003 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. %---------------------------------------------------------------------------% @@ -45,9 +45,13 @@ :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_goal, hlds__hlds_data. -:- import_module backend_libs__code_model, ll_backend__code_info. +:- import_module backend_libs__code_model. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__code_info. :- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module list. :- pred switch_gen__generate_switch(code_model, prog_var, can_fail, list(case), @@ -59,15 +63,21 @@ :- implementation. -:- import_module hlds__hlds_llds. -:- import_module check_hlds__type_util. -:- import_module ll_backend__dense_switch, ll_backend__string_switch. -:- import_module ll_backend__tag_switch, ll_backend__lookup_switch. -:- import_module ll_backend__code_gen, ll_backend__unify_gen. -:- import_module ll_backend__code_aux, ll_backend__code_util. -:- import_module ll_backend__trace. :- import_module backend_libs__switch_util. -:- import_module libs__globals, libs__options, libs__tree. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_llds. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__code_util. +:- import_module ll_backend__dense_switch. +:- import_module ll_backend__lookup_switch. +:- import_module ll_backend__string_switch. +:- import_module ll_backend__tag_switch. +:- import_module ll_backend__trace. +:- import_module ll_backend__unify_gen. :- import_module bool, int, string, map, std_util, require. diff --git a/compiler/switch_util.m b/compiler/switch_util.m index d2faa63ca..764411c99 100644 --- a/compiler/switch_util.m +++ b/compiler/switch_util.m @@ -14,8 +14,13 @@ :- module backend_libs__switch_util. :- interface. -:- import_module parse_tree__prog_data, hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__hlds_module, check_hlds__type_util. + +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module parse_tree__prog_data. + :- import_module list, assoc_list, map, std_util. %-----------------------------------------------------------------------------% diff --git a/compiler/table_gen.m b/compiler/table_gen.m index 3700c7661..ae009b93d 100644 --- a/compiler/table_gen.m +++ b/compiler/table_gen.m @@ -232,6 +232,7 @@ :- interface. :- import_module hlds__hlds_module. + :- import_module io. :- pred table_gen__process_module(module_info::in, module_info::out, @@ -241,21 +242,37 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module parse_tree__prog_util, parse_tree__inst. -:- import_module hlds__hlds_module, hlds__hlds_pred. -:- import_module hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__instmap, hlds__passes_aux, hlds__error_util. -:- import_module hlds__quantification, hlds__goal_util, hlds__hlds_out. -:- import_module check_hlds__type_util, check_hlds__mode_util. -:- import_module check_hlds__purity, check_hlds__modes, check_hlds__inst_match. -:- import_module check_hlds__polymorphism, check_hlds__det_analysis. -:- import_module transform_hlds__const_prop. -:- import_module ll_backend__llds, ll_backend__code_aux. +:- import_module backend_libs__code_model. +:- import_module backend_libs__rtti. +:- 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__polymorphism. +:- import_module check_hlds__purity. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_data. +:- 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__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_aux. +:- import_module ll_backend__code_util. +:- import_module ll_backend__continuation_info. :- import_module ll_backend__follow_code. -:- import_module ll_backend__code_util, ll_backend__continuation_info. -:- import_module backend_libs__code_model, backend_libs__rtti. -:- import_module libs__globals, libs__options. +:- import_module ll_backend__llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__const_prop. :- import_module term, varset. :- import_module bool, int, string, list, assoc_list. diff --git a/compiler/tag_switch.m b/compiler/tag_switch.m index bf1e60afa..dfdcf9066 100644 --- a/compiler/tag_switch.m +++ b/compiler/tag_switch.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1994-2000,2002 The University of Melbourne. +% Copyright (C) 1994-2000,2002-2003 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. %-----------------------------------------------------------------------------% @@ -14,10 +14,13 @@ :- interface. +:- import_module backend_libs__code_model. +:- import_module backend_libs__switch_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. :- import_module parse_tree__prog_data. -:- import_module hlds__hlds_data, hlds__hlds_goal. -:- import_module ll_backend__llds, ll_backend__code_info. -:- import_module backend_libs__switch_util, backend_libs__code_model. :- import_module list. @@ -31,12 +34,17 @@ :- implementation. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_llds. -:- import_module check_hlds__type_util. -:- import_module ll_backend__code_gen, ll_backend__trace. :- import_module backend_libs__builtin_ops. -:- import_module libs__options, libs__globals, libs__tree. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_llds. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_gen. +:- import_module ll_backend__trace. +:- import_module parse_tree__prog_data. :- import_module bool, int, string, assoc_list, map. :- import_module require, std_util. diff --git a/compiler/term_errors.m b/compiler/term_errors.m index 6034c3cb0..c2d8c6373 100644 --- a/compiler/term_errors.m +++ b/compiler/term_errors.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-2000 The University of Melbourne. +% Copyright (C) 1997-2000, 2003 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. %-----------------------------------------------------------------------------% @@ -16,7 +16,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, parse_tree__prog_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. :- import_module io, bag, std_util, list, assoc_list. @@ -128,11 +130,16 @@ :- implementation. -:- import_module hlds__hlds_out, parse_tree__prog_out, hlds__passes_aux. :- import_module hlds__error_util. -:- import_module term, varset. -:- import_module parse_tree__mercury_to_mercury, transform_hlds__term_util. -:- import_module libs__options, libs__globals. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. +:- import_module term. +:- import_module transform_hlds__term_util. +:- import_module varset. :- import_module bool, int, string, map, bag, require. diff --git a/compiler/term_pass1.m b/compiler/term_pass1.m index bae9b309a..78055bb5a 100644 --- a/compiler/term_pass1.m +++ b/compiler/term_pass1.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-1998 The University of Melbourne. +% Copyright (C) 1997-1998, 2003 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. %-----------------------------------------------------------------------------% @@ -24,8 +24,11 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. -:- import_module transform_hlds__term_util, transform_hlds__term_errors. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__term_util. + :- import_module io, list, std_util. :- type arg_size_result @@ -49,10 +52,14 @@ :- implementation. -:- import_module transform_hlds__term_traversal, transform_hlds__term_errors. -:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_data. -:- import_module check_hlds__mode_util, check_hlds__type_util. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. :- import_module transform_hlds__lp. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__term_traversal. :- import_module int, float, char, string, bool, set, bag, map. :- import_module term, varset, require. diff --git a/compiler/term_pass2.m b/compiler/term_pass2.m index 314cec146..d54011826 100644 --- a/compiler/term_pass2.m +++ b/compiler/term_pass2.m @@ -1,5 +1,5 @@ %----------------------------------------------------------------------------- -% Copyright (C) 1997-1998 The University of Melbourne. +% Copyright (C) 1997-1998, 2003 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,7 +17,10 @@ :- module transform_hlds__term_pass2. :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, transform_hlds__term_util. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module transform_hlds__term_util. + :- import_module list. :- pred prove_termination_in_scc(list(pred_proc_id)::in, module_info::in, @@ -25,9 +28,12 @@ :- implementation. -:- import_module transform_hlds__term_traversal, transform_hlds__term_errors. -:- import_module hlds__hlds_goal, parse_tree__prog_data. -:- import_module check_hlds__type_util, check_hlds__mode_util. +:- import_module transform_hlds__term_traversal. +:- import_module transform_hlds__term_errors. +:- import_module hlds__hlds_goal. +:- import_module parse_tree__prog_data. +:- import_module check_hlds__type_util. +:- import_module check_hlds__mode_util. :- import_module std_util, bool, int, assoc_list. :- import_module set, bag, map, term, require. diff --git a/compiler/term_traversal.m b/compiler/term_traversal.m index 724141a7c..d05cde294 100644 --- a/compiler/term_traversal.m +++ b/compiler/term_traversal.m @@ -20,9 +20,13 @@ :- interface. -:- import_module transform_hlds__term_util, transform_hlds__term_errors. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module parse_tree__prog_data. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__term_util. + :- import_module list, bag, map, std_util, set. :- type traversal_info @@ -97,7 +101,9 @@ :- implementation. -:- import_module hlds__hlds_data, check_hlds__type_util. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_data. + :- import_module bool, int, require. traverse_goal(Goal, Params, Info0, Info) :- diff --git a/compiler/term_util.m b/compiler/term_util.m index 71b20d695..72c2d2408 100644 --- a/compiler/term_util.m +++ b/compiler/term_util.m @@ -19,9 +19,12 @@ :- interface. -:- import_module transform_hlds__term_errors, parse_tree__prog_data. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. +:- import_module hlds__hlds_data. :- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. +:- import_module transform_hlds__term_errors. :- import_module std_util, bool, int, list, map, bag. @@ -208,9 +211,12 @@ :- implementation. -:- import_module check_hlds__inst_match, parse_tree__prog_out. -:- import_module check_hlds__mode_util, check_hlds__type_util. -:- import_module libs__globals, libs__options. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_out. :- import_module assoc_list, require. diff --git a/compiler/termination.m b/compiler/termination.m index 668adfade..a92f817e0 100644 --- a/compiler/termination.m +++ b/compiler/termination.m @@ -47,10 +47,13 @@ :- interface. -:- import_module io, bool, std_util, list. -:- import_module parse_tree__prog_data, hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module parse_tree__prog_data. :- import_module transform_hlds__term_util. +:- import_module io, bool, std_util, list. + % Perform termination analysis on the module. :- pred termination__pass(module_info::in, module_info::out, @@ -85,20 +88,28 @@ :- implementation. -:- import_module transform_hlds__term_pass1, transform_hlds__term_pass2. -:- import_module transform_hlds__term_errors. -:- import_module check_hlds__inst_match, hlds__passes_aux, libs__options. -:- import_module libs__globals. -:- import_module hlds__hlds_data, hlds__hlds_goal. -:- import_module transform_hlds__dependency_graph, varset. -:- import_module check_hlds__mode_util, hlds__hlds_out. -:- import_module parse_tree__prog_out, parse_tree__prog_util. -:- import_module parse_tree__mercury_to_mercury, check_hlds__type_util. +:- 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__passes_aux. :- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__mercury_to_mercury. :- import_module parse_tree__modules. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module transform_hlds__dependency_graph. +:- import_module transform_hlds__term_errors. +:- import_module transform_hlds__term_pass1. +:- import_module transform_hlds__term_pass2. :- import_module map, int, char, string, relation. :- import_module require, bag, set, term. +:- import_module varset. %----------------------------------------------------------------------------% diff --git a/compiler/top_level.m b/compiler/top_level.m index e22275655..3ec266ad5 100644 --- a/compiler/top_level.m +++ b/compiler/top_level.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2002 The University of Melbourne. +% Copyright (C) 2002-2003 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. %-----------------------------------------------------------------------------% @@ -14,16 +14,22 @@ :- interface. % the front-end phases -:- import_module parse_tree, hlds, check_hlds, transform_hlds. +:- import_module check_hlds. +:- import_module hlds. +:- import_module parse_tree. +:- import_module transform_hlds. % back-ends that we currently use or plan to use -:- import_module aditi_backend, ll_backend, ml_backend. +:- import_module aditi_backend. +:- import_module ll_backend. +:- import_module ml_backend. % obsolete or incomplete back-ends :- import_module bytecode_backend. % misc utilities -:- import_module libs, backend_libs. +:- import_module backend_libs. +:- import_module libs. :- include_module mercury_compile. diff --git a/compiler/trace.m b/compiler/trace.m index 0c73941a8..620da5c49 100644 --- a/compiler/trace.m +++ b/compiler/trace.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-2002 The University of Melbourne. +% Copyright (C) 1997-2003 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. %-----------------------------------------------------------------------------% @@ -46,10 +46,14 @@ :- interface. -:- import_module parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__hlds_pred, hlds__hlds_module. -:- import_module ll_backend__code_info, ll_backend__llds. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module libs__globals. +:- import_module ll_backend__code_info. +:- import_module ll_backend__llds. +:- import_module parse_tree__prog_data. + :- import_module map, std_util, set. % The kinds of external ports for which the code we generate will @@ -213,14 +217,20 @@ :- implementation. -:- import_module parse_tree__inst. -:- import_module hlds__instmap, hlds__hlds_llds. -:- import_module check_hlds__type_util. -:- import_module check_hlds__inst_match, check_hlds__mode_util. -:- import_module ll_backend__llds_out, ll_backend__layout_out. -:- import_module ll_backend__continuation_info, ll_backend__code_util. :- import_module backend_libs__code_model. -:- import_module libs__options, libs__trace_params, libs__tree. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__hlds_llds. +:- import_module hlds__instmap. +:- import_module libs__options. +:- import_module libs__trace_params. +:- import_module libs__tree. +:- import_module ll_backend__code_util. +:- import_module ll_backend__continuation_info. +:- import_module ll_backend__layout_out. +:- import_module ll_backend__llds_out. +:- import_module parse_tree__inst. :- import_module list, bool, int, string, map, std_util, require, term, varset. diff --git a/compiler/trace_params.m b/compiler/trace_params.m index f768a25fb..49366eca7 100644 --- a/compiler/trace_params.m +++ b/compiler/trace_params.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -37,6 +37,7 @@ :- import_module hlds__hlds_pred. :- import_module ll_backend__llds. % XXX for trace_port + :- import_module bool, std_util. :- type trace_level. diff --git a/compiler/trans_opt.m b/compiler/trans_opt.m index 6666b36ff..39c9ce437 100644 --- a/compiler/trans_opt.m +++ b/compiler/trans_opt.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1997-2002 The University of Melbourne. +% Copyright (C) 1997-2003 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. %-----------------------------------------------------------------------------% @@ -51,8 +51,11 @@ :- interface. +:- import_module hlds__hlds_module. +:- import_module parse_tree__modules. +:- import_module parse_tree__prog_data. + :- import_module io, bool, list. -:- import_module hlds__hlds_module, parse_tree__modules, parse_tree__prog_data. :- pred trans_opt__write_optfile(module_info, io__state, io__state). :- mode trans_opt__write_optfile(in, di, uo) is det. @@ -70,10 +73,15 @@ :- implementation. -:- import_module transform_hlds__intermod, hlds__hlds_pred. +:- import_module hlds__hlds_pred. +:- import_module hlds__passes_aux. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. :- import_module parse_tree__mercury_to_mercury. -:- import_module parse_tree__prog_io, libs__globals, ll_backend__code_util. -:- import_module hlds__passes_aux, parse_tree__prog_out, libs__options. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_out. +:- import_module transform_hlds__intermod. :- import_module transform_hlds__termination. :- import_module set, string, list, map, varset, term, std_util. diff --git a/compiler/transform.m b/compiler/transform.m index e22de5a0f..527dafb66 100644 --- a/compiler/transform.m +++ b/compiler/transform.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1995-1998 The University of Melbourne. +% Copyright (C) 1995-1998, 2003 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. %-----------------------------------------------------------------------------% @@ -30,7 +30,10 @@ :- module transform_hlds__transform. :- interface. -:- import_module hlds__hlds_goal, check_hlds__mode_info. + +:- import_module check_hlds__mode_info. +:- import_module hlds__hlds_goal. + :- import_module list. %:- pred unfold__in_proc(pred_id, proc_id, hlds_goal_expr, @@ -45,9 +48,15 @@ %-----------------------------------------------------------------------------% :- implementation. + +:- import_module check_hlds__delay_info. +:- import_module check_hlds__mode_util. +:- import_module ll_backend__code_aux. +:- import_module parse_tree__prog_data. + :- import_module map, set, std_util. -:- import_module check_hlds__mode_util, check_hlds__delay_info, term, require. -:- import_module varset, ll_backend__code_aux, parse_tree__prog_data. +:- import_module term, require. +:- import_module varset. :- import_module hlds__instmap. %-----------------------------------------------------------------------------% diff --git a/compiler/transform_hlds.m b/compiler/transform_hlds.m index 6ae61a4ec..7a9ca3f9b 100644 --- a/compiler/transform_hlds.m +++ b/compiler/transform_hlds.m @@ -18,14 +18,17 @@ :- include_module intermod, trans_opt. -:- include_module dependency_graph. % XXX imports llds (for profiling labels) +:- include_module dependency_graph. % XXX imports llds (for profiling labels) :- include_module table_gen. :- include_module (lambda). :- include_module termination. - :- include_module term_pass1, term_pass2, term_traversal, term_errors. + :- include_module term_pass1. + :- include_module term_pass2. + :- include_module term_traversal. + :- include_module term_errors. :- include_module term_util. :- include_module lp. % this could alternatively go in the `libs' module @@ -33,7 +36,11 @@ :- include_module higher_order. :- include_module inlining. :- include_module deforest. - :- include_module constraint, pd_cost, pd_debug, pd_info, pd_term. + :- include_module constraint. + :- include_module pd_cost. + :- include_module pd_debug. + :- include_module pd_info. + :- include_module pd_term. :- include_module pd_util. :- include_module delay_construct. :- include_module unused_args. diff --git a/compiler/tree.m b/compiler/tree.m index 1aef155fa..fee68b3a2 100644 --- a/compiler/tree.m +++ b/compiler/tree.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 1993-2001 The University of Melbourne. +% Copyright (C) 1993-2001, 2003 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. %-----------------------------------------------------------------------------% @@ -18,7 +18,9 @@ %-----------------------------------------------------------------------------% :- interface. + :- import_module list. + :- type tree(T) ---> empty ; node(T) ; tree(tree(T), tree(T)). @@ -82,5 +84,4 @@ tree__map(_F, empty) = empty. tree__map(F, node(T)) = node(F(T)). tree__map(F, tree(L, R)) = tree(tree__map(F, L), tree__map(F, R)). - %-----------------------------------------------------------------------------% diff --git a/compiler/type_ctor_info.m b/compiler/type_ctor_info.m index 25b62a1e5..b773a2f3c 100644 --- a/compiler/type_ctor_info.m +++ b/compiler/type_ctor_info.m @@ -35,7 +35,9 @@ :- interface. -:- import_module hlds__hlds_module, backend_libs__rtti. +:- import_module backend_libs__rtti. +:- import_module hlds__hlds_module. + :- import_module list. :- pred type_ctor_info__generate_hlds(module_info::in, module_info::out) @@ -57,14 +59,24 @@ :- implementation. -:- import_module backend_libs__rtti, backend_libs__pseudo_type_info. -:- import_module hlds__hlds_data, hlds__hlds_pred, hlds__hlds_out. -:- import_module hlds__make_tags, parse_tree__prog_data. -:- import_module parse_tree__prog_util, parse_tree__prog_out. -:- import_module ll_backend__code_util, hlds__special_pred. -:- import_module hlds__hlds_code_util, hlds__special_pred. -:- import_module check_hlds__type_util, libs__globals, libs__options. -:- import_module backend_libs__builtin_ops, hlds__error_util. +:- import_module backend_libs__builtin_ops. +:- import_module backend_libs__pseudo_type_info. +:- import_module backend_libs__rtti. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__hlds_code_util. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. +:- import_module hlds__hlds_pred. +:- import_module hlds__make_tags. +:- import_module hlds__special_pred. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module ll_backend__code_util. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. :- import_module bool, string, int, map, std_util, assoc_list, require. :- import_module set, term. diff --git a/compiler/type_util.m b/compiler/type_util.m index b9e1a6b7f..202b1b3b3 100644 --- a/compiler/type_util.m +++ b/compiler/type_util.m @@ -18,8 +18,11 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. -:- import_module parse_tree__prog_data, libs__globals. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module libs__globals. +:- import_module parse_tree__prog_data. :- import_module term. :- import_module bool, std_util, list, map. @@ -497,11 +500,14 @@ :- implementation. -:- import_module parse_tree__prog_io, parse_tree__prog_io_goal. :- import_module backend_libs__foreign. -:- import_module parse_tree__prog_util. :- import_module check_hlds__purity. -:- import_module libs__options, libs__globals. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module parse_tree__prog_io. +:- import_module parse_tree__prog_io_goal. +:- import_module parse_tree__prog_util. + :- import_module bool, char, int, string. :- import_module assoc_list, require, varset. diff --git a/compiler/typecheck.m b/compiler/typecheck.m index 4f71702fd..a24c40134 100644 --- a/compiler/typecheck.m +++ b/compiler/typecheck.m @@ -102,8 +102,11 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_data. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. +:- import_module hlds__hlds_data. :- import_module parse_tree__prog_data. + :- import_module bool, io, list, map. % typecheck(Module0, Module, FoundError, @@ -154,15 +157,26 @@ :- implementation. -:- import_module hlds__hlds_goal, hlds__goal_util, parse_tree__prog_util. -:- import_module check_hlds__type_util, parse_tree__modules. -:- import_module parse_tree__prog_io, parse_tree__prog_io_util. -:- import_module parse_tree__prog_out, hlds__hlds_out, hlds__error_util. -:- import_module parse_tree__mercury_to_mercury, check_hlds__mode_util. -:- import_module libs__options, getopt, libs__globals. -:- import_module hlds__passes_aux, check_hlds__clause_to_proc. -:- import_module hlds__special_pred, check_hlds__inst_match. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__type_util. +:- import_module hlds__error_util. +:- import_module hlds__goal_util. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_out. +:- import_module hlds__passes_aux. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- 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_io_util. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module getopt. :- import_module int, set, string, require, multi_map. :- import_module assoc_list, std_util, term, varset, term_io. diff --git a/compiler/unify_proc.m b/compiler/unify_proc.m index 74555f4e2..02f8dad19 100644 --- a/compiler/unify_proc.m +++ b/compiler/unify_proc.m @@ -46,10 +46,15 @@ :- module check_hlds__unify_proc. :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. + +:- import_module check_hlds__mode_info. :- import_module hlds__hlds_data. -:- import_module check_hlds__mode_info, parse_tree__prog_data. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. :- import_module hlds__special_pred. +:- import_module parse_tree__prog_data. + :- import_module bool, std_util, io, list. :- type proc_requests. @@ -124,23 +129,36 @@ :- implementation. -:- import_module libs__globals, libs__options. -:- import_module ll_backend__code_util, ll_backend__code_info. +:- import_module check_hlds__clause_to_proc. +:- import_module check_hlds__cse_detection. +:- 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__polymorphism. +:- import_module check_hlds__post_typecheck. +:- import_module check_hlds__switch_detection. :- import_module check_hlds__type_util. -:- import_module parse_tree__mercury_to_mercury, hlds__hlds_out. -:- import_module hlds__make_hlds, check_hlds__polymorphism. -:- import_module check_hlds__post_typecheck, parse_tree__prog_util. -:- import_module parse_tree__prog_out. -:- import_module hlds__quantification, check_hlds__clause_to_proc, term. -:- import_module varset. -:- import_module check_hlds__modes, check_hlds__mode_util. -:- import_module check_hlds__inst_match, hlds__instmap, (parse_tree__inst). -:- import_module check_hlds__switch_detection, check_hlds__cse_detection. -:- import_module check_hlds__det_analysis, check_hlds__unique_modes. -:- import_module recompilation. +:- import_module check_hlds__unique_modes. :- import_module hlds__goal_util. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module hlds__make_hlds. +:- import_module hlds__quantification. +:- import_module libs__globals. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_info. +:- import_module ll_backend__code_util. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_out. +:- import_module parse_tree__prog_util. +:- import_module recompilation. -:- import_module libs__tree, map, set, queue, int, string, require, assoc_list. +:- import_module term. +:- import_module varset. +:- import_module map, set, queue, int, string, require, assoc_list. % We keep track of all the complicated unification procs we need % by storing them in the proc_requests structure. @@ -197,7 +215,10 @@ unify_proc__set_req_queue(proc_requests(A, _), ReqQueue, %-----------------------------------------------------------------------------% unify_proc__lookup_mode_num(ModuleInfo, TypeCtor, UniMode, Det, Num) :- - ( unify_proc__search_mode_num(ModuleInfo, TypeCtor, UniMode, Det, Num1) -> + ( + unify_proc__search_mode_num(ModuleInfo, TypeCtor, UniMode, + Det, Num1) + -> Num = Num1 ; error("unify_proc.m: unify_proc__search_num failed") diff --git a/compiler/unique_modes.m b/compiler/unique_modes.m index 962eb0cb0..8397b122e 100644 --- a/compiler/unique_modes.m +++ b/compiler/unique_modes.m @@ -35,8 +35,12 @@ :- module check_hlds__unique_modes. :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred, hlds__hlds_goal. + :- import_module check_hlds__mode_info. +:- import_module hlds__hlds_goal. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io, bool. % check every predicate in a module @@ -58,15 +62,25 @@ :- implementation. -:- import_module hlds__hlds_data, check_hlds__mode_debug. -:- import_module check_hlds__modecheck_unify, check_hlds__modecheck_call. -:- import_module check_hlds__mode_util, parse_tree__prog_out, hlds__hlds_out. -:- import_module parse_tree__mercury_to_mercury, hlds__passes_aux. -:- import_module check_hlds__modes, parse_tree__prog_data. -:- import_module check_hlds__mode_errors, ll_backend__llds. -:- import_module check_hlds__unify_proc. -:- import_module (parse_tree__inst), hlds__instmap, check_hlds__inst_match. +:- import_module check_hlds__inst_match. :- import_module check_hlds__inst_util. +:- import_module check_hlds__mode_debug. +:- import_module check_hlds__mode_errors. +:- import_module check_hlds__mode_util. +:- import_module check_hlds__modecheck_call. +:- import_module check_hlds__modecheck_unify. +:- import_module check_hlds__modes. +:- import_module check_hlds__unify_proc. +:- import_module hlds__hlds_data. +:- import_module hlds__hlds_out. +:- import_module hlds__instmap. +:- import_module hlds__passes_aux. +:- import_module ll_backend__llds. +:- import_module parse_tree__inst. +:- import_module parse_tree__mercury_to_mercury. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_out. + :- import_module term, varset. :- import_module assoc_list, bag, int, list, map. :- import_module require, set, std_util, string. diff --git a/compiler/unneeded_code.m b/compiler/unneeded_code.m index 0d4dfed24..54a5ae7a3 100644 --- a/compiler/unneeded_code.m +++ b/compiler/unneeded_code.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %-----------------------------------------------------------------------------% @@ -57,7 +57,9 @@ :- interface. -:- import_module hlds__hlds_module, hlds__hlds_pred. +:- import_module hlds__hlds_module. +:- import_module hlds__hlds_pred. + :- import_module io. :- pred unneeded_code__process_proc_msg(pred_id::in, proc_id::in, @@ -69,13 +71,20 @@ :- implementation. -:- import_module parse_tree__prog_data, parse_tree__prog_data. -:- import_module hlds__hlds_goal, hlds__instmap, hlds__quantification. -:- import_module hlds__goal_form, hlds__passes_aux, hlds__hlds_out. -:- import_module check_hlds__inst_match, check_hlds__mode_util. :- import_module check_hlds__goal_path. +:- import_module check_hlds__inst_match. +:- import_module check_hlds__mode_util. +:- import_module hlds__goal_form. +:- 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 ll_backend__code_aux. -:- import_module libs__globals, libs__options. +:- import_module parse_tree__prog_data. +:- import_module parse_tree__prog_data. :- import_module bool, int, list, assoc_list, map, set, std_util, require. diff --git a/compiler/unused_args.m b/compiler/unused_args.m index cf02a11b2..2560bbcc5 100644 --- a/compiler/unused_args.m +++ b/compiler/unused_args.m @@ -43,8 +43,9 @@ %------------------------------------------------------------------------------- :- interface. -:- import_module hlds__hlds_module. :- import_module analysis. +:- import_module hlds__hlds_module. + :- import_module io. :- pred unused_args__process_module(module_info::in, module_info::out, @@ -63,18 +64,28 @@ %------------------------------------------------------------------------------- :- implementation. -:- import_module parse_tree__mercury_to_mercury, parse_tree__modules. -:- import_module parse_tree__prog_data, parse_tree__prog_out. -:- import_module parse_tree__prog_util. -:- import_module hlds__hlds_pred, hlds__hlds_goal, hlds__hlds_data. -:- import_module hlds__hlds_out, hlds__instmap, hlds__make_hlds. -:- import_module hlds__quantification, hlds__special_pred. -:- import_module hlds__passes_aux. +:- 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 check_hlds__type_util, check_hlds__mode_util. -:- import_module check_hlds__inst_match, check_hlds__polymorphism. +:- 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__make_hlds. +:- import_module hlds__passes_aux. +:- import_module hlds__quantification. +:- import_module hlds__special_pred. +:- import_module libs__globals. +:- import_module libs__options. +:- 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__mmc_analysis. -:- import_module libs__options, libs__globals. :- import_module bool, int, char, string, list, assoc_list, set, map. :- import_module std_util, require. diff --git a/compiler/use_local_vars.m b/compiler/use_local_vars.m index 0cefcb45c..780b41f7b 100644 --- a/compiler/use_local_vars.m +++ b/compiler/use_local_vars.m @@ -63,6 +63,7 @@ :- import_module backend_libs__proc_label. :- import_module ll_backend__llds. + :- import_module list, counter. :- pred use_local_vars__main(list(instruction)::in, list(instruction)::out, diff --git a/compiler/var_locn.m b/compiler/var_locn.m index d1a31526f..fa276f8de 100644 --- a/compiler/var_locn.m +++ b/compiler/var_locn.m @@ -1,5 +1,5 @@ %---------------------------------------------------------------------------% -% Copyright (C) 2000-2002 The University of Melbourne. +% Copyright (C) 2000-2003 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. %---------------------------------------------------------------------------% @@ -323,8 +323,11 @@ :- implementation. -:- import_module ll_backend__code_util, ll_backend__exprn_aux. -:- import_module libs__options, libs__tree. +:- import_module libs__options. +:- import_module libs__tree. +:- import_module ll_backend__code_util. +:- import_module ll_backend__exprn_aux. + :- import_module int, string, bag, require, getopt, varset, term. :- type dead_or_alive ---> dead ; alive. diff --git a/compiler/wrap_blocks.m b/compiler/wrap_blocks.m index 6a9986c44..e844da267 100644 --- a/compiler/wrap_blocks.m +++ b/compiler/wrap_blocks.m @@ -1,5 +1,5 @@ %-----------------------------------------------------------------------------% -% Copyright (C) 2001 The University of Melbourne. +% Copyright (C) 2001, 2003 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. %-----------------------------------------------------------------------------% @@ -22,6 +22,7 @@ :- interface. :- import_module ll_backend__llds. + :- import_module list. :- pred wrap_blocks(list(instruction)::in, list(instruction)::out) @@ -30,6 +31,7 @@ :- implementation. :- import_module ll_backend__opt_util. + :- import_module bool, int, std_util, require. wrap_blocks(Instrs0, Instrs) :-