[m-rev.] diff: reduce undesirable dependencies
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Mar 23 21:51:08 AEDT 2004
Reduce the dependence of earlier parts of the compiler on the later ones.
Unnecessary import_module declarations in top level modules such as hlds.m
cause unnecessary recompilations when adding new types in later modules,
such as submodules of ll_backend.m. This change reduces the number of such
unnecessary imports.
There are no changes in algorithms, only functionality being moved around.
compiler/code_model.m:
Change this module from being a submodule of backend_libs.m to being a
submodule of hlds.m, since nothing in it is dependent on any backend.
compiler/arg_info.m:
compiler/code_util.m:
Change arg_info.m from being a submodule of ll_backend.m to being a
submodule of hlds.m, since most of it is applicable to all current
and foreseeable backends. Move the one exported predicate that is
ll_backend dependent, and its support predicates, to code_util.m.
compiler/backend_libs.m:
compiler/ll_backend.m:
compiler/hlds.m:
Update include_module declarations in accordance with the above.
compiler/prog_data.m:
compiler/term_util.m:
Instead of defining two separate types for holding argument size and
termination information, one including HLDS-specific information (in
term_util.m) and one not (in prog_data.m), use a polymorphic type
defined in prog_data.m and two monomorphic instances.
compiler/termination.m:
compiler/mercury_to_mercury.m:
Change the predicates for writing out argument size and termination
information to handle the polymorphic type (we don't need special
handling of the monomorphic versions), and move them from termination.m
to mercury_to_mercury.m, since this allows us to avoid some
undesirable dependencies.
compiler/base_typeclass_info.m:
compiler/hlds_code_util.m:
Move the predicate make_instance_string from base_typeclass_info.m
to hlds_code_util.m, again because it allows us to remove some
undesirable dependencies.
compiler/top_level.m:
compiler/backend_libs.m:
compiler/check_hlds.m:
compiler/hlds.m:
compiler/ll_backend.m:
compiler/parse_tree.m:
compiler/transform_hlds.m:
Delete some import_module declarations of other top level modules
in these top level modules. Some imports were totally unnecessary.
Some imports were useful in only a small minority of submodules;
those submodules now import the necessary top level modules directly.
Move remaining import_module declarations to the implementation section
where this is feasible.
Where we still need to import modules we ideally shouldn't, note why.
compiler/*.m:
Update imports of code_util and arg_info.
In some cases, import top level modules no longer imported by the
parent module.
In some cases, delete unnecessary imports.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/add_heap_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.10
diff -u -b -r1.10 add_heap_ops.m
--- compiler/add_heap_ops.m 24 Oct 2003 06:17:34 -0000 1.10
+++ compiler/add_heap_ops.m 22 Mar 2004 15:52:17 -0000
@@ -39,8 +39,8 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__goal_form.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_data.
Index: compiler/add_trail_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.12
diff -u -b -r1.12 add_trail_ops.m
--- compiler/add_trail_ops.m 24 Oct 2003 06:17:34 -0000 1.12
+++ compiler/add_trail_ops.m 22 Mar 2004 15:52:22 -0000
@@ -39,8 +39,8 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
Index: compiler/aditi_backend.pp
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/aditi_backend.pp,v
retrieving revision 1.5
diff -u -b -r1.5 aditi_backend.pp
--- compiler/aditi_backend.pp 1 Dec 2003 15:55:29 -0000 1.5
+++ compiler/aditi_backend.pp 23 Mar 2004 10:28:57 -0000
@@ -8,8 +8,8 @@
%
:- module aditi_backend.
:- interface.
-:- import_module transform_hlds, check_hlds. % are these needed?
-:- import_module hlds, parse_tree, libs.
+
+:- import_module hlds.
%:- import_module aditi_hlds, aditi_codegen, aditi_rl_out.
@@ -69,14 +69,14 @@
%:- end_module aditi_rl_out.
-%-----------------------------------------------------------------------------%
-
:- implementation.
- % aditi_backend__rl_exprn uses backend_libs__builtin_ops.
-:- import_module backend_libs.
- % aditi_backend__magic uses ll_backend__saved_vars.
-:- import_module ll_backend.
+:- import_module check_hlds. % for type_util, mode_util
+:- import_module transform_hlds. % for dependency_graph, inlining,
+ % dead_proc_elim
+:- import_module parse_tree.
+:- import_module libs.
+:- import_module backend_libs.
:- end_module aditi_backend.
Index: compiler/arg_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/arg_info.m,v
retrieving revision 1.41
diff -u -b -r1.41 arg_info.m
--- compiler/arg_info.m 31 Oct 2003 03:27:20 -0000 1.41
+++ compiler/arg_info.m 22 Mar 2004 16:50:32 -0000
@@ -15,13 +15,12 @@
%-----------------------------------------------------------------------------%
-:- module ll_backend__arg_info.
+:- module hlds__arg_info.
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__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.
@@ -40,11 +39,6 @@
:- pred make_arg_infos(list(type)::in, list(mode)::in, code_model::in,
module_info::in, list(arg_info)::out) is det.
- % Given a procedure that already has its arg_info field filled in,
- % return a list giving its input variables and their initial locations.
-:- pred arg_info__build_input_arg_list(proc_info::in,
- assoc_list(prog_var, lval)::out) is det.
-
% Divide the given list of arguments into those treated as inputs
% by the calling convention and those treated as outputs.
:- pred arg_info__compute_in_and_out_vars(module_info::in,
@@ -101,7 +95,6 @@
:- implementation.
:- import_module check_hlds__mode_util.
-:- import_module ll_backend__code_util.
:- import_module std_util, map, int, require.
@@ -212,28 +205,6 @@
error("make_arg_infos_list: length mis-match").
make_arg_infos_list([_|_], [], _, _, _, _) :-
error("make_arg_infos_list: length mis-match").
-
-%---------------------------------------------------------------------------%
-
-arg_info__build_input_arg_list(ProcInfo, VarLvals) :-
- proc_info_headvars(ProcInfo, HeadVars),
- proc_info_arg_info(ProcInfo, ArgInfos),
- assoc_list__from_corresponding_lists(HeadVars, ArgInfos, VarArgInfos),
- arg_info__build_input_arg_list_2(VarArgInfos, VarLvals).
-
-:- pred arg_info__build_input_arg_list_2(assoc_list(prog_var, arg_info)::in,
- assoc_list(prog_var, lval)::out) is det.
-
-arg_info__build_input_arg_list_2([], []).
-arg_info__build_input_arg_list_2([V - Arg | Rest0], VarArgs) :-
- Arg = arg_info(Loc, Mode),
- ( Mode = top_in ->
- code_util__arg_loc_to_register(Loc, Reg),
- VarArgs = [V - Reg | VarArgs0]
- ;
- VarArgs = VarArgs0
- ),
- arg_info__build_input_arg_list_2(Rest0, VarArgs0).
%---------------------------------------------------------------------------%
Index: compiler/backend_libs.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/backend_libs.m,v
retrieving revision 1.6
diff -u -b -r1.6 backend_libs.m
--- compiler/backend_libs.m 1 Dec 2003 15:55:29 -0000 1.6
+++ compiler/backend_libs.m 23 Mar 2004 10:12:32 -0000
@@ -11,19 +11,14 @@
%
:- module backend_libs.
:- interface.
-:- import_module check_hlds. % is this needed?
:- import_module hlds.
-:- import_module libs.
:- import_module parse_tree.
-:- import_module transform_hlds. % is this needed?
-:- import_module ll_backend. % export.m uses ll_backend.arg_info.
% modules that provide functionality used by several different back-ends
:- include_module base_typeclass_info.
:- include_module builtin_ops.
:- include_module bytecode_data.
:- include_module c_util.
-:- include_module code_model.
:- include_module compile_target_code.
:- include_module export.
:- include_module foreign.
@@ -35,6 +30,11 @@
:- include_module switch_util.
:- include_module type_ctor_info.
:- include_module type_class_info.
+
+:- implementation.
+
+:- import_module check_hlds. % needed for type_util, mode_util
+:- import_module libs.
:- end_module backend_libs.
Index: compiler/base_typeclass_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/base_typeclass_info.m,v
retrieving revision 1.26
diff -u -b -r1.26 base_typeclass_info.m
--- compiler/base_typeclass_info.m 23 Oct 2003 02:02:08 -0000 1.26
+++ compiler/base_typeclass_info.m 22 Mar 2004 17:08:05 -0000
@@ -24,27 +24,22 @@
:- 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.
- % Given a list of types, mangle the names so into a string which
- % identifies them. The types must all have their top level functor
- % bound, with any arguments free variables.
-:- pred base_typeclass_info__make_instance_string(list(type), string).
-:- mode base_typeclass_info__make_instance_string(in, out) is det.
-
:- implementation.
:- import_module check_hlds__type_util.
+:- import_module hlds__hlds_code_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 parse_tree__prog_data.
:- import_module parse_tree__prog_io.
:- import_module parse_tree__prog_out.
@@ -92,8 +87,7 @@
% declaration originally came from _this_ module.
status_defined_in_this_module(ImportStatus, yes)
->
- base_typeclass_info__make_instance_string(InstanceTypes,
- InstanceString),
+ make_instance_string(InstanceTypes, InstanceString),
base_typeclass_info__gen_body(PredProcIds,
InstanceTypes, InstanceConstraints, ModuleInfo,
ClassId, BaseTypeClassInfo),
@@ -162,30 +156,4 @@
list__length(SuperClassConstraints, NumSuperClasses),
list__length(ClassVars, ClassArity).
-%----------------------------------------------------------------------------%
-
- % Note that for historical reasons, builtin types
- % are treated as being unqualified (`int') rather than
- % being qualified (`builtin:int') at this point.
-
-base_typeclass_info__make_instance_string(InstanceTypes, InstanceString) :-
- list__map(base_typeclass_info__type_to_string,
- InstanceTypes, InstanceStrings),
- string__append_list(InstanceStrings, InstanceString).
-
-:- pred base_typeclass_info__type_to_string(type, string).
-:- mode base_typeclass_info__type_to_string(in, out) is det.
-
-base_typeclass_info__type_to_string(Type, String) :-
- ( sym_name_and_args(Type, TypeName, TypeArgs) ->
- prog_out__sym_name_to_string(TypeName, "__", TypeNameString),
- list__length(TypeArgs, TypeArity),
- string__int_to_string(TypeArity, TypeArityString),
- string__append_list(
- [TypeNameString, "__arity", TypeArityString, "__"],
- String)
- ;
- error("base_typeclass_info__type_to_string: invalid type")
- ).
-
%----------------------------------------------------------------------------%
Index: compiler/bytecode_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/bytecode_gen.m,v
retrieving revision 1.79
diff -u -b -r1.79 bytecode_gen.m
--- compiler/bytecode_gen.m 19 Mar 2004 10:19:19 -0000 1.79
+++ compiler/bytecode_gen.m 22 Mar 2004 16:44:30 -0000
@@ -39,9 +39,10 @@
% 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__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_code_util.
:- import_module hlds__hlds_data.
@@ -50,7 +51,6 @@
:- 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 parse_tree__error_util.
:- import_module parse_tree__prog_data.
Index: compiler/call_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/call_gen.m,v
retrieving revision 1.158
diff -u -b -r1.158 call_gen.m
--- compiler/call_gen.m 14 Nov 2003 01:06:03 -0000 1.158
+++ compiler/call_gen.m 22 Mar 2004 16:44:41 -0000
@@ -18,7 +18,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_pred.
:- import_module ll_backend__code_info.
@@ -61,6 +61,7 @@
:- import_module check_hlds__polymorphism.
:- import_module check_hlds__type_util.
:- import_module check_hlds__unify_proc.
+:- import_module hlds__arg_info.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_llds.
:- import_module hlds__hlds_module.
@@ -68,7 +69,6 @@
:- 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.
Index: compiler/check_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/check_hlds.m,v
retrieving revision 1.3
diff -u -b -r1.3 check_hlds.m
--- compiler/check_hlds.m 16 Mar 2003 08:01:26 -0000 1.3
+++ compiler/check_hlds.m 23 Mar 2004 09:30:09 -0000
@@ -13,8 +13,6 @@
:- 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.
% :- import_module check_hlds__mode_analysis.
@@ -69,6 +67,8 @@
%-----------------------------------------------------------------------------%
:- implementation.
+
+:- import_module libs.
:- import_module transform_hlds. % for pd_cost, etc.
:- end_module check_hlds.
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.55
diff -u -b -r1.55 check_typeclass.m
--- compiler/check_typeclass.m 19 Mar 2004 10:19:19 -0000 1.55
+++ compiler/check_typeclass.m 22 Mar 2004 16:33:25 -0000
@@ -58,11 +58,11 @@
:- implementation.
-:- import_module backend_libs__base_typeclass_info.
:- import_module check_hlds__inst_match.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__typecheck.
:- import_module check_hlds__type_util.
+:- import_module hlds__hlds_code_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_out.
@@ -778,8 +778,7 @@
% Perhaps we should include the arity in this mangled
% string?
string__int_to_string(Arity, ArityString),
- base_typeclass_info__make_instance_string(InstanceTypes,
- InstanceString),
+ make_instance_string(InstanceTypes, InstanceString),
string__append_list(
[check_typeclass__introduced_pred_name_prefix,
ClassNameString, "____",
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.120
diff -u -b -r1.120 code_gen.m
--- compiler/code_gen.m 23 Mar 2004 06:56:39 -0000 1.120
+++ compiler/code_gen.m 23 Mar 2004 07:42:28 -0000
@@ -30,7 +30,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.285
diff -u -b -r1.285 code_info.m
--- compiler/code_info.m 8 Jan 2004 06:52:36 -0000 1.285
+++ compiler/code_info.m 22 Mar 2004 16:52:31 -0000
@@ -29,8 +29,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__proc_label.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_llds.
@@ -51,10 +51,10 @@
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__arg_info.
:- import_module hlds__hlds_code_util.
:- import_module libs__options.
:- import_module libs__tree.
-:- import_module ll_backend__arg_info.
:- import_module ll_backend__code_util.
:- import_module ll_backend__exprn_aux.
:- import_module ll_backend__llds_out.
@@ -362,7 +362,7 @@
proc_info_get_initial_instmap(ProcInfo, ModuleInfo, InstMap),
proc_info_liveness_info(ProcInfo, Liveness),
proc_info_interface_code_model(ProcInfo, CodeModel),
- arg_info__build_input_arg_list(ProcInfo, ArgList),
+ build_input_arg_list(ProcInfo, ArgList),
proc_info_varset(ProcInfo, VarSet),
proc_info_stack_slots(ProcInfo, StackSlots),
globals__get_options(Globals, Options),
Index: compiler/code_model.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_model.m,v
retrieving revision 1.3
diff -u -b -r1.3 code_model.m
--- compiler/code_model.m 15 Mar 2003 03:08:43 -0000 1.3
+++ compiler/code_model.m 22 Mar 2004 16:00:08 -0000
@@ -4,7 +4,7 @@
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
-:- module backend_libs__code_model.
+:- module hlds__code_model.
% This module defines the `code_model' data type, and associated procedures.
% The `code_model' type is a simplified version of the `determinism' type
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.147
diff -u -b -r1.147 code_util.m
--- compiler/code_util.m 23 Mar 2004 06:56:40 -0000 1.147
+++ compiler/code_util.m 23 Mar 2004 07:43:50 -0000
@@ -23,8 +23,9 @@
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
:- import_module ll_backend__llds.
+:- import_module parse_tree__prog_data.
-:- import_module list, std_util.
+:- import_module list, assoc_list, std_util.
% Create a code address which holds the address of the specified
% procedure.
@@ -87,19 +88,24 @@
:- pred code_util__lvals_in_lval(lval::in, list(lval)::out) is det.
:- pred code_util__lvals_in_lvals(list(lval)::in, list(lval)::out) is det.
+ % Given a procedure that already has its arg_info field filled in,
+ % return a list giving its input variables and their initial locations.
+:- pred build_input_arg_list(proc_info::in,
+ assoc_list(prog_var, lval)::out) is det.
+
%---------------------------------------------------------------------------%
:- implementation.
:- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__special_pred.
:- import_module libs__globals.
:- import_module libs__options.
:- import_module parse_tree__prog_util.
:- import_module bool, char, int, string, set, map, term, varset.
-:- import_module require, std_util, assoc_list.
+:- import_module require, std_util.
%---------------------------------------------------------------------------%
@@ -423,3 +429,23 @@
code_util__lvals_in_rval(Rval, Lvals).
%-----------------------------------------------------------------------------%
+
+build_input_arg_list(ProcInfo, VarLvals) :-
+ proc_info_headvars(ProcInfo, HeadVars),
+ proc_info_arg_info(ProcInfo, ArgInfos),
+ assoc_list__from_corresponding_lists(HeadVars, ArgInfos, VarArgInfos),
+ build_input_arg_list_2(VarArgInfos, VarLvals).
+
+:- pred build_input_arg_list_2(assoc_list(prog_var, arg_info)::in,
+ assoc_list(prog_var, lval)::out) is det.
+
+build_input_arg_list_2([], []).
+build_input_arg_list_2([V - Arg | Rest0], VarArgs) :-
+ Arg = arg_info(Loc, Mode),
+ ( Mode = top_in ->
+ code_util__arg_loc_to_register(Loc, Reg),
+ VarArgs = [V - Reg | VarArgs0]
+ ;
+ VarArgs = VarArgs0
+ ),
+ build_input_arg_list_2(Rest0, VarArgs0).
Index: compiler/commit_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/commit_gen.m,v
retrieving revision 1.4
diff -u -b -r1.4 commit_gen.m
--- compiler/commit_gen.m 15 Mar 2003 03:08:43 -0000 1.4
+++ compiler/commit_gen.m 22 Mar 2004 15:53:30 -0000
@@ -16,7 +16,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
:- import_module ll_backend__llds.
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.22
diff -u -b -r1.22 const_prop.m
--- compiler/const_prop.m 19 Feb 2004 07:17:22 -0000 1.22
+++ compiler/const_prop.m 23 Mar 2004 10:23:42 -0000
@@ -57,9 +57,6 @@
:- 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.
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.87
diff -u -b -r1.87 dead_proc_elim.m
--- compiler/dead_proc_elim.m 19 Mar 2004 10:19:19 -0000 1.87
+++ compiler/dead_proc_elim.m 23 Mar 2004 10:23:58 -0000
@@ -72,7 +72,6 @@
:- import_module hlds__passes_aux.
:- import_module libs__globals.
:- import_module libs__options.
-:- import_module ll_backend__llds.
:- import_module parse_tree__error_util.
:- import_module parse_tree__prog_util.
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.22
diff -u -b -r1.22 deep_profiling.m
--- compiler/deep_profiling.m 21 Dec 2003 05:04:32 -0000 1.22
+++ compiler/deep_profiling.m 22 Mar 2004 16:06:48 -0000
@@ -28,10 +28,10 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__rtti.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_pred.
@@ -44,6 +44,7 @@
:- import_module parse_tree__inst.
:- import_module parse_tree__prog_data.
:- import_module parse_tree__prog_util.
+:- import_module transform_hlds.
:- import_module transform_hlds__dependency_graph.
:- import_module bool, int, list, assoc_list, map, require, set.
Index: compiler/dense_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dense_switch.m,v
retrieving revision 1.47
diff -u -b -r1.47 dense_switch.m
--- compiler/dense_switch.m 27 Oct 2003 05:42:36 -0000 1.47
+++ compiler/dense_switch.m 22 Mar 2004 15:53:40 -0000
@@ -16,9 +16,9 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
Index: compiler/dependency_graph.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dependency_graph.m,v
retrieving revision 1.67
diff -u -b -r1.67 dependency_graph.m
--- compiler/dependency_graph.m 1 Dec 2003 15:55:31 -0000 1.67
+++ compiler/dependency_graph.m 22 Mar 2004 15:44:47 -0000
@@ -103,6 +103,7 @@
:- implementation.
+:- import_module backend_libs.
:- import_module backend_libs__name_mangle.
:- import_module backend_libs__proc_label.
:- import_module check_hlds__mode_util.
Index: compiler/disj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/disj_gen.m,v
retrieving revision 1.79
diff -u -b -r1.79 disj_gen.m
--- compiler/disj_gen.m 27 Oct 2003 05:42:36 -0000 1.79
+++ compiler/disj_gen.m 22 Mar 2004 15:53:44 -0000
@@ -17,7 +17,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
:- import_module ll_backend__llds.
Index: compiler/export.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.74
diff -u -b -r1.74 export.m
--- compiler/export.m 19 Mar 2004 10:19:19 -0000 1.74
+++ compiler/export.m 22 Mar 2004 16:45:10 -0000
@@ -71,16 +71,16 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__c_util.
:- import_module backend_libs__foreign.
:- import_module backend_libs__name_mangle.
:- import_module backend_libs__proc_label.
:- import_module check_hlds__type_util.
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_pred.
:- import_module libs__globals.
:- import_module libs__options.
-:- import_module ll_backend__arg_info.
:- import_module parse_tree__error_util.
:- import_module parse_tree__modules.
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.51
diff -u -b -r1.51 fact_table.m
--- compiler/fact_table.m 23 Mar 2004 06:56:40 -0000 1.51
+++ compiler/fact_table.m 23 Mar 2004 07:42:29 -0000
@@ -89,19 +89,19 @@
:- import_module parse_tree__prog_out.
:- import_module parse_tree__prog_util.
% HLDS modules
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_out.
:- import_module hlds__passes_aux.
:- import_module 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__c_util.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__export.
:- import_module backend_libs__name_mangle.
:- import_module backend_libs__foreign.
Index: compiler/follow_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/follow_vars.m,v
retrieving revision 1.66
diff -u -b -r1.66 follow_vars.m
--- compiler/follow_vars.m 18 Mar 2003 02:43:35 -0000 1.66
+++ compiler/follow_vars.m 22 Mar 2004 16:45:43 -0000
@@ -48,12 +48,12 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__mode_util.
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__quantification.
:- import_module libs__globals.
-:- import_module ll_backend__arg_info.
:- import_module ll_backend__call_gen.
:- import_module ll_backend__code_util.
:- import_module ll_backend__llds.
Index: compiler/foreign.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/foreign.m,v
retrieving revision 1.35
diff -u -b -r1.35 foreign.m
--- compiler/foreign.m 19 Mar 2004 10:19:19 -0000 1.35
+++ compiler/foreign.m 22 Mar 2004 15:57:52 -0000
@@ -5,7 +5,7 @@
%-----------------------------------------------------------------------------%
% This module defines predicates for interfacing with foreign languages.
-% In particular, this module supports interfacing with with languages
+% In particular, this module supports interfacing with languages
% other than the target of compilation.
% Main authors: trd, dgj.
@@ -228,10 +228,10 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__name_mangle.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
Index: compiler/goal_form.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_form.m,v
retrieving revision 1.7
diff -u -b -r1.7 goal_form.m
--- compiler/goal_form.m 18 Feb 2004 01:39:38 -0000 1.7
+++ compiler/goal_form.m 23 Mar 2004 10:31:22 -0000
@@ -95,6 +95,7 @@
:- implementation.
:- import_module hlds__hlds_data.
+:- import_module parse_tree__prog_data.
:- import_module transform_hlds__term_util.
:- import_module bool, int, std_util, require.
Index: compiler/hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds.m,v
retrieving revision 1.212
diff -u -b -r1.212 hlds.m
--- compiler/hlds.m 19 Mar 2004 10:19:20 -0000 1.212
+++ compiler/hlds.m 23 Mar 2004 09:52:00 -0000
@@ -10,15 +10,7 @@
:- module hlds.
:- interface.
-:- import_module backend_libs. % XXX needed for rtti, foreign, etc.
-:- import_module check_hlds. % needed for unify_proc__unify_proc_id,
- % etc.
-:- 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.
%-----------------------------------------------------------------------------%
@@ -41,6 +33,8 @@
:- include_module hlds_out.
% Miscellaneous utilities.
+:- include_module arg_info.
+:- include_module code_model.
:- include_module goal_form.
:- include_module goal_util.
:- include_module hlds_code_util.
@@ -50,9 +44,12 @@
%-----------------------------------------------------------------------------%
:- implementation.
-:- import_module aditi_backend. % XXX for rl__get_entry_proc_name,
- % which is used by hlds_out.m to dump
- % aditi_call goals.
+
+:- import_module libs.
+:- import_module check_hlds. % needed for unify_proc__unify_proc_id,
+ % etc.
+:- import_module transform_hlds. % needed for mmc_analysis, term_util
+
:- end_module hlds.
%-----------------------------------------------------------------------------%
Index: compiler/hlds_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_code_util.m,v
retrieving revision 1.9
diff -u -b -r1.9 hlds_code_util.m
--- compiler/hlds_code_util.m 1 Dec 2003 15:55:36 -0000 1.9
+++ compiler/hlds_code_util.m 22 Mar 2004 17:09:05 -0000
@@ -20,7 +20,10 @@
:- import_module hlds__hlds_module.
:- import_module parse_tree__prog_data.
+:- import_module list.
+
% Are equivalence types fully expanded on this backend?
+
:- pred are_equivalence_types_expanded(module_info::in) is semidet.
% Find out how a function symbol (constructor) is represented
@@ -28,13 +31,21 @@
:- func cons_id_to_tag(cons_id, type, module_info) = cons_tag.
+ % Given a list of types, mangle the names so into a string which
+ % identifies them. The types must all have their top level functor
+ % bound, with any arguments free variables.
+
+:- pred make_instance_string(list(type)::in, string::out) is det.
+
:- implementation.
:- import_module check_hlds__type_util.
:- import_module libs__globals.
:- import_module libs__options.
+:- import_module parse_tree__prog_io.
+:- import_module parse_tree__prog_out.
-:- import_module bool, char, string, require, list, map, std_util, term.
+:- import_module bool, char, string, require, map, std_util, term.
%-----------------------------------------------------------------------------%
@@ -104,3 +115,27 @@
).
%-----------------------------------------------------------------------------%
+
+ % Note that for historical reasons, builtin types
+ % are treated as being unqualified (`int') rather than
+ % being qualified (`builtin:int') at this point.
+
+make_instance_string(InstanceTypes, InstanceString) :-
+ list__map(type_to_string, InstanceTypes, InstanceStrings),
+ string__append_list(InstanceStrings, InstanceString).
+
+:- pred type_to_string((type)::in, string::out) is det.
+
+type_to_string(Type, String) :-
+ ( sym_name_and_args(Type, TypeName, TypeArgs) ->
+ prog_out__sym_name_to_string(TypeName, "__", TypeNameString),
+ list__length(TypeArgs, TypeArity),
+ string__int_to_string(TypeArity, TypeArityString),
+ string__append_list(
+ [TypeNameString, "__arity", TypeArityString, "__"],
+ String)
+ ;
+ error("type_to_string: invalid type")
+ ).
+
+%----------------------------------------------------------------------------%
Index: compiler/hlds_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_data.m,v
retrieving revision 1.82
diff -u -b -r1.82 hlds_data.m
--- compiler/hlds_data.m 21 Dec 2003 05:04:33 -0000 1.82
+++ compiler/hlds_data.m 22 Mar 2004 16:02:59 -0000
@@ -13,6 +13,7 @@
:- interface.
+:- import_module backend_libs.
:- import_module backend_libs__rtti.
:- import_module hlds__hlds_pred.
:- import_module parse_tree__inst.
Index: compiler/hlds_llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_llds.m,v
retrieving revision 1.2
diff -u -b -r1.2 hlds_llds.m
--- compiler/hlds_llds.m 15 Mar 2003 03:08:50 -0000 1.2
+++ compiler/hlds_llds.m 22 Mar 2004 16:09:51 -0000
@@ -14,6 +14,8 @@
:- interface.
:- import_module hlds__hlds_goal.
+:- import_module ll_backend. % XXX should make specialized types
+ % to avoid these imports
:- import_module ll_backend__llds.
:- import_module parse_tree__prog_data.
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.96
diff -u -b -r1.96 hlds_module.m
--- compiler/hlds_module.m 19 Mar 2004 11:13:14 -0000 1.96
+++ compiler/hlds_module.m 22 Mar 2004 16:03:17 -0000
@@ -22,6 +22,7 @@
:- interface.
:- import_module analysis.
+:- import_module backend_libs.
:- import_module backend_libs__foreign.
:- import_module check_hlds__unify_proc.
:- import_module hlds__hlds_data.
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.325
diff -u -b -r1.325 hlds_out.m
--- compiler/hlds_out.m 23 Mar 2004 06:56:40 -0000 1.325
+++ compiler/hlds_out.m 23 Mar 2004 07:42:30 -0000
@@ -249,10 +249,9 @@
:- 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.
:- import_module aditi_backend__rl.
% LLDS back-end modules (XXX should avoid using those here).
@@ -262,6 +261,7 @@
:- import_module ll_backend__llds_out.
% Misc
+:- import_module backend_libs.
:- import_module backend_libs__foreign.
:- import_module backend_libs__rtti.
:- import_module libs__globals.
@@ -3397,12 +3397,11 @@
( string__contains_char(Verbose, 't') ->
hlds_out__write_indent(Indent, !IO),
io__write_string("% Arg size properties: ", !IO),
- termination__write_maybe_arg_size_info(MaybeArgSize, yes, !IO),
+ write_maybe_arg_size_info(MaybeArgSize, yes, !IO),
io__nl(!IO),
hlds_out__write_indent(Indent, !IO),
io__write_string("% Termination properties: ", !IO),
- termination__write_maybe_termination_info(MaybeTermination,
- yes, !IO),
+ write_maybe_termination_info(MaybeTermination, yes, !IO),
io__nl(!IO)
;
true
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.139
diff -u -b -r1.139 hlds_pred.m
--- compiler/hlds_pred.m 12 Feb 2004 03:36:14 -0000 1.139
+++ compiler/hlds_pred.m 22 Mar 2004 16:04:04 -0000
@@ -2693,7 +2693,9 @@
:- implementation.
-:- import_module backend_libs__builtin_ops, hlds__special_pred.
+:- import_module backend_libs.
+:- import_module backend_libs__builtin_ops.
+:- import_module hlds__special_pred.
pred_info_is_builtin(PredInfo) :-
ModuleName = pred_info_module(PredInfo),
Index: compiler/inlining.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.115
diff -u -b -r1.115 inlining.m
--- compiler/inlining.m 21 Dec 2003 05:04:34 -0000 1.115
+++ compiler/inlining.m 23 Mar 2004 10:22:58 -0000
@@ -162,7 +162,6 @@
:- 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.
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.157
diff -u -b -r1.157 intermod.m
--- compiler/intermod.m 19 Mar 2004 10:19:20 -0000 1.157
+++ compiler/intermod.m 23 Mar 2004 10:23:20 -0000
@@ -89,6 +89,7 @@
:- implementation.
+:- import_module backend_libs.
:- import_module backend_libs__foreign.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
@@ -103,7 +104,6 @@
:- 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.
Index: compiler/ite_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ite_gen.m,v
retrieving revision 1.72
diff -u -b -r1.72 ite_gen.m
--- compiler/ite_gen.m 27 Oct 2003 05:42:36 -0000 1.72
+++ compiler/ite_gen.m 22 Mar 2004 15:54:16 -0000
@@ -18,7 +18,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
:- import_module ll_backend__llds.
Index: compiler/lambda.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lambda.m,v
retrieving revision 1.86
diff -u -b -r1.86 lambda.m
--- compiler/lambda.m 21 Dec 2003 05:04:34 -0000 1.86
+++ compiler/lambda.m 22 Mar 2004 15:58:48 -0000
@@ -83,9 +83,6 @@
:- implementation.
-:- import_module backend_libs__code_model. % XXX for some back-end dependent
- % optimizations
-
% Parse tree modules
:- import_module parse_tree__prog_data.
:- import_module parse_tree__prog_util.
@@ -94,6 +91,7 @@
:- import_module check_hlds__inst_match.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
Index: compiler/live_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/live_vars.m,v
retrieving revision 1.103
diff -u -b -r1.103 live_vars.m
--- compiler/live_vars.m 21 Dec 2003 05:04:34 -0000 1.103
+++ compiler/live_vars.m 22 Mar 2004 16:45:52 -0000
@@ -61,13 +61,13 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__mode_util.
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_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.
Index: compiler/liveness.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/liveness.m,v
retrieving revision 1.126
diff -u -b -r1.126 liveness.m
--- compiler/liveness.m 5 Nov 2003 03:17:38 -0000 1.126
+++ compiler/liveness.m 22 Mar 2004 16:46:00 -0000
@@ -185,6 +185,8 @@
% HLDS modules
:- import_module check_hlds__mode_util.
:- import_module check_hlds__polymorphism.
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__goal_form.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
@@ -195,12 +197,8 @@
:- import_module hlds__quantification.
% LLDS modules
-:- import_module ll_backend__arg_info.
:- 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__globals.
Index: compiler/ll_backend.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ll_backend.m,v
retrieving revision 1.6
diff -u -b -r1.6 ll_backend.m
--- compiler/ll_backend.m 5 Jun 2003 04:16:20 -0000 1.6
+++ compiler/ll_backend.m 23 Mar 2004 09:24:37 -0000
@@ -11,18 +11,13 @@
:- interface.
:- import_module aditi_backend. % XXX for rl_file, used in llds_out.
-:- 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?
%-----------------------------------------------------------------------------%
% Pre-passes to transform or annotate the HLDS
:- include_module deep_profiling. % transform
-:- include_module arg_info. % annotate
:- include_module saved_vars. % transform
:- include_module stack_opt. % transform
:- include_module follow_code. % transform
@@ -93,6 +88,12 @@
:- include_module layout_out.
:- include_module rtti_out.
+:- implementation.
+
+:- import_module check_hlds. % needed for type_util, mode_util etc
+:- import_module backend_libs.
+:- import_module libs.
+
:- end_module ll_backend.
%-----------------------------------------------------------------------------%
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.297
diff -u -b -r1.297 llds.m
--- compiler/llds.m 8 Mar 2004 09:12:24 -0000 1.297
+++ compiler/llds.m 22 Mar 2004 16:05:47 -0000
@@ -17,10 +17,10 @@
:- interface.
:- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__foreign.
:- import_module backend_libs__proc_label.
:- import_module backend_libs__rtti.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_pred.
:- import_module libs__tree.
Index: compiler/lookup_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_switch.m,v
retrieving revision 1.51
diff -u -b -r1.51 lookup_switch.m
--- compiler/lookup_switch.m 27 Oct 2003 05:42:36 -0000 1.51
+++ compiler/lookup_switch.m 22 Mar 2004 15:54:42 -0000
@@ -41,8 +41,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_llds.
Index: compiler/loop_inv.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/loop_inv.m,v
retrieving revision 1.8
diff -u -b -r1.8 loop_inv.m
--- compiler/loop_inv.m 19 Mar 2004 10:19:20 -0000 1.8
+++ compiler/loop_inv.m 22 Mar 2004 15:58:55 -0000
@@ -118,12 +118,12 @@
:- implementation.
-:- 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__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__instmap.
Index: compiler/magic.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/magic.m,v
retrieving revision 1.41
diff -u -b -r1.41 magic.m
--- compiler/magic.m 21 Dec 2003 05:04:34 -0000 1.41
+++ compiler/magic.m 23 Mar 2004 08:55:18 -0000
@@ -190,6 +190,7 @@
:- import_module hlds__quantification.
:- import_module libs__globals.
:- import_module libs__options.
+:- import_module ll_backend.
:- import_module ll_backend__saved_vars.
:- import_module parse_tree__inst.
:- import_module parse_tree__prog_data.
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.463
diff -u -b -r1.463 make_hlds.m
--- compiler/make_hlds.m 23 Mar 2004 06:56:40 -0000 1.463
+++ compiler/make_hlds.m 23 Mar 2004 07:42:32 -0000
@@ -97,6 +97,7 @@
:- implementation.
+:- import_module backend_libs.
:- import_module backend_libs__export.
:- import_module backend_libs__foreign.
:- import_module check_hlds__clause_to_proc.
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.304
diff -u -b -r1.304 mercury_compile.m
--- compiler/mercury_compile.m 19 Mar 2004 11:13:15 -0000 1.304
+++ compiler/mercury_compile.m 22 Mar 2004 16:46:31 -0000
@@ -88,7 +88,6 @@
:- 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.
@@ -134,6 +133,7 @@
:- import_module backend_libs__compile_target_code.
:- import_module backend_libs__name_mangle.
:- import_module check_hlds__goal_path.
+:- import_module hlds__arg_info.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_out.
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.236
diff -u -b -r1.236 mercury_to_mercury.m
--- compiler/mercury_to_mercury.m 21 Dec 2003 05:04:36 -0000 1.236
+++ compiler/mercury_to_mercury.m 22 Mar 2004 14:09:25 -0000
@@ -350,6 +350,24 @@
io__state).
:- mode mercury_output_instance_methods(in, di, uo) is det.
+ % This predicate outputs termination_info pragmas;
+ % such annotations can be part of .opt and .trans_opt files.
+
+:- pred write_pragma_termination_info(pred_or_func::in, sym_name::in,
+ list(mode)::in, prog_context::in,
+ maybe(generic_arg_size_info(T))::in,
+ maybe(generic_termination_info(T))::in, io::di, io::uo) is det.
+
+ % Write the given arg size info. Verbose if the second arg is yes.
+
+:- pred write_maybe_arg_size_info(maybe(generic_arg_size_info(T))::in,
+ bool::in, io::di, io::uo) is det.
+
+ % Write the given termination info. Verbose if the second arg is yes.
+
+:- pred write_maybe_termination_info(maybe(generic_termination_info(T))::in,
+ bool::in, io::di, io::uo) is det.
+
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -367,8 +385,6 @@
:- 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.
@@ -640,13 +656,9 @@
{ Pragma = termination_info(PredOrFunc, PredName,
ModeList, MaybePragmaArgSizeInfo,
MaybePragmaTerminationInfo) },
- { add_context_to_arg_size_info(MaybePragmaArgSizeInfo, Context,
- MaybeArgSizeInfo) },
- { add_context_to_termination_info(MaybePragmaTerminationInfo,
- Context, MaybeTerminationInfo) },
- termination__write_pragma_termination_info(PredOrFunc,
- PredName, ModeList, Context,
- MaybeArgSizeInfo, MaybeTerminationInfo)
+ write_pragma_termination_info(PredOrFunc, PredName, ModeList,
+ Context, MaybePragmaArgSizeInfo,
+ MaybePragmaTerminationInfo)
;
{ Pragma = terminates(Pred, Arity) },
mercury_output_pragma_decl(Pred, Arity, predicate, "terminates")
@@ -3989,3 +4001,88 @@
Inst \= defined_inst(user_inst(_, _)).
%-----------------------------------------------------------------------------%
+
+ % These predicates are used to print out the termination_info pragmas.
+ % If they are changed, then prog_io_pragma.m must also be changed
+ % so that it can parse the resulting pragma termination_info
+ % declarations.
+
+write_pragma_termination_info(PredOrFunc, SymName, ModeList, Context,
+ MaybeArgSize, MaybeTermination, !IO) :-
+ io__write_string(":- pragma termination_info(", !IO),
+ varset__init(InitVarSet),
+ (
+ PredOrFunc = predicate,
+ mercury_output_pred_mode_subdecl(InitVarSet, SymName,
+ ModeList, no, Context, !IO)
+ ;
+ PredOrFunc = function,
+ pred_args_to_func_args(ModeList, FuncModeList, RetMode),
+ mercury_output_func_mode_subdecl(InitVarSet, SymName,
+ FuncModeList, RetMode, no, Context, !IO)
+ ),
+ io__write_string(", ", !IO),
+ write_maybe_arg_size_info(MaybeArgSize, no, !IO),
+ io__write_string(", ", !IO),
+ write_maybe_termination_info(MaybeTermination, no, !IO),
+ io__write_string(").\n", !IO).
+
+write_maybe_arg_size_info(MaybeArgSizeInfo, Verbose, !IO) :-
+ (
+ MaybeArgSizeInfo = no,
+ io__write_string("not_set", !IO)
+ ;
+ MaybeArgSizeInfo = yes(infinite(Error)),
+ io__write_string("infinite", !IO),
+ ( Verbose = yes ->
+ io__write_string("(", !IO),
+ io__write(Error, !IO),
+ io__write_string(")", !IO)
+ ;
+ true
+ )
+ ;
+ MaybeArgSizeInfo = yes(finite(Const, UsedArgs)),
+ io__write_string("finite(", !IO),
+ io__write_int(Const, !IO),
+ io__write_string(", ", !IO),
+ write_used_args(UsedArgs, !IO),
+ io__write_string(")", !IO)
+ ).
+
+:- pred write_used_args(list(bool)::in, io::di, io::uo) is det.
+
+write_used_args([], !IO) :-
+ io__write_string("[]", !IO).
+write_used_args([UsedArg | UsedArgs], !IO) :-
+ io__write_string("[", !IO),
+ io__write(UsedArg, !IO),
+ write_used_args_2(UsedArgs, !IO),
+ io__write_string("]", !IO).
+
+:- pred write_used_args_2(list(bool)::in, io::di, io::uo) is det.
+
+write_used_args_2([], !IO).
+write_used_args_2([ UsedArg | UsedArgs ], !IO) :-
+ io__write_string(", ", !IO),
+ io__write(UsedArg, !IO),
+ write_used_args_2(UsedArgs, !IO).
+
+write_maybe_termination_info(MaybeTerminationInfo, Verbose, !IO) :-
+ (
+ MaybeTerminationInfo = no,
+ io__write_string("not_set", !IO)
+ ;
+ MaybeTerminationInfo = yes(cannot_loop),
+ io__write_string("cannot_loop", !IO)
+ ;
+ MaybeTerminationInfo = yes(can_loop(Error)),
+ io__write_string("can_loop", !IO),
+ ( Verbose = yes ->
+ io__write_string("(", !IO),
+ io__write(Error, !IO),
+ io__write_string(")", !IO)
+ ;
+ true
+ )
+ ).
Index: compiler/middle_rec.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/middle_rec.m,v
retrieving revision 1.97
diff -u -b -r1.97 middle_rec.m
--- compiler/middle_rec.m 27 Oct 2003 05:42:36 -0000 1.97
+++ compiler/middle_rec.m 22 Mar 2004 15:54:50 -0000
@@ -28,7 +28,7 @@
:- implementation.
:- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__goal_form.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_llds.
Index: compiler/ml_backend.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_backend.m,v
retrieving revision 1.6
diff -u -b -r1.6 ml_backend.m
--- compiler/ml_backend.m 1 Dec 2003 15:55:43 -0000 1.6
+++ compiler/ml_backend.m 23 Mar 2004 09:31:13 -0000
@@ -22,13 +22,8 @@
:- module ml_backend.
:- interface.
-:- 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?
-:- import_module aditi_backend. % need aditi_backend.rl_file
%-----------------------------------------------------------------------------%
@@ -81,7 +76,11 @@
:- implementation.
-% :- import_module ll_backend. % Needed and imported in ml_closure_gen.m.
+:- import_module backend_libs.
+:- import_module libs.
+:- import_module check_hlds. % is this needed?
+:- import_module transform_hlds. % is this needed?
+:- import_module aditi_backend. % need aditi_backend.rl_file
:- end_module ml_backend.
Index: compiler/ml_call_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_call_gen.m,v
retrieving revision 1.45
diff -u -b -r1.45 ml_call_gen.m
--- compiler/ml_call_gen.m 19 Mar 2004 10:19:22 -0000 1.45
+++ compiler/ml_call_gen.m 22 Mar 2004 15:54:54 -0000
@@ -16,7 +16,7 @@
:- module ml_backend__ml_call_gen.
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_pred.
:- import_module ml_backend__ml_code_util.
Index: compiler/ml_closure_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_closure_gen.m,v
retrieving revision 1.26
diff -u -b -r1.26 ml_closure_gen.m
--- compiler/ml_closure_gen.m 19 Mar 2004 10:19:22 -0000 1.26
+++ compiler/ml_closure_gen.m 22 Mar 2004 15:55:01 -0000
@@ -78,11 +78,11 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__pseudo_type_info.
:- import_module backend_libs__rtti.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_module.
:- import_module libs__globals.
:- import_module libs__options.
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.136
diff -u -b -r1.136 ml_code_gen.m
--- compiler/ml_code_gen.m 19 Mar 2004 10:19:22 -0000 1.136
+++ compiler/ml_code_gen.m 22 Mar 2004 15:55:05 -0000
@@ -721,7 +721,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_module.
:- import_module ml_backend__ml_code_util.
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.79
diff -u -b -r1.79 ml_code_util.m
--- compiler/ml_code_util.m 23 Mar 2004 06:56:41 -0000 1.79
+++ compiler/ml_code_util.m 23 Mar 2004 07:42:33 -0000
@@ -15,14 +15,14 @@
:- module ml_backend__ml_code_util.
:- interface.
-:- import_module parse_tree__prog_data.
-:- import_module hlds__hlds_module.
-:- import_module hlds__hlds_pred.
:- import_module backend_libs__builtin_ops.
:- import_module backend_libs__rtti.
-:- import_module backend_libs__code_model.
-:- import_module ml_backend__mlds.
+:- import_module hlds__code_model.
+:- import_module hlds__hlds_module.
+:- import_module hlds__hlds_pred.
:- import_module libs__globals.
+:- import_module ml_backend__mlds.
+:- import_module parse_tree__prog_data.
:- import_module bool, int, list, map, std_util.
Index: compiler/ml_string_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_string_switch.m,v
retrieving revision 1.15
diff -u -b -r1.15 ml_string_switch.m
--- compiler/ml_string_switch.m 20 Feb 2004 02:39:57 -0000 1.15
+++ compiler/ml_string_switch.m 22 Mar 2004 15:55:25 -0000
@@ -19,8 +19,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module ml_backend__ml_code_util.
:- import_module ml_backend__mlds.
Index: compiler/ml_switch_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_switch_gen.m,v
retrieving revision 1.15
diff -u -b -r1.15 ml_switch_gen.m
--- compiler/ml_switch_gen.m 20 Feb 2004 02:39:57 -0000 1.15
+++ compiler/ml_switch_gen.m 22 Mar 2004 15:55:28 -0000
@@ -62,7 +62,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module libs__globals.
Index: compiler/ml_tag_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_tag_switch.m,v
retrieving revision 1.8
diff -u -b -r1.8 ml_tag_switch.m
--- compiler/ml_tag_switch.m 20 Feb 2004 02:39:57 -0000 1.8
+++ compiler/ml_tag_switch.m 22 Mar 2004 15:55:31 -0000
@@ -15,8 +15,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module ml_backend__ml_code_util.
:- import_module ml_backend__mlds.
Index: compiler/ml_unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_unify_gen.m,v
retrieving revision 1.71
diff -u -b -r1.71 ml_unify_gen.m
--- compiler/ml_unify_gen.m 19 Mar 2004 10:19:23 -0000 1.71
+++ compiler/ml_unify_gen.m 22 Mar 2004 15:55:34 -0000
@@ -15,7 +15,7 @@
:- module ml_backend__ml_unify_gen.
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_module.
Index: compiler/mlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds.m,v
retrieving revision 1.110
diff -u -b -r1.110 mlds.m
--- compiler/mlds.m 19 Mar 2004 10:19:23 -0000 1.110
+++ compiler/mlds.m 22 Mar 2004 15:55:42 -0000
@@ -328,10 +328,10 @@
:- interface.
:- 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__code_model.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
:- import_module libs__globals.
Index: compiler/mlds_to_c.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.161
diff -u -b -r1.161 mlds_to_c.m
--- compiler/mlds_to_c.m 19 Mar 2004 10:19:23 -0000 1.161
+++ compiler/mlds_to_c.m 22 Mar 2004 15:55:55 -0000
@@ -65,11 +65,11 @@
:- 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__name_mangle.
:- import_module backend_libs__rtti. % for rtti__addr_to_string.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_pred. % for pred_proc_id.
:- import_module hlds__passes_aux.
:- import_module libs__globals.
Index: compiler/mlds_to_gcc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_gcc.m,v
retrieving revision 1.94
diff -u -b -r1.94 mlds_to_gcc.m
--- compiler/mlds_to_gcc.m 19 Mar 2004 10:19:23 -0000 1.94
+++ compiler/mlds_to_gcc.m 22 Mar 2004 15:56:01 -0000
@@ -159,11 +159,11 @@
% XXX some of these imports might be unused
:- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__name_mangle.
:- import_module backend_libs__pseudo_type_info.
:- import_module backend_libs__rtti. % for rtti__addr_to_string.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_pred. % for proc_id_to_int and invalid_pred_id
:- import_module hlds__passes_aux.
:- import_module libs__globals.
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.139
diff -u -b -r1.139 mlds_to_il.m
--- compiler/mlds_to_il.m 19 Mar 2004 10:19:23 -0000 1.139
+++ compiler/mlds_to_il.m 22 Mar 2004 15:56:08 -0000
@@ -136,12 +136,12 @@
:- 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__name_mangle.
:- import_module backend_libs__pseudo_type_info.
:- import_module backend_libs__rtti.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__passes_aux.
:- import_module libs__globals.
:- import_module libs__options.
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.137
diff -u -b -r1.137 opt_debug.m
--- compiler/opt_debug.m 3 Feb 2004 05:40:01 -0000 1.137
+++ compiler/opt_debug.m 22 Mar 2004 15:56:17 -0000
@@ -15,9 +15,9 @@
:- interface.
:- import_module backend_libs__builtin_ops.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__proc_label.
:- import_module backend_libs__rtti.
+:- import_module hlds__code_model.
:- import_module ll_backend__layout.
:- import_module ll_backend__livemap.
:- import_module ll_backend__llds.
Index: compiler/par_conj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/par_conj_gen.m,v
retrieving revision 1.14
diff -u -b -r1.14 par_conj_gen.m
--- compiler/par_conj_gen.m 27 Oct 2003 05:42:36 -0000 1.14
+++ compiler/par_conj_gen.m 22 Mar 2004 15:56:24 -0000
@@ -96,7 +96,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
:- import_module ll_backend__llds.
Index: compiler/parse_tree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/parse_tree.m,v
retrieving revision 1.5
diff -u -b -r1.5 parse_tree.m
--- compiler/parse_tree.m 19 Mar 2004 10:19:24 -0000 1.5
+++ compiler/parse_tree.m 22 Mar 2004 13:43:35 -0000
@@ -63,13 +63,6 @@
:- implementation.
:- import_module check_hlds. % XXX for type_util.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.
%-----------------------------------------------------------------------------%
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.250
diff -u -b -r1.250 polymorphism.m
--- compiler/polymorphism.m 5 Feb 2004 01:54:20 -0000 1.250
+++ compiler/polymorphism.m 22 Mar 2004 16:33:48 -0000
@@ -339,7 +339,6 @@
:- implementation.
-:- import_module backend_libs__base_typeclass_info.
:- import_module check_hlds__clause_to_proc.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__purity.
@@ -347,6 +346,7 @@
:- import_module check_hlds__typecheck.
:- import_module check_hlds__unify_proc.
:- import_module hlds__goal_util.
+:- import_module hlds__hlds_code_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_out.
:- import_module hlds__instmap.
@@ -2339,8 +2339,7 @@
map__lookup(InstanceTable, ClassId, InstanceList),
list__index1_det(InstanceList, InstanceNum, InstanceDefn),
InstanceModuleName = InstanceDefn ^ instance_module,
- base_typeclass_info__make_instance_string(InstanceTypes,
- InstanceString),
+ make_instance_string(InstanceTypes, InstanceString),
ConsId = base_typeclass_info_const(InstanceModuleName, ClassId,
InstanceNum, InstanceString),
BaseTypeClassInfoTerm = functor(ConsId, no, []),
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.66
diff -u -b -r1.66 pragma_c_gen.m
--- compiler/pragma_c_gen.m 19 Mar 2004 10:19:24 -0000 1.66
+++ compiler/pragma_c_gen.m 22 Mar 2004 15:56:27 -0000
@@ -21,7 +21,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_pred.
:- import_module ll_backend__code_info.
Index: compiler/prog_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_data.m,v
retrieving revision 1.105
diff -u -b -r1.105 prog_data.m
--- compiler/prog_data.m 25 Feb 2004 02:38:49 -0000 1.105
+++ compiler/prog_data.m 23 Mar 2004 08:34:42 -0000
@@ -602,21 +602,25 @@
% See term_util.m.
%
-:- type pragma_arg_size_info
+:- type generic_arg_size_info(ErrorInfo)
---> finite(int, list(bool))
% The termination constant is a finite integer.
% The list of bool has a 1:1 correspondence
% with the input arguments of the procedure.
% It stores whether the argument contributes
% to the size of the output arguments.
- ; infinite.
+ ; infinite(ErrorInfo).
% There is no finite integer for which the
% above equation is true.
-:- type pragma_termination_info
+:- type generic_termination_info(ErrorInfo)
---> cannot_loop % This procedure definitely terminates for all
% possible inputs.
- ; can_loop. % This procedure might not terminate.
+ ; can_loop(ErrorInfo).
+ % This procedure might not terminate.
+
+:- type pragma_arg_size_info == generic_arg_size_info(unit).
+:- type pragma_termination_info == generic_termination_info(unit).
%
% Stuff for the `unused_args' pragma.
@@ -1351,8 +1355,6 @@
%-----------------------------------------------------------------------------%
:- implementation.
-
-:- import_module check_hlds__purity.
:- import_module string.
Index: compiler/prog_io_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_goal.m,v
retrieving revision 1.26
diff -u -b -r1.26 prog_io_goal.m
--- compiler/prog_io_goal.m 31 Oct 2003 03:27:28 -0000 1.26
+++ compiler/prog_io_goal.m 22 Mar 2004 14:18:14 -0000
@@ -101,7 +101,6 @@
:- 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.
Index: compiler/prog_io_pragma.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
retrieving revision 1.64
diff -u -b -r1.64 prog_io_pragma.m
--- compiler/prog_io_pragma.m 12 Feb 2004 03:36:15 -0000 1.64
+++ compiler/prog_io_pragma.m 22 Mar 2004 14:19:39 -0000
@@ -28,8 +28,6 @@
:- import_module parse_tree__prog_io.
:- import_module parse_tree__prog_io_goal.
:- import_module parse_tree__prog_util.
-:- import_module transform_hlds__term_errors.
-:- import_module transform_hlds__term_util.
:- import_module int, map, string, std_util, bool, require, set.
@@ -1068,7 +1066,7 @@
MaybeArgSizeInfo = no
;
ArgSizeTerm = term__functor(term__atom("infinite"), [], _),
- MaybeArgSizeInfo = yes(infinite)
+ MaybeArgSizeInfo = yes(infinite(unit))
;
ArgSizeTerm = term__functor(term__atom("finite"),
[IntTerm, UsedArgsTerm], _),
@@ -1081,7 +1079,7 @@
MaybeTerminationInfo = no
;
TerminationTerm = term__functor(term__atom("can_loop"), [], _),
- MaybeTerminationInfo = yes(can_loop)
+ MaybeTerminationInfo = yes(can_loop(unit))
;
TerminationTerm = term__functor(term__atom("cannot_loop"),
[], _),
@@ -1697,4 +1695,3 @@
term__coerce_var(TypeVar0, TypeVar),
convert_type(SpecTypeTerm0, SpecType),
TypeSpec = TypeVar - SpecType.
-
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.37
diff -u -b -r1.37 rl_exprn.m
--- compiler/rl_exprn.m 19 Mar 2004 10:19:25 -0000 1.37
+++ compiler/rl_exprn.m 23 Mar 2004 08:40:59 -0000
@@ -131,6 +131,7 @@
:- implementation.
:- import_module aditi_backend__rl_out.
+:- import_module backend_libs.
:- import_module backend_libs__builtin_ops.
:- import_module check_hlds__inst_match.
:- import_module check_hlds__mode_util.
Index: compiler/rtti.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.43
diff -u -b -r1.43 rtti.m
--- compiler/rtti.m 20 Feb 2004 04:43:44 -0000 1.43
+++ compiler/rtti.m 22 Mar 2004 15:56:30 -0000
@@ -24,7 +24,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_pred.
Index: compiler/stack_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_alloc.m,v
retrieving revision 1.5
diff -u -b -r1.5 stack_alloc.m
--- compiler/stack_alloc.m 24 Oct 2003 06:17:48 -0000 1.5
+++ compiler/stack_alloc.m 22 Mar 2004 15:56:39 -0000
@@ -38,8 +38,8 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__goal_path.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module hlds__hlds_llds.
Index: compiler/stack_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_opt.m,v
retrieving revision 1.10
diff -u -b -r1.10 stack_opt.m
--- compiler/stack_opt.m 24 Oct 2003 06:17:48 -0000 1.10
+++ compiler/stack_opt.m 22 Mar 2004 16:46:40 -0000
@@ -84,12 +84,13 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__matching.
:- import_module check_hlds__goal_path.
:- import_module check_hlds__inst_match.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__arg_info.
+:- import_module hlds__code_model.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
@@ -99,7 +100,6 @@
:- 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.
Index: compiler/store_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/store_alloc.m,v
retrieving revision 1.84
diff -u -b -r1.84 store_alloc.m
--- compiler/store_alloc.m 24 Oct 2003 06:17:48 -0000 1.84
+++ compiler/store_alloc.m 22 Mar 2004 16:52:58 -0000
@@ -49,7 +49,7 @@
:- import_module libs__globals.
:- import_module libs__options.
:- import_module libs__trace_params.
-:- import_module ll_backend__arg_info.
+:- import_module ll_backend__code_util.
:- import_module ll_backend__follow_vars.
:- import_module ll_backend__liveness.
:- import_module ll_backend__llds.
@@ -88,7 +88,7 @@
;
set__init(ResumeVars0)
),
- arg_info__build_input_arg_list(!.ProcInfo, InputArgLvals),
+ build_input_arg_list(!.ProcInfo, InputArgLvals),
LastLocns0 = initial_last_locns(InputArgLvals),
proc_info_stack_slots(!.ProcInfo, StackSlots),
StoreAllocInfo = store_alloc_info(ModuleInfo, StackSlots),
Index: compiler/string_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/string_switch.m,v
retrieving revision 1.45
diff -u -b -r1.45 string_switch.m
--- compiler/string_switch.m 27 Oct 2003 05:42:36 -0000 1.45
+++ compiler/string_switch.m 22 Mar 2004 15:56:49 -0000
@@ -17,8 +17,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
Index: compiler/switch_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/switch_gen.m,v
retrieving revision 1.83
diff -u -b -r1.83 switch_gen.m
--- compiler/switch_gen.m 27 Oct 2003 05:42:37 -0000 1.83
+++ compiler/switch_gen.m 22 Mar 2004 15:56:57 -0000
@@ -45,7 +45,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.57
diff -u -b -r1.57 table_gen.m
--- compiler/table_gen.m 19 Mar 2004 10:19:25 -0000 1.57
+++ compiler/table_gen.m 23 Mar 2004 10:23:28 -0000
@@ -242,7 +242,7 @@
:- implementation.
-:- import_module backend_libs__code_model.
+:- import_module backend_libs.
:- import_module backend_libs__rtti.
:- import_module check_hlds__det_analysis.
:- import_module check_hlds__inst_match.
@@ -251,6 +251,7 @@
:- import_module check_hlds__polymorphism.
:- import_module check_hlds__purity.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__goal_util.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_error_util.
@@ -263,11 +264,8 @@
:- 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.
:- import_module ll_backend__continuation_info.
-:- import_module ll_backend__follow_code.
-:- import_module ll_backend__llds.
:- import_module parse_tree__error_util.
:- import_module parse_tree__inst.
:- import_module parse_tree__prog_data.
Index: compiler/tag_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tag_switch.m,v
retrieving revision 1.58
diff -u -b -r1.58 tag_switch.m
--- compiler/tag_switch.m 5 Nov 2003 03:17:44 -0000 1.58
+++ compiler/tag_switch.m 22 Mar 2004 15:57:04 -0000
@@ -14,8 +14,8 @@
:- interface.
-:- import_module backend_libs__code_model.
:- import_module backend_libs__switch_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
Index: compiler/term_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_util.m,v
retrieving revision 1.35
diff -u -b -r1.35 term_util.m
--- compiler/term_util.m 19 Mar 2004 10:19:26 -0000 1.35
+++ compiler/term_util.m 22 Mar 2004 14:19:52 -0000
@@ -47,27 +47,11 @@
%
% where | | represents a semilinear norm.
-:- type arg_size_info
- ---> finite(int, list(bool))
- % The termination constant is a finite integer.
- % The list of bool has a 1:1 correspondence
- % with the input arguments of the procedure.
- % It stores whether the argument contributes
- % to the size of the output arguments.
-
- ; infinite(list(term_errors__error)).
- % There is no finite integer for which the
- % above equation is true. The argument says
- % why the analysis failed to find a finite
- % constant.
-
-:- type termination_info
- ---> cannot_loop % This procedure terminates for all
- % possible inputs.
-
- ; can_loop(list(term_errors__error)).
- % The analysis could not prove that the
- % procedure terminates.
+:- type arg_size_info ==
+ generic_arg_size_info(list(term_errors__error)).
+
+:- type termination_info ==
+ generic_termination_info(list(term_errors__error)).
% The type `used_args' holds a mapping which specifies for each procedure
% which of its arguments are used.
@@ -148,14 +132,14 @@
%-----------------------------------------------------------------------------%
-% Convert a prog_data__pragma_termination_info into a
-% term_util__termination_info, by adding the appropriate context.
+ % Convert a prog_data__pragma_termination_info into a
+ % term_util__termination_info, by adding the appropriate context.
:- pred add_context_to_termination_info(maybe(pragma_termination_info)::in,
prog_context::in, maybe(termination_info)::out) is det.
-% Convert a prog_data__pragma_arg_size_info into a
-% term_util__arg_size_info, by adding the appropriate context.
+ % Convert a prog_data__pragma_arg_size_info into a
+ % term_util__arg_size_info, by adding the appropriate context.
:- pred add_context_to_arg_size_info(maybe(pragma_arg_size_info)::in,
prog_context::in, maybe(arg_size_info)::out) is det.
@@ -354,12 +338,12 @@
add_context_to_termination_info(no, _, no).
add_context_to_termination_info(yes(cannot_loop), _, yes(cannot_loop)).
-add_context_to_termination_info(yes(can_loop), Context,
+add_context_to_termination_info(yes(can_loop(_)), Context,
yes(can_loop([Context - imported_pred]))).
add_context_to_arg_size_info(no, _, no).
add_context_to_arg_size_info(yes(finite(A, B)), _, yes(finite(A, B))).
-add_context_to_arg_size_info(yes(infinite), Context,
+add_context_to_arg_size_info(yes(infinite(_)), Context,
yes(infinite([Context - imported_pred]))).
%-----------------------------------------------------------------------------%
Index: compiler/termination.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.39
diff -u -b -r1.39 termination.m
--- compiler/termination.m 19 Mar 2004 10:19:26 -0000 1.39
+++ compiler/termination.m 22 Mar 2004 14:20:06 -0000
@@ -48,40 +48,20 @@
:- 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.
+:- import_module io.
% Perform termination analysis on the module.
:- pred termination__pass(module_info::in, module_info::out,
io::di, io::uo) is det.
- % Write the given arg size info; verbose if the second arg is yes.
-
-:- pred termination__write_maybe_arg_size_info(maybe(arg_size_info)::in,
- bool::in, io::di, io::uo) is det.
-
- % Write the given termination info; verbose if the second arg is yes.
-
-:- pred termination__write_maybe_termination_info(maybe(termination_info)::in,
- bool::in, io::di, io::uo) is det.
-
% Write out a termination_info pragma for the predicate if it
% is exported, it is not a builtin and it is not a predicate used
% to force type specialization.
:- pred termination__write_pred_termination_info(module_info::in, pred_id::in,
io::di, io::uo) is det.
- % This predicate outputs termination_info pragmas;
- % such annotations can be part of .opt and .trans_opt files.
-
-:- pred termination__write_pragma_termination_info(pred_or_func::in,
- sym_name::in, list(mode)::in, prog_context::in,
- maybe(arg_size_info)::in, maybe(termination_info)::in,
- io::di, io::uo) is det.
-
%----------------------------------------------------------------------------%
%----------------------------------------------------------------------------%
@@ -101,6 +81,7 @@
:- import_module parse_tree__error_util.
:- import_module parse_tree__mercury_to_mercury.
:- import_module parse_tree__modules.
+:- import_module parse_tree__prog_data.
:- import_module parse_tree__prog_out.
:- import_module parse_tree__prog_util.
:- import_module transform_hlds__dependency_graph.
@@ -108,7 +89,9 @@
:- import_module transform_hlds__term_norm.
:- import_module transform_hlds__term_pass1.
:- import_module transform_hlds__term_pass2.
+:- import_module transform_hlds__term_util.
+:- import_module bool, std_util, list.
:- import_module map, int, char, string, relation.
:- import_module require, bag, set, term.
:- import_module varset.
@@ -927,96 +910,10 @@
proc_info_get_maybe_arg_size_info(ProcInfo, ArgSize),
proc_info_get_maybe_termination_info(ProcInfo, Termination),
proc_info_declared_argmodes(ProcInfo, ModeList),
- termination__write_pragma_termination_info(PredOrFunc, SymName,
+ write_pragma_termination_info(PredOrFunc, SymName,
ModeList, Context, ArgSize, Termination, !IO),
termination__make_opt_int_procs(PredId, ProcIds, ProcTable,
PredOrFunc, SymName, Context, !IO).
-
-%----------------------------------------------------------------------------%
-
-% These predicates are used to print out the termination_info pragmas.
-% If they are changed, then prog_io_pragma.m must also be changed so that
-% it can parse the resulting pragma termination_info declarations.
-
-termination__write_pragma_termination_info(PredOrFunc, SymName, ModeList,
- Context, MaybeArgSize, MaybeTermination, !IO) :-
- io__write_string(":- pragma termination_info(", !IO),
- varset__init(InitVarSet),
- (
- PredOrFunc = predicate,
- mercury_output_pred_mode_subdecl(InitVarSet, SymName,
- ModeList, no, Context, !IO)
- ;
- PredOrFunc = function,
- pred_args_to_func_args(ModeList, FuncModeList, RetMode),
- mercury_output_func_mode_subdecl(InitVarSet, SymName,
- FuncModeList, RetMode, no, Context, !IO)
- ),
- io__write_string(", ", !IO),
- termination__write_maybe_arg_size_info(MaybeArgSize, no, !IO),
- io__write_string(", ", !IO),
- termination__write_maybe_termination_info(MaybeTermination, no, !IO),
- io__write_string(").\n", !IO).
-
-termination__write_maybe_arg_size_info(MaybeArgSizeInfo, Verbose, !IO) :-
- (
- MaybeArgSizeInfo = no,
- io__write_string("not_set", !IO)
- ;
- MaybeArgSizeInfo = yes(infinite(Error)),
- io__write_string("infinite", !IO),
- ( Verbose = yes ->
- io__write_string("(", !IO),
- io__write(Error, !IO),
- io__write_string(")", !IO)
- ;
- true
- )
- ;
- MaybeArgSizeInfo = yes(finite(Const, UsedArgs)),
- io__write_string("finite(", !IO),
- io__write_int(Const, !IO),
- io__write_string(", ", !IO),
- termination__write_used_args(UsedArgs, !IO),
- io__write_string(")", !IO)
- ).
-
-:- pred termination__write_used_args(list(bool)::in, io::di, io::uo) is det.
-
-termination__write_used_args([], !IO) :-
- io__write_string("[]", !IO).
-termination__write_used_args([UsedArg | UsedArgs], !IO) :-
- io__write_string("[", !IO),
- io__write(UsedArg, !IO),
- termination__write_used_args_2(UsedArgs, !IO),
- io__write_string("]", !IO).
-
-:- pred termination__write_used_args_2(list(bool)::in, io::di, io::uo) is det.
-
-termination__write_used_args_2([], !IO).
-termination__write_used_args_2([ UsedArg | UsedArgs ], !IO) :-
- io__write_string(", ", !IO),
- io__write(UsedArg, !IO),
- termination__write_used_args_2(UsedArgs, !IO).
-
-termination__write_maybe_termination_info(MaybeTerminationInfo, Verbose, !IO) :-
- (
- MaybeTerminationInfo = no,
- io__write_string("not_set", !IO)
- ;
- MaybeTerminationInfo = yes(cannot_loop),
- io__write_string("cannot_loop", !IO)
- ;
- MaybeTerminationInfo = yes(can_loop(Error)),
- io__write_string("can_loop", !IO),
- ( Verbose = yes ->
- io__write_string("(", !IO),
- io__write(Error, !IO),
- io__write_string(")", !IO)
- ;
- true
- )
- ).
%----------------------------------------------------------------------------%
Index: compiler/top_level.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/top_level.m,v
retrieving revision 1.3
diff -u -b -r1.3 top_level.m
--- compiler/top_level.m 15 Mar 2003 03:09:12 -0000 1.3
+++ compiler/top_level.m 23 Mar 2004 10:13:57 -0000
@@ -24,7 +24,7 @@
:- import_module ll_backend.
:- import_module ml_backend.
-% obsolete or incomplete back-ends
+% incomplete back-ends
:- import_module bytecode_backend.
% misc utilities
@@ -38,10 +38,11 @@
% Mercury compiler's .NET back-end, which assumes that main is defined
% in the program's top-level module.
:- use_module io.
-:- use_module top_level.mercury_compile.
:- pred main(io.state::di, io.state::uo) is det.
:- implementation.
+
+:- use_module top_level.mercury_compile.
main --> top_level.mercury_compile.real_main.
Index: compiler/trace.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trace.m,v
retrieving revision 1.61
diff -u -b -r1.61 trace.m
--- compiler/trace.m 27 Oct 2003 05:42:37 -0000 1.61
+++ compiler/trace.m 22 Mar 2004 15:57:07 -0000
@@ -212,10 +212,10 @@
:- implementation.
-:- import_module backend_libs__code_model.
:- import_module check_hlds__inst_match.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_llds.
:- import_module hlds__instmap.
:- import_module libs__options.
Index: compiler/trans_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.21
diff -u -b -r1.21 trans_opt.m
--- compiler/trans_opt.m 15 Mar 2003 03:09:12 -0000 1.21
+++ compiler/trans_opt.m 23 Mar 2004 10:24:12 -0000
@@ -77,7 +77,6 @@
:- 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.
:- import_module parse_tree__prog_out.
Index: compiler/transform_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/transform_hlds.m,v
retrieving revision 1.8
diff -u -b -r1.8 transform_hlds.m
--- compiler/transform_hlds.m 1 Dec 2003 15:55:49 -0000 1.8
+++ compiler/transform_hlds.m 23 Mar 2004 10:05:41 -0000
@@ -11,8 +11,9 @@
:- module transform_hlds.
:- interface.
-:- import_module check_hlds. % is this needed?
-:- import_module hlds, parse_tree, libs.
+:- import_module hlds.
+:- import_module parse_tree.
+:- import_module libs.
%-----------------------------------------------------------------------------%
@@ -64,8 +65,8 @@
%-----------------------------------------------------------------------------%
:- implementation.
-:- import_module ll_backend. % XXX for code_util, code_aux
-:- import_module backend_libs. % XXX for rtti
+
+:- import_module check_hlds.
:- end_module transform_hlds.
Index: compiler/tree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tree.m,v
retrieving revision 1.16
diff -u -b -r1.16 tree.m
--- compiler/tree.m 15 Mar 2003 03:09:12 -0000 1.16
+++ compiler/tree.m 22 Mar 2004 15:39:35 -0000
@@ -21,7 +21,8 @@
:- import_module list.
-:- type tree(T) ---> empty
+:- type tree(T)
+ ---> empty
; node(T)
; tree(tree(T), tree(T)).
@@ -30,14 +31,11 @@
% Make a tree from a list of trees.
:- func tree__list(list(tree(T))) = tree(T).
-:- pred tree__flatten(tree(T), list(T)).
-:- mode tree__flatten(in, out) is det.
+:- pred tree__flatten(tree(T)::in, list(T)::out) is det.
-:- pred tree__is_empty(tree(T)).
-:- mode tree__is_empty(in) is semidet.
+:- pred tree__is_empty(tree(T)::in) is semidet.
-:- pred tree__tree_of_lists_is_empty(tree(list(T))).
-:- mode tree__tree_of_lists_is_empty(in) is semidet.
+:- pred tree__tree_of_lists_is_empty(tree(list(T))::in) is semidet.
:- func tree__map(func(T) = U, tree(T)) = tree(U).
@@ -45,7 +43,8 @@
:- implementation.
-tree__flatten(T) = L :- tree__flatten(T, L).
+tree__flatten(T) = L :-
+ tree__flatten(T, L).
tree__list([]) = empty.
tree__list([X | Xs]) = tree(X, tree__list(Xs)).
@@ -53,10 +52,10 @@
tree__flatten(T, L) :-
tree__flatten_2(T, [], L).
-:- pred tree__flatten_2(tree(T), list(T), list(T)).
-:- mode tree__flatten_2(in, in, out) is det.
% flatten_2(T, L0, L) is true iff L is the list that results from
% traversing T left-to-right depth-first, and then appending L0.
+:- pred tree__flatten_2(tree(T)::in, list(T)::in, list(T)::out) is det.
+
tree__flatten_2(empty, L, L).
tree__flatten_2(node(T), L, [T|L]).
tree__flatten_2(tree(T1,T2), L0, L) :-
Index: compiler/type_ctor_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.54
diff -u -b -r1.54 type_ctor_info.m
--- compiler/type_ctor_info.m 23 Mar 2004 06:56:42 -0000 1.54
+++ compiler/type_ctor_info.m 23 Mar 2004 10:24:21 -0000
@@ -73,7 +73,6 @@
:- import_module hlds__special_pred.
:- import_module libs__globals.
:- import_module libs__options.
-:- import_module ll_backend__code_util.
:- import_module parse_tree__error_util.
:- import_module parse_tree__prog_data.
:- import_module parse_tree__prog_out.
Index: compiler/type_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_util.m,v
retrieving revision 1.136
diff -u -b -r1.136 type_util.m
--- compiler/type_util.m 23 Dec 2003 03:11:00 -0000 1.136
+++ compiler/type_util.m 22 Mar 2004 16:22:29 -0000
@@ -523,6 +523,7 @@
:- implementation.
+:- import_module backend_libs.
:- import_module backend_libs__foreign.
:- import_module check_hlds__purity.
:- import_module hlds__hlds_out.
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.137
diff -u -b -r1.137 unify_gen.m
--- compiler/unify_gen.m 19 Mar 2004 10:19:26 -0000 1.137
+++ compiler/unify_gen.m 22 Mar 2004 16:46:52 -0000
@@ -18,7 +18,7 @@
:- interface.
-:- import_module backend_libs__code_model.
+:- import_module hlds__code_model.
:- import_module hlds__hlds_data.
:- import_module hlds__hlds_goal.
:- import_module ll_backend__code_info.
@@ -46,13 +46,13 @@
:- import_module backend_libs__rtti.
:- import_module check_hlds__mode_util.
:- import_module check_hlds__type_util.
+:- import_module hlds__arg_info.
:- import_module hlds__hlds_module.
:- import_module hlds__hlds_out.
:- import_module hlds__hlds_pred.
:- import_module libs__globals.
:- import_module libs__options.
:- import_module libs__tree.
-:- import_module ll_backend__arg_info.
:- import_module ll_backend__code_aux.
:- import_module ll_backend__code_util.
:- import_module ll_backend__continuation_info.
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.16
diff -u -b -r1.16 unneeded_code.m
--- compiler/unneeded_code.m 5 Nov 2003 03:17:44 -0000 1.16
+++ compiler/unneeded_code.m 23 Mar 2004 10:24:29 -0000
@@ -82,7 +82,6 @@
:- import_module hlds__quantification.
:- import_module libs__globals.
:- import_module libs__options.
-:- import_module ll_backend__code_aux.
:- import_module parse_tree__prog_data.
:- import_module bool, int, list, assoc_list, map, set, std_util, require.
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list