[m-rev.] diff: split code_aux.m
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri Mar 22 17:43:20 AEDT 2002
Split code_aux.m into two. The part that remains in code_aux.m needs stuff
from the LLDS back end. The part that moves out (to the new file goal_form)
doesn't. This removes several unnecessary dependencies on the LLDS back end.
compiler/goal_form.m:
The predicates from code_aux that test goals for having particular
forms. It is part of the hlds module.
compiler/code_aux.m:
Delete the predicates that moved to goal_form.m.
compiler/*.m:
Fix module qualifications and module imports to account for the above
change. In the process, sort module imports into groups.
Zoltan.
cvs diff: Diffing .
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/code_aux.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_aux.m,v
retrieving revision 1.63
diff -u -b -r1.63 code_aux.m
--- compiler/code_aux.m 2002/03/20 12:35:54 1.63
+++ compiler/code_aux.m 2002/03/22 06:28:43
@@ -15,39 +15,11 @@
:- interface.
-:- import_module ll_backend__code_info, hlds__hlds_module, hlds__hlds_goal.
:- import_module parse_tree__prog_data.
+:- import_module hlds__hlds_goal.
+:- import_module ll_backend__code_info.
:- import_module bool.
- % code_aux__contains_only_builtins(G) is true if G is a leaf procedure,
- % i.e. control does not leave G to call another procedure, even if
- % that procedure is a complicated unification.
-
-:- pred code_aux__contains_only_builtins(hlds_goal).
-:- mode code_aux__contains_only_builtins(in) is semidet.
-
- % Succeeds if the goal cannot loop forever.
-:- pred code_aux__goal_cannot_loop(module_info, hlds_goal).
-:- mode code_aux__goal_cannot_loop(in, in) is semidet.
-
- % Succeeds if the goal cannot loop forever or throw an exception.
-:- pred code_aux__goal_cannot_loop_or_throw(hlds_goal).
-:- mode code_aux__goal_cannot_loop_or_throw(in) is semidet.
-
- % Succeeds if the goal can loop forever.
-:- pred code_aux__goal_can_loop(module_info, hlds_goal).
-:- mode code_aux__goal_can_loop(in, in) is semidet.
-
- % Succeeds if the goal can loop forever or throw an exception.
-:- pred code_aux__goal_can_loop_or_throw(hlds_goal).
-:- mode code_aux__goal_can_loop_or_throw(in) is semidet.
-
- % code_aux__goal_is_flat(Goal) is true if Goal does not contain
- % any branched structures (ie if-then-else or disjunctions or
- % switches.)
-:- pred code_aux__goal_is_flat(hlds_goal).
-:- mode code_aux__goal_is_flat(in) is semidet.
-
% code_aux__contains_simple_recursive_call(G, CI, Last) succeeds
% if G is a conjunction of goals, exactly one of which is a recursive
% call (CI says what the current procedure is), and there are no
@@ -65,178 +37,33 @@
%---------------------------------------------------------------------------%
:- implementation.
-
-:- import_module hlds__hlds_pred, ll_backend__llds, ll_backend__llds_out.
-:- import_module varset, check_hlds__type_util, transform_hlds__term_util.
-:- import_module string, set, std_util, assoc_list, require.
-:- import_module list, map.
-
-code_aux__contains_only_builtins(Goal - _GoalInfo) :-
- code_aux__contains_only_builtins_2(Goal).
-
-:- pred code_aux__contains_only_builtins_2(hlds_goal_expr).
-:- mode code_aux__contains_only_builtins_2(in) is semidet.
-
-code_aux__contains_only_builtins_2(conj(Goals)) :-
- code_aux__contains_only_builtins_list(Goals).
-code_aux__contains_only_builtins_2(disj(Goals, _)) :-
- code_aux__contains_only_builtins_list(Goals).
-code_aux__contains_only_builtins_2(switch(_Var, _Category, Cases, _)) :-
- code_aux__contains_only_builtins_cases(Cases).
-code_aux__contains_only_builtins_2(not(Goal)) :-
- code_aux__contains_only_builtins(Goal).
-code_aux__contains_only_builtins_2(some(_Vars, _, Goal)) :-
- code_aux__contains_only_builtins(Goal).
-code_aux__contains_only_builtins_2(if_then_else(_Vars, Cond, Then, Else, _)) :-
- code_aux__contains_only_builtins(Cond),
- code_aux__contains_only_builtins(Then),
- code_aux__contains_only_builtins(Else).
-code_aux__contains_only_builtins_2(call(_, _, _, BuiltinState, _, _)) :-
- BuiltinState = inline_builtin.
-code_aux__contains_only_builtins_2(unify(_, _, _, Uni, _)) :-
- (
- Uni = assign(_, _)
- ;
- Uni = simple_test(_, _)
- ;
- Uni = construct(_, _, _, _, _, _, _)
- ;
- Uni = deconstruct(_, _, _, _, _, _)
- ).
- % Complicated unifies are _non_builtin_
-
-:- pred code_aux__contains_only_builtins_cases(list(case)).
-:- mode code_aux__contains_only_builtins_cases(in) is semidet.
-
-code_aux__contains_only_builtins_cases([]).
-code_aux__contains_only_builtins_cases([case(_ConsId, Goal)|Cases]) :-
- code_aux__contains_only_builtins(Goal),
- code_aux__contains_only_builtins_cases(Cases).
-
-:- pred code_aux__contains_only_builtins_list(list(hlds_goal)).
-:- mode code_aux__contains_only_builtins_list(in) is semidet.
-
-code_aux__contains_only_builtins_list([]).
-code_aux__contains_only_builtins_list([Goal|Goals]) :-
- code_aux__contains_only_builtins(Goal),
- code_aux__contains_only_builtins_list(Goals).
-
-%-----------------------------------------------------------------------------%
-
-code_aux__goal_can_loop(ModuleInfo, Goal) :-
- \+ code_aux__goal_cannot_loop(ModuleInfo, Goal).
-
-code_aux__goal_can_loop_or_throw(Goal) :-
- \+ code_aux__goal_cannot_loop_or_throw(Goal).
-
-code_aux__goal_cannot_loop(ModuleInfo, Goal) :-
- code_aux__goal_cannot_loop_aux(yes(ModuleInfo), Goal).
-
-code_aux__goal_cannot_loop_or_throw(Goal) :-
- code_aux__goal_cannot_loop_aux(no, Goal).
-
-:- pred code_aux__goal_cannot_loop_aux(maybe(module_info), hlds_goal).
-:- mode code_aux__goal_cannot_loop_aux(in, in) is semidet.
-
-code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal) :-
- Goal = GoalExpr - _,
- code_aux__goal_cannot_loop_expr(MaybeModuleInfo, GoalExpr).
-
-:- pred code_aux__goal_cannot_loop_expr(maybe(module_info), hlds_goal_expr).
-:- mode code_aux__goal_cannot_loop_expr(in, in) is semidet.
-
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo, conj(Goals)) :-
- list__member(Goal, Goals) =>
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo, disj(Goals, _)) :-
- list__member(Goal, Goals) =>
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo,
- switch(_Var, _Category, Cases, _)) :-
- list__member(Case, Cases) =>
- (
- Case = case(_, Goal),
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal)
- ).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo, not(Goal)) :-
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo, some(_Vars, _, Goal)) :-
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Goal).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo,
- if_then_else(_Vars, Cond, Then, Else, _)) :-
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Cond),
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Then),
- code_aux__goal_cannot_loop_aux(MaybeModuleInfo, Else).
-code_aux__goal_cannot_loop_expr(MaybeModuleInfo,
- call(PredId, ProcId, _, _, _, _)) :-
- MaybeModuleInfo = yes(ModuleInfo),
- module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
- proc_info_get_maybe_termination_info(ProcInfo, MaybeTermInfo),
- MaybeTermInfo = yes(cannot_loop).
-code_aux__goal_cannot_loop_expr(_, unify(_, _, _, Uni, _)) :-
- (
- Uni = assign(_, _)
- ;
- Uni = simple_test(_, _)
- ;
- Uni = construct(_, _, _, _, _, _, _)
- ;
- Uni = deconstruct(_, _, _, _, _, _)
- ).
- % Complicated unifies are _non_builtin_
-
-%-----------------------------------------------------------------------------%
-
-code_aux__goal_is_flat(Goal - _GoalInfo) :-
- code_aux__goal_is_flat_2(Goal).
-
-:- pred code_aux__goal_is_flat_2(hlds_goal_expr).
-:- mode code_aux__goal_is_flat_2(in) is semidet.
-
-code_aux__goal_is_flat_2(conj(Goals)) :-
- code_aux__goal_is_flat_list(Goals).
-code_aux__goal_is_flat_2(not(Goal)) :-
- code_aux__goal_is_flat(Goal).
-code_aux__goal_is_flat_2(some(_Vars, _, Goal)) :-
- code_aux__goal_is_flat(Goal).
-code_aux__goal_is_flat_2(generic_call(_, _, _, _)).
-code_aux__goal_is_flat_2(call(_, _, _, _, _, _)).
-code_aux__goal_is_flat_2(unify(_, _, _, _, _)).
-code_aux__goal_is_flat_2(foreign_proc(_, _, _, _, _, _, _)).
-
-%-----------------------------------------------------------------------------%
-
-:- pred code_aux__goal_is_flat_list(list(hlds_goal)).
-:- mode code_aux__goal_is_flat_list(in) is semidet.
-code_aux__goal_is_flat_list([]).
-code_aux__goal_is_flat_list([Goal|Goals]) :-
- code_aux__goal_is_flat(Goal),
- code_aux__goal_is_flat_list(Goals).
+:- import_module hlds__goal_form.
+:- import_module ll_backend__llds, ll_backend__llds_out.
+:- import_module string, list, assoc_list, map, std_util, varset.
%-----------------------------------------------------------------------------%
code_aux__contains_simple_recursive_call(Goal - _, CodeInfo, Last) :-
Goal = conj(Goals),
- code_aux__contains_simple_recursive_call_2(Goals, CodeInfo, Last).
+ code_aux__contains_simple_recursive_call_expr(Goals, CodeInfo, Last).
-:- pred code_aux__contains_simple_recursive_call_2(list(hlds_goal), code_info,
- bool).
-:- mode code_aux__contains_simple_recursive_call_2(in, in, out) is semidet.
+:- pred code_aux__contains_simple_recursive_call_expr(list(hlds_goal)::in,
+ code_info::in, bool::out) is semidet.
-code_aux__contains_simple_recursive_call_2([Goal|Goals], CodeInfo, Last) :-
+code_aux__contains_simple_recursive_call_expr([Goal|Goals], CodeInfo, Last) :-
Goal = GoalExpr - _,
(
- code_aux__contains_only_builtins_2(GoalExpr)
+ contains_only_builtins_expr(GoalExpr)
->
- code_aux__contains_simple_recursive_call_2(Goals, CodeInfo,
+ code_aux__contains_simple_recursive_call_expr(Goals, CodeInfo,
Last)
;
code_aux__is_recursive_call(GoalExpr, CodeInfo),
( Goals = [] ->
Last = yes
;
- code_aux__contains_only_builtins_list(Goals),
+ contains_only_builtins_list(Goals),
Last = no
)
).
Index: compiler/constraint.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/constraint.m,v
retrieving revision 1.47
diff -u -b -r1.47 constraint.m
--- compiler/constraint.m 2002/03/20 12:36:00 1.47
+++ compiler/constraint.m 2002/03/22 05:56:33
@@ -46,9 +46,9 @@
:- implementation.
:- import_module hlds__goal_util, hlds__hlds_pred, hlds__hlds_module.
-:- import_module hlds__hlds_data.
-:- import_module check_hlds__mode_util, hlds__passes_aux.
-:- import_module ll_backend__code_aux, check_hlds__inst_match.
+:- import_module hlds__hlds_data, hlds__passes_aux, hlds__goal_form.
+:- import_module check_hlds__mode_util.
+:- import_module check_hlds__inst_match.
:- import_module check_hlds__purity.
:- import_module libs__options, libs__globals.
@@ -408,7 +408,7 @@
{ goal_info_is_pure(GoalInfo) },
% Don't propagate goals that can loop.
- { code_aux__goal_cannot_loop(ModuleInfo, Goal) }
+ { goal_cannot_loop(ModuleInfo, Goal) }
->
% It's a constraint, add it to the list of constraints
% to be attached to goals earlier in the conjunction.
@@ -464,7 +464,7 @@
;
% Don't move goals which can fail before a goal which
% can loop if `--fully-strict' is set.
- { \+ code_aux__goal_cannot_loop(ModuleInfo, Goal) },
+ { \+ goal_cannot_loop(ModuleInfo, Goal) },
{ module_info_globals(ModuleInfo, Globals) },
{ globals__lookup_bool_option(Globals, fully_strict, yes) }
->
Index: compiler/goal_form.m
===================================================================
RCS file: goal_form.m
diff -N goal_form.m
--- /dev/null Fri Dec 1 02:25:58 2000
+++ goal_form.m Fri Mar 22 16:29:57 2002
@@ -0,0 +1,202 @@
+%-----------------------------------------------------------------------------%
+% Copyright (C) 2002 The University of Melbourne.
+% This file may only be copied under the terms of the GNU General
+% Public License - see the file COPYING in the Mercury distribution.
+%---------------------------------------------------------------------------%
+%
+% A module that provides functions that check whether goals fulfill
+% particular criteria
+%
+% Main authors: conway, zs.
+%
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- module hlds__goal_form.
+
+:- interface.
+
+:- import_module hlds__hlds_module, hlds__hlds_goal.
+:- import_module list.
+
+ % Succeeds if the goal cannot loop forever.
+:- pred goal_cannot_loop(module_info, hlds_goal).
+:- mode goal_cannot_loop(in, in) is semidet.
+
+ % Succeeds if the goal cannot loop forever or throw an exception.
+:- pred goal_cannot_loop_or_throw(hlds_goal).
+:- mode goal_cannot_loop_or_throw(in) is semidet.
+
+ % Succeeds if the goal can loop forever.
+:- pred goal_can_loop(module_info, hlds_goal).
+:- mode goal_can_loop(in, in) is semidet.
+
+ % Succeeds if the goal can loop forever or throw an exception.
+:- pred goal_can_loop_or_throw(hlds_goal).
+:- mode goal_can_loop_or_throw(in) is semidet.
+
+ % contains_only_builtins(G) is true if G is a leaf procedure,
+ % i.e. control does not leave G to call another procedure, even if
+ % that procedure is a complicated unification.
+
+:- pred contains_only_builtins(hlds_goal).
+:- mode contains_only_builtins(in) is semidet.
+
+:- pred contains_only_builtins_expr(hlds_goal_expr).
+:- mode contains_only_builtins_expr(in) is semidet.
+
+:- pred contains_only_builtins_list(list(hlds_goal)).
+:- mode contains_only_builtins_list(in) is semidet.
+
+ % goal_is_flat(Goal) is true if Goal does not contain
+ % any branched structures (ie if-then-else or disjunctions or
+ % switches.)
+:- pred goal_is_flat(hlds_goal).
+:- mode goal_is_flat(in) is semidet.
+
+%---------------------------------------------------------------------------%
+
+:- implementation.
+
+:- import_module hlds__hlds_pred.
+:- import_module transform_hlds__term_util.
+:- import_module std_util.
+
+%-----------------------------------------------------------------------------%
+
+goal_can_loop(ModuleInfo, Goal) :-
+ \+ goal_cannot_loop(ModuleInfo, Goal).
+
+goal_can_loop_or_throw(Goal) :-
+ \+ goal_cannot_loop_or_throw(Goal).
+
+goal_cannot_loop(ModuleInfo, Goal) :-
+ goal_cannot_loop_aux(yes(ModuleInfo), Goal).
+
+goal_cannot_loop_or_throw(Goal) :-
+ goal_cannot_loop_aux(no, Goal).
+
+:- pred goal_cannot_loop_aux(maybe(module_info), hlds_goal).
+:- mode goal_cannot_loop_aux(in, in) is semidet.
+
+goal_cannot_loop_aux(MaybeModuleInfo, Goal) :-
+ Goal = GoalExpr - _,
+ goal_cannot_loop_expr(MaybeModuleInfo, GoalExpr).
+
+:- pred goal_cannot_loop_expr(maybe(module_info), hlds_goal_expr).
+:- mode goal_cannot_loop_expr(in, in) is semidet.
+
+goal_cannot_loop_expr(MaybeModuleInfo, conj(Goals)) :-
+ list__member(Goal, Goals) =>
+ goal_cannot_loop_aux(MaybeModuleInfo, Goal).
+goal_cannot_loop_expr(MaybeModuleInfo, disj(Goals, _)) :-
+ list__member(Goal, Goals) =>
+ goal_cannot_loop_aux(MaybeModuleInfo, Goal).
+goal_cannot_loop_expr(MaybeModuleInfo,
+ switch(_Var, _Category, Cases, _)) :-
+ list__member(Case, Cases) =>
+ (
+ Case = case(_, Goal),
+ goal_cannot_loop_aux(MaybeModuleInfo, Goal)
+ ).
+goal_cannot_loop_expr(MaybeModuleInfo, not(Goal)) :-
+ goal_cannot_loop_aux(MaybeModuleInfo, Goal).
+goal_cannot_loop_expr(MaybeModuleInfo, some(_Vars, _, Goal)) :-
+ goal_cannot_loop_aux(MaybeModuleInfo, Goal).
+goal_cannot_loop_expr(MaybeModuleInfo,
+ if_then_else(_Vars, Cond, Then, Else, _)) :-
+ goal_cannot_loop_aux(MaybeModuleInfo, Cond),
+ goal_cannot_loop_aux(MaybeModuleInfo, Then),
+ goal_cannot_loop_aux(MaybeModuleInfo, Else).
+goal_cannot_loop_expr(MaybeModuleInfo,
+ call(PredId, ProcId, _, _, _, _)) :-
+ MaybeModuleInfo = yes(ModuleInfo),
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
+ proc_info_get_maybe_termination_info(ProcInfo, MaybeTermInfo),
+ MaybeTermInfo = yes(cannot_loop).
+goal_cannot_loop_expr(_, unify(_, _, _, Uni, _)) :-
+ (
+ Uni = assign(_, _)
+ ;
+ Uni = simple_test(_, _)
+ ;
+ Uni = construct(_, _, _, _, _, _, _)
+ ;
+ Uni = deconstruct(_, _, _, _, _, _)
+ ).
+ % Complicated unifies are _non_builtin_
+
+%-----------------------------------------------------------------------------%
+
+contains_only_builtins(Goal - _GoalInfo) :-
+ contains_only_builtins_expr(Goal).
+
+contains_only_builtins_expr(conj(Goals)) :-
+ contains_only_builtins_list(Goals).
+contains_only_builtins_expr(disj(Goals, _)) :-
+ contains_only_builtins_list(Goals).
+contains_only_builtins_expr(switch(_Var, _Category, Cases, _)) :-
+ contains_only_builtins_cases(Cases).
+contains_only_builtins_expr(not(Goal)) :-
+ contains_only_builtins(Goal).
+contains_only_builtins_expr(some(_Vars, _, Goal)) :-
+ contains_only_builtins(Goal).
+contains_only_builtins_expr(if_then_else(_Vars, Cond, Then, Else, _)) :-
+ contains_only_builtins(Cond),
+ contains_only_builtins(Then),
+ contains_only_builtins(Else).
+contains_only_builtins_expr(call(_, _, _, BuiltinState, _, _)) :-
+ BuiltinState = inline_builtin.
+contains_only_builtins_expr(unify(_, _, _, Uni, _)) :-
+ (
+ Uni = assign(_, _)
+ ;
+ Uni = simple_test(_, _)
+ ;
+ Uni = construct(_, _, _, _, _, _, _)
+ ;
+ Uni = deconstruct(_, _, _, _, _, _)
+ ).
+ % Complicated unifies are _non_builtin_
+
+:- pred contains_only_builtins_cases(list(case)).
+:- mode contains_only_builtins_cases(in) is semidet.
+
+contains_only_builtins_cases([]).
+contains_only_builtins_cases([case(_ConsId, Goal)|Cases]) :-
+ contains_only_builtins(Goal),
+ contains_only_builtins_cases(Cases).
+
+contains_only_builtins_list([]).
+contains_only_builtins_list([Goal|Goals]) :-
+ contains_only_builtins(Goal),
+ contains_only_builtins_list(Goals).
+
+%-----------------------------------------------------------------------------%
+
+goal_is_flat(Goal - _GoalInfo) :-
+ goal_is_flat_expr(Goal).
+
+:- pred goal_is_flat_expr(hlds_goal_expr).
+:- mode goal_is_flat_expr(in) is semidet.
+
+goal_is_flat_expr(conj(Goals)) :-
+ goal_is_flat_list(Goals).
+goal_is_flat_expr(not(Goal)) :-
+ goal_is_flat(Goal).
+goal_is_flat_expr(some(_Vars, _, Goal)) :-
+ goal_is_flat(Goal).
+goal_is_flat_expr(generic_call(_, _, _, _)).
+goal_is_flat_expr(call(_, _, _, _, _, _)).
+goal_is_flat_expr(unify(_, _, _, _, _)).
+goal_is_flat_expr(foreign_proc(_, _, _, _, _, _, _)).
+
+:- pred goal_is_flat_list(list(hlds_goal)).
+:- mode goal_is_flat_list(in) is semidet.
+
+goal_is_flat_list([]).
+goal_is_flat_list([Goal|Goals]) :-
+ goal_is_flat(Goal),
+ goal_is_flat_list(Goals).
+
+%-----------------------------------------------------------------------------%
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.74
diff -u -b -r1.74 goal_util.m
--- compiler/goal_util.m 2002/03/20 12:36:12 1.74
+++ compiler/goal_util.m 2002/03/22 05:15:28
@@ -14,9 +14,9 @@
:- module hlds__goal_util.
:- interface.
+:- import_module parse_tree__inst, parse_tree__prog_data.
:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module.
-:- import_module hlds__hlds_pred.
-:- import_module (parse_tree__inst), hlds__instmap, parse_tree__prog_data.
+:- import_module hlds__hlds_pred, hlds__instmap.
:- import_module assoc_list, bool, list, set, map, term, std_util.
% The predicates rename_var* take a structure and a mapping from var -> var
@@ -229,11 +229,11 @@
:- implementation.
-:- import_module hlds__hlds_data, check_hlds__mode_util, ll_backend__code_aux.
-:- import_module parse_tree__prog_data, check_hlds__purity.
-:- import_module ll_backend__code_aux, check_hlds__det_analysis.
-:- import_module check_hlds__inst_match, check_hlds__type_util.
-:- import_module (parse_tree__inst).
+:- import_module parse_tree__prog_data, parse_tree__inst.
+:- import_module hlds__hlds_data, hlds__goal_form.
+:- import_module check_hlds__purity, check_hlds__det_analysis.
+:- import_module check_hlds__inst_match, check_hlds__mode_util.
+:- import_module check_hlds__type_util.
:- import_module int, string, require, varset.
@@ -1195,7 +1195,7 @@
% (can_loop, can_fail) into (can_fail, can_loop).
(
FullyStrict = yes,
- \+ code_aux__goal_cannot_loop(ModuleInfo, EarlierGoal)
+ \+ goal_cannot_loop(ModuleInfo, EarlierGoal)
->
LaterCanFail = cannot_fail
;
@@ -1205,7 +1205,7 @@
% (can_loop, can_fail), since this could worsen
% the termination properties of the program.
( EarlierCanFail = can_fail ->
- code_aux__goal_cannot_loop(ModuleInfo, LaterGoal)
+ goal_cannot_loop(ModuleInfo, LaterGoal)
;
true
).
Index: compiler/hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds.m,v
retrieving revision 1.206
diff -u -b -r1.206 hlds.m
--- compiler/hlds.m 2002/03/20 12:36:15 1.206
+++ compiler/hlds.m 2002/03/22 05:15:35
@@ -35,7 +35,7 @@
% Miscellaneous utilities.
:- include_module passes_aux, error_util.
-:- include_module goal_util. % XXX goal_util imports code_aux.m
+:- include_module goal_form, goal_util.
:- include_module hlds_code_util. % XXX currently code_util.m
%-----------------------------------------------------------------------------%
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.105
diff -u -b -r1.105 hlds_pred.m
--- compiler/hlds_pred.m 2002/03/20 12:36:21 1.105
+++ compiler/hlds_pred.m 2002/03/22 05:57:23
@@ -27,7 +27,7 @@
:- import_module parse_tree__prog_util.
% HLDS modules.
-:- import_module ll_backend__code_aux, hlds__goal_util, hlds__make_hlds.
+:- import_module hlds__goal_util, hlds__make_hlds, hlds__goal_form.
:- import_module check_hlds__inst_match, check_hlds__mode_util.
:- import_module check_hlds__type_util.
@@ -1423,7 +1423,7 @@
% Approximate the termination information
% for the new procedure.
- ( code_aux__goal_cannot_loop(ModuleInfo0, Goal0) ->
+ ( goal_cannot_loop(ModuleInfo0, Goal0) ->
TermInfo = yes(cannot_loop)
;
TermInfo = no
Index: compiler/middle_rec.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/middle_rec.m,v
retrieving revision 1.88
diff -u -b -r1.88 middle_rec.m
--- compiler/middle_rec.m 2002/03/20 12:36:44 1.88
+++ compiler/middle_rec.m 2002/03/22 06:09:07
@@ -1,5 +1,5 @@
%---------------------------------------------------------------------------%
-% Copyright (C) 1994-2001 The University of Melbourne.
+% Copyright (C) 1994-2002 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%---------------------------------------------------------------------------%
@@ -25,16 +25,16 @@
:- implementation.
-:- import_module backend_libs__builtin_ops, hlds__hlds_module.
-:- import_module hlds__hlds_data, parse_tree__prog_data, parse_tree__prog_out.
+:- import_module parse_tree__prog_data, parse_tree__prog_out.
+:- import_module hlds__hlds_module, hlds__hlds_data, hlds__goal_form.
:- import_module ll_backend__code_gen, ll_backend__unify_gen.
-:- import_module ll_backend__code_util, ll_backend__code_aux.
-:- import_module ll_backend__opt_util.
-:- import_module backend_libs__code_model.
+:- import_module ll_backend__code_util, ll_backend__opt_util.
+:- import_module ll_backend__code_aux.
+:- import_module backend_libs__builtin_ops, backend_libs__code_model.
+:- import_module libs__tree.
-:- import_module bool, set, int, std_util, libs__tree, list, assoc_list.
+:- import_module bool, int, string, list, assoc_list, set, std_util.
:- import_module require.
-:- import_module string.
%---------------------------------------------------------------------------%
@@ -45,14 +45,14 @@
Case1 = case(ConsId1, Goal1),
Case2 = case(ConsId2, Goal2),
(
- code_aux__contains_only_builtins(Goal1),
+ contains_only_builtins(Goal1),
code_aux__contains_simple_recursive_call(Goal2,
CodeInfo0, _)
->
middle_rec__generate_switch(Var, ConsId1, Goal1, Goal2,
SM, GoalInfo, Instrs, CodeInfo0, CodeInfo)
;
- code_aux__contains_only_builtins(Goal2),
+ contains_only_builtins(Goal2),
code_aux__contains_simple_recursive_call(Goal1,
CodeInfo0, _)
->
@@ -64,8 +64,8 @@
;
GoalExpr = if_then_else(Vars, Cond, Then, Else, SM),
(
- code_aux__contains_only_builtins(Cond),
- code_aux__contains_only_builtins(Then),
+ contains_only_builtins(Cond),
+ contains_only_builtins(Then),
code_aux__contains_simple_recursive_call(Else,
CodeInfo0, no)
->
@@ -74,10 +74,10 @@
in_else, SM, GoalInfo, Instrs,
CodeInfo0, CodeInfo)
;
- code_aux__contains_only_builtins(Cond),
+ contains_only_builtins(Cond),
code_aux__contains_simple_recursive_call(Then,
CodeInfo0, no),
- code_aux__contains_only_builtins(Else)
+ contains_only_builtins(Else)
->
semidet_fail,
middle_rec__generate_ite(Vars, Cond, Then, Else,
Index: compiler/pd_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/pd_util.m,v
retrieving revision 1.18
diff -u -b -r1.18 pd_util.m
--- compiler/pd_util.m 2002/03/20 12:37:06 1.18
+++ compiler/pd_util.m 2002/03/22 06:02:41
@@ -140,17 +140,17 @@
%-----------------------------------------------------------------------------%
:- implementation.
-:- import_module check_hlds__det_analysis, transform_hlds__constraint.
-:- import_module transform_hlds__pd_cost, hlds__hlds_data, hlds__instmap.
-:- import_module transform_hlds__unused_args, check_hlds__inst_match.
-:- import_module (parse_tree__inst), hlds__quantification.
-:- import_module check_hlds__mode_util.
-:- import_module ll_backend__code_aux, check_hlds__purity.
+:- import_module parse_tree__inst.
+:- import_module hlds__goal_util, hlds__hlds_data, hlds__instmap.
+:- import_module hlds__quantification, hlds__goal_form.
+:- import_module check_hlds__purity, check_hlds__type_util.
:- import_module check_hlds__mode_info, check_hlds__unique_modes.
-:- import_module transform_hlds__pd_debug.
-:- import_module check_hlds__type_util, check_hlds__det_util.
-:- import_module check_hlds__det_analysis, libs__options, hlds__goal_util.
-:- import_module check_hlds__det_report, check_hlds__inst_util.
+:- import_module check_hlds__mode_util, check_hlds__inst_util.
+:- import_module check_hlds__inst_match, check_hlds__det_report.
+:- import_module check_hlds__det_util, check_hlds__det_analysis.
+:- import_module transform_hlds__pd_cost, transform_hlds__pd_debug.
+:- import_module transform_hlds__constraint, transform_hlds__unused_args.
+:- import_module libs__options.
:- import_module assoc_list, int, require, set, term.
pd_util__goal_get_calls(Goal0, CalledPreds) :-
@@ -1194,7 +1194,7 @@
% (can_loop, can_fail) into (can_fail, can_loop).
(
FullyStrict = yes,
- \+ code_aux__goal_cannot_loop(ModuleInfo, EarlierGoal)
+ \+ goal_cannot_loop(ModuleInfo, EarlierGoal)
->
LaterCanFail = cannot_fail
;
@@ -1204,7 +1204,7 @@
% (can_loop, can_fail), since this could worsen
% the termination properties of the program.
( EarlierCanFail = can_fail ->
- code_aux__goal_cannot_loop(ModuleInfo, LaterGoal)
+ goal_cannot_loop(ModuleInfo, LaterGoal)
;
true
).
Index: compiler/rl.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl.m,v
retrieving revision 1.19
diff -u -b -r1.19 rl.m
--- compiler/rl.m 2002/03/20 12:37:18 1.19
+++ compiler/rl.m 2002/03/22 05:21:02
@@ -17,9 +17,9 @@
:- interface.
+:- import_module parse_tree__prog_data.
:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_module.
-:- import_module hlds__hlds_pred.
-:- import_module hlds__instmap, parse_tree__prog_data.
+:- import_module hlds__hlds_pred, hlds__instmap.
:- import_module assoc_list, list, std_util, map, set.
%-----------------------------------------------------------------------------%
@@ -671,10 +671,12 @@
%-----------------------------------------------------------------------------%
:- implementation.
-:- import_module ll_backend__code_util, ll_backend__code_aux, libs__globals.
-:- import_module ll_backend__llds_out, libs__options, parse_tree__prog_out.
-:- import_module check_hlds__mode_util, parse_tree__prog_util.
-:- import_module check_hlds__type_util, ll_backend__llds.
+:- import_module parse_tree__prog_util, parse_tree__prog_out.
+:- import_module hlds__goal_form.
+:- import_module check_hlds__type_util, check_hlds__mode_util.
+:- import_module ll_backend__llds, ll_backend__llds_out.
+:- import_module ll_backend__code_util, ll_backend__code_aux.
+:- import_module libs__globals, libs__options.
:- import_module bool, int, require, string.
rl__default_temporary_state(ModuleInfo, TmpState) :-
@@ -938,7 +940,7 @@
all [Goal] (
list__member(Goal, Goals)
=>
- code_aux__goal_cannot_loop(ModuleInfo, Goal)
+ goal_cannot_loop(ModuleInfo, Goal)
)
).
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.100
diff -u -b -r1.100 simplify.m
--- compiler/simplify.m 2002/03/20 12:37:21 1.100
+++ compiler/simplify.m 2002/03/22 06:05:52
@@ -74,20 +74,23 @@
:- implementation.
-:- import_module ll_backend__code_aux, check_hlds__det_analysis.
-:- import_module ll_backend__follow_code, hlds__goal_util.
-:- import_module transform_hlds__const_prop.
-:- import_module hlds__hlds_module, hlds__hlds_data, (parse_tree__inst).
-:- import_module check_hlds__inst_match, varset.
-:- import_module libs__options, hlds__passes_aux, parse_tree__prog_data.
-:- import_module check_hlds__mode_util, check_hlds__type_util.
-:- import_module ll_backend__code_util, hlds__quantification.
+:- import_module parse_tree__inst, parse_tree__prog_data.
+:- import_module parse_tree__prog_util.
+:- import_module hlds__hlds_module, hlds__hlds_data, hlds__passes_aux.
+:- import_module hlds__goal_util, hlds__goal_form, hlds__special_pred.
+:- import_module hlds__quantification.
+:- import_module check_hlds__type_util.
+:- import_module check_hlds__mode_util, check_hlds__inst_match.
+:- import_module check_hlds__det_analysis.
:- import_module check_hlds__modes, check_hlds__purity.
+:- import_module check_hlds__unify_proc.
+:- import_module check_hlds__polymorphism.
+:- import_module transform_hlds__const_prop.
:- import_module transform_hlds__pd_cost.
-:- import_module parse_tree__prog_util, check_hlds__unify_proc.
-:- import_module hlds__special_pred, check_hlds__polymorphism.
+:- import_module ll_backend__code_util, ll_backend__follow_code.
+:- import_module libs__options.
-:- import_module set, require, std_util, int, term.
+:- import_module int, set, require, std_util, varset, term.
%-----------------------------------------------------------------------------%
@@ -330,7 +333,7 @@
% ensure goal is pure or semipure
\+ goal_info_is_impure(GoalInfo0),
( det_info_get_fully_strict(DetInfo, no)
- ; code_aux__goal_cannot_loop(ModuleInfo, Goal0)
+ ; goal_cannot_loop(ModuleInfo, Goal0)
)
->
% warn about this, unless the goal was an explicit
@@ -378,7 +381,7 @@
% ensure goal is pure or semipure
\+ goal_info_is_impure(GoalInfo0),
( det_info_get_fully_strict(DetInfo, no)
- ; code_aux__goal_cannot_loop(ModuleInfo, Goal0)
+ ; goal_cannot_loop(ModuleInfo, Goal0)
)
->
/******************
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.10
diff -u -b -r1.10 unneeded_code.m
--- compiler/unneeded_code.m 2002/03/20 12:37:36 1.10
+++ compiler/unneeded_code.m 2002/03/22 06:09:28
@@ -69,14 +69,16 @@
:- implementation.
-:- import_module parse_tree__prog_data, hlds__hlds_goal, parse_tree__prog_data.
-:- import_module check_hlds__inst_match, hlds__instmap, check_hlds__mode_util.
-:- import_module hlds__passes_aux, hlds__hlds_out, libs__globals.
-:- import_module libs__options.
-:- import_module ll_backend__code_aux, check_hlds__goal_path.
-:- import_module hlds__quantification.
-:- import_module std_util, bool, int, list, assoc_list, map, set, require.
+:- import_module parse_tree__prog_data, parse_tree__prog_data.
+:- import_module hlds__hlds_goal, hlds__instmap, hlds__quantification.
+:- import_module hlds__goal_form, hlds__passes_aux, hlds__hlds_out.
+:- import_module check_hlds__inst_match, check_hlds__mode_util.
+:- import_module check_hlds__goal_path.
+:- import_module ll_backend__code_aux.
+:- import_module libs__globals, libs__options.
+:- import_module bool, int, list, assoc_list, map, set, std_util, require.
+
% The branch_alts and branch_point types record the information the
% transform needs to know about a particular branched control
% structure: where it is, what kind it is, and how many alternatives
@@ -456,13 +458,13 @@
% With --fully-strict, we cannot optimize away
% infinite loops or exceptions.
Options^fully_strict = yes,
- code_aux__goal_can_loop_or_throw(Goal)
+ goal_can_loop_or_throw(Goal)
;
% With --no-reorder-conj, we cannot move
% infinite loops or exceptions, but we can
% delete them.
Options^reorder_conj = no,
- code_aux__goal_can_loop_or_throw(Goal),
+ goal_can_loop_or_throw(Goal),
WhereInfo0 = branches(BranchMap),
\+ map__is_empty(BranchMap)
;
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/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/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
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/structure_reuse
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/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
--------------------------------------------------------------------------
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