[m-rev.] diff: add_pred.m
Zoltan Somogyi
zs at csse.unimelb.edu.au
Mon Nov 1 16:08:26 AEDT 2010
compiler/add_pred.m:
Minor style fixes.
Zoltan.
cvs diff: Diffing .
Index: add_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_pred.m,v
retrieving revision 1.41
diff -u -b -r1.41 add_pred.m
--- add_pred.m 16 Sep 2010 00:39:02 -0000 1.41
+++ add_pred.m 1 Nov 2010 05:07:00 -0000
@@ -219,9 +219,6 @@
%-----------------------------------------------------------------------------%
-:- pred add_builtin(pred_id::in, list(mer_type)::in, compilation_target::in,
- pred_info::in, pred_info::out) is det.
-
% For most builtin predicates, say foo/2, we add a clause
%
% foo(H1, H2) :- foo(H1, H2).
@@ -233,6 +230,9 @@
%
% A few builtins are treated specially.
%
+:- pred add_builtin(pred_id::in, list(mer_type)::in, compilation_target::in,
+ pred_info::in, pred_info::out) is det.
+
add_builtin(PredId, Types, CompilationTarget, !PredInfo) :-
Module = pred_info_module(!.PredInfo),
Name = pred_info_name(!.PredInfo),
@@ -240,8 +240,8 @@
pred_info_get_clauses_info(!.PredInfo, ClausesInfo0),
clauses_info_get_varset(ClausesInfo0, VarSet0),
clauses_info_get_headvars(ClausesInfo0, HeadVars),
- % XXX ARGVEC - clean this up after the pred_info is converted to
- % use the arg_vector structure.
+ % XXX ARGVEC - clean this up after the pred_info is converted to use
+ % the arg_vector structure.
clauses_info_get_headvar_list(ClausesInfo0, HeadVarList),
goal_info_init(Context, GoalInfo0),
@@ -394,16 +394,15 @@
%-----------------------------------------------------------------------------%
- % We should store the mode varset and the mode condition in the HLDS
- % - at the moment we just ignore those two arguments.
- %
module_add_mode(InstVarSet, PredName, Modes, MaybeDet, Status, MContext,
PredOrFunc, IsClassMethod, PredProcId, !ModuleInfo, !Specs) :-
+ % We should store the mode varset and the mode condition in the HLDS
+ % - at the moment we just ignore those two arguments.
+
% Lookup the pred or func declaration in the predicate table.
- % If it's not there (or if it is ambiguous), optionally print a
- % warning message and insert an implicit definition for the
- % predicate; it is presumed to be local, and its type
- % will be inferred automatically.
+ % If it is not there (or if it is ambiguous), optionally print a warning
+ % message and insert an implicit definition for the predicate;
+ % it is presumed to be local, and its type will be inferred automatically.
module_info_get_name(!.ModuleInfo, ModuleName0),
sym_name_get_module_name_default(PredName, ModuleName0, ModuleName),
@@ -525,8 +524,8 @@
prog_type.var_list_to_type_list(map.init, TypeVars, Types),
map.init(Proofs),
map.init(ConstraintMap),
- % The class context is empty since this is an implicit
- % definition. Inference will fill it in.
+ % The class context is empty since this is an implicit definition.
+ % Inference will fill it in.
ClassContext = constraints([], []),
% We assume none of the arguments are existentially typed.
% Existential types must be declared, they won't be inferred.
@@ -540,14 +539,14 @@
add_marker(marker_infer_type, Markers0, Markers),
pred_info_set_markers(Markers, PredInfo0, PredInfo),
(
- \+ predicate_table_search_pf_sym_arity(!.PredicateTable,
+ predicate_table_search_pf_sym_arity(!.PredicateTable,
is_fully_qualified, PredOrFunc, PredName, Arity, _)
->
+ unexpected(this_file, "preds_add_implicit")
+ ;
module_info_get_partial_qualifier_info(ModuleInfo, MQInfo),
predicate_table_insert_qual(PredInfo, may_be_unqualified, MQInfo,
PredId, !PredicateTable)
- ;
- unexpected(this_file, "preds_add_implicit")
).
%-----------------------------------------------------------------------------%
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list