[m-rev.] diff: avoid hlds dependencies on ll_backend.code_util
Simon Taylor
stayl at cs.mu.OZ.AU
Fri Feb 28 17:40:28 AEDT 2003
Estimated hours taken: 1
Branches: main
Avoid dependencies on ll_backend.code_util in *hlds.*.
compiler/code_util.m:
compiler/hlds_pred.m:
Move the predicates to identify builtins into hlds_pred.m.
compiler/*.m:
Update calls and remove unnecessary imports.
Index: code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.107
diff -u -u -r1.107 code_gen.m
--- code_gen.m 17 Jan 2003 05:56:46 -0000 1.107
+++ code_gen.m 28 Feb 2003 04:18:16 -0000
@@ -397,7 +397,7 @@
GenBytecode = yes,
% We don't generate bytecode for __Unify__, __Compare__ etc
% Since we will assume this code is already correct
- \+ code_util__compiler_generated(PredInfo),
+ \+ compiler_generated(PredInfo),
% Don't generate bytecode for procs with foreign code
goal_has_foreign(Goal) = no
->
Index: code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.141
diff -u -u -r1.141 code_util.m
--- code_util.m 30 Jan 2003 05:59:17 -0000 1.141
+++ code_util.m 28 Feb 2003 04:41:46 -0000
@@ -118,32 +118,6 @@
:- pred code_util__negate_the_test(list(instruction), list(instruction)).
:- mode code_util__negate_the_test(in, out) is det.
- % code_util__compiler_generated(PredInfo) succeeds iff
- % the PredInfo is for a compiler generated instance of a
- % type-specific special_pred (i.e. one of the __Unify__,
- % __Index__, or __Compare__ predicates generated as a
- % type-specific instance of unify/2, index/2, or compare/3).
- %
- % XXX The name of this predicate is misleading, because there
- % are other kinds of compiler-generated predicates, e.g. those
- % for lambda expressions, those generated by higher-order
- % specialization, ordinary type specialization, deforestation,
- % etc., for which this predicate does not succeed.
-
-:- pred code_util__compiler_generated(pred_info).
-:- mode code_util__compiler_generated(in) is semidet.
-
-:- pred code_util__predinfo_is_builtin(pred_info).
-:- mode code_util__predinfo_is_builtin(in) is semidet.
-
- % code_util__builtin_state(ModuleInfo, CallerPredId,
- % PredId, ProcId, BuiltinState)
- %
- % Is the given procedure a builtin that should be generated inline?
-:- pred code_util__builtin_state(module_info,
- pred_id, pred_id, proc_id, builtin_state).
-:- mode code_util__builtin_state(in, in, in, in, out) is det.
-
% Find out how a function symbol (constructor) is represented
% in the given type.
@@ -420,59 +394,6 @@
MaxRegNum1 = MaxRegNum0
),
code_util__max_mentioned_reg_2(Lvals, MaxRegNum1, MaxRegNum).
-
-%-----------------------------------------------------------------------------%
-
-code_util__predinfo_is_builtin(PredInfo) :-
- pred_info_module(PredInfo, ModuleName),
- pred_info_name(PredInfo, PredName),
- pred_info_arity(PredInfo, Arity),
- hlds_pred__initial_proc_id(ProcId),
- code_util__is_inline_builtin(ModuleName, PredName, ProcId, Arity).
-
-code_util__builtin_state(ModuleInfo, CallerPredId,
- PredId, ProcId, BuiltinState) :-
- module_info_pred_info(ModuleInfo, PredId, PredInfo),
- pred_info_module(PredInfo, ModuleName),
- pred_info_name(PredInfo, PredName),
- pred_info_arity(PredInfo, Arity),
- module_info_globals(ModuleInfo, Globals),
- globals__lookup_bool_option(Globals, inline_builtins, InlineBuiltins),
- (
- % The automatically generated "recursive" call in the
- % goal for each builtin must be generated inline, or
- % we would generate an infinite loop.
- ( InlineBuiltins = yes
- ; CallerPredId = PredId
- ),
- code_util__is_inline_builtin(ModuleName, PredName,
- ProcId, Arity)
- ->
- BuiltinState = inline_builtin
- ;
- BuiltinState = not_builtin
- ).
-
-:- pred code_util__is_inline_builtin(module_name, string, proc_id, arity).
-:- mode code_util__is_inline_builtin(in, in, in, in) is semidet.
-
-code_util__is_inline_builtin(ModuleName, PredName, ProcId, Arity) :-
- Arity =< 3,
- prog_varset_init(VarSet),
- varset__new_vars(VarSet, Arity, Args, _),
- builtin_ops__translate_builtin(ModuleName, PredName, ProcId, Args, _).
-
-:- pred prog_varset_init(prog_varset::out) is det.
-prog_varset_init(VarSet) :- varset__init(VarSet).
-
-%-----------------------------------------------------------------------------%
-
- % XXX The name of this predicate is misleading -- see the comment
- % in the declaration.
-code_util__compiler_generated(PredInfo) :-
- pred_info_name(PredInfo, PredName),
- pred_info_arity(PredInfo, PredArity),
- special_pred_name_arity(_, _, PredName, PredArity).
%-----------------------------------------------------------------------------%
Index: dead_proc_elim.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.75
diff -u -u -r1.75 dead_proc_elim.m
--- dead_proc_elim.m 22 Feb 2003 13:18:23 -0000 1.75
+++ dead_proc_elim.m 28 Feb 2003 04:18:35 -0000
@@ -53,7 +53,6 @@
:- import_module hlds__hlds_goal, hlds__hlds_data, parse_tree__prog_util.
:- import_module ll_backend__llds.
:- import_module hlds__passes_aux, libs__globals, libs__options.
-:- import_module ll_backend__code_util.
:- import_module int, string, list, set, queue, bool, require.
@@ -774,7 +773,7 @@
% Don't eliminate special preds since they won't
% be actually called from the HLDS until after
% polymorphism.
- code_util__compiler_generated(PredInfo)
+ compiler_generated(PredInfo)
;
% Don't eliminate preds from builtin modules,
% since later passes of the compiler may introduce
Index: det_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.76
diff -u -u -r1.76 det_report.m
--- det_report.m 21 Feb 2003 05:11:59 -0000 1.76
+++ det_report.m 28 Feb 2003 04:18:50 -0000
@@ -139,7 +139,7 @@
:- import_module hlds__hlds_data, check_hlds__type_util.
:- import_module check_hlds__mode_util, check_hlds__inst_match.
:- import_module hlds__hlds_out, parse_tree__mercury_to_mercury.
-:- import_module ll_backend__code_util, hlds__passes_aux.
+:- import_module hlds__passes_aux.
:- import_module libs__globals, libs__options.
:- import_module assoc_list, bool, int, map, set, std_util, require, string.
@@ -207,7 +207,7 @@
% happen for the Unify pred for the unit type,
% if such types are not boxed (as they are not
% boxed for the IL backend).
- { \+ code_util__compiler_generated(PredInfo0) },
+ { \+ compiler_generated(PredInfo0) },
% Don't warn about predicates which are
% inferred erroneous when the appropiate
Index: goal_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.81
diff -u -u -r1.81 goal_util.m
--- goal_util.m 28 Feb 2003 00:21:37 -0000 1.81
+++ goal_util.m 28 Feb 2003 04:34:34 -0000
@@ -245,9 +245,6 @@
:- import_module check_hlds__inst_match, check_hlds__mode_util.
:- import_module check_hlds__type_util.
- % XXX for code_util__builtin_state.
-:- import_module ll_backend, ll_backend__code_util.
-
:- import_module int, string, require, varset.
%-----------------------------------------------------------------------------%
@@ -1225,12 +1222,11 @@
lookup_builtin_pred_proc_id(Module, ModuleName, PredName,
Arity, ModeNo, PredId, ProcId),
- % code_util__buitin_state only uses this to work out whether
+ % builtin_state only uses this to work out whether
% this is the "recursive" clause generated for the compiler
% for each builtin, so an invalid pred_id won't cause problems.
invalid_pred_id(InvalidPredId),
- code_util__builtin_state(Module, InvalidPredId,
- PredId, ProcId, BuiltinState),
+ builtin_state(Module, InvalidPredId, PredId, ProcId, BuiltinState),
Call = call(PredId, ProcId, Args, BuiltinState, no,
qualified(ModuleName, PredName)),
Index: higher_order.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.102
diff -u -u -r1.102 higher_order.m
--- higher_order.m 28 Feb 2003 00:21:37 -0000 1.102
+++ higher_order.m 28 Feb 2003 04:51:43 -0000
@@ -37,7 +37,7 @@
:- import_module hlds__hlds_pred, hlds__hlds_goal, hlds__hlds_data.
:- import_module hlds__instmap, (parse_tree__inst).
-:- import_module ll_backend__code_util, libs__globals, check_hlds__mode_util.
+:- import_module libs__globals, check_hlds__mode_util.
:- import_module hlds__goal_util.
:- import_module check_hlds__type_util, libs__options, parse_tree__prog_data.
:- import_module parse_tree__prog_out, hlds__quantification.
@@ -979,8 +979,7 @@
pred_info_name(PredInfo, PredName),
SymName = qualified(ModuleName, PredName),
proc(CallerPredId, _) = Info0 ^ pred_proc_id,
- code_util__builtin_state(ModuleInfo, CallerPredId,
- PredId, ProcId, Builtin),
+ builtin_state(ModuleInfo, CallerPredId, PredId, ProcId, Builtin),
MaybeContext = no,
Goal1 = call(PredId, ProcId, AllArgs, Builtin, MaybeContext, SymName),
Index: hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.296
diff -u -u -r1.296 hlds_out.m
--- hlds_out.m 21 Feb 2003 04:23:13 -0000 1.296
+++ hlds_out.m 28 Feb 2003 04:30:21 -0000
@@ -800,7 +800,7 @@
% need that information to understand how the program
% has been transformed.
{ \+ string__contains_char(Verbose, 'U') },
- { code_util__compiler_generated(PredInfo) }
+ { compiler_generated(PredInfo) }
->
[]
;
Index: hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.117
diff -u -u -r1.117 hlds_pred.m
--- hlds_pred.m 22 Feb 2003 13:18:24 -0000 1.117
+++ hlds_pred.m 28 Feb 2003 04:31:28 -0000
@@ -2756,6 +2756,92 @@
%-----------------------------------------------------------------------------%
+ % Predicates to deal with builtins.
+:- interface.
+
+ % compiler_generated(PredInfo) succeeds iff
+ % the PredInfo is for a compiler generated instance of a
+ % type-specific special_pred (i.e. one of the __Unify__,
+ % __Index__, or __Compare__ predicates generated as a
+ % type-specific instance of unify/2, index/2, or compare/3).
+ %
+ % XXX The name of this predicate is misleading, because there
+ % are other kinds of compiler-generated predicates, e.g. those
+ % for lambda expressions, those generated by higher-order
+ % specialization, ordinary type specialization, deforestation,
+ % etc., for which this predicate does not succeed.
+
+:- pred compiler_generated(pred_info).
+:- mode compiler_generated(in) is semidet.
+
+ % Is the argument the pred_info for a builtin that can be
+ % generated inline?
+:- pred pred_info_is_builtin(pred_info).
+:- mode pred_info_is_builtin(in) is semidet.
+
+ % builtin_state(ModuleInfo, CallerPredId,
+ % PredId, ProcId, BuiltinState)
+ %
+ % Is the given procedure a builtin that should be generated inline
+ % in the given caller?
+:- pred builtin_state(module_info, pred_id, pred_id, proc_id, builtin_state).
+:- mode builtin_state(in, in, in, in, out) is det.
+
+:- implementation.
+
+:- import_module backend_libs__builtin_ops, hlds__special_pred.
+
+pred_info_is_builtin(PredInfo) :-
+ pred_info_module(PredInfo, ModuleName),
+ pred_info_name(PredInfo, PredName),
+ pred_info_arity(PredInfo, Arity),
+ hlds_pred__initial_proc_id(ProcId),
+ is_inline_builtin(ModuleName, PredName, ProcId, Arity).
+
+builtin_state(ModuleInfo, CallerPredId,
+ PredId, ProcId, BuiltinState) :-
+ module_info_pred_info(ModuleInfo, PredId, PredInfo),
+ pred_info_module(PredInfo, ModuleName),
+ pred_info_name(PredInfo, PredName),
+ pred_info_arity(PredInfo, Arity),
+ module_info_globals(ModuleInfo, Globals),
+ globals__lookup_bool_option(Globals, inline_builtins, InlineBuiltins),
+ (
+ % The automatically generated "recursive" call in the
+ % goal for each builtin must be generated inline, or
+ % we would generate an infinite loop.
+ ( InlineBuiltins = yes
+ ; CallerPredId = PredId
+ ),
+ is_inline_builtin(ModuleName, PredName,
+ ProcId, Arity)
+ ->
+ BuiltinState = inline_builtin
+ ;
+ BuiltinState = not_builtin
+ ).
+
+:- pred is_inline_builtin(module_name, string, proc_id, arity).
+:- mode is_inline_builtin(in, in, in, in) is semidet.
+
+is_inline_builtin(ModuleName, PredName, ProcId, Arity) :-
+ Arity =< 3,
+ prog_varset_init(VarSet),
+ varset__new_vars(VarSet, Arity, Args, _),
+ builtin_ops__translate_builtin(ModuleName, PredName, ProcId, Args, _).
+
+:- pred prog_varset_init(prog_varset::out) is det.
+prog_varset_init(VarSet) :- varset__init(VarSet).
+
+ % XXX The name of this predicate is misleading -- see the comment
+ % in the declaration.
+compiler_generated(PredInfo) :-
+ pred_info_name(PredInfo, PredName),
+ pred_info_arity(PredInfo, PredArity),
+ special_pred_name_arity(_, _, PredName, PredArity).
+
+%-----------------------------------------------------------------------------%
+
% Predicates to check whether a given predicate
% is an Aditi query.
Index: intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.132
diff -u -u -r1.132 intermod.m
--- intermod.m 22 Feb 2003 13:18:25 -0000 1.132
+++ intermod.m 28 Feb 2003 04:17:08 -0000
@@ -89,8 +89,7 @@
:- import_module assoc_list, dir, getopt, int, list, map, multi_map, require.
:- import_module set, std_util, string, term, varset.
-:- import_module ll_backend__code_util, libs__globals, hlds__goal_util, term.
-:- import_module varset.
+:- import_module libs__globals, hlds__goal_util.
:- import_module hlds__hlds_data, hlds__hlds_goal, hlds__hlds_pred.
:- import_module hlds__hlds_out, transform_hlds__inlining, ll_backend__llds.
:- import_module parse_tree__mercury_to_mercury, check_hlds__mode_util.
@@ -353,8 +352,8 @@
% Don't export builtins since they will be
% recreated in the importing module anyway.
- \+ code_util__compiler_generated(PredInfo),
- \+ code_util__predinfo_is_builtin(PredInfo),
+ \+ compiler_generated(PredInfo),
+ \+ pred_info_is_builtin(PredInfo),
% These will be recreated in the importing module.
\+ set__member(PredId, TypeSpecForcePreds),
@@ -595,7 +594,7 @@
% the `.opt' file, since they will be recreated every
% time anyway.
%
- { code_util__compiler_generated(PredInfo) }
+ { compiler_generated(PredInfo) }
->
{ DoWrite = yes }
;
Index: make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.435
diff -u -u -r1.435 make_hlds.m
--- make_hlds.m 22 Feb 2003 13:18:25 -0000 1.435
+++ make_hlds.m 28 Feb 2003 04:17:00 -0000
@@ -111,7 +111,7 @@
:- import_module check_hlds__purity, check_hlds__unify_proc.
:- import_module transform_hlds__term_util.
:- import_module ll_backend, ll_backend__llds.
-:- import_module ll_backend__code_util, ll_backend__fact_table.
+:- import_module ll_backend__fact_table.
:- import_module hlds__hlds_code_util.
:- import_module backend_libs__export, backend_libs__foreign.
:- import_module recompilation.
@@ -3376,7 +3376,7 @@
{ predicate_table_insert(PredicateTable0, PredInfo0,
NeedQual, PQInfo, PredId, PredicateTable1) },
(
- { code_util__predinfo_is_builtin(PredInfo0) }
+ { pred_info_is_builtin(PredInfo0) }
->
{ add_builtin(PredId, Types,
PredInfo0, PredInfo) },
@@ -4316,7 +4316,7 @@
;
% Ignore clauses for builtins. This makes bootstrapping
% easier when redefining builtins to use normal Mercury code.
- { code_util__predinfo_is_builtin(PredInfo1) }
+ { pred_info_is_builtin(PredInfo1) }
->
prog_out__write_context(Context),
report_warning("Warning: clause for builtin.\n"),
Index: ml_code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.67
diff -u -u -r1.67 ml_code_util.m
--- ml_code_util.m 28 Feb 2003 00:21:37 -0000 1.67
+++ ml_code_util.m 28 Feb 2003 04:19:05 -0000
@@ -807,7 +807,6 @@
:- import_module backend_libs__foreign.
:- import_module parse_tree__prog_util, check_hlds__type_util.
:- import_module check_hlds__mode_util, hlds__special_pred, hlds__error_util.
-:- import_module ll_backend__code_util. % XXX for `code_util__compiler_generated'.
:- import_module ml_backend__ml_code_gen, ml_backend__ml_call_gen.
:- import_module libs__globals, libs__options.
Index: modecheck_unify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.53
diff -u -u -r1.53 modecheck_unify.m
--- modecheck_unify.m 27 Jan 2003 09:20:49 -0000 1.53
+++ modecheck_unify.m 28 Feb 2003 04:19:32 -0000
@@ -48,7 +48,7 @@
:- import_module check_hlds__mode_info, check_hlds__modes.
:- import_module check_hlds__mode_errors.
:- import_module check_hlds__inst_match, check_hlds__inst_util.
-:- import_module check_hlds__unify_proc, ll_backend__code_util.
+:- import_module check_hlds__unify_proc.
:- import_module check_hlds__unique_modes.
:- import_module check_hlds__typecheck, check_hlds__modecheck_call.
:- import_module (parse_tree__inst), hlds__quantification, hlds__make_hlds.
@@ -975,7 +975,7 @@
PredInfo),
mode_info_get_instmap(ModeInfo3, InstMap0),
(
- ( code_util__compiler_generated(PredInfo)
+ ( compiler_generated(PredInfo)
; instmap__is_unreachable(InstMap0)
)
->
Index: modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.264
diff -u -u -r1.264 modes.m
--- modes.m 22 Feb 2003 13:18:26 -0000 1.264
+++ modes.m 28 Feb 2003 04:28:01 -0000
@@ -1144,8 +1144,7 @@
=(ModeInfo),
{ mode_info_get_module_info(ModeInfo, ModuleInfo) },
{ mode_info_get_predid(ModeInfo, CallerPredId) },
- { code_util__builtin_state(ModuleInfo, CallerPredId,
- PredId, Mode, Builtin) },
+ { builtin_state(ModuleInfo, CallerPredId, PredId, Mode, Builtin) },
{ Call = call(PredId, Mode, Args, Builtin, Context, PredName) },
handle_extra_goals(Call, ExtraGoals, GoalInfo0, Args0, Args,
InstMap0, Goal),
Index: post_typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/post_typecheck.m,v
retrieving revision 1.45
diff -u -u -r1.45 post_typecheck.m
--- post_typecheck.m 22 Feb 2003 13:18:27 -0000 1.45
+++ post_typecheck.m 28 Feb 2003 04:20:00 -0000
@@ -120,7 +120,7 @@
:- implementation.
-:- import_module (hlds__assertion), ll_backend__code_util.
+:- import_module (hlds__assertion).
:- import_module check_hlds__typecheck, check_hlds__clause_to_proc.
:- import_module check_hlds__mode_util, check_hlds__inst_match.
:- import_module (parse_tree__inst), parse_tree__prog_util, hlds__error_util.
@@ -1228,7 +1228,7 @@
% a type ambiguity error, but compiler-generated
% predicates are not type-checked.)
%
- \+ code_util__compiler_generated(PredInfo0),
+ \+ compiler_generated(PredInfo0),
%
% We don't do this for the clause introduced by the
@@ -1319,7 +1319,7 @@
% We don't do this for compiler-generated predicates --
% they will never contain calls to field access functions.
%
- \+ code_util__compiler_generated(PredInfo0),
+ \+ compiler_generated(PredInfo0),
%
% If there is a constructor for which the argument types
Index: purity.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.53
diff -u -u -r1.53 purity.m
--- purity.m 28 Feb 2003 00:21:38 -0000 1.53
+++ purity.m 28 Feb 2003 04:20:33 -0000
@@ -182,7 +182,7 @@
:- import_module hlds__hlds_data, hlds__hlds_goal, parse_tree__prog_io_util.
:- import_module check_hlds__type_util, check_hlds__mode_util.
-:- import_module ll_backend__code_util, parse_tree__prog_data.
+:- import_module parse_tree__prog_data.
:- import_module check_hlds__unify_proc.
:- import_module libs__globals, libs__options, parse_tree__mercury_to_mercury.
:- import_module hlds__hlds_out.
@@ -870,7 +870,7 @@
;
% Don't require purity annotations on calls in
% compiler-generated code.
- { code_util__compiler_generated(PredInfo) }
+ { compiler_generated(PredInfo) }
->
[]
;
@@ -1068,7 +1068,7 @@
io__write_string(".\n"),
prog_out__write_context(Context),
{ pred_info_get_purity(PredInfo, DeclaredPurity) },
- ( { code_util__compiler_generated(PredInfo) } ->
+ ( { compiler_generated(PredInfo) } ->
io__write_string(" It must be pure.\n")
;
io__write_string(" It must be declared `"),
Index: rl_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.26
diff -u -u -r1.26 rl_exprn.m
--- rl_exprn.m 17 Jan 2003 05:56:47 -0000 1.26
+++ rl_exprn.m 28 Feb 2003 04:20:53 -0000
@@ -126,7 +126,7 @@
:- implementation.
-:- import_module ll_backend__code_util, hlds__hlds_pred, hlds__hlds_data.
+:- import_module hlds__hlds_pred, hlds__hlds_data.
:- import_module check_hlds__inst_match.
:- import_module hlds__instmap, check_hlds__mode_util, libs__tree.
:- import_module check_hlds__type_util, parse_tree__prog_out.
@@ -940,10 +940,10 @@
% in Aditi predicates so the types must be known.
\+ {
% `index/2' doesn't work in Aditi.
- code_util__compiler_generated(PredInfo),
+ compiler_generated(PredInfo),
\+ pred_info_name(PredInfo, "__Index__")
},
- { \+ code_util__predinfo_is_builtin(PredInfo) },
+ { \+ pred_info_is_builtin(PredInfo) },
{ \+ rl_exprn__is_simple_extra_aditi_builtin(PredInfo,
ProcId, _) }
->
@@ -988,7 +988,7 @@
{ pred_info_name(PredInfo, PredName) },
{ pred_info_arity(PredInfo, Arity) },
(
- { code_util__predinfo_is_builtin(PredInfo) }
+ { pred_info_is_builtin(PredInfo) }
->
rl_exprn__generate_builtin_call(PredId, ProcId, PredInfo,
Args, Fail, Code)
Index: rtti.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti.m,v
retrieving revision 1.23
diff -u -u -r1.23 rtti.m
--- rtti.m 26 Feb 2003 06:36:24 -0000 1.23
+++ rtti.m 28 Feb 2003 04:21:08 -0000
@@ -625,7 +625,6 @@
:- import_module parse_tree__prog_util. % for mercury_public_builtin_module
:- import_module hlds__hlds_data.
:- import_module check_hlds__type_util, check_hlds__mode_util.
-:- import_module ll_backend__code_util. % for code_util__compiler_generated
:- import_module ll_backend__llds_out. % for name_mangle and sym_name_mangle
:- import_module int, string, require, varset.
@@ -747,7 +746,7 @@
IsPseudoImp = (pred_info_is_pseudo_imported(PredInfo) -> yes ; no),
IsExported = (procedure_is_exported(PredInfo, ProcId) -> yes ; no),
IsSpecialPredInstance =
- (code_util__compiler_generated(PredInfo) -> yes ; no),
+ (compiler_generated(PredInfo) -> yes ; no),
ProcHeadVarsWithNames = list__map((func(Var) = Var - Name :-
Name = varset__lookup_name(ProcVarSet, Var)
), ProcHeadVars),
Index: simplify.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.112
diff -u -u -r1.112 simplify.m
--- simplify.m 28 Feb 2003 00:21:38 -0000 1.112
+++ simplify.m 28 Feb 2003 04:21:32 -0000
@@ -103,7 +103,7 @@
{
% Don't warn for compiler-generated procedures.
list__member(warn_simple_code, Simplifications0),
- code_util__compiler_generated(PredInfo0)
+ compiler_generated(PredInfo0)
->
list__delete_all(Simplifications0, warn_simple_code,
Simplifications)
Index: termination.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.24
diff -u -u -r1.24 termination.m
--- termination.m 20 Mar 2002 12:37:28 -0000 1.24
+++ termination.m 28 Feb 2003 04:21:43 -0000
@@ -91,7 +91,7 @@
:- import_module libs__globals.
:- import_module hlds__hlds_data, hlds__hlds_goal.
:- import_module transform_hlds__dependency_graph, varset.
-:- import_module check_hlds__mode_util, hlds__hlds_out, ll_backend__code_util.
+:- import_module check_hlds__mode_util, hlds__hlds_out.
:- import_module parse_tree__prog_out, parse_tree__prog_util.
:- import_module parse_tree__mercury_to_mercury, check_hlds__type_util.
:- import_module hlds__special_pred.
@@ -475,7 +475,7 @@
set_compiler_gen_terminates(PredInfo, ProcIds, PredId, Module,
ProcTable0, ProcTable) :-
(
- code_util__predinfo_is_builtin(PredInfo)
+ pred_info_is_builtin(PredInfo)
->
set_builtin_terminates(ProcIds, PredId, PredInfo, Module,
ProcTable0, ProcTable)
@@ -709,7 +709,7 @@
;
ImportStatus = opt_exported
},
- { \+ code_util__compiler_generated(PredInfo) },
+ { \+ compiler_generated(PredInfo) },
% XXX These should be allowed, but the predicate
% declaration for the specialized predicate is not produced
Index: typecheck.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.330
diff -u -u -r1.330 typecheck.m
--- typecheck.m 22 Feb 2003 13:18:29 -0000 1.330
+++ typecheck.m 28 Feb 2003 04:21:58 -0000
@@ -156,7 +156,6 @@
:- import_module hlds__hlds_goal, hlds__goal_util, parse_tree__prog_util.
:- import_module check_hlds__type_util, parse_tree__modules.
-:- import_module ll_backend__code_util.
:- import_module parse_tree__prog_io, parse_tree__prog_io_util.
:- import_module parse_tree__prog_out, hlds__hlds_out, hlds__error_util.
:- import_module parse_tree__mercury_to_mercury, check_hlds__mode_util.
@@ -320,9 +319,9 @@
% But, compiler-generated unify predicates are not guaranteed
% to be type-correct if they call a user-defined equality pred
% or if it is a special pred for an existentially typed data type.
- ( code_util__compiler_generated(!.PredInfo),
+ ( compiler_generated(!.PredInfo),
\+ special_pred_needs_typecheck(!.PredInfo, ModuleInfo0)
- ; code_util__predinfo_is_builtin(!.PredInfo)
+ ; pred_info_is_builtin(!.PredInfo)
)
->
pred_info_clauses_info(!.PredInfo, ClausesInfo0),
@@ -4850,7 +4849,7 @@
typecheck_info_get_module_info(TypeCheckInfo, ModuleInfo),
module_info_pred_info(ModuleInfo, PredId, PredInfo),
\+ pred_info_get_goal_type(PredInfo, clauses_and_pragmas),
- \+ code_util__compiler_generated(PredInfo),
+ \+ compiler_generated(PredInfo),
\+ pred_info_import_status(PredInfo, opt_imported)
->
ConsTypeInfo = error(foreign_type_constructor(TypeCtor,
Index: unused_args.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.81
diff -u -u -r1.81 unused_args.m
--- unused_args.m 21 Feb 2003 01:54:40 -0000 1.81
+++ unused_args.m 28 Feb 2003 06:37:37 -0000
@@ -74,7 +74,6 @@
:- import_module check_hlds__type_util, check_hlds__mode_util.
:- import_module check_hlds__inst_match, check_hlds__polymorphism.
:- import_module transform_hlds__mmc_analysis.
-:- import_module ll_backend__code_util.
:- import_module libs__options, libs__globals.
:- import_module bool, int, char, string, list, assoc_list, set, map.
@@ -259,7 +258,7 @@
% as if they use all of their arguments,
% to avoid spurious warnings in their callers.
(
- code_util__predinfo_is_builtin(PredInfo)
+ pred_info_is_builtin(PredInfo)
;
pred_info_get_markers(PredInfo, Markers),
check_marker(Markers, stub)
@@ -1550,8 +1549,8 @@
\+ pred_info_import_status(PredInfo, opt_imported),
% Don't warn about builtins
% that have unused arguments.
- \+ code_util__predinfo_is_builtin(PredInfo),
- \+ code_util__compiler_generated(PredInfo),
+ \+ pred_info_is_builtin(PredInfo),
+ \+ compiler_generated(PredInfo),
% Don't warn about stubs for procedures
% with no clauses -- in that case,
% we *expect* that none of the arguments
--------------------------------------------------------------------------
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