[m-rev.] for review: rbmm info in goal_infos
Zoltan Somogyi
zs at csse.unimelb.edu.au
Fri Aug 3 16:56:03 AEST 2007
For review (of the changes to hlds_goal.m) by Quan. The other changes
are trivial.
Zoltan.
Add new fields to the goal_info structure for region based memory management.
The fields are currently unused, but (a) Quan will add the code to fill them
in, and then (b) I will modify the code generator to use the filled in fields.
additions by Quan.
compiler/hlds_goal.m:
Make the change described above.
Group all the procedures that access goal_info components together.
Some of the getters were predicates while some were functions, so
this diff changes them all to be functions. (The setters remain
predicates.)
compiler/*.m:
Trivial changes to conform to the change in hlds_goal.m.
In simplify.m, break up a huge (800+ line) predicate into smaller
pieces.
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/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/accumulator.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/accumulator.m,v
retrieving revision 1.68
diff -u -b -r1.68 accumulator.m
--- compiler/accumulator.m 2 Aug 2007 01:23:58 -0000 1.68
+++ compiler/accumulator.m 2 Aug 2007 08:03:13 -0000
@@ -489,7 +489,7 @@
;
GoalExpr = if_then_else(_Vars, Cond, Then, Else),
Cond = hlds_goal(_CondGoalExpr, CondGoalInfo),
- goal_info_get_instmap_delta(CondGoalInfo, CondInstMapDelta),
+ CondInstMapDelta = goal_info_get_instmap_delta(CondGoalInfo),
goal_to_conj_list(Then, GoalAList),
goal_to_conj_list(Else, GoalBList)
@@ -561,7 +561,7 @@
store(Identifier, Goal, store_info(N, IM0, GS0), store_info(N+1, IM, GS)) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(IM0, InstMapDelta, IM),
goal_store_det_insert(Identifier - N, Goal - IM0, GS0, GS).
@@ -1084,7 +1084,7 @@
P = (pred(Id::in, Set0::in, Set::out) is det :-
goal_store_lookup(GoalStore, Id, Goal - _InstMap),
Goal = hlds_goal(_GoalExpr, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
Set = NonLocals `union` Set0
),
list.foldl(P, set.to_sorted_list(Before), set.init, BeforeNonLocals),
@@ -1215,7 +1215,7 @@
set.member(DuringAssocVar, PossibleDuringAssocVars),
Warning = []
;
- goal_info_get_context(GoalInfo, ProgContext),
+ ProgContext = goal_info_get_context(GoalInfo),
Warning = [warn(ProgContext, PredId, BeforeAssocVar,
DuringAssocVar)]
),
@@ -1352,7 +1352,7 @@
goal_store_member(GS, Key, Goal - InstMap0),
Key = base - _,
Goal = hlds_goal(_GoalExpr, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
instmap_changed_vars(InstMap0, InstMap, VarTypes,
ModuleInfo, ChangedVars),
Index: compiler/add_heap_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.34
diff -u -b -r1.34 add_heap_ops.m
--- compiler/add_heap_ops.m 19 Jan 2007 07:04:07 -0000 1.34
+++ compiler/add_heap_ops.m 2 Aug 2007 07:57:02 -0000
@@ -115,8 +115,8 @@
!Info) :-
Goals0 = [FirstDisjunct | _],
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ Context = goal_info_get_context(GoalInfo),
+ CodeModel = goal_info_get_code_model(GoalInfo),
% If necessary, save the heap pointer so that we can restore it
% on back-tracking. We don't need to do this here if it is a model_det
@@ -148,9 +148,9 @@
% We handle negations by converting them into if-then-elses:
% not(G) ===> (if G then fail else true)
%
- goal_info_get_context(OuterGoalInfo, Context),
+ Context = goal_info_get_context(OuterGoalInfo),
InnerGoal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_determinism(InnerGoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(InnerGoalInfo),
determinism_components(Determinism, _CanFail, NumSolns),
True = true_goal_with_context(Context),
Fail = fail_goal_with_context(Context),
@@ -183,7 +183,7 @@
% so that we can restore it if the condition fails.
( goal_may_allocate_heap(Cond0) ->
new_saved_hp_var(SavedHeapPointerVar, !Info),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
gen_mark_hp(SavedHeapPointerVar, Context, MarkHeapPointerGoal, !Info),
% Generate code to restore the heap pointer, and insert that code
@@ -217,7 +217,7 @@
% a call to a procedure which will at runtime call error/1 with an
% appropriate "Sorry, not implemented" error message.
ModuleInfo = !.Info ^ module_info,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
generate_call("reclaim_heap_nondet_pragma_foreign_code",
detism_erroneous, purity_pure, [], [], ModuleInfo, Context,
SorryNotImplementedCode),
@@ -245,7 +245,7 @@
DisjGoalInfo, DisjGoals, !Info) :-
goal_add_heap_ops(Goal0, Goal1, !Info),
Goal1 = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
% If needed, reset the heap pointer before executing the goal,
% to reclaim heap space allocated in earlier branches.
Index: compiler/add_trail_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.46
diff -u -b -r1.46 add_trail_ops.m
--- compiler/add_trail_ops.m 19 Jan 2007 07:04:07 -0000 1.46
+++ compiler/add_trail_ops.m 2 Aug 2007 08:08:18 -0000
@@ -145,8 +145,8 @@
goal_expr_add_trail_ops(disj(Goals0), GoalInfo, hlds_goal(GoalExpr, GoalInfo),
!Info) :-
Goals0 = [_ | _],
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ Context = goal_info_get_context(GoalInfo),
+ CodeModel = goal_info_get_code_model(GoalInfo),
%
% Allocate a new trail ticket so that we can restore things on
% back-tracking.
@@ -166,9 +166,9 @@
% We handle negations by converting them into if-then-elses:
% not(G) ===> (if G then fail else true)
%
- goal_info_get_context(OuterGoalInfo, Context),
+ Context = goal_info_get_context(OuterGoalInfo),
InnerGoal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_determinism(InnerGoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(InnerGoalInfo),
determinism_components(Determinism, _CanFail, NumSolns),
True = true_goal_with_context(Context),
Fail = fail_goal_with_context(Context),
@@ -191,8 +191,8 @@
goal_expr_add_trail_ops(scope(Reason, Goal0), OuterGoalInfo,
hlds_goal(GoalExpr, OuterGoalInfo), !Info) :-
Goal0 = hlds_goal(_, InnerGoalInfo),
- goal_info_get_code_model(InnerGoalInfo, InnerCodeModel),
- goal_info_get_code_model(OuterGoalInfo, OuterCodeModel),
+ InnerCodeModel = goal_info_get_code_model(InnerGoalInfo),
+ OuterCodeModel = goal_info_get_code_model(OuterGoalInfo),
(
InnerCodeModel = model_non,
OuterCodeModel \= model_non
@@ -201,7 +201,7 @@
% Before executing the goal, we save the ticket counter,
% and allocate a new trail ticket.
- goal_info_get_context(OuterGoalInfo, Context),
+ Context = goal_info_get_context(OuterGoalInfo),
new_ticket_counter_var(SavedTicketCounterVar, !Info),
new_ticket_var(TicketVar, !Info),
gen_mark_ticket_stack(SavedTicketCounterVar, Context,
@@ -259,7 +259,7 @@
%
OptTrailUsage = !.Info ^ opt_trail_usage,
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
OptTrailUsage = yes,
CondCodeModel \= model_non,
@@ -271,7 +271,7 @@
% condition fails.
%
new_ticket_var(TicketVar, !Info),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
gen_store_ticket(TicketVar, Context, StoreTicketGoal, !.Info),
%
% Commit the trail ticket entries if the condition succeeds.
@@ -324,7 +324,7 @@
% to a procedure which will at runtime call error/1 with an appropriate
% "Sorry, not implemented" error message.
ModuleInfo = !.Info^ module_info,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
trail_generate_call("trailed_nondet_pragma_foreign_code",
detism_erroneous, purity_pure, [], [], ModuleInfo, Context,
SorryNotImplementedCode),
@@ -354,7 +354,7 @@
disj_add_trail_ops([Goal0 | Goals0], IsFirstBranch, CodeModel, TicketVar,
[Goal | Goals], !Info) :-
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
% First undo the effects of any earlier branches.
(
Index: compiler/arg_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/arg_info.m,v
retrieving revision 1.56
diff -u -b -r1.56 arg_info.m
--- compiler/arg_info.m 31 Jul 2006 08:31:27 -0000 1.56
+++ compiler/arg_info.m 2 Aug 2007 07:45:24 -0000
@@ -163,7 +163,7 @@
generate_proc_arg_info(ArgTypes, ModuleInfo, !ProcInfo) :-
proc_info_get_argmodes(!.ProcInfo, ArgModes),
- proc_info_interface_code_model(!.ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(!.ProcInfo),
make_arg_infos(ArgTypes, ArgModes, CodeModel, ModuleInfo, ArgInfo),
proc_info_set_arg_info(ArgInfo, !ProcInfo).
Index: compiler/assertion.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/assertion.m,v
retrieving revision 1.57
diff -u -b -r1.57 assertion.m
--- compiler/assertion.m 17 May 2007 03:52:39 -0000 1.57
+++ compiler/assertion.m 2 Aug 2007 05:26:02 -0000
@@ -197,7 +197,7 @@
assert_id_goal(Module, AssertId, hlds_goal(GoalExpr, GoalInfo)),
goal_is_equivalence(hlds_goal(GoalExpr, GoalInfo), P, Q),
- goal_info_get_nonlocals(GoalInfo, UniversiallyQuantifiedVars),
+ UniversiallyQuantifiedVars = goal_info_get_nonlocals(GoalInfo),
% There may or may not be a some [] depending on whether
% the user explicity qualified the call or not.
@@ -303,7 +303,7 @@
is_update_assertion(Module, AssertId, _PredId, CallVars, StateA - StateB) :-
assert_id_goal(Module, AssertId, hlds_goal(GoalExpr, GoalInfo)),
goal_is_equivalence(hlds_goal(GoalExpr, GoalInfo), P, Q),
- goal_info_get_nonlocals(GoalInfo, UniversiallyQuantifiedVars),
+ UniversiallyQuantifiedVars = goal_info_get_nonlocals(GoalInfo),
% There may or may not be an explicit some [Vars] there,
% as quantification now works correctly.
Index: compiler/build_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/build_mode_constraints.m,v
retrieving revision 1.26
diff -u -b -r1.26 build_mode_constraints.m
--- compiler/build_mode_constraints.m 17 May 2007 03:52:39 -0000 1.26
+++ compiler/build_mode_constraints.m 2 Aug 2007 03:25:28 -0000
@@ -290,8 +290,8 @@
add_mc_vars_for_goal(PredId, ProgVarset, hlds_goal(GoalExpr, GoalInfo),
!VarInfo) :-
- goal_info_get_nonlocals(GoalInfo, Nonlocals),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ Nonlocals = goal_info_get_nonlocals(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
set.to_sorted_list(Nonlocals, NlsList),
prog_vars_at_path(ProgVarset, PredId, NlsList, GoalPath, _, !VarInfo),
@@ -387,9 +387,9 @@
add_goal_constraints(ModuleInfo, ProgVarset, PredId,
hlds_goal(GoalExpr, GoalInfo), !VarInfo, !Constraints) :-
- goal_info_get_nonlocals(GoalInfo, Nonlocals),
- goal_info_get_goal_path(GoalInfo, GoalPath),
- goal_info_get_context(GoalInfo, Context),
+ Nonlocals = goal_info_get_nonlocals(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
+ Context = goal_info_get_context(GoalInfo),
add_goal_expr_constraints(ModuleInfo, ProgVarset, PredId, GoalExpr, Context,
GoalPath, Nonlocals, !VarInfo, !Constraints).
@@ -534,7 +534,7 @@
!VarInfo),
GoalInfos = list.map(get_hlds_goal_info, Goals),
- list.map(goal_info_get_goal_path, GoalInfos, DisjunctGoalPaths),
+ DisjunctGoalPaths = list.map(goal_info_get_goal_path, GoalInfos),
list.foldl2(add_goal_constraints(ModuleInfo, ProgVarset, PredId),
Goals, !VarInfo, !Constraints),
@@ -550,7 +550,7 @@
negation(Goal), Context, GoalPath, Nonlocals, !VarInfo,
!Constraints) :-
Goal = hlds_goal(_, NegatedGoalInfo),
- goal_info_get_goal_path(NegatedGoalInfo, NegatedGoalPath),
+ NegatedGoalPath = goal_info_get_goal_path(NegatedGoalInfo),
VarMap = rep_var_map(!.VarInfo),
NonlocalsAtPath = set.fold(cons_prog_var_at_path(VarMap, PredId, GoalPath),
Nonlocals, []),
@@ -569,7 +569,7 @@
scope(_Reason, Goal), Context, GoalPath, Nonlocals, !VarInfo,
!Constraints) :-
Goal = hlds_goal(_, SomeGoalInfo),
- goal_info_get_goal_path(SomeGoalInfo, SomeGoalPath),
+ SomeGoalPath = goal_info_get_goal_path(SomeGoalInfo),
% If a program variable is produced by the sub-goal of the some
% statement, it is produced at the main goal as well
@@ -594,9 +594,9 @@
Cond = hlds_goal(_, CondInfo),
Then = hlds_goal(_, ThenInfo),
Else = hlds_goal(_, ElseInfo),
- goal_info_get_goal_path(CondInfo, CondPath),
- goal_info_get_goal_path(ThenInfo, ThenPath),
- goal_info_get_goal_path(ElseInfo, ElsePath),
+ CondPath = goal_info_get_goal_path(CondInfo),
+ ThenPath = goal_info_get_goal_path(ThenInfo),
+ ElsePath = goal_info_get_goal_path(ElseInfo),
prog_vars_at_path(ProgVarset, PredId, NonlocalsList, GoalPath,
NonlocalsHere, !VarInfo),
@@ -611,8 +611,8 @@
% The existentially quantified variables shared between the condition
% and the then-part have special constraints.
- goal_info_get_nonlocals(CondInfo, CondNonlocals),
- goal_info_get_nonlocals(ThenInfo, ThenNonlocals),
+ CondNonlocals = goal_info_get_nonlocals(CondInfo),
+ ThenNonlocals = goal_info_get_nonlocals(ThenInfo),
list.filter(set.contains(CondNonlocals), ExistVars, NonlocalToCond),
list.filter(set.contains(ThenNonlocals), NonlocalToCond, LocalAndShared),
prog_vars_at_path(ProgVarset, PredId, LocalAndShared, CondPath,
@@ -837,8 +837,8 @@
add_goal_nonlocals_to_conjunct_production_maps(VarMap, PredId, Nonlocals,
hlds_goal(_SubGoalExpr, SubGoalInfo), !ConjConstraintsInfo) :-
- goal_info_get_nonlocals(SubGoalInfo, SubGoalNonlocals),
- goal_info_get_goal_path(SubGoalInfo, SubGoalPath),
+ SubGoalNonlocals = goal_info_get_nonlocals(SubGoalInfo),
+ SubGoalPath = goal_info_get_goal_path(SubGoalInfo),
% These are variables nonlocal to the conjunction that
% appear in this particular conjunct.
Index: compiler/bytecode_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/bytecode_gen.m,v
retrieving revision 1.112
diff -u -b -r1.112 bytecode_gen.m
--- compiler/bytecode_gen.m 19 Jan 2007 07:04:08 -0000 1.112
+++ compiler/bytecode_gen.m 2 Aug 2007 03:23:25 -0000
@@ -195,7 +195,7 @@
gen_goal(hlds_goal(GoalExpr, GoalInfo), !ByteInfo, Code) :-
gen_goal_expr(GoalExpr, GoalInfo, !ByteInfo, GoalCode),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_line(Context, Line),
Code = tree(node([byte_context(Line)]), GoalCode).
@@ -220,7 +220,7 @@
;
GoalExpr = plain_call(PredId, ProcId, ArgVars, BuiltinState, _, _),
( BuiltinState = not_builtin ->
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
gen_call(PredId, ProcId, ArgVars, Detism, !.ByteInfo, Code)
;
gen_builtin(PredId, ProcId, ArgVars, !.ByteInfo, Code)
@@ -240,9 +240,9 @@
;
GoalExpr = scope(_, InnerGoal),
gen_goal(InnerGoal, !ByteInfo, InnerCode),
- goal_info_get_determinism(GoalInfo, OuterDetism),
+ OuterDetism = goal_info_get_determinism(GoalInfo),
InnerGoal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_determinism(InnerGoalInfo, InnerDetism),
+ InnerDetism = goal_info_get_determinism(InnerGoalInfo),
determinism_to_code_model(OuterDetism, OuterCodeModel),
determinism_to_code_model(InnerDetism, InnerCodeModel),
( InnerCodeModel = OuterCodeModel ->
Index: compiler/call_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/call_gen.m,v
retrieving revision 1.190
diff -u -b -r1.190 call_gen.m
--- compiler/call_gen.m 6 Jan 2007 09:23:25 -0000 1.190
+++ compiler/call_gen.m 2 Aug 2007 07:28:28 -0000
@@ -104,8 +104,8 @@
Address = make_proc_entry_label(!.CI, ModuleInfo, PredId, ProcId, yes),
code_info.get_next_label(ReturnLabel, !CI),
call_gen.call_comment(!.CI, PredId, CodeModel, CallComment),
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ Context = goal_info_get_context(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
CallCode = node([
llds_instr(livevals(LiveVals), ""),
llds_instr(llcall(Address, code_label(ReturnLabel), ReturnLiveLvalues,
@@ -116,7 +116,7 @@
% Figure out what variables will be live at the return point, and where,
% for use in the accurate garbage collector, and in the debugger.
code_info.get_instmap(!.CI, InstMap),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap, InstMapDelta, ReturnInstMap),
% Update the code generator state to reflect the situation after the call.
@@ -124,7 +124,7 @@
ReturnInstMap, ReturnLiveLvalues, !CI),
% If the call can fail, generate code to check for and handle the failure.
- handle_failure(CodeModel, GoalInfo, FailHandlingCode, !CI),
+ handle_call_failure(CodeModel, GoalInfo, FailHandlingCode, !CI),
Code = tree_list([SetupCode, TraceCode, CallCode, FailHandlingCode]).
@@ -206,13 +206,13 @@
% Make the call.
code_info.get_next_label(ReturnLabel, !CI),
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ Context = goal_info_get_context(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
% Figure out what variables will be live at the return point, and where,
% for use in the accurate garbage collector, and in the debugger.
code_info.get_instmap(!.CI, InstMap),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap, InstMapDelta, ReturnInstMap),
% Update the code generator state to reflect the situation after the call.
@@ -227,7 +227,7 @@
]),
% If the call can fail, generate code to check for and handle the failure.
- handle_failure(CodeModel, GoalInfo, FailHandlingCode, !CI),
+ handle_call_failure(CodeModel, GoalInfo, FailHandlingCode, !CI),
Code = tree_list([SetupCode, NonVarCode, TraceCode, CallCode,
FailHandlingCode]).
@@ -429,12 +429,13 @@
),
trace_prepare_for_call(!.CI, TraceCode).
-:- pred handle_failure(code_model::in, hlds_goal_info::in,
+:- pred handle_call_failure(code_model::in, hlds_goal_info::in,
code_tree::out, code_info::in, code_info::out) is det.
-handle_failure(CodeModel, GoalInfo, FailHandlingCode, !CI) :-
- ( CodeModel = model_semi ->
- goal_info_get_determinism(GoalInfo, Detism),
+handle_call_failure(CodeModel, GoalInfo, FailHandlingCode, !CI) :-
+ (
+ CodeModel = model_semi,
+ Detism = goal_info_get_determinism(GoalInfo),
( Detism = detism_failure ->
code_info.generate_failure(FailHandlingCode, !CI)
;
@@ -451,6 +452,9 @@
FailCode, ContLabelCode])
)
;
+ ( CodeModel = model_det
+ ; CodeModel = model_non
+ ),
FailHandlingCode = empty
).
@@ -518,7 +522,7 @@
handle_return(ArgsInfos, GoalInfo, _NonLiveOutputs, ReturnInstMap,
ReturnLiveLvalues, !CI) :-
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_reachable(InstMapDelta) ->
OkToDeleteAny = no
;
Index: compiler/clause_to_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/clause_to_proc.m,v
retrieving revision 1.79
diff -u -b -r1.79 clause_to_proc.m
--- compiler/clause_to_proc.m 17 May 2007 03:52:40 -0000 1.79
+++ compiler/clause_to_proc.m 2 Aug 2007 03:26:17 -0000
@@ -225,7 +225,7 @@
goal_info_init(GoalInfo0),
( GoalList = [FirstGoal | _] ->
FirstGoal = hlds_goal(_, FirstGoalInfo),
- goal_info_get_context(FirstGoalInfo, Context)
+ Context = goal_info_get_context(FirstGoalInfo)
;
proc_info_get_context(!.Proc, Context)
),
@@ -240,7 +240,7 @@
% is impure/semipure.
( contains_nonpure_goal(GoalList) ->
- list.map(goal_get_purity, GoalList, PurityList),
+ PurityList = list.map(goal_get_purity, GoalList),
Purity = list.foldl(worst_purity, PurityList, purity_pure),
goal_info_set_purity(Purity, GoalInfo2, GoalInfo)
;
@@ -258,8 +258,7 @@
contains_nonpure_goal([Goal | Goals]) :-
(
- goal_get_purity(Goal, Purity),
- Purity \= purity_pure
+ goal_get_purity(Goal) \= purity_pure
;
contains_nonpure_goal(Goals)
).
Index: compiler/closure_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/closure_analysis.m,v
retrieving revision 1.14
diff -u -b -r1.14 closure_analysis.m
--- compiler/closure_analysis.m 6 Jan 2007 09:23:25 -0000 1.14
+++ compiler/closure_analysis.m 2 Aug 2007 08:03:35 -0000
@@ -462,8 +462,7 @@
dump_ho_values(GoalInfo, Varset, !IO) :-
HO_Values = goal_info_get_ho_values(GoalInfo),
( not map.is_empty(HO_Values) ->
- goal_info_get_context(GoalInfo, Context),
- prog_out.write_context(Context, !IO),
+ prog_out.write_context(goal_info_get_context(GoalInfo), !IO),
io.nl(!IO),
map.foldl(dump_ho_value(Varset), HO_Values, !IO)
;
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.172
diff -u -b -r1.172 code_gen.m
--- compiler/code_gen.m 31 Jul 2007 01:56:32 -0000 1.172
+++ compiler/code_gen.m 2 Aug 2007 07:46:49 -0000
@@ -82,7 +82,7 @@
code_info.pre_goal_update(GoalInfo, IsAtomic, !CI),
code_info.get_instmap(!.CI, InstMap),
( instmap.is_reachable(InstMap) ->
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
% Sanity check: code of some code models should occur
% only in limited contexts.
(
@@ -105,7 +105,7 @@
generate_goal_2(GoalExpr, GoalInfo, CodeModel,
ForwardLiveVarsBeforeGoal, GoalCode, !CI),
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
code_info.get_proc_info(!.CI, ProcInfo),
% If the predicate's evaluation method is memo, loopcheck or minimal
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.347
diff -u -b -r1.347 code_info.m
--- compiler/code_info.m 31 Jul 2007 01:56:33 -0000 1.347
+++ compiler/code_info.m 2 Aug 2007 07:47:20 -0000
@@ -480,7 +480,7 @@
CodeInfo) :-
proc_info_get_initial_instmap(ProcInfo, ModuleInfo, InstMap),
proc_info_get_liveness_info(ProcInfo, Liveness),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
build_input_arg_list(ProcInfo, ArgList),
proc_info_get_varset(ProcInfo, VarSet),
proc_info_get_vartypes(ProcInfo, VarTypes),
@@ -883,7 +883,7 @@
goal_info_get_post_births(GoalInfo, PostBirths),
add_forward_live_vars(PostBirths, !CI),
make_vars_forward_live(PostBirths, !CI),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
get_instmap(!.CI, InstMap0),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
set_instmap(InstMap, !CI).
@@ -927,7 +927,7 @@
get_proc_model(CI) = CodeModel :-
get_proc_info(CI, ProcInfo),
- proc_info_interface_code_model(ProcInfo, CodeModel).
+ CodeModel = proc_info_interface_code_model(ProcInfo).
get_headvars(CI) = HeadVars :-
get_module_info(CI, ModuleInfo),
@@ -3698,7 +3698,7 @@
partition_args(ArgInfos, InArgInfos, OutArgInfos, _UnusedArgInfos),
assoc_list.keys(OutArgInfos, OutVars),
set.list_to_set(OutVars, OutVarSet),
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
get_opt_no_return_calls(!.CI, OptNoReturnCalls),
get_module_info(!.CI, ModuleInfo),
(
@@ -3709,8 +3709,9 @@
DummyStackVarLocs = []
;
compute_forward_live_var_saves(!.CI, OutVarSet, ForwardVarLocs),
- goal_info_get_code_model(GoalInfo, CodeModel),
- ( CodeModel = model_non ->
+ CodeModel = goal_info_get_code_model(GoalInfo),
+ (
+ CodeModel = model_non,
% Save variables protected by the nearest resumption point on the
% stack.
% XXX This should be unnecessary; with the current setup, the code
@@ -3722,6 +3723,9 @@
compute_resume_var_stack_locs(!.CI, ResumeVarLocs),
list.append(ResumeVarLocs, ForwardVarLocs, StackVarLocs)
;
+ ( CodeModel = model_det
+ ; CodeModel = model_semi
+ ),
StackVarLocs = ForwardVarLocs
),
VarTypes = get_var_types(!.CI),
Index: compiler/code_model.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_model.m,v
retrieving revision 1.14
diff -u -b -r1.14 code_model.m
--- compiler/code_model.m 1 Dec 2006 15:03:51 -0000 1.14
+++ compiler/code_model.m 2 Aug 2007 07:40:08 -0000
@@ -36,9 +36,9 @@
:- mode determinism_to_code_model(in, out) is det.
:- mode determinism_to_code_model(out, in) is multi.
-:- pred proc_info_interface_code_model(proc_info::in, code_model::out) is det.
+:- func proc_info_interface_code_model(proc_info) = code_model.
-:- pred goal_info_get_code_model(hlds_goal_info::in, code_model::out) is det.
+:- func goal_info_get_code_model(hlds_goal_info) = code_model.
% Construct a representation of the interface determinism of a procedure.
% The code we have chosen is not sequential; instead it encodes the various
@@ -67,12 +67,12 @@
determinism_to_code_model(detism_erroneous, model_det).
determinism_to_code_model(detism_failure, model_semi).
-proc_info_interface_code_model(ProcInfo, CodeModel) :-
+proc_info_interface_code_model(ProcInfo) = CodeModel :-
proc_info_interface_determinism(ProcInfo, Determinism),
determinism_to_code_model(Determinism, CodeModel).
-goal_info_get_code_model(GoalInfo, CodeModel) :-
- goal_info_get_determinism(GoalInfo, Determinism),
+goal_info_get_code_model(GoalInfo) = CodeModel :-
+ Determinism = goal_info_get_determinism(GoalInfo),
determinism_to_code_model(Determinism, CodeModel).
represent_determinism(detism_det) = detism_rep(det_rep).
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.178
diff -u -b -r1.178 code_util.m
--- compiler/code_util.m 6 Jan 2007 09:23:26 -0000 1.178
+++ compiler/code_util.m 2 Aug 2007 07:47:45 -0000
@@ -230,10 +230,14 @@
goal_may_alloc_temp_frame_2(call_foreign_proc(_, _, _, _, _, _, _), yes).
goal_may_alloc_temp_frame_2(scope(_, Goal), May) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_code_model(GoalInfo, CodeModel),
- ( CodeModel = model_non ->
+ CodeModel = goal_info_get_code_model(GoalInfo),
+ (
+ CodeModel = model_non,
May = yes
;
+ ( CodeModel = model_det
+ ; CodeModel = model_semi
+ ),
goal_may_alloc_temp_frame(Goal, May)
).
goal_may_alloc_temp_frame_2(negation(Goal), May) :-
Index: compiler/commit_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/commit_gen.m,v
retrieving revision 1.17
diff -u -b -r1.17 commit_gen.m
--- compiler/commit_gen.m 31 Jul 2007 01:56:34 -0000 1.17
+++ compiler/commit_gen.m 2 Aug 2007 07:47:52 -0000
@@ -69,7 +69,7 @@
AddRegionOps = should_add_region_ops(!.CI, OuterGoalInfo),
Goal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_code_model(InnerGoalInfo, InnerCodeModel),
+ InnerCodeModel = goal_info_get_code_model(InnerGoalInfo),
(
OuterCodeModel = model_det,
(
Index: compiler/common.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/common.m,v
retrieving revision 1.102
diff -u -b -r1.102 common.m
--- compiler/common.m 6 Jan 2007 09:23:26 -0000 1.102
+++ compiler/common.m 2 Aug 2007 03:33:02 -0000
@@ -299,7 +299,7 @@
% is in the instmap_delta, which will not be true if the
% variable is local to the unification. The optimization
% is pointless in that case.
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo0),
instmap_delta_search_var(InstMapDelta, Var, _),
map.search(AllStructMap0, TypeCtor, ConsIdMap0),
@@ -503,7 +503,7 @@
common_optimise_call(PredId, ProcId, Args, GoalInfo, Goal0, Goal, !Info) :-
(
- goal_info_get_determinism(GoalInfo, Det),
+ Det = goal_info_get_determinism(GoalInfo),
check_call_detism(Det),
simplify_info_get_var_types(!.Info, VarTypes),
simplify_info_get_module_info(!.Info, ModuleInfo),
@@ -573,7 +573,7 @@
map.apply_to_list(OutputArgs2, VarTypes, OutputArgTypes2),
types_match_exactly_list(OutputArgTypes1, OutputArgTypes2)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
CallPieces = det_report_seen_call_id(ModuleInfo, SeenCall),
CurPieces = [words("Warning: redundant") | CallPieces]
++ [suffix(".")],
@@ -597,14 +597,14 @@
goal_cost(hlds_goal(GoalExpr0, GoalInfo), Cost),
simplify_info_incr_cost_delta(Cost, !Info),
simplify_info_set_requantify(!Info),
- goal_info_get_determinism(GoalInfo, Detism0),
+ Detism0 = goal_info_get_determinism(GoalInfo),
( Detism0 \= detism_det ->
simplify_info_set_rerun_det(!Info)
;
true
)
;
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
ThisCall = call_args(Context, InputArgs, OutputArgs),
map.det_update(SeenCalls0, SeenCall, [ThisCall | SeenCallsList0],
SeenCalls),
@@ -612,7 +612,7 @@
GoalExpr = GoalExpr0
)
;
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
ThisCall = call_args(Context, InputArgs, OutputArgs),
map.det_insert(SeenCalls0, SeenCall, [ThisCall], SeenCalls),
CommonInfo = CommonInfo0 ^ seen_calls := SeenCalls,
Index: compiler/complexity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/complexity.m,v
retrieving revision 1.28
diff -u -b -r1.28 complexity.m
--- compiler/complexity.m 19 Jan 2007 07:04:09 -0000 1.28
+++ compiler/complexity.m 2 Aug 2007 08:03:47 -0000
@@ -259,14 +259,14 @@
proc_info_get_varset(!.ProcInfo, VarSet),
proc_info_get_vartypes(!.ProcInfo, VarTypes),
proc_info_get_goal(!.ProcInfo, OrigGoal),
- goal_info_get_context(OrigGoalInfo, Context),
+ Context = goal_info_get_context(OrigGoalInfo),
% Even if the original goal doesn't use all of the headvars, the code
% generated by the transformation does, so we need to compute the
% nonlocals from the headvars rather than getting it from the
% nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
goal_info_set_purity(purity_impure, OrigGoalInfo, ImpureOrigGoalInfo),
IsActiveVarName = "IsActive",
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.44
diff -u -b -r1.44 const_prop.m
--- compiler/const_prop.m 6 Jan 2007 09:23:27 -0000 1.44
+++ compiler/const_prop.m 2 Aug 2007 08:04:01 -0000
@@ -560,7 +560,7 @@
make_assignment_goal(OutputArg, InputArg, Goal, !GoalInfo) :-
make_assignment(OutputArg, InputArg, Goal),
- goal_info_get_instmap_delta(!.GoalInfo, Delta0),
+ Delta0 = goal_info_get_instmap_delta(!.GoalInfo),
instmap_delta_set(OutputArg ^ arg_var, InputArg ^ arg_inst, Delta0, Delta),
goal_info_set_instmap_delta(Delta, !GoalInfo),
goal_info_set_determinism(detism_det, !GoalInfo).
@@ -570,7 +570,7 @@
make_construction_goal(OutputArg, Cons, Goal, !GoalInfo) :-
make_construction(OutputArg, Cons, Goal),
- goal_info_get_instmap_delta(!.GoalInfo, Delta0),
+ Delta0 = goal_info_get_instmap_delta(!.GoalInfo),
instmap_delta_set(OutputArg ^ arg_var, bound(unique,
[bound_functor(Cons, [])]), Delta0, Delta),
goal_info_set_instmap_delta(Delta, !GoalInfo),
Index: compiler/constraint.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/constraint.m,v
retrieving revision 1.85
diff -u -b -r1.85 constraint.m
--- compiler/constraint.m 6 Jan 2007 09:23:27 -0000 1.85
+++ compiler/constraint.m 2 Aug 2007 08:16:52 -0000
@@ -86,8 +86,8 @@
% We need to treat all single goals as conjunctions so that propagate_conj
% can move the constraints to the left of the goal if that is allowed.
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_features(GoalInfo0, Features0),
- goal_info_get_context(GoalInfo0, Context),
+ Features0 = goal_info_get_features(GoalInfo0),
+ Context = goal_info_get_context(GoalInfo0),
goal_to_conj_list(Goal0, Goals0),
propagate_conj(Goals0, Constraints, Goals, !Info, !IO),
goal_list_nonlocals(Goals, NonLocals),
@@ -285,7 +285,7 @@
annotate_conj_output_vars([Goal | Goals], ModuleInfo, VarTypes, InstMap0,
!RevGoals) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
instmap_changed_vars(InstMap0, InstMap, VarTypes,
@@ -404,7 +404,7 @@
Conjunct = annotated_conjunct(Goal, ChangedVars, OutputVars,
IncompatibleInstVars),
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
CI_ModuleInfo0 = !.Info ^ module_info,
goal_can_loop_or_throw(Goal, GoalCanLoopOrThrow,
CI_ModuleInfo0, CI_ModuleInfo, !IO),
@@ -414,7 +414,7 @@
% Propagating cc_nondet goals would be tricky, because we would
% need to be careful about reordering the constraints (the cc_nondet
% goal can't be moved before any goals which can fail).
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
( Detism = detism_semi
; Detism = detism_failure
),
@@ -424,7 +424,7 @@
set.empty(OutputVars),
% Don't propagate impure goals.
- goal_info_get_purity(GoalInfo, purity_pure),
+ goal_info_get_purity(GoalInfo) = purity_pure,
% Only propagate goals that cannot loop or throw exceptions.
GoalCanLoopOrThrow = cannot_loop_or_throw
@@ -458,7 +458,7 @@
;
% Prune away the constraints after a goal that cannot succeed
% -- they can never be executed.
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _, at_most_zero)
->
constraint_info_update_changed(Constraints0, !Info),
@@ -467,7 +467,7 @@
;
% Don't propagate constraints into or past impure goals.
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_purity(GoalInfo, purity_impure)
+ goal_info_get_purity(GoalInfo) = purity_impure
->
Constraints1 = [],
flatten_constraints(Constraints0,
@@ -538,7 +538,7 @@
IncompatibleInstVars, Constructs0),
(
ConstraintGoal0 = hlds_goal(_, ConstraintInfo),
- goal_info_get_nonlocals(ConstraintInfo, ConstraintNonLocals),
+ ConstraintNonLocals = goal_info_get_nonlocals(ConstraintInfo),
set.member(ConstructVar, ConstraintNonLocals)
->
VarSet0 = !.Info ^ varset,
@@ -594,7 +594,7 @@
[Constraint | Constraints], !RevDependent, !RevIndependent) :-
Constraint = constraint(ConstraintGoal, _, IncompatibleInstVars, _),
ConstraintGoal = hlds_goal(_, ConstraintGoalInfo),
- goal_info_get_nonlocals(ConstraintGoalInfo, ConstraintNonLocals),
+ ConstraintNonLocals = goal_info_get_nonlocals(ConstraintGoalInfo),
(
(
@@ -636,7 +636,7 @@
EarlierConstraint = constraint(_, EarlierChangedVars, _, _),
Constraint = constraint(ConstraintGoal, _, _, _),
ConstraintGoal = hlds_goal(_, ConstraintGoalInfo),
- goal_info_get_nonlocals(ConstraintGoalInfo, ConstraintNonLocals),
+ ConstraintNonLocals = goal_info_get_nonlocals(ConstraintGoalInfo),
set.intersect(EarlierChangedVars, ConstraintNonLocals,
EarlierConstraintIntersection),
set.empty(EarlierConstraintIntersection).
@@ -740,7 +740,7 @@
constraint_info_update_goal(hlds_goal(_, GoalInfo), !Info) :-
InstMap0 = !.Info ^ instmap,
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
!:Info = !.Info ^ instmap := InstMap.
Index: compiler/cse_detection.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/cse_detection.m,v
retrieving revision 1.109
diff -u -b -r1.109 cse_detection.m
--- compiler/cse_detection.m 28 May 2007 01:06:17 -0000 1.109
+++ compiler/cse_detection.m 2 Aug 2007 03:27:26 -0000
@@ -239,7 +239,7 @@
hlds_goal(GoalExpr, GoalInfo), InstMap) :-
detect_cse_in_goal_2(GoalExpr0, GoalInfo, InstMap0, !CseInfo, Redo,
GoalExpr),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap).
% Here we process each of the different sorts of goals.
@@ -285,20 +285,20 @@
Redo = no,
Goal = disj([])
;
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, NonLocalsList),
detect_cse_in_disj(NonLocalsList, Goals0, GoalInfo,
InstMap, !CseInfo, Redo, Goal)
).
detect_cse_in_goal_2(switch(Var, CanFail, Cases0), GoalInfo, InstMap,
!CseInfo, Redo, Goal) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, NonLocalsList),
detect_cse_in_cases(NonLocalsList, Var, CanFail, Cases0, GoalInfo,
InstMap, !CseInfo, Redo, Goal).
detect_cse_in_goal_2(if_then_else(Vars, Cond0, Then0, Else0), GoalInfo,
InstMap, !CseInfo, Redo, Goal) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, NonLocalsList),
detect_cse_in_ite(NonLocalsList, Vars, Cond0, Then0, Else0, GoalInfo,
InstMap, !CseInfo, Redo, Goal).
@@ -561,7 +561,7 @@
!.CseState = have_candidate(HoistedGoal,
FirstOldNewVars, LaterOldNewVars0),
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
find_similar_deconstruct(HoistedGoal,
Goal0, Context, OldNewVars, Goals0)
@@ -597,7 +597,7 @@
unexpected(this_file,
"non-functor unify in construct_common_unify")
),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
create_parallel_subterms(Args, Context, Ucontext, !CseInfo,
OldNewVars, Replacements),
map.from_assoc_list(OldNewVars, Sub),
Index: compiler/deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.63
diff -u -b -r1.63 deep_profiling.m
--- compiler/deep_profiling.m 19 Apr 2007 04:24:50 -0000 1.63
+++ compiler/deep_profiling.m 2 Aug 2007 07:48:11 -0000
@@ -359,7 +359,7 @@
)
;
GoalExpr = plain_call(_, _, _, BuiltinState, _, _),
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
( set.member(feature_tailcall, Features) ->
!:TailCallSites = [!.N | !.TailCallSites]
;
@@ -462,7 +462,7 @@
deep_prof_transform_proc(ModuleInfo, PredProcId, !ProcInfo) :-
proc_info_get_maybe_deep_profile_info(!.ProcInfo, MaybeDeepInfo),
- proc_info_interface_code_model(!.ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(!.ProcInfo),
(
CodeModel = model_det,
(
@@ -819,7 +819,7 @@
% means that the procedure body does actually leave a nondet stack frame
% when it succeeds, and its determinism must be adjusted accordingly.
%
- goal_info_get_determinism(GoalInfo0, Detism0),
+ Detism0 = goal_info_get_determinism(GoalInfo0),
determinism_components(Detism0, CanFail, _),
determinism_components(Detism, CanFail, at_most_many),
goal_info_set_determinism(Detism, GoalInfo0, GoalInfo1),
@@ -872,7 +872,7 @@
varset.new_named_var(VarSet0, "MiddleCSD", MiddleCSD, VarSet1),
map.set(VarTypes0, MiddleCSD, CPointerType, VarTypes1),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
FileName = term.context_file(Context),
proc_info_get_maybe_deep_profile_info(!.ProcInfo, MaybeDeepProfInfo),
@@ -1011,8 +1011,8 @@
;
GoalExpr0 = scope(Reason0, SubGoal0),
SubGoal0 = hlds_goal(_, InnerInfo),
- goal_info_get_determinism(GoalInfo0, OuterDetism),
- goal_info_get_determinism(InnerInfo, InnerDetism),
+ OuterDetism = goal_info_get_determinism(GoalInfo0),
+ InnerDetism = goal_info_get_determinism(InnerInfo),
( InnerDetism = OuterDetism ->
MaybeCut = scope_is_no_cut,
Reason = Reason0,
@@ -1100,7 +1100,7 @@
deep_prof_wrap_call(GoalPath, hlds_goal(GoalExpr0, GoalInfo0),
hlds_goal(GoalExpr, GoalInfo), !DeepInfo) :-
ModuleInfo = !.DeepInfo ^ deep_module_info,
- goal_info_get_features(GoalInfo0, GoalFeatures),
+ GoalFeatures = goal_info_get_features(GoalInfo0),
goal_info_remove_feature(feature_tailcall, GoalInfo0, GoalInfo1),
make_impure(GoalInfo1, GoalInfo),
@@ -1125,7 +1125,7 @@
!:DeepInfo = !.DeepInfo ^ deep_var_types := VarTypes1,
!:DeepInfo = !.DeepInfo ^ deep_site_num_counter := SiteNumCounter,
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
FileName0 = term.context_file(Context),
LineNumber = term.context_line(Context),
compress_filename(!.DeepInfo, FileName0, FileName),
@@ -1204,7 +1204,7 @@
Generic = cast(_),
unexpected(this_file, "deep_profiling.wrap_call: cast")
),
- goal_info_get_code_model(GoalInfo0, GoalCodeModel),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo0),
module_info_get_globals(ModuleInfo, Globals),
globals.lookup_bool_option(Globals, use_zeroing_for_ho_cycles,
UseZeroing),
@@ -1244,7 +1244,7 @@
"wrap_call: multi-procedure SCCs not yet implemented")
),
- goal_info_get_code_model(GoalInfo0, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo0),
( CodeModel = model_det ->
list.condense([
CallGoals,
@@ -1423,7 +1423,7 @@
generate_deep_det_call(ModuleInfo, "prepare_for_callback", 1,
[SiteNumVar], [], PrepareGoal),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
LineNumber = term.context_line(Context),
FileName0 = term.context_file(Context),
compress_filename(!.DeepInfo, FileName0, FileName),
@@ -1769,7 +1769,7 @@
= hlds_goal_info.
goal_info_add_nonlocals_make_impure(!.GoalInfo, NewNonLocals) = !:GoalInfo :-
- goal_info_get_nonlocals(!.GoalInfo, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(!.GoalInfo),
NonLocals = set.union(NonLocals0, NewNonLocals),
goal_info_set_nonlocals(NonLocals, !GoalInfo),
make_impure(!GoalInfo).
@@ -1784,7 +1784,7 @@
:- pred make_impure(hlds_goal_info::in, hlds_goal_info::out) is det.
make_impure(!GoalInfo) :-
- ( goal_info_get_purity(!.GoalInfo, purity_impure) ->
+ ( goal_info_get_purity(!.GoalInfo) = purity_impure ->
% We don't add not_impure_for_determinism, since we want to
% keep the existing determinism.
true
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.80
diff -u -b -r1.80 deforest.m
--- compiler/deforest.m 2 Aug 2007 01:23:58 -0000 1.80
+++ compiler/deforest.m 2 Aug 2007 08:34:11 -0000
@@ -292,7 +292,7 @@
pd_info_get_instmap(!.PDInfo, InstMap0),
partially_evaluate_conj_goals(!.Goals, [], !:Goals, !PDInfo, !IO),
pd_info_set_instmap(InstMap0, !PDInfo),
- goal_info_get_nonlocals(!.GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(!.GoalInfo),
globals.io_lookup_bool_option(deforestation, Deforestation, !IO),
(
Deforestation = yes,
@@ -783,7 +783,7 @@
; OpaqueGoal = LaterGoal
),
OpaqueGoal = hlds_goal(_, OpaqueGoalInfo),
- goal_info_get_nonlocals(OpaqueGoalInfo, OpaqueNonLocals),
+ OpaqueNonLocals = goal_info_get_nonlocals(OpaqueGoalInfo),
set.intersect(OpaqueNonLocals, OpaqueVars, UsedOpaqueVars),
\+ set.empty(UsedOpaqueVars)
->
@@ -878,7 +878,7 @@
; MaybeLaterGoal = yes(ImpureGoal)
),
ImpureGoal = hlds_goal(_, ImpureGoalInfo),
- \+ goal_info_get_purity(ImpureGoalInfo, purity_pure)
+ \+ goal_info_get_purity(ImpureGoalInfo) = purity_pure
->
pd_debug_message("goal list contains impure goal(s)\n", [], !IO),
ShouldTry = no
@@ -1273,7 +1273,7 @@
% Give the conjunction a context so that the generated predicate
% name points to the location of the first goal.
EarlierGoal = hlds_goal(_, EarlierGoalInfo),
- goal_info_get_context(EarlierGoalInfo, EarlierContext),
+ EarlierContext = goal_info_get_context(EarlierGoalInfo),
goal_info_set_context(EarlierContext, ConjInfo0, ConjInfo),
FoldGoal = hlds_goal(conj(plain_conj, DeforestConj), ConjInfo).
@@ -1497,7 +1497,7 @@
AfterIrrelevant, AfterGoals, !:SubConjNonLocals) :-
AddGoalNonLocals = (pred(Goal::in, Vars0::in, Vars::out) is det :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, GoalNonLocals),
+ GoalNonLocals = goal_info_get_nonlocals(GoalInfo),
set.union(Vars0, GoalNonLocals, Vars)
),
list.foldl(AddGoalNonLocals, RevBeforeGoals, !NonLocals),
@@ -1618,7 +1618,7 @@
; EarlierGoalExpr = if_then_else(Vars, Cond, Then0, Else0) ->
pd_info_update_goal(Cond, !PDInfo),
Cond = hlds_goal(_, CondInfo),
- goal_info_get_nonlocals(CondInfo, CondNonLocals),
+ CondNonLocals = goal_info_get_nonlocals(CondInfo),
set.union(CondNonLocals, NonLocals, ThenNonLocals),
append_goal(Then0, BetweenGoals, LaterGoal,
ThenNonLocals, 1, DeforestInfo, Then, !PDInfo, !IO),
@@ -1636,14 +1636,14 @@
pd_info_set_instmap(InstMap0, !PDInfo),
goal_list_instmap_delta([EarlierGoal | BetweenGoals], Delta0),
LaterGoal = hlds_goal(_, LaterInfo),
- goal_info_get_instmap_delta(LaterInfo, Delta1),
+ Delta1 = goal_info_get_instmap_delta(LaterInfo),
instmap_delta_apply_instmap_delta(Delta0, Delta1, test_size, Delta2),
instmap_delta_restrict(NonLocals, Delta2, Delta),
goal_list_determinism([EarlierGoal | BetweenGoals], Detism0),
- goal_info_get_determinism(LaterInfo, Detism1),
+ Detism1 = goal_info_get_determinism(LaterInfo),
det_conjunction_detism(Detism0, Detism1, Detism),
goal_list_purity([EarlierGoal | BetweenGoals], Purity0),
- goal_info_get_purity(LaterInfo, Purity1),
+ Purity1 = goal_info_get_purity(LaterInfo),
worst_purity(Purity0, Purity1) = Purity,
goal_info_init(NonLocals, Delta, Detism, Purity, GoalInfo),
Goal2 = hlds_goal(GoalExpr, GoalInfo),
@@ -1740,7 +1740,7 @@
Name = unqualify_name(SymName),
list.length(Args, Arity),
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
pd_info_get_local_term_info(!.PDInfo, LocalTermInfo0),
@@ -1863,7 +1863,7 @@
% Update the quantification if not all the output arguments are used.
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_nonlocals(GoalInfo1, NonLocals1),
+ NonLocals1 = goal_info_get_nonlocals(GoalInfo1),
set.list_to_set(Args, NonLocals),
( set.equal(NonLocals1, NonLocals) ->
Goal2 = Goal1
@@ -1922,9 +1922,9 @@
pd_info_incr_size_delta(SizeDelta, !PDInfo),
pd_info_set_changed(yes, !PDInfo),
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Det0),
+ Det0 = goal_info_get_determinism(GoalInfo0),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_determinism(GoalInfo, Det),
+ Det = goal_info_get_determinism(GoalInfo),
% Rerun determinism analysis later if the determinism of any of
% the sub-goals changes - this avoids problems with inlining
Index: compiler/delay_construct.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_construct.m,v
retrieving revision 1.24
diff -u -b -r1.24 delay_construct.m
--- compiler/delay_construct.m 6 Jan 2007 09:23:28 -0000 1.24
+++ compiler/delay_construct.m 2 Aug 2007 08:13:14 -0000
@@ -98,7 +98,7 @@
GoalExpr0 = conj(ConjType, Goals0),
(
ConjType = plain_conj,
- goal_info_get_determinism(GoalInfo0, Detism),
+ Detism = goal_info_get_determinism(GoalInfo0),
determinism_components(Detism, CanFail, MaxSoln),
(
% If the conjunction cannot fail, then its conjuncts cannot
@@ -144,7 +144,7 @@
;
GoalExpr0 = if_then_else(Vars, Cond0, Then0, Else0),
Cond0 = hlds_goal(_, CondInfo0),
- goal_info_get_instmap_delta(CondInfo0, CondInstMapDelta),
+ CondInstMapDelta = goal_info_get_instmap_delta(CondInfo0),
instmap.apply_instmap_delta(InstMap0, CondInstMapDelta, InstMapThen),
delay_construct_in_goal(Cond0, InstMap0, DelayInfo, Cond),
delay_construct_in_goal(Then0, InstMapThen, DelayInfo, Then),
@@ -203,7 +203,7 @@
delay_construct_in_conj([Goal0 | Goals0], InstMap0, DelayInfo,
ConstructedVars0, RevDelayedGoals0, Goals) :-
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
instmap.apply_instmap_delta(InstMap0, InstMapDelta0, InstMap1),
(
GoalExpr0 = unify(_, _, _, Unif, _),
@@ -221,7 +221,7 @@
;
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
delay_construct_skippable(GoalExpr0, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
maybe_complete_with_typeinfo_vars(NonLocals,
DelayInfo ^ body_typeinfo_liveness,
DelayInfo ^ vartypes,
@@ -229,7 +229,7 @@
set.intersect(CompletedNonLocals, ConstructedVars0,
Intersection),
set.empty(Intersection),
- goal_info_get_purity(GoalInfo0, purity_pure)
+ goal_info_get_purity(GoalInfo0) = purity_pure
->
delay_construct_in_conj(Goals0, InstMap1, DelayInfo,
ConstructedVars0, RevDelayedGoals0, Goals1),
@@ -250,7 +250,7 @@
;
GoalExpr = plain_call(_, _, _, inline_builtin, _, _)
),
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _CanFail, MaxSoln),
MaxSoln \= at_most_many.
Index: compiler/delay_partial_inst.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/delay_partial_inst.m,v
retrieving revision 1.1
diff -u -b -r1.1 delay_partial_inst.m
--- compiler/delay_partial_inst.m 25 Jun 2007 00:58:10 -0000 1.1
+++ compiler/delay_partial_inst.m 2 Aug 2007 03:27:56 -0000
@@ -327,7 +327,7 @@
% Unify the canonical variables and corresponding ground
% arguments (if any).
- goal_info_get_context(GoalInfo0, ProgContext),
+ ProgContext = goal_info_get_context(GoalInfo0),
SubUnifyGoals = list.filter_map_corresponding3(
maybe_unify_var_with_ground_var(ModuleInfo, ProgContext),
CanonVars, Args, UniModes),
@@ -362,7 +362,7 @@
% Unify each ground argument with the corresponding canonical
% variable.
ModuleInfo = !.DelayInfo ^ dpi_module_info,
- goal_info_get_context(GoalInfo0, ProgContext),
+ ProgContext = goal_info_get_context(GoalInfo0),
SubUnifyGoals = list.filter_map_corresponding3(
maybe_unify_var_with_ground_var(ModuleInfo, ProgContext),
CanonArgs, DeconArgs, UniModes),
@@ -408,7 +408,7 @@
get_sole_cons_id_and_canon_vars(!.ConstructMap, LHS, ConsId,
CanonArgs)
then
- goal_info_get_context(GoalInfo0, ProgContext),
+ ProgContext = goal_info_get_context(GoalInfo0),
create_pure_atomic_complicated_unification(RHSVar,
rhs_functor(ConsId, no, CanonArgs),
ProgContext, umc_explicit, [], TestGoal),
Index: compiler/dep_par_conj.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dep_par_conj.m,v
retrieving revision 1.20
diff -u -b -r1.20 dep_par_conj.m
--- compiler/dep_par_conj.m 17 May 2007 03:52:40 -0000 1.20
+++ compiler/dep_par_conj.m 2 Aug 2007 08:14:08 -0000
@@ -617,7 +617,7 @@
% Wrap a purity scope around the goal if purity would have been lessened
% by the addition of signal goals (which are impure) or calls to
% parallelised procs (which may be impure).
- goal_info_get_purity(GoalInfo, Purity),
+ Purity = goal_info_get_purity(GoalInfo),
( Purity = purity_impure ->
NewGoal = NewGoal0
;
@@ -644,13 +644,13 @@
transform_conjunct(SharedVars, FutureMap, Goal0, Goal, !InstMap,
!VarSet, !VarTypes, !ModuleInfo, !ParProcs) :-
- goal_get_nonlocals(Goal0, Nonlocals),
+ Nonlocals = goal_get_nonlocals(Goal0),
set.intersect(Nonlocals, SharedVars, Intersect),
( set.empty(Intersect) ->
Goal = Goal0
;
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
% Divide shared variables into those that are produced by this
% conjunct, and those that are consumed by it.
@@ -694,8 +694,8 @@
set(prog_var)::out, instmap_delta::out) is det.
get_nonlocals_and_instmaps(hlds_goal(_, GoalInfo), Nonlocals, InstMapDelta) :-
- goal_info_get_nonlocals(GoalInfo, Nonlocals),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta).
+ Nonlocals = goal_info_get_nonlocals(GoalInfo),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo).
:- pred find_shared_variables_2(module_info::in, int::in,
list(set(prog_var))::in, instmap::in, list(instmap_delta)::in,
@@ -1035,8 +1035,7 @@
:- pred var_in_nonlocals(prog_var::in, hlds_goal::in) is semidet.
var_in_nonlocals(Var, Goal) :-
- goal_get_nonlocals(Goal, Nonlocals),
- set.member(Var, Nonlocals).
+ set.member(Var, goal_get_nonlocals(Goal)).
:- pred var_not_in_nonlocals(prog_var::in, hlds_goal::in) is semidet.
Index: compiler/det_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_analysis.m,v
retrieving revision 1.207
diff -u -b -r1.207 det_analysis.m
--- compiler/det_analysis.m 4 Mar 2007 23:37:55 -0000 1.207
+++ compiler/det_analysis.m 2 Aug 2007 03:33:10 -0000
@@ -386,14 +386,14 @@
InstMap0, !.SolnContext, RightFailingContexts,
MaybePromiseEqvSolutionSets, DetInfo, Detism, GoalFailingContexts,
!Specs) :-
- goal_info_get_nonlocals(GoalInfo0, NonLocalVars),
- goal_info_get_instmap_delta(GoalInfo0, InstmapDelta),
+ NonLocalVars = goal_info_get_nonlocals(GoalInfo0),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo0),
% If a pure or semipure goal has no output variables, then the goal
% is in a single-solution context.
(
det_no_output_vars(NonLocalVars, InstMap0, InstmapDelta, DetInfo),
- goal_info_get_purity(GoalInfo0, Purity),
+ Purity = goal_info_get_purity(GoalInfo0),
(
Purity = purity_impure
=>
@@ -481,7 +481,7 @@
% LLDS back-ends rely on this.)
GoalExpr1 = if_then_else(_, hlds_goal(_, CondInfo), _, _),
- goal_info_get_determinism(CondInfo, CondDetism),
+ CondDetism = goal_info_get_determinism(CondInfo),
determinism_components(CondDetism, _, at_most_many),
Solns \= at_most_many
->
@@ -495,7 +495,7 @@
Solns = at_most_zero,
some [ConjGoalInfo] (
list.member(hlds_goal(_, ConjGoalInfo), ConjGoals),
- goal_info_get_determinism(ConjGoalInfo, ConjGoalDetism),
+ ConjGoalDetism = goal_info_get_determinism(ConjGoalInfo),
determinism_components(ConjGoalDetism, _, at_most_many)
)
->
@@ -697,7 +697,7 @@
->
true
;
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
determinism_components(Detism, CanFail, MaxSoln),
( CanFail \= cannot_fail ->
First = "Error: parallel conjunct may fail."
@@ -758,7 +758,7 @@
can_fail, at_most_zero, Detism, [], GoalFailingContexts0, !Specs),
(
Goals = [],
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
FailingContext = failing_context(Context, fail_goal),
GoalFailingContexts = [FailingContext | GoalFailingContexts0]
;
@@ -862,7 +862,7 @@
determinism_components(Detism, CanFail, NumSolns),
(
SwitchCanFail = can_fail,
- goal_info_get_context(GoalInfo, SwitchContext),
+ SwitchContext = goal_info_get_context(GoalInfo),
FailingContext = failing_context(SwitchContext,
incomplete_switch(Var)),
GoalFailingContexts = [FailingContext | GoalFailingContexts0]
@@ -930,7 +930,7 @@
ProcId = ProcIdPrime,
determinism_components(Detism, CanFail, at_most_many)
;
- goal_info_get_context(GoalInfo, GoalContext),
+ GoalContext = goal_info_get_context(GoalInfo),
det_get_proc_info(DetInfo, ProcInfo),
proc_info_get_varset(ProcInfo, VarSet),
det_info_get_module_info(DetInfo, ModuleInfo),
@@ -960,7 +960,7 @@
),
(
CanFail = can_fail,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
FailingContext = failing_context(Context, call_goal(PredId, ProcId)),
GoalFailingContexts = [FailingContext]
;
@@ -978,7 +978,7 @@
GoalInfo, SolnContext, RightFailingContexts, DetInfo,
Detism, GoalFailingContexts, !Specs) :-
determinism_components(CallDetism, CanFail, NumSolns),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
NumSolns = at_most_many_cc,
SolnContext = all_solns
@@ -1063,7 +1063,7 @@
NumSolns1 = at_most_many_cc,
SolnContext = all_solns
->
- goal_info_get_context(GoalInfo, GoalContext),
+ GoalContext = goal_info_get_context(GoalInfo),
proc_info_get_varset(ProcInfo, VarSet),
WrongContextPredPieces = describe_one_pred_name(ModuleInfo,
should_module_qualify, PredId),
@@ -1086,7 +1086,7 @@
determinism_components(Detism, CanFail, NumSolns),
(
CanFail = can_fail,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
FailingContext = failing_context(Context,
call_goal(PredId, ProcId)),
GoalFailingContexts = [FailingContext]
@@ -1152,7 +1152,7 @@
determinism_components(Detism, UnifyCanFail, UnifyNumSolns),
(
UnifyCanFail = can_fail,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
Unify = construct(_, _, _, _, _, _, _),
unexpected(this_file, "can_fail construct")
@@ -1284,7 +1284,7 @@
determinism_components(Detism, CanFail, _),
(
CanFail = can_fail,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
GoalFailingContexts = [failing_context(Context, negated_goal)]
;
CanFail = cannot_fail,
@@ -1310,7 +1310,7 @@
det_get_proc_info(DetInfo, ProcInfo),
proc_info_get_varset(ProcInfo, VarSet),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
Kind = equivalent_solutions,
SolnContextToUse = first_soln,
@@ -1395,14 +1395,14 @@
MaybePromiseEqvSolutionSets = no,
SolnContextToUse = first_soln
),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_changed_vars(InstmapDelta, ChangedVars),
det_info_get_module_info(DetInfo, ModuleInfo),
% BoundVars must include both vars whose inst has changed and vars
% with inst any which may have been further constrained by the goal.
set.divide(var_is_ground_in_instmap(ModuleInfo, InstMap0),
ChangedVars, _GroundAtStartVars, GroundBoundVars),
- goal_info_get_nonlocals(GoalInfo, NonLocalVars),
+ NonLocalVars = goal_info_get_nonlocals(GoalInfo),
AnyBoundVars = set.filter(var_is_any_in_instmap(ModuleInfo, InstMap0),
NonLocalVars),
BoundVars = set.union(GroundBoundVars, AnyBoundVars),
@@ -1484,7 +1484,7 @@
->
true
;
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
DetismStr = determinism_to_string(Detism),
Pieces = [words("Error: trace goal has determinism"),
quote(DetismStr), suffix(","),
@@ -1563,7 +1563,7 @@
det_type_has_user_defined_equality_pred(DetInfo, Type)
->
( CanFail = can_fail ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
proc_info_get_varset(ProcInfo, VarSet),
(
GoalContext = ccuc_switch,
@@ -1603,7 +1603,7 @@
verbose_only(VerbosePieces)])]),
!:Specs = [Spec | !.Specs]
; SolnContext = all_solns ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
proc_info_get_varset(ProcInfo, VarSet),
(
GoalContext = ccuc_switch,
Index: compiler/det_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/det_report.m,v
retrieving revision 1.137
diff -u -b -r1.137 det_report.m
--- compiler/det_report.m 19 Jan 2007 07:04:10 -0000 1.137
+++ compiler/det_report.m 2 Aug 2007 03:32:39 -0000
@@ -392,7 +392,7 @@
Cmp = tighter,
det_info_get_pred_id(DetInfo, PredId),
det_info_get_proc_id(DetInfo, ProcId),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
det_info_get_module_info(DetInfo, ModuleInfo),
PredPieces = describe_one_proc_name_mode(ModuleInfo,
should_not_module_qualify, proc(PredId, ProcId)),
@@ -495,7 +495,7 @@
det_diagnose_goal(hlds_goal(GoalExpr, GoalInfo), Desired, SwitchContext,
DetInfo, Msgs) :-
- goal_info_get_determinism(GoalInfo, Actual),
+ Actual = goal_info_get_determinism(GoalInfo),
( compare_determinisms(Desired, Actual, tighter) ->
det_diagnose_goal_2(GoalExpr, GoalInfo, Desired, Actual, SwitchContext,
DetInfo, Msgs)
@@ -523,7 +523,7 @@
DesSolns \= at_most_many_cc,
ClausesWithSoln > 1
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Disjunction has multiple clauses with solutions.")],
Msg = simple_msg(Context, [always(Pieces)]),
Msgs = [Msg] ++ Msgs1
@@ -542,7 +542,7 @@
SwitchCanFail = can_fail,
determinism_components(Desired, cannot_fail, _)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
det_diagnose_switch_context(SwitchContext, DetInfo, NestingPieces),
det_get_proc_info(DetInfo, ProcInfo),
proc_info_get_varset(ProcInfo, VarSet),
@@ -571,7 +571,7 @@
det_diagnose_goal_2(plain_call(PredId, ProcId, _, _, CallContext, _), GoalInfo,
Desired, Actual, _, DetInfo, Msgs) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
det_report_call_context(Context, CallContext, DetInfo, PredId, ProcId,
InitMsgs, StartingPieces),
det_diagnose_atomic_goal(Desired, Actual, Context, StartingPieces,
@@ -580,13 +580,13 @@
det_diagnose_goal_2(generic_call(GenericCall, _, _, _), GoalInfo,
Desired, Actual, _, _DetInfo, Msgs) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
report_generic_call_context(GenericCall, StartingPieces),
det_diagnose_atomic_goal(Desired, Actual, Context, StartingPieces, Msgs).
det_diagnose_goal_2(unify(LHS, RHS, _, _, UnifyContext), GoalInfo,
Desired, Actual, _, DetInfo, Msgs) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
First = yes,
Last = yes,
det_report_unify_context(First, Last, Context, UnifyContext,
@@ -597,7 +597,7 @@
Desired, _Actual, SwitchContext, DetInfo, Msgs) :-
determinism_components(Desired, _DesiredCanFail, DesiredSolns),
Cond = hlds_goal(_CondGoal, CondInfo),
- goal_info_get_determinism(CondInfo, CondDetism),
+ CondDetism = goal_info_get_determinism(CondInfo),
determinism_components(CondDetism, _CondCanFail, CondSolns),
(
CondSolns = at_most_many,
@@ -619,14 +619,14 @@
DesiredCanFail = cannot_fail,
ActualCanFail = can_fail
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Negated goal can succeed.")],
Msgs = [simple_msg(Context, [always(Pieces)])]
;
DesiredSolns = at_most_zero,
ActualSolns \= at_most_zero
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Negated goal can fail.")],
Msgs = [simple_msg(Context, [always(Pieces)])]
;
@@ -636,7 +636,7 @@
det_diagnose_goal_2(scope(_, Goal), _, Desired, Actual, SwitchContext, DetInfo,
Msgs) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_determinism(GoalInfo, Internal),
+ Internal = goal_info_get_determinism(GoalInfo),
( Actual = Internal ->
InternalDesired = Desired
;
@@ -647,7 +647,7 @@
det_diagnose_goal_2(call_foreign_proc(_, _, _, _, _, _, _), GoalInfo, Desired,
_, _, _, Msgs) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
DesiredStr = determinism_to_string(Desired),
Pieces = [words("Determinism declaration not satisfied."),
words("Desired determinism is " ++ DesiredStr ++ ".")],
@@ -746,7 +746,7 @@
det_diagnose_goal(Goal, ClauseDesired, SwitchContext, DetInfo, Msgs1),
(
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_determinism(GoalInfo, GoalDetism),
+ GoalDetism = goal_info_get_determinism(GoalInfo),
determinism_components(GoalDetism, _, at_most_zero)
->
true
Index: compiler/disj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/disj_gen.m,v
retrieving revision 1.103
diff -u -b -r1.103 disj_gen.m
--- compiler/disj_gen.m 31 Jul 2007 01:56:34 -0000 1.103
+++ compiler/disj_gen.m 2 Aug 2007 07:48:20 -0000
@@ -530,7 +530,7 @@
!CI),
maybe_generate_internal_event_code(Goal, DisjGoalInfo, TraceCode, !CI),
- goal_info_get_code_model(GoalInfo, GoalCodeModel),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo),
code_gen.generate_goal(GoalCodeModel, Goal, GoalCode, !CI),
(
Index: compiler/distance_granularity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/distance_granularity.m,v
retrieving revision 1.3
diff -u -b -r1.3 distance_granularity.m
--- compiler/distance_granularity.m 23 May 2007 10:09:16 -0000 1.3
+++ compiler/distance_granularity.m 2 Aug 2007 08:14:49 -0000
@@ -518,7 +518,7 @@
% The non-locals of the hlds_goal_info of the if_then_else goal must
% contain the variable controlling the granularity.
- goal_info_get_nonlocals(ConjInfo, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(ConjInfo),
set.insert(NonLocals0, GranularityVar, NonLocals),
goal_info_set_nonlocals(NonLocals, ConjInfo, IfThenElseInfo),
IfThenElseGoal = hlds_goal(if_then_else([], Cond, Then, Else),
@@ -582,7 +582,7 @@
CallBuiltin, CallUnifyContext, CallSymName),
% Var has instmap bound(Distance).
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
MerInst = bound(shared, [bound_functor(int_const(Distance),
[])]),
instmap_delta_insert(Var, MerInst, InstMapDelta0,
@@ -707,7 +707,7 @@
% Take the context of the first goal of the conjunction.
list.index1_det(Goals0, 1, FirstGoal),
FirstGoal = hlds_goal(_, FirstGoalInfo),
- goal_info_get_context(FirstGoalInfo, Context),
+ Context = goal_info_get_context(FirstGoalInfo),
goal_info_init(NonLocals, InstMapDeltaDecrement, Detism,
Purity, Context, DecrementGoalInfo),
DecrementGoal = hlds_goal(DecrementGoalExpr,
@@ -724,7 +724,7 @@
GoalExpr = plain_call(CalleePredId, CalleeProcId, CallArgs,
CallBuiltin, CallUnifyContext, CallSymName),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
MerInst = ground(shared, none),
instmap_delta_insert(Var, MerInst, InstMapDelta0,
InstMapDelta),
@@ -961,10 +961,10 @@
% Update the nonlocals and the instmap_delta of the hlds_goal_info
% of the recursive plain call for Var.
- goal_info_get_nonlocals(CallInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(CallInfo0),
set.insert(NonLocals0, Var, NonLocals),
goal_info_set_nonlocals(NonLocals, CallInfo0, CallInfo1),
- goal_info_get_instmap_delta(CallInfo1, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(CallInfo1),
MerInst = ground(shared, none),
instmap_delta_insert(Var, MerInst, InstMapDelta0, InstMapDelta),
goal_info_set_instmap_delta(InstMapDelta, CallInfo1, CallInfo),
Index: compiler/equiv_type_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/equiv_type_hlds.m,v
retrieving revision 1.42
diff -u -b -r1.42 equiv_type_hlds.m
--- compiler/equiv_type_hlds.m 2 Aug 2007 01:23:59 -0000 1.42
+++ compiler/equiv_type_hlds.m 2 Aug 2007 08:14:57 -0000
@@ -708,7 +708,7 @@
Changed, !Info) :-
replace_in_goal_expr(EqvMap, GoalExpr0, GoalExpr, Changed0, !Info),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
TVarSet0 = !.Info ^ tvarset,
Cache0 = !.Info ^ inst_cache,
instmap_delta_map_foldl(
Index: compiler/erl_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_code_gen.m,v
retrieving revision 1.22
diff -u -b -r1.22 erl_code_gen.m
--- compiler/erl_code_gen.m 20 Jul 2007 05:11:16 -0000 1.22
+++ compiler/erl_code_gen.m 2 Aug 2007 07:45:07 -0000
@@ -336,7 +336,7 @@
erl_gen_proc_defn(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo,
ProcVarSet, ProcBody, EnvVarNames) :-
pred_info_get_import_status(PredInfo, ImportStatus),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
proc_info_get_headvars(ProcInfo, HeadVars),
proc_info_get_initial_instmap(ProcInfo, ModuleInfo, InstMap0),
proc_info_get_goal(ProcInfo, Goal0),
@@ -348,13 +348,13 @@
% declared.
Goal0 = hlds_goal(GoalExpr, GoalInfo0),
- goal_info_get_code_gen_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_code_gen_nonlocals(GoalInfo0),
set.list_to_set(HeadVars, HeadVarsSet),
set.intersect(HeadVarsSet, NonLocals0, NonLocals),
goal_info_set_code_gen_nonlocals(NonLocals, GoalInfo0, GoalInfo),
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_context(GoalInfo, _Context),
+ _Context = goal_info_get_context(GoalInfo),
some [!Info] (
!:Info = erl_gen_info_init(ModuleInfo, PredId, ProcId),
@@ -447,8 +447,8 @@
%
erl_gen_goal(CodeModel, InstMap, Goal, MaybeSuccessExpr0, Code, !Info) :-
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_code_model(GoalInfo, GoalCodeModel),
+ Context = goal_info_get_context(GoalInfo),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo),
(
(
CodeModel = model_det,
@@ -463,7 +463,7 @@
->
unexpected(this_file, "erl_gen_goal: code model mismatch")
;
- goal_info_get_determinism(GoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(GoalInfo),
(
Determinism = detism_erroneous
->
@@ -490,8 +490,8 @@
erl_gen_commit(Goal, CodeModel, ScopeDetism, InstMap, Context,
MaybeSuccessExpr, Statement, !Info) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_code_model(GoalInfo, GoalCodeModel),
- goal_info_get_context(GoalInfo, _GoalContext),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo),
+ _GoalContext = goal_info_get_context(GoalInfo),
(
GoalCodeModel = model_non,
@@ -633,7 +633,7 @@
% goal). Thus there is nothing special we have to do here.
),
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_determinism(GoalInfo, GoalDetism),
+ GoalDetism = goal_info_get_determinism(GoalInfo),
erl_gen_goal_expr(GoalExpr, CodeModel, GoalDetism, InstMap, Context,
MaybeSuccessExpr, Statement, !Info)
).
@@ -1000,7 +1000,7 @@
erl_gen_ite(CodeModel, InstMap0, Cond, Then, Else, _Context, MaybeSuccessExpr0,
Statement, !Info) :-
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
% model_det Cond:
% <(Cond -> Then ; Else)>
@@ -1010,7 +1010,7 @@
CondCodeModel = model_det,
erl_gen_goal(model_det, InstMap0, Cond, no, CondStatement, !Info),
- goal_info_get_determinism(CondGoalInfo, CondDeterminism),
+ CondDeterminism = goal_info_get_determinism(CondGoalInfo),
( CondDeterminism = detism_erroneous ->
% The `Then' code is unreachable.
Statement = CondStatement
@@ -1147,7 +1147,7 @@
erl_gen_negation(Cond, CodeModel, InstMap, _Context, MaybeSuccessExpr,
Statement, !Info) :-
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
% model_det negation:
% <not(Goal)>
@@ -1253,7 +1253,7 @@
Statement, !Info) :-
Rest = [_ | _],
First = hlds_goal(_, FirstGoalInfo),
- goal_info_get_determinism(FirstGoalInfo, FirstDeterminism),
+ FirstDeterminism = goal_info_get_determinism(FirstGoalInfo),
( determinism_components(FirstDeterminism, _, at_most_zero) ->
% the `Rest' code is unreachable
% There is no success expression in this case.
@@ -1436,8 +1436,8 @@
%
First = hlds_goal(_, FirstGoalInfo),
- goal_info_get_code_model(FirstGoalInfo, FirstCodeModel),
- goal_info_get_determinism(FirstGoalInfo, FirstDeterminism),
+ FirstCodeModel = goal_info_get_code_model(FirstGoalInfo),
+ FirstDeterminism = goal_info_get_determinism(FirstGoalInfo),
(
FirstCodeModel = model_det,
erl_fix_success_expr(InstMap, First, MaybeSuccessExpr,
Index: compiler/erl_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_code_util.m,v
retrieving revision 1.12
diff -u -b -r1.12 erl_code_util.m
--- compiler/erl_code_util.m 2 Aug 2007 01:23:59 -0000 1.12
+++ compiler/erl_code_util.m 2 Aug 2007 05:25:48 -0000
@@ -387,8 +387,8 @@
erl_gen_info_get_module_info(Info, ModuleInfo),
erl_gen_info_get_var_types(Info, VarTypes),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
BoundNonLocals = set.filter(is_bound_and_not_dummy(ModuleInfo, VarTypes,
InstMap, InstmapDelta), NonLocals).
Index: compiler/erl_unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/erl_unify_gen.m,v
retrieving revision 1.9
diff -u -b -r1.9 erl_unify_gen.m
--- compiler/erl_unify_gen.m 20 Jul 2007 07:06:47 -0000 1.9
+++ compiler/erl_unify_gen.m 2 Aug 2007 07:45:15 -0000
@@ -327,7 +327,7 @@
module_info_pred_proc_info(ModuleInfo, PredProcId, PredInfo, ProcInfo),
pred_info_get_arg_types(PredInfo, CalleeTypes),
proc_info_get_argmodes(ProcInfo, ArgModes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
% Create extra variables needed to complete the call to the procedure.
NumExtraVars = list.length(CalleeTypes) - list.length(CurriedArgs),
Index: compiler/exception_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/exception_analysis.m,v
retrieving revision 1.38
diff -u -b -r1.38 exception_analysis.m
--- compiler/exception_analysis.m 23 May 2007 10:09:16 -0000 1.38
+++ compiler/exception_analysis.m 2 Aug 2007 08:15:07 -0000
@@ -347,7 +347,7 @@
check_goal_for_exceptions(SCC, VarTypes, hlds_goal(GoalExpr, GoalInfo),
!Result, !ModuleInfo, !IO) :-
- ( goal_info_get_determinism(GoalInfo, detism_erroneous) ->
+ ( goal_info_get_determinism(GoalInfo) = detism_erroneous ->
!:Result = !.Result ^ status := may_throw(user_exception)
;
check_goal_for_exceptions_2(SCC, VarTypes, GoalExpr, GoalInfo,
Index: compiler/export.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/export.m,v
retrieving revision 1.112
diff -u -b -r1.112 export.m
--- compiler/export.m 25 Jul 2007 06:12:18 -0000 1.112
+++ compiler/export.m 2 Aug 2007 07:43:12 -0000
@@ -391,7 +391,7 @@
generate_proc_arg_info(ArgTypes, ModuleInfo, ProcInfo, NewProcInfo),
proc_info_arg_info(NewProcInfo, ArgInfos)
),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
assoc_list.from_corresponding_lists(ArgInfos, ArgTypes, ArgInfoTypes0),
% Figure out what the C return type should be, and build the `return'
Index: compiler/follow_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/follow_code.m,v
retrieving revision 1.89
diff -u -b -r1.89 follow_code.m
--- compiler/follow_code.m 19 Jan 2007 07:04:12 -0000 1.89
+++ compiler/follow_code.m 2 Aug 2007 07:31:16 -0000
@@ -109,7 +109,7 @@
GoalExpr0 = conj(ConjType, Goals0),
(
ConjType = plain_conj,
- goal_info_get_purity(GoalInfo, ConjPurity),
+ ConjPurity = goal_info_get_purity(GoalInfo),
move_follow_code_in_conj(Goals0, ConjPurity, Goals, !Changed)
;
ConjType = parallel_conj,
@@ -233,7 +233,7 @@
move_follow_code_select([Goal | Goals], FollowGoals, RestGoals, !Purity) :-
Goal = hlds_goal(GoalExpr, GoalInfo),
( move_follow_code_is_builtin(GoalExpr) ->
- goal_info_get_purity(GoalInfo, GoalPurity),
+ GoalPurity = goal_info_get_purity(GoalInfo),
!:Purity = worst_purity(!.Purity, GoalPurity),
move_follow_code_select(Goals, FollowGoals0, RestGoals, !Purity),
FollowGoals = [Goal | FollowGoals0]
@@ -267,7 +267,7 @@
FollowPurity, Else),
GoalExpr = if_then_else(Vars, Cond, Then, Else)
),
- goal_info_get_purity(GoalInfo0, OldPurity),
+ OldPurity = goal_info_get_purity(GoalInfo0),
NewPurity = worst_purity(OldPurity, FollowPurity),
goal_info_set_purity(NewPurity, GoalInfo0, GoalInfo),
Goal = hlds_goal(GoalExpr, GoalInfo).
@@ -311,7 +311,7 @@
follow_code_conjoin_goal_and_goal_list(Goal0, FollowGoals, FollowPurity,
Goal) :-
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Detism0),
+ Detism0 = goal_info_get_determinism(GoalInfo0),
determinism_components(Detism0, _CanFail0, MaxSolns0),
( MaxSolns0 = at_most_zero ->
Goal = Goal0
@@ -323,7 +323,7 @@
;
GoalExpr = conj(plain_conj, [Goal0 | FollowGoals])
),
- goal_info_get_purity(GoalInfo0, OldPurity),
+ OldPurity = goal_info_get_purity(GoalInfo0),
NewPurity = worst_purity(OldPurity, FollowPurity),
goal_info_set_purity(NewPurity, GoalInfo0, GoalInfo),
Goal = hlds_goal(GoalExpr, GoalInfo)
@@ -337,7 +337,7 @@
check_follow_code_detism([], _).
check_follow_code_detism([hlds_goal(_, GoalInfo) | Goals], Detism0) :-
- goal_info_get_determinism(GoalInfo, Detism1),
+ Detism1 = goal_info_get_determinism(GoalInfo),
det_conjunction_detism(Detism0, Detism1, Detism0),
check_follow_code_detism(Goals, Detism0).
Index: compiler/foreign.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/foreign.m,v
retrieving revision 1.73
diff -u -b -r1.73 foreign.m
--- compiler/foreign.m 14 Jul 2007 02:32:42 -0000 1.73
+++ compiler/foreign.m 2 Aug 2007 07:43:19 -0000
@@ -348,7 +348,7 @@
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
pred_info_get_arg_types(PredInfo, ArgTypes),
proc_info_get_argmodes(ProcInfo, Modes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
% Build a list of argument variables, together with their names, modes,
% and types.
Index: compiler/format_call.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/format_call.m,v
retrieving revision 1.10
diff -u -b -r1.10 format_call.m
--- compiler/format_call.m 6 Jan 2007 09:23:31 -0000 1.10
+++ compiler/format_call.m 2 Aug 2007 03:33:17 -0000
@@ -457,7 +457,7 @@
Name = pred_info_name(PredInfo),
( is_format_call(ModuleName, Name, Args, StringVar, ValuesVar) ->
Arity = pred_info_orig_arity(PredInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
FormatCallSite = format_call_site(StringVar, ValuesVar,
ModuleName, Name, Arity, Context, CurId),
!:FormatCallSites = [FormatCallSite | !.FormatCallSites],
Index: compiler/goal_form.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_form.m,v
retrieving revision 1.38
diff -u -b -r1.38 goal_form.m
--- compiler/goal_form.m 6 Jan 2007 09:23:32 -0000 1.38
+++ compiler/goal_form.m 2 Aug 2007 05:27:13 -0000
@@ -191,7 +191,7 @@
%
goal_can_throw(hlds_goal(GoalExpr, GoalInfo), Result, !ModuleInfo, !IO) :-
- goal_info_get_determinism(GoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(GoalInfo),
( Determinism \= detism_erroneous ->
goal_can_throw_2(GoalExpr, GoalInfo, Result, !ModuleInfo, !IO)
;
@@ -448,7 +448,7 @@
goal_can_throw_func(MaybeModuleInfo, hlds_goal(GoalExpr, GoalInfo))
= CanThrow :-
- goal_info_get_determinism(GoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(GoalInfo),
( Determinism = detism_erroneous ->
CanThrow = yes
;
@@ -712,7 +712,7 @@
%-----------------------------------------------------------------------------%
cannot_fail_before_stack_flush(hlds_goal(GoalExpr, GoalInfo)) :-
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, CanFail, _),
(
CanFail = cannot_fail
@@ -742,7 +742,7 @@
->
true
;
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, cannot_fail, _)
->
cannot_fail_before_stack_flush_conj(Goals)
Index: compiler/goal_path.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_path.m,v
retrieving revision 1.43
diff -u -b -r1.43 goal_path.m
--- compiler/goal_path.m 17 May 2007 03:52:41 -0000 1.43
+++ compiler/goal_path.m 2 Aug 2007 03:33:33 -0000
@@ -165,8 +165,8 @@
;
Goal0 = scope(Reason, SubGoal0),
SubGoal0 = hlds_goal(_, InnerInfo),
- goal_info_get_determinism(GoalInfo, OuterDetism),
- goal_info_get_determinism(InnerInfo, InnerDetism),
+ OuterDetism = goal_info_get_determinism(GoalInfo),
+ InnerDetism = goal_info_get_determinism(InnerInfo),
( InnerDetism = OuterDetism ->
MaybeCut = scope_is_no_cut
;
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.150
diff -u -b -r1.150 goal_util.m
--- compiler/goal_util.m 2 Aug 2007 01:23:59 -0000 1.150
+++ compiler/goal_util.m 2 Aug 2007 07:45:53 -0000
@@ -385,7 +385,7 @@
%-----------------------------------------------------------------------------%
update_instmap(hlds_goal(_GoalExpr0, GoalInfo0), !InstMap) :-
- goal_info_get_instmap_delta(GoalInfo0, DeltaInstMap),
+ DeltaInstMap = goal_info_get_instmap_delta(GoalInfo0),
instmap.apply_instmap_delta(!.InstMap, DeltaInstMap, !:InstMap).
%-----------------------------------------------------------------------------%
@@ -1137,14 +1137,14 @@
% Work out the nonlocals, instmap_delta and determinism
% of the entire conjunction.
CaseGoal = hlds_goal(_, CaseGoalInfo),
- goal_info_get_nonlocals(CaseGoalInfo, CaseNonLocals0),
+ CaseNonLocals0 = goal_info_get_nonlocals(CaseGoalInfo),
set.insert(CaseNonLocals0, Var, CaseNonLocals),
- goal_info_get_instmap_delta(CaseGoalInfo, CaseInstMapDelta),
+ CaseInstMapDelta = goal_info_get_instmap_delta(CaseGoalInfo),
instmap_delta_apply_instmap_delta(ExtraInstMapDelta, CaseInstMapDelta,
test_size, InstMapDelta),
- goal_info_get_determinism(CaseGoalInfo, CaseDetism0),
+ CaseDetism0 = goal_info_get_determinism(CaseGoalInfo),
det_conjunction_detism(detism_semi, CaseDetism0, Detism),
- goal_info_get_purity(CaseGoalInfo, CasePurity),
+ CasePurity = goal_info_get_purity(CaseGoalInfo),
goal_info_init(CaseNonLocals, InstMapDelta,
Detism, CasePurity, CombinedGoalInfo),
Disjunct = hlds_goal(conj(plain_conj, GoalList), CombinedGoalInfo).
@@ -1156,7 +1156,7 @@
conj_list_to_goal([Cond0, Then], CondThenInfo, CondThen),
Cond0 = hlds_goal(_, CondInfo0),
- goal_info_get_determinism(CondInfo0, CondDetism0),
+ CondDetism0 = goal_info_get_determinism(CondInfo0),
determinism_components(CondDetism0, CondCanFail0, CondMaxSoln0),
@@ -1189,8 +1189,8 @@
;
instmap_delta_init_reachable(NegCondDelta)
),
- goal_info_get_nonlocals(CondInfo, CondNonLocals),
- goal_info_get_purity(CondInfo, CondPurity),
+ CondNonLocals = goal_info_get_nonlocals(CondInfo),
+ CondPurity = goal_info_get_purity(CondInfo),
goal_info_init(CondNonLocals, NegCondDelta, NegCondDet, CondPurity,
NegCondInfo),
@@ -1209,20 +1209,20 @@
Goal1 = hlds_goal(_, GoalInfo1),
Goal2 = hlds_goal(_, GoalInfo2),
- goal_info_get_nonlocals(GoalInfo1, NonLocals1),
- goal_info_get_nonlocals(GoalInfo2, NonLocals2),
- goal_info_get_nonlocals(GoalInfo, OuterNonLocals),
+ NonLocals1 = goal_info_get_nonlocals(GoalInfo1),
+ NonLocals2 = goal_info_get_nonlocals(GoalInfo2),
+ OuterNonLocals = goal_info_get_nonlocals(GoalInfo),
set.union(NonLocals1, NonLocals2, CombinedNonLocals0),
set.intersect(CombinedNonLocals0, OuterNonLocals, CombinedNonLocals),
- goal_info_get_instmap_delta(GoalInfo1, Delta1),
- goal_info_get_instmap_delta(GoalInfo2, Delta2),
+ Delta1 = goal_info_get_instmap_delta(GoalInfo1),
+ Delta2 = goal_info_get_instmap_delta(GoalInfo2),
instmap_delta_apply_instmap_delta(Delta1, Delta2, test_size,
CombinedDelta0),
instmap_delta_restrict(OuterNonLocals, CombinedDelta0, CombinedDelta),
- goal_info_get_determinism(GoalInfo1, Detism1),
- goal_info_get_determinism(GoalInfo2, Detism2),
+ Detism1 = goal_info_get_determinism(GoalInfo1),
+ Detism2 = goal_info_get_determinism(GoalInfo2),
det_conjunction_detism(Detism1, Detism2, CombinedDetism),
goal_list_purity([Goal1, Goal2], CombinedPurity),
@@ -1251,7 +1251,7 @@
goal_list_determinism(GoalsInConj, Detism),
goal_list_purity(GoalsInConj, Purity),
GoalAInfo = GoalA ^ hlds_goal_info,
- goal_info_get_context(GoalAInfo, Context),
+ Context = goal_info_get_context(GoalAInfo),
goal_info_init(NonLocals, InstMapDelta, Detism, Purity, Context,
ConjGoalInfo),
ConjGoal = hlds_goal(ConjGoalExpr, ConjGoalInfo).
@@ -1348,9 +1348,9 @@
EarlierGoal = hlds_goal(_, EarlierGoalInfo),
LaterGoal = hlds_goal(_, LaterGoalInfo),
- goal_info_get_determinism(EarlierGoalInfo, EarlierDetism),
+ EarlierDetism = goal_info_get_determinism(EarlierGoalInfo),
determinism_components(EarlierDetism, EarlierCanFail, _),
- goal_info_get_determinism(LaterGoalInfo, LaterDetism),
+ LaterDetism = goal_info_get_determinism(LaterGoalInfo),
determinism_components(LaterDetism, LaterCanFail, _),
% If --fully-strict was specified, don't convert (can_loop, can_fail)
@@ -1376,9 +1376,9 @@
EarlierGoal = hlds_goal(_, EarlierGoalInfo),
LaterGoal = hlds_goal(_, LaterGoalInfo),
- goal_info_get_determinism(EarlierGoalInfo, EarlierDetism),
+ EarlierDetism = goal_info_get_determinism(EarlierGoalInfo),
determinism_components(EarlierDetism, EarlierCanFail, _),
- goal_info_get_determinism(LaterGoalInfo, LaterDetism),
+ LaterDetism = goal_info_get_determinism(LaterGoalInfo),
determinism_components(LaterDetism, LaterCanFail, _),
% If --fully-strict was specified, don't convert (can_loop, can_fail) into
@@ -1420,14 +1420,14 @@
VarTypes, ModuleInfo) :-
LaterGoal = hlds_goal(_, LaterGoalInfo),
EarlierGoal = hlds_goal(_, EarlierGoalInfo),
- goal_info_get_instmap_delta(EarlierGoalInfo, EarlierInstMapDelta),
+ EarlierInstMapDelta = goal_info_get_instmap_delta(EarlierGoalInfo),
instmap.apply_instmap_delta(InstMapBeforeEarlierGoal,
EarlierInstMapDelta, InstMapAfterEarlierGoal),
instmap_changed_vars(InstMapBeforeEarlierGoal, InstMapAfterEarlierGoal,
VarTypes, ModuleInfo, EarlierChangedVars),
- goal_info_get_nonlocals(LaterGoalInfo, LaterGoalNonLocals),
+ LaterGoalNonLocals = goal_info_get_nonlocals(LaterGoalInfo),
set.intersect(EarlierChangedVars, LaterGoalNonLocals, Intersection),
not set.empty(Intersection).
Index: compiler/granularity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/granularity.m,v
retrieving revision 1.8
diff -u -b -r1.8 granularity.m
--- compiler/granularity.m 7 May 2007 05:21:30 -0000 1.8
+++ compiler/granularity.m 2 Aug 2007 08:15:18 -0000
@@ -121,7 +121,7 @@
MaybeRuntimeCond = no,
Features = [],
InstMapDeltaSrc = [],
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
some [!Attributes] (
!:Attributes = default_attributes(lang_c),
set_purity(purity_impure, !Attributes),
Index: compiler/headvar_names.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/headvar_names.m,v
retrieving revision 1.3
diff -u -b -r1.3 headvar_names.m
--- compiler/headvar_names.m 2 Aug 2007 01:24:00 -0000 1.3
+++ compiler/headvar_names.m 2 Aug 2007 05:29:43 -0000
@@ -77,7 +77,7 @@
improve_single_clause_headvars(Conj0, HeadVars0, [],
VarSet0, VarSet, map.init, Subst, [], RevConj),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
rename_vars_in_var_set(no, Subst, NonLocals0, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo),
conj_list_to_goal(list.reverse(RevConj), GoalInfo, Goal),
@@ -152,7 +152,7 @@
; list.member(OtherGoal, !.RevConj)
),
OtherGoal = hlds_goal(_, OtherGoalInfo),
- goal_info_get_nonlocals(OtherGoalInfo, OtherNonLocals),
+ OtherNonLocals = goal_info_get_nonlocals(OtherGoalInfo),
set.member(HeadVar, OtherNonLocals)
))
->
Index: compiler/hhf.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hhf.m,v
retrieving revision 1.31
diff -u -b -r1.31 hhf.m
--- compiler/hhf.m 17 May 2007 03:52:42 -0000 1.31
+++ compiler/hhf.m 2 Aug 2007 05:31:37 -0000
@@ -195,7 +195,7 @@
process_clause(_HeadVars, clause(ProcIds, Goal0, Lang, Context),
clause(ProcIds, Goal, Lang, Context), !HI) :-
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
process_goal(NonLocals, Goal0, Goal, !HI).
% XXX We probably need to requantify, but it stuffs up the inst_graph to do
@@ -220,7 +220,7 @@
goal_use_own_nonlocals(Goal0, Goal, !HI) :-
Goal0 = hlds_goal(GoalExpr0, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
process_goal_expr(NonLocals, GoalInfo, GoalExpr0, GoalExpr, !HI),
Goal = hlds_goal(GoalExpr, GoalInfo).
@@ -272,11 +272,11 @@
GoalExpr0 = if_then_else(Vs, Cond0, Then0, Else0),
process_goal(NonLocals, Cond0, Cond, !HI),
Then0 = hlds_goal(ThenExpr0, ThenInfo),
- goal_info_get_nonlocals(ThenInfo, ThenNonLocals),
+ ThenNonLocals = goal_info_get_nonlocals(ThenInfo),
process_goal_expr(ThenNonLocals, ThenInfo, ThenExpr0, ThenExpr, !HI),
Then = hlds_goal(ThenExpr, ThenInfo),
Else0 = hlds_goal(ElseExpr0, ElseInfo),
- goal_info_get_nonlocals(ElseInfo, ElseNonLocals),
+ ElseNonLocals = goal_info_get_nonlocals(ElseInfo),
process_goal_expr(ElseNonLocals, ElseInfo, ElseExpr0, ElseExpr, !HI),
Else = hlds_goal(ElseExpr, ElseInfo),
GoalExpr = if_then_else(Vs, Cond, Then, Else)
@@ -316,8 +316,8 @@
list.foldl(inst_graph.set_parent(X), Args, InstGraph2, InstGraph),
!:HI = !.HI ^ inst_graph := InstGraph
),
- goal_info_get_nonlocals(GoalInfo0, GINonlocals0),
- GINonlocals = GINonlocals0 `set.union` list_to_set(Args),
+ GINonlocals0 = goal_info_get_nonlocals(GoalInfo0),
+ GINonlocals = set.union(GINonlocals0, list_to_set(Args)),
goal_info_set_nonlocals(GINonlocals, GoalInfo0, GoalInfo),
UnifyGoalExpr = unify(X, rhs_functor(ConsId, IsExistConstruct, Args),
Mode, Unif, Context),
@@ -335,8 +335,8 @@
unexpected(this_file, "hhf_make_unifications: length mismatch (2)").
make_unifications([A | As], [B | Bs], GI0, M, U, C,
[hlds_goal(unify(A, rhs_var(B), M, U, C), GI) | Us]) :-
- goal_info_get_nonlocals(GI0, GINonlocals0),
- GINonlocals = GINonlocals0 `set.insert` A `set.insert` B,
+ GINonlocals0 = goal_info_get_nonlocals(GI0),
+ GINonlocals = set.insert_list(GINonlocals0, [A, B]),
goal_info_set_nonlocals(GINonlocals, GI0, GI),
make_unifications(As, Bs, GI0, M, U, C, Us).
@@ -353,7 +353,7 @@
map.lookup(InstGraph0, A, Node),
Node = node(_, parent(_))
;
- A `set.member` NonLocals
+ set.member(A, NonLocals)
)
->
VarSet0 = !.HI ^ varset,
@@ -366,8 +366,8 @@
!:HI = !.HI ^ varset := VarSet,
!:HI = !.HI ^ vartypes := VarTypes,
!:HI = !.HI ^ inst_graph := InstGraph,
- goal_info_get_nonlocals(GI0, GINonlocals0),
- GINonlocals = GINonlocals0 `set.insert` V,
+ GINonlocals0 = goal_info_get_nonlocals(GI0),
+ GINonlocals = set.insert(GINonlocals0, V),
goal_info_set_nonlocals(GINonlocals, GI0, GI),
Goals = [hlds_goal(unify(A, rhs_var(V), M, U, C), GI) | Goals0]
;
Index: compiler/higher_order.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.167
diff -u -b -r1.167 higher_order.m
--- compiler/higher_order.m 17 May 2007 03:52:42 -0000 1.167
+++ compiler/higher_order.m 2 Aug 2007 08:15:35 -0000
@@ -1381,7 +1381,7 @@
)
->
list.reverse(HigherOrderArgs0, HigherOrderArgs),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
find_matching_version(!.Info, CalledPred, CalledProc, Args0,
Context, HigherOrderArgs, IsUserSpecProc, FindResult),
(
@@ -2150,7 +2150,7 @@
not_builtin, MaybeContext, SymName)
;
NeedIntCast = yes,
- goal_info_get_context(OrigGoalInfo, Context),
+ Context = goal_info_get_context(OrigGoalInfo),
generate_unsafe_type_cast(Context, CompareType, Arg1, CastArg1,
CastGoal1, ProcInfo0, ProcInfo1),
generate_unsafe_type_cast(Context, CompareType, Arg2, CastArg2,
@@ -2180,7 +2180,7 @@
!Info) :-
ModuleInfo = !.Info ^ global_info ^ module_info,
ProcInfo0 = !.Info ^ proc_info,
- goal_info_get_context(OrigGoalInfo, Context),
+ Context = goal_info_get_context(OrigGoalInfo),
unwrap_no_tag_arg(WrappedType, Context, Constructor, Arg1,
UnwrappedArg1, ExtractGoal1, ProcInfo0, ProcInfo1),
unwrap_no_tag_arg(WrappedType, Context, Constructor, Arg2,
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.179
diff -u -b -r1.179 hlds_goal.m
--- compiler/hlds_goal.m 2 Aug 2007 01:24:00 -0000 1.179
+++ compiler/hlds_goal.m 2 Aug 2007 03:21:49 -0000
@@ -832,18 +832,139 @@
%-----------------------------------------------------------------------------%
%
-% Information for all kinds of goals
+% Information for all kinds of goals.
%
-%
% Access predicates for the hlds_goal_info data structure.
% For documentation on the meaning of the fields that these
% procedures access, see the definition of the hlds_goal_info type.
-%
:- type hlds_goal_info.
-:- type hlds_goal_code_gen_info.
-:- type hlds_goal_extra_info.
+
+ % Stuff specific to a back-end. At the moment, only the LLDS back-end
+ % annotates the HLDS.
+:- type hlds_goal_code_gen_info
+ ---> no_code_gen_info
+ ; llds_code_gen_info(
+ llds_code_gen :: llds_code_gen_details
+ ).
+
+ % This type stores the possible values of a higher order variable
+ % at a particular point, as determined by the closure analysis
+ % (see closure_analysis.m.) If a variable does not have an entry
+ % in the map, then it may take any (valid) value.
+ %
+:- type ho_values == map(prog_var, set(pred_proc_id)).
+
+:- type rbmm_goal_info
+ ---> rbmm_goal_info(
+ created_regions :: set(prog_var),
+ removed_regions :: set(prog_var),
+ carried_regions :: set(prog_var),
+
+ allocated_into_regions :: set(prog_var),
+ used_regions :: set(prog_var)
+ ).
+
+:- type mode_constr_goal_info
+ ---> mode_constr_goal_info(
+ % Inst_graph nodes that are reachable from variables
+ % that occur in the goal.
+ mci_occurring_vars :: set(prog_var),
+
+ % Inst_graph nodes produced by this goal.
+ mci_producing_vars :: set(prog_var),
+
+ % Inst_graph nodes consumed by this goal.
+ mci_consuming_vars :: set(prog_var),
+
+ % The variables that this goal makes visible.
+ mci_make_visible_vars :: set(prog_var),
+
+ % The variables that this goal needs to be visible
+ % before it is executed.
+ mci_need_visible_vars :: set(prog_var)
+ ).
+
+ % Information about compile-time garbage collection.
+:- type ctgc_goal_info
+ ---> ctgc_goal_info(
+ % The local forward use set: this set contains the variables
+ % that are syntactically needed during forward execution.
+ % It is computed as the set of instantiated vars (input vars
+ % + sum(pre_births), minus the set of dead vars
+ % (sum(post_deaths and pre_deaths).
+ % The information is needed for determining the direct reuses.
+ ctgc_lfu :: set(prog_var),
+
+ % The local backward use set. This set contains the
+ % instantiated variables that are needed upon backtracking
+ % (i.e. syntactically appearing in any nondet call preceding
+ % this goal).
+ ctgc_lbu :: set(prog_var),
+
+ % Any structure reuse information related to this call.
+ ctgc_reuse :: reuse_description
+ ).
+
+ % Information describing possible kinds of reuse on a per goal basis.
+ % - 'no_reuse_info': before CTGC analysis, every goal is annotated with
+ % the reuse description 'no_reuse_info', i.e. no information about any
+ % reuse.
+ % - 'potential_reuse': the value 'potential_reuse' states that in a reuse
+ % version of the procedure to which the goal belongs, this goal may safely
+ % be replaced by a goal implementing structure reuse.
+ % - 'reuse': the value 'reuse' states that in the current procedure (either
+ % the specialised reuse version of a procedure, or the original procedure
+ % itself) the current goal can safely be replaced by a goal performing
+ % structure reuse.
+ % - 'missed_reuse': the value 'missed_reuse' gives some feedback when an
+ % opportunity for reuse was missed for some reason (only used for calls).
+ %
+:- type reuse_description
+ ---> no_reuse_info
+ ; missed_reuse(list(missed_message))
+ ; potential_reuse(short_reuse_description)
+ ; reuse(short_reuse_description).
+
+ % A short description of the kind of reuse allowed in the associated
+ % goal:
+ % - 'cell_died' (only relevant for deconstructions): states that the cell
+ % of the deconstruction becomes dead after that deconstruction.
+ % - 'cell_reused' (only relevant for constructions): states that it is
+ % allowed to reuse a previously discovered dead term for constructing a
+ % new term in the given construction. Details of which term is reused are
+ % recorded.
+ % - 'reuse_call' (only applicable to procedure calls): the called
+ % procedure is an optimised procedure w.r.t. CTGC. Records whether the
+ % call is conditional or not.
+ %
+:- type short_reuse_description
+ ---> cell_died
+ ; cell_reused(
+ dead_var, % The dead variable selected for reusing.
+ is_conditional, % States whether the reuse is conditional.
+ list(cons_id), % What are the possible cons_ids that the
+ % variable to be reused can have.
+ list(needs_update)
+ % Which of the fields of the cell to be
+ % reused already contain the correct value.
+ )
+ ; reuse_call(is_conditional).
+
+ % Used to represent the fact whether a reuse opportunity is either
+ % always safe (unconditional_reuse) or involves a reuse condition to
+ % be satisfied (conditional_reuse).
+ %
+:- type is_conditional
+ ---> conditional_reuse
+ ; unconditional_reuse.
+
+:- type needs_update
+ ---> needs_update
+ ; does_not_need_update.
+
+:- type missed_message == string.
:- pred goal_info_init(hlds_goal_info::out) is det.
:- pred goal_info_init(prog_context::in, hlds_goal_info::out) is det.
@@ -861,20 +982,23 @@
% or in both the pre-death and pre-birth sets.
% see also goal_info_get_code_model in code_model.m
-:- pred goal_info_get_determinism(hlds_goal_info::in, determinism::out) is det.
-:- pred goal_info_get_instmap_delta(hlds_goal_info::in, instmap_delta::out)
- is det.
-:- pred goal_info_get_context(hlds_goal_info::in, prog_context::out) is det.
-:- pred goal_info_get_nonlocals(hlds_goal_info::in, set(prog_var)::out) is det.
-:- pred goal_info_get_code_gen_nonlocals(hlds_goal_info::in,
- set(prog_var)::out) is det.
-:- pred goal_info_get_purity(hlds_goal_info::in, purity::out) is det.
-:- pred goal_info_get_features(hlds_goal_info::in, set(goal_feature)::out)
- is det.
-:- pred goal_info_get_goal_path(hlds_goal_info::in, goal_path::out) is det.
-:- pred goal_info_get_code_gen_info(hlds_goal_info::in,
- hlds_goal_code_gen_info::out) is det.
-:- func goal_info_get_extra_info(hlds_goal_info) = hlds_goal_extra_info.
+:- func goal_info_get_determinism(hlds_goal_info) = determinism.
+:- func goal_info_get_instmap_delta(hlds_goal_info) = instmap_delta.
+:- func goal_info_get_context(hlds_goal_info) = prog_context.
+:- func goal_info_get_nonlocals(hlds_goal_info) = set(prog_var).
+:- func goal_info_get_code_gen_nonlocals(hlds_goal_info) = set(prog_var).
+:- func goal_info_get_purity(hlds_goal_info) = purity.
+:- func goal_info_get_features(hlds_goal_info) = set(goal_feature).
+:- func goal_info_get_goal_path(hlds_goal_info) = goal_path.
+:- func goal_info_get_code_gen_info(hlds_goal_info) = hlds_goal_code_gen_info.
+:- func goal_info_get_ho_values(hlds_goal_info) = ho_values.
+:- func goal_info_get_maybe_rbmm(hlds_goal_info) = maybe(rbmm_goal_info).
+:- func goal_info_get_maybe_mode_constr(hlds_goal_info) =
+ maybe(mode_constr_goal_info).
+:- func goal_info_get_maybe_ctgc(hlds_goal_info) = maybe(ctgc_goal_info).
+:- func goal_info_get_maybe_lfu(hlds_goal_info) = maybe(set(prog_var)).
+:- func goal_info_get_maybe_lbu(hlds_goal_info) = maybe(set(prog_var)).
+:- func goal_info_get_maybe_reuse(hlds_goal_info) = maybe(reuse_description).
:- pred goal_info_set_determinism(determinism::in,
hlds_goal_info::in, hlds_goal_info::out) is det.
@@ -894,9 +1018,29 @@
hlds_goal_info::in, hlds_goal_info::out) is det.
:- pred goal_info_set_code_gen_info(hlds_goal_code_gen_info::in,
hlds_goal_info::in, hlds_goal_info::out) is det.
-:- pred goal_info_set_extra_info(hlds_goal_extra_info::in, hlds_goal_info::in,
+:- pred goal_info_set_ho_values(ho_values::in,
+ hlds_goal_info::in, hlds_goal_info::out) is det.
+:- pred goal_info_set_maybe_rbmm(maybe(rbmm_goal_info)::in,
+ hlds_goal_info::in, hlds_goal_info::out) is det.
+:- pred goal_info_set_maybe_mode_constr(maybe(mode_constr_goal_info)::in,
+ hlds_goal_info::in, hlds_goal_info::out) is det.
+:- pred goal_info_set_maybe_ctgc(maybe(ctgc_goal_info)::in,
+ hlds_goal_info::in, hlds_goal_info::out) is det.
+:- pred goal_info_set_lfu(set(prog_var)::in, hlds_goal_info::in,
+ hlds_goal_info::out) is det.
+:- pred goal_info_set_lbu(set(prog_var)::in, hlds_goal_info::in,
+ hlds_goal_info::out) is det.
+:- pred goal_info_set_reuse(reuse_description::in, hlds_goal_info::in,
hlds_goal_info::out) is det.
+ % The following functions produce an 'unexpected' error when the
+ % requested values have not been set.
+ %
+:- func goal_info_get_rbmm(hlds_goal_info) = rbmm_goal_info.
+:- func goal_info_get_lfu(hlds_goal_info) = set(prog_var).
+:- func goal_info_get_lbu(hlds_goal_info) = set(prog_var).
+:- func goal_info_get_reuse(hlds_goal_info) = reuse_description.
+
:- pred goal_info_get_occurring_vars(hlds_goal_info::in, set(prog_var)::out)
is det.
:- pred goal_info_get_producing_vars(hlds_goal_info::in, set(prog_var)::out)
@@ -931,8 +1075,6 @@
:- func need_visible_vars(hlds_goal_info) = set(prog_var).
:- func 'need_visible_vars :='(hlds_goal_info, set(prog_var)) = hlds_goal_info.
-:- pred goal_get_nonlocals(hlds_goal::in, set(prog_var)::out) is det.
-
:- type contains_trace_goal
---> contains_trace_goal
; contains_no_trace_goal.
@@ -940,7 +1082,9 @@
:- func worst_contains_trace(contains_trace_goal, contains_trace_goal)
= contains_trace_goal.
-:- pred goal_get_purity(hlds_goal::in, purity::out) is det.
+:- func goal_get_nonlocals(hlds_goal) = set(prog_var).
+
+:- func goal_get_purity(hlds_goal) = purity.
:- pred goal_set_purity(purity::in, hlds_goal::in, hlds_goal::out) is det.
@@ -1086,104 +1230,6 @@
%-----------------------------------------------------------------------------%
%
-% Get/set predicates for the extra_goal_info structure
-%
-
-:- func goal_info_get_ho_values(hlds_goal_info) = ho_values.
-
-:- pred goal_info_set_ho_values(ho_values::in,
- hlds_goal_info::in, hlds_goal_info::out) is det.
-
-%-----------------------------------------------------------------------------%
-%
-% Types and get/set predicates for the CTGC related information stored for each
-% goal.
-%
-
- % Information describing possible kinds of reuse on a per goal basis.
- % - 'no_reuse_info': before CTGC analysis, every goal is annotated with
- % the reuse description 'no_reuse_info', i.e. no information about any
- % reuse.
- % - 'potential_reuse': the value 'potential_reuse' states that in a reuse
- % version of the procedure to which the goal belongs, this goal may safely
- % be replaced by a goal implementing structure reuse.
- % - 'reuse': the value 'reuse' states that in the current procedure (either
- % the specialised reuse version of a procedure, or the original procedure
- % itself) the current goal can safely be replaced by a goal performing
- % structure reuse.
- % - 'missed_reuse': the value 'missed_reuse' gives some feedback when an
- % opportunity for reuse was missed for some reason (only used for calls).
- %
-:- type reuse_description
- ---> no_reuse_info
- ; missed_reuse(list(missed_message))
- ; potential_reuse(short_reuse_description)
- ; reuse(short_reuse_description).
-
- % A short description of the kind of reuse allowed in the associated
- % goal:
- % - 'cell_died' (only relevant for deconstructions): states that the cell
- % of the deconstruction becomes dead after that deconstruction.
- % - 'cell_reused' (only relevant for constructions): states that it is
- % allowed to reuse a previously discovered dead term for constructing a
- % new term in the given construction. Details of which term is reused are
- % recorded.
- % - 'reuse_call' (only applicable to procedure calls): the called
- % procedure is an optimised procedure w.r.t. CTGC. Records whether the
- % call is conditional or not.
- %
-:- type short_reuse_description
- ---> cell_died
- ; cell_reused(
- dead_var, % The dead variable selected for reusing.
- is_conditional, % States whether the reuse is conditional.
- list(cons_id), % What are the possible cons_ids that the
- % variable to be reused can have.
- list(needs_update)
- % Which of the fields of the cell to be
- % reused already contain the correct value.
- )
- ; reuse_call(is_conditional).
-
- % Used to represent the fact whether a reuse opportunity is either
- % always safe (unconditional_reuse) or involves a reuse condition to
- % be satisfied (conditional_reuse).
- %
-:- type is_conditional
- ---> conditional_reuse
- ; unconditional_reuse.
-
-:- type needs_update
- ---> needs_update
- ; does_not_need_update.
-
-:- type missed_message == string.
-
- % The following functions produce an 'unexpected' error when the
- % requested values have not been set.
- %
-:- func goal_info_get_lfu(hlds_goal_info) = set(prog_var).
-:- func goal_info_get_lbu(hlds_goal_info) = set(prog_var).
-:- func goal_info_get_reuse(hlds_goal_info) = reuse_description.
-
- % Same as above, but instead of producing an error, the predicate
- % fails.
-:- pred goal_info_maybe_get_lfu(hlds_goal_info::in, set(prog_var)::out) is
- semidet.
-:- pred goal_info_maybe_get_lbu(hlds_goal_info::in, set(prog_var)::out) is
- semidet.
-:- pred goal_info_maybe_get_reuse(hlds_goal_info::in, reuse_description::out)
- is semidet.
-
-:- pred goal_info_set_lfu(set(prog_var)::in, hlds_goal_info::in,
- hlds_goal_info::out) is det.
-:- pred goal_info_set_lbu(set(prog_var)::in, hlds_goal_info::in,
- hlds_goal_info::out) is det.
-:- pred goal_info_set_reuse(reuse_description::in, hlds_goal_info::in,
- hlds_goal_info::out) is det.
-
-%-----------------------------------------------------------------------------%
-%
% The rename_var* predicates take a structure and a mapping from var -> var
% and apply that translation. If a var in the input structure does not
% occur as a key in the mapping, then the variable is left unsubstituted
@@ -1435,29 +1481,6 @@
is det.
%-----------------------------------------------------------------------------%
-%
-% Stuff specific to a back-end. At the moment, only the LLDS back-end
-% annotates the HLDS.
-%
-
-:- type hlds_goal_code_gen_info
- ---> no_code_gen_info
- ; llds_code_gen_info(llds_code_gen :: llds_code_gen_details).
-
-%-----------------------------------------------------------------------------%
-%
-% Stuff specific to the auxiliary analysis passes of the compiler.
-%
-% At the moment only closure analysis annotates the HLDS at a per-goal level.
-
- % This type stores the possible values of a higher order variable
- % (at a particular point) as determined by the closure analysis
- % (see closure_analysis.m.) If a variable does not have an entry
- % in the map then it may take any (valid) value.
- %
-:- type ho_values == map(prog_var, set(pred_proc_id)).
-
-%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
:- implementation.
@@ -1540,93 +1563,67 @@
:- type hlds_goal_info
---> goal_info(
- determinism :: determinism,
- % The overall determinism of the goal
- % (computed during determinism analysis)
- % [because true determinism is undecidable,
- % this may be a conservative approximation].
-
- instmap_delta :: instmap_delta,
- % The change in insts over this goal
- % (computed during mode analysis)
- % [because true unreachability is undecidable,
- % the instmap_delta may be reachable even
- % when the goal really never succeeds]
- %
- % The following invariant is required
- % by the code generator and is enforced
- % by the final simplification pass:
+ % The overall determinism of the goal (computed during
+ % determinism analysis). Since the determinism analysis problem
+ % is is undecidable, this may be a conservative approximation.
+ gi_determinism :: determinism,
+
+ % The change in insts over this goal (computed during mode
+ % analysis). Since the unreachability problem is undecidable,
+ % the instmap_delta may be reachable even when the goal
+ % really never succeeds.
+ %
+ % The following invariant is required by the code generator
+ % and is enforced by the final simplification pass:
+ %
% the determinism specifies at_most_zero solns
- % iff the instmap_delta is unreachable.
+ % IFF the instmap_delta is unreachable.
%
- % Before the final simplification pass,
- % the determinism and instmap_delta
- % might not be consistent with regard to
- % unreachability, but both will be
- % conservative approximations, so if either
- % says a goal is unreachable then it is.
- %
- % Normally the instmap_delta will list only
- % the nonlocal variables of the goal.
-
- nonlocals :: set(prog_var),
- % The non-local vars in the goal, i.e. the
- % variables that occur both inside and outside
- % of the goal. (computed by quantification.m)
- % [in some circumstances, this may be a
- % conservative approximation: it may be
- % a superset of the real non-locals].
-
- purity :: purity,
-
- features :: set(goal_feature),
- % The set of compiler-defined "features" of
- % this goal, which optimisers may wish
- % to know about.
-
- goal_path :: goal_path,
- % The path to this goal from the root in
- % reverse order.
-
- code_gen_info :: hlds_goal_code_gen_info,
-
- extra_goal_info :: hlds_goal_extra_info
- % Extra information about that goal that may
- % be attached by various optional analysis
- % passes, e.g closure analysis.
+ % Before the final simplification pass, the determinism and
+ % instmap_delta might not be consistent with regard to
+ % unreachability, but both will be conservative approximations,
+ % so if either says a goal is unreachable then it is.
+ %
+ % Normally the instmap_delta will list only the nonlocal
+ % variables of the goal.
+ gi_instmap_delta :: instmap_delta,
+
+ % The non-local vars in the goal, i.e. the variables that
+ % occur both inside and outside of the goal (computed by
+ % quantification.m). In some circumstances, this may be a
+ % conservative approximation: it may be a superset of the
+ % real non-locals.
+ gi_nonlocals :: set(prog_var),
+
+ gi_purity :: purity,
+
+ % The set of compiler-defined "features" of this goal,
+ % which optimisers may wish to know about.
+ gi_features :: set(goal_feature),
+
+ % The path to this goal from the root, in reverse order.
+ gi_goal_path :: goal_path,
+
+ gi_code_gen_info :: hlds_goal_code_gen_info,
+
+ % Extra information about the goal that doesn't fit in an
+ % eight-word cell. Mostly used for information used by
+ % various optional analysis passes, e.g closure analysis.
+ gi_extra :: hlds_goal_extra_info
).
:- type hlds_goal_extra_info
---> extra_goal_info(
- context :: prog_context,
+ egi_context :: prog_context,
- extra_info_ho_vals :: ho_values,
+ egi_ho_vals :: ho_values,
% Any information related to structure reuse (CTGC).
- extra_info_maybe_ctgc_info :: maybe(ctgc_info),
-
- maybe_mode_constraint_info ::
- maybe(mode_constraint_goal_info)
- ).
-
-:- type mode_constraint_goal_info
- ---> mode_constraint_goal_info(
- % Inst_graph nodes that are reachable from variables
- % that occur in the goal.
- mci_occurring_vars :: set(prog_var),
-
- % Inst_graph nodes produced by this goal.
- mci_producing_vars :: set(prog_var),
+ egi_maybe_ctgc :: maybe(ctgc_goal_info),
- % Inst_graph nodes consumed by this goal.
- mci_consuming_vars :: set(prog_var),
-
- % The variables that this goal makes visible.
- mci_make_visible_vars :: set(prog_var),
+ egi_maybe_rbmm :: maybe(rbmm_goal_info),
- % The variables that this goal needs to be visible
- % before it is executed.
- mci_need_visible_vars :: set(prog_var)
+ egi_maybe_mode_constr :: maybe(mode_constr_goal_info)
).
:- pragma inline(goal_info_init/1).
@@ -1665,55 +1662,71 @@
hlds_goal_extra_info_init(Context) = ExtraInfo :-
HO_Values = map.init,
- ExtraInfo = extra_goal_info(Context, HO_Values, no, no).
+ ExtraInfo = extra_goal_info(Context, HO_Values, no, no, no).
+
+:- func ctgc_goal_info_init = ctgc_goal_info.
-goal_info_get_determinism(GoalInfo, GoalInfo ^ determinism).
-goal_info_get_instmap_delta(GoalInfo, GoalInfo ^ instmap_delta).
-goal_info_get_nonlocals(GoalInfo, GoalInfo ^ nonlocals).
-goal_info_get_purity(GoalInfo, GoalInfo ^ purity).
-goal_info_get_features(GoalInfo, GoalInfo ^ features).
-goal_info_get_goal_path(GoalInfo, GoalInfo ^ goal_path).
-goal_info_get_code_gen_info(GoalInfo, GoalInfo ^ code_gen_info).
-goal_info_get_extra_info(GoalInfo) = GoalInfo ^ extra_goal_info.
-
-goal_info_set_determinism(Determinism, GoalInfo,
- GoalInfo ^ determinism := Determinism).
-goal_info_set_instmap_delta(InstMapDelta, GoalInfo,
- GoalInfo ^ instmap_delta := InstMapDelta).
-goal_info_set_nonlocals(NonLocals, GoalInfo,
- GoalInfo ^ nonlocals := NonLocals).
-goal_info_set_purity(Purity, GoalInfo,
- GoalInfo ^ purity := Purity).
-goal_info_set_features(Features, GoalInfo, GoalInfo ^ features := Features).
-goal_info_set_goal_path(GoalPath, GoalInfo,
- GoalInfo ^ goal_path := GoalPath).
-goal_info_set_code_gen_info(CodeGenInfo, GoalInfo,
- GoalInfo ^ code_gen_info := CodeGenInfo).
-goal_info_set_extra_info(ExtraInfo, GoalInfo,
- GoalInfo ^ extra_goal_info := ExtraInfo).
+ctgc_goal_info_init = ctgc_goal_info(set.init, set.init, no_reuse_info).
+
+goal_info_get_determinism(GoalInfo) = GoalInfo ^ gi_determinism.
+goal_info_get_instmap_delta(GoalInfo) = GoalInfo ^ gi_instmap_delta.
+goal_info_get_nonlocals(GoalInfo) = GoalInfo ^ gi_nonlocals.
+goal_info_get_purity(GoalInfo) = GoalInfo ^ gi_purity.
+goal_info_get_features(GoalInfo) = GoalInfo ^ gi_features.
+goal_info_get_goal_path(GoalInfo) = GoalInfo ^ gi_goal_path.
+goal_info_get_code_gen_info(GoalInfo) = GoalInfo ^ gi_code_gen_info.
+goal_info_get_context(GoalInfo) = GoalInfo ^ gi_extra ^ egi_context.
+goal_info_get_ho_values(GoalInfo) = GoalInfo ^ gi_extra ^ egi_ho_vals.
+goal_info_get_maybe_rbmm(GoalInfo) = GoalInfo ^ gi_extra ^ egi_maybe_rbmm.
+goal_info_get_maybe_mode_constr(GoalInfo) =
+ GoalInfo ^ gi_extra ^ egi_maybe_mode_constr.
+goal_info_get_maybe_ctgc(GoalInfo) = GoalInfo ^ gi_extra ^ egi_maybe_ctgc.
+
+goal_info_set_determinism(Determinism, !GoalInfo) :-
+ !GoalInfo ^ gi_determinism := Determinism.
+goal_info_set_instmap_delta(InstMapDelta, !GoalInfo) :-
+ !GoalInfo ^ gi_instmap_delta := InstMapDelta.
+goal_info_set_nonlocals(NonLocals, !GoalInfo) :-
+ !GoalInfo ^ gi_nonlocals := NonLocals.
+goal_info_set_purity(Purity, !GoalInfo) :-
+ !GoalInfo ^ gi_purity := Purity.
+goal_info_set_features(Features, !GoalInfo) :-
+ !GoalInfo ^ gi_features := Features.
+goal_info_set_goal_path(GoalPath, !GoalInfo) :-
+ !GoalInfo ^ gi_goal_path := GoalPath.
+goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo) :-
+ !GoalInfo ^ gi_code_gen_info := CodeGenInfo.
+goal_info_set_context(Context, !GoalInfo) :-
+ !GoalInfo ^ gi_extra ^ egi_context := Context.
+goal_info_set_ho_values(Values, !GoalInfo) :-
+ !GoalInfo ^ gi_extra ^ egi_ho_vals := Values.
+goal_info_set_maybe_rbmm(RBMMInfo, !GoalInfo) :-
+ !GoalInfo ^ gi_extra ^ egi_maybe_rbmm := RBMMInfo.
+goal_info_set_maybe_mode_constr(ModeConstrInfo, !GoalInfo) :-
+ !GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := ModeConstrInfo.
+goal_info_set_maybe_ctgc(CTGCInfo, !GoalInfo) :-
+ !GoalInfo ^ gi_extra ^ egi_maybe_ctgc := CTGCInfo.
% The code-gen non-locals are always the same as the
% non-locals when structure reuse is not being performed.
-goal_info_get_code_gen_nonlocals(GoalInfo, NonLocals) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals).
+goal_info_get_code_gen_nonlocals(GoalInfo) =
+ goal_info_get_nonlocals(GoalInfo).
% The code-gen non-locals are always the same as the
% non-locals when structure reuse is not being performed.
goal_info_set_code_gen_nonlocals(NonLocals, !GoalInfo) :-
goal_info_set_nonlocals(NonLocals, !GoalInfo).
-goal_info_get_context(GoalInfo,
- GoalInfo ^ extra_goal_info ^ context).
-goal_info_set_context(Context, GoalInfo,
- GoalInfo ^ extra_goal_info ^ context := Context).
-
-goal_info_get_ho_values(GoalInfo) =
- GoalInfo ^ extra_goal_info ^ extra_info_ho_vals.
-
-goal_info_set_ho_values(Values, !GoalInfo) :-
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ extra_info_ho_vals := Values.
+goal_info_get_rbmm(GoalInfo) = RBMM :-
+ MaybeRBMM = goal_info_get_maybe_rbmm(GoalInfo),
+ (
+ MaybeRBMM = yes(RBMM)
+ ;
+ MaybeRBMM = no,
+ unexpected(this_file, "Requesting unavailable RBMM information.")
+ ).
goal_info_get_occurring_vars(GoalInfo, OccurringVars) :-
- MMCI = GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI = GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI = yes(MCI),
OccurringVars = MCI ^ mci_occurring_vars
@@ -1723,7 +1736,7 @@
).
goal_info_get_producing_vars(GoalInfo, ProducingVars) :-
- MMCI = GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI = GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI = yes(MCI),
ProducingVars = MCI ^ mci_producing_vars
@@ -1733,7 +1746,7 @@
).
goal_info_get_consuming_vars(GoalInfo, ConsumingVars) :-
- MMCI = GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI = GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI = yes(MCI),
ConsumingVars = MCI ^ mci_consuming_vars
@@ -1743,7 +1756,7 @@
).
goal_info_get_make_visible_vars(GoalInfo, MakeVisibleVars) :-
- MMCI = GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI = GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI = yes(MCI),
MakeVisibleVars = MCI ^ mci_make_visible_vars
@@ -1753,7 +1766,7 @@
).
goal_info_get_need_visible_vars(GoalInfo, NeedVisibleVars) :-
- MMCI = GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI = GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI = yes(MCI),
NeedVisibleVars = MCI ^ mci_need_visible_vars
@@ -1763,7 +1776,7 @@
).
goal_info_set_occurring_vars(OccurringVars, !GoalInfo) :-
- MMCI0 = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI0 = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI0 = yes(MCI0),
MCI = MCI0 ^ mci_occurring_vars := OccurringVars
@@ -1773,14 +1786,13 @@
set.init(ConsumingVars),
set.init(MakeVisibleVars),
set.init(NeedVisibleVars),
- MCI = mode_constraint_goal_info(OccurringVars, ProducingVars,
+ MCI = mode_constr_goal_info(OccurringVars, ProducingVars,
ConsumingVars, MakeVisibleVars, NeedVisibleVars)
),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info
- := yes(MCI).
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := yes(MCI).
goal_info_set_producing_vars(ProducingVars, !GoalInfo) :-
- MMCI0 = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI0 = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI0 = yes(MCI0),
MCI = MCI0 ^ mci_producing_vars := ProducingVars
@@ -1790,14 +1802,13 @@
set.init(ConsumingVars),
set.init(MakeVisibleVars),
set.init(NeedVisibleVars),
- MCI = mode_constraint_goal_info(OccurringVars, ProducingVars,
+ MCI = mode_constr_goal_info(OccurringVars, ProducingVars,
ConsumingVars, MakeVisibleVars, NeedVisibleVars)
),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info
- := yes(MCI).
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := yes(MCI).
goal_info_set_consuming_vars(ConsumingVars, !GoalInfo) :-
- MMCI0 = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI0 = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI0 = yes(MCI0),
MCI = MCI0 ^ mci_consuming_vars := ConsumingVars
@@ -1807,14 +1818,13 @@
set.init(ProducingVars),
set.init(MakeVisibleVars),
set.init(NeedVisibleVars),
- MCI = mode_constraint_goal_info(OccurringVars, ProducingVars,
+ MCI = mode_constr_goal_info(OccurringVars, ProducingVars,
ConsumingVars, MakeVisibleVars, NeedVisibleVars)
),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info
- := yes(MCI).
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := yes(MCI).
goal_info_set_make_visible_vars(MakeVisibleVars, !GoalInfo) :-
- MMCI0 = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI0 = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI0 = yes(MCI0),
MCI = MCI0 ^ mci_make_visible_vars := MakeVisibleVars
@@ -1824,14 +1834,13 @@
set.init(ProducingVars),
set.init(ConsumingVars),
set.init(NeedVisibleVars),
- MCI = mode_constraint_goal_info(OccurringVars, ProducingVars,
+ MCI = mode_constr_goal_info(OccurringVars, ProducingVars,
ConsumingVars, MakeVisibleVars, NeedVisibleVars)
),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info
- := yes(MCI).
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := yes(MCI).
goal_info_set_need_visible_vars(NeedVisibleVars, !GoalInfo) :-
- MMCI0 = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info,
+ MMCI0 = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr,
(
MMCI0 = yes(MCI0),
MCI = MCI0 ^ mci_need_visible_vars := NeedVisibleVars
@@ -1841,11 +1850,10 @@
set.init(ProducingVars),
set.init(ConsumingVars),
set.init(MakeVisibleVars),
- MCI = mode_constraint_goal_info(OccurringVars, ProducingVars,
+ MCI = mode_constr_goal_info(OccurringVars, ProducingVars,
ConsumingVars, MakeVisibleVars, NeedVisibleVars)
),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info ^ maybe_mode_constraint_info
- := yes(MCI).
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_mode_constr := yes(MCI).
producing_vars(GoalInfo) = ProducingVars :-
goal_info_get_producing_vars(GoalInfo, ProducingVars).
@@ -1871,114 +1879,110 @@
'need_visible_vars :='(GoalInfo0, NeedVisibleVars) = GoalInfo :-
goal_info_set_need_visible_vars(NeedVisibleVars, GoalInfo0, GoalInfo).
-%-----------------------------------------------------------------------------%
-%
-% Information about compile-time garbage collection.
-
-:- type ctgc_info
- ---> ctgc_info(
- % The local forward use set: this set contains the variables
- % that are syntactically needed during forward execution.
- % It is computed as the set of instantiated vars (input vars
- % + sum(pre_births), minus the set of dead vars
- % (sum(post_deaths and pre_deaths).
- % The information is needed for determining the direct reuses.
- lfu :: set(prog_var),
-
- % The local backward use set. This set contains the
- % instantiated variables that are needed upon backtracking
- % (i.e. syntactically appearing in any nondet call preceding
- % this goal).
- lbu :: set(prog_var),
-
- % Any structure reuse information related to this call.
- reuse :: reuse_description
- ).
-
-:- func ctgc_info_init = ctgc_info.
-
-ctgc_info_init = ctgc_info(set.init, set.init, no_reuse_info).
-
-goal_info_get_lfu(GoalInfo) = LFU :-
- ( goal_info_maybe_get_lfu(GoalInfo, LFU0) ->
- LFU = LFU0
+goal_info_get_maybe_lfu(GoalInfo) = MaybeLFU :-
+ MaybeCTGC = GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
+ (
+ MaybeCTGC = yes(CTGC),
+ MaybeLFU = yes(CTGC ^ ctgc_lfu)
;
- unexpected(this_file,
- "Requesting LFU information while CTGC field not set.")
+ MaybeCTGC = no,
+ MaybeLFU = no
).
-goal_info_get_lbu(GoalInfo) = LBU :-
- ( goal_info_maybe_get_lbu(GoalInfo, LBU0) ->
- LBU = LBU0
+goal_info_get_maybe_lbu(GoalInfo) = MaybeLBU :-
+ MaybeCTGC = GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
+ (
+ MaybeCTGC = yes(CTGC),
+ MaybeLBU = yes(CTGC ^ ctgc_lbu)
;
- unexpected(this_file,
- "Requesting LBU information while CTGC field not set.")
+ MaybeCTGC = no,
+ MaybeLBU = no
).
-goal_info_get_reuse(GoalInfo) = Reuse :-
- ( goal_info_maybe_get_reuse(GoalInfo, Reuse0) ->
- Reuse = Reuse0
+goal_info_get_maybe_reuse(GoalInfo) = MaybeReuse :-
+ MaybeCTGC = GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
+ (
+ MaybeCTGC = yes(CTGC),
+ MaybeReuse = yes(CTGC ^ ctgc_reuse)
;
- unexpected(this_file,
- "Requesting reuse information while CTGC field not set.")
+ MaybeCTGC = no,
+ MaybeReuse = no
).
-goal_info_maybe_get_lfu(GoalInfo, LFU) :-
- MaybeCTGC = GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
- MaybeCTGC = yes(CTGC),
- LFU = CTGC ^ lfu.
-
-goal_info_maybe_get_lbu(GoalInfo, LBU) :-
- MaybeCTGC = GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
- MaybeCTGC = yes(CTGC),
- LBU = CTGC ^ lbu.
-
-goal_info_maybe_get_reuse(GoalInfo, Reuse) :-
- MaybeCTGC = GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
- MaybeCTGC = yes(CTGC),
- Reuse = CTGC ^ reuse.
-
goal_info_set_lfu(LFU, !GoalInfo) :-
- MaybeCTGC0 = !.GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
+ MaybeCTGC0 = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
(
MaybeCTGC0 = yes(CTGC0)
;
MaybeCTGC0 = no,
- CTGC0 = ctgc_info_init
+ CTGC0 = ctgc_goal_info_init
),
- CTGC = CTGC0 ^ lfu := LFU,
+ CTGC = CTGC0 ^ ctgc_lfu := LFU,
MaybeCTGC = yes(CTGC),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info
- ^ extra_info_maybe_ctgc_info := MaybeCTGC.
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc := MaybeCTGC.
goal_info_set_lbu(LBU, !GoalInfo) :-
- MaybeCTGC0 = !.GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
+ MaybeCTGC0 = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
(
MaybeCTGC0 = yes(CTGC0)
;
MaybeCTGC0 = no,
- CTGC0 = ctgc_info_init
+ CTGC0 = ctgc_goal_info_init
),
- CTGC = CTGC0 ^ lbu := LBU,
+ CTGC = CTGC0 ^ ctgc_lbu := LBU,
MaybeCTGC = yes(CTGC),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info
- ^ extra_info_maybe_ctgc_info := MaybeCTGC.
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc := MaybeCTGC.
goal_info_set_reuse(Reuse, !GoalInfo) :-
- MaybeCTGC0 = !.GoalInfo ^ extra_goal_info ^ extra_info_maybe_ctgc_info,
+ MaybeCTGC0 = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc,
(
MaybeCTGC0 = yes(CTGC0)
;
MaybeCTGC0 = no,
- CTGC0 = ctgc_info_init
+ CTGC0 = ctgc_goal_info_init
),
- CTGC = CTGC0 ^ reuse := Reuse,
+ CTGC = CTGC0 ^ ctgc_reuse := Reuse,
MaybeCTGC = yes(CTGC),
- !:GoalInfo = !.GoalInfo ^ extra_goal_info
- ^ extra_info_maybe_ctgc_info := MaybeCTGC.
+ !:GoalInfo = !.GoalInfo ^ gi_extra ^ egi_maybe_ctgc := MaybeCTGC.
+
+goal_info_get_lfu(GoalInfo) = LFU :-
+ MaybeLFU = goal_info_get_maybe_lfu(GoalInfo),
+ (
+ MaybeLFU = yes(LFU)
+ ;
+ MaybeLFU = no,
+ unexpected(this_file,
+ "Requesting LFU information while CTGC field not set.")
+ ).
+
+goal_info_get_lbu(GoalInfo) = LBU :-
+ MaybeLBU = goal_info_get_maybe_lbu(GoalInfo),
+ (
+ MaybeLBU = yes(LBU)
+ ;
+ MaybeLBU = no,
+ unexpected(this_file,
+ "Requesting LBU information while CTGC field not set.")
+ ).
+
+goal_info_get_reuse(GoalInfo) = Reuse :-
+ MaybeReuse = goal_info_get_maybe_reuse(GoalInfo),
+ (
+ MaybeReuse = yes(Reuse)
+ ;
+ MaybeReuse = no,
+ unexpected(this_file,
+ "Requesting reuse information while CTGC field not set.")
+ ).
%-----------------------------------------------------------------------------%
+goal_get_purity(hlds_goal(_GoalExpr, GoalInfo)) =
+ goal_info_get_purity(GoalInfo).
+
+goal_get_nonlocals(hlds_goal(_GoalExpr, GoalInfo)) =
+ goal_info_get_nonlocals(GoalInfo).
+
worst_contains_trace(contains_trace_goal, contains_trace_goal) =
contains_trace_goal.
worst_contains_trace(contains_trace_goal, contains_no_trace_goal) =
@@ -1988,9 +1992,6 @@
worst_contains_trace(contains_no_trace_goal, contains_no_trace_goal) =
contains_no_trace_goal.
-goal_get_purity(hlds_goal(_GoalExpr, GoalInfo), Purity) :-
- goal_info_get_purity(GoalInfo, Purity).
-
goal_set_purity(Purity, hlds_goal(GoalExpr, GoalInfo0),
hlds_goal(GoalExpr, GoalInfo)) :-
goal_info_set_purity(Purity, GoalInfo0, GoalInfo).
@@ -2000,7 +2001,7 @@
goal_info_get_goal_purity(GoalInfo, Purity, ContainsTraceGoal).
goal_info_get_goal_purity(GoalInfo, Purity, ContainsTraceGoal) :-
- goal_info_get_purity(GoalInfo, Purity),
+ Purity = goal_info_get_purity(GoalInfo),
( goal_info_has_feature(GoalInfo, feature_contains_trace) ->
ContainsTraceGoal = contains_trace_goal
;
@@ -2008,24 +2009,21 @@
).
goal_info_add_feature(Feature, !GoalInfo) :-
- goal_info_get_features(!.GoalInfo, Features0),
+ Features0 = goal_info_get_features(!.GoalInfo),
set.insert(Features0, Feature, Features),
goal_info_set_features(Features, !GoalInfo).
goal_info_remove_feature(Feature, !GoalInfo) :-
- goal_info_get_features(!.GoalInfo, Features0),
+ Features0 = goal_info_get_features(!.GoalInfo),
set.delete(Features0, Feature, Features),
goal_info_set_features(Features, !GoalInfo).
goal_info_has_feature(GoalInfo, Feature) :-
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
set.member(Feature, Features).
%-----------------------------------------------------------------------------%
-goal_get_nonlocals(hlds_goal(_GoalExpr, GoalInfo), NonLocals) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals).
-
goal_set_context(Context, hlds_goal(GoalExpr, GoalInfo0),
hlds_goal(GoalExpr, GoalInfo)) :-
goal_info_set_context(Context, GoalInfo0, GoalInfo).
@@ -2302,13 +2300,14 @@
CodeGenInfo = llds_code_gen_info(LldsInfo)
),
- ExtraInfo0 = extra_goal_info(Context, HO_Values, MaybeCTGC0, MaybeMCI0),
+ ExtraInfo0 = extra_goal_info(Context, HO_Values, MaybeCTGC0, MaybeRBMM0,
+ MaybeMCI0),
(
MaybeCTGC0 = no,
MaybeCTGC = no
;
MaybeCTGC0 = yes(CTGC0),
- CTGC0 = ctgc_info(ForwardUse0, BackwardUse0, ReuseDesc0),
+ CTGC0 = ctgc_goal_info(ForwardUse0, BackwardUse0, ReuseDesc0),
rename_vars_in_var_set(Must, Subn, ForwardUse0, ForwardUse),
rename_vars_in_var_set(Must, Subn, BackwardUse0, BackwardUse),
(
@@ -2327,26 +2326,41 @@
ShortReuseDesc0, ShortReuseDesc),
ReuseDesc = reuse(ShortReuseDesc)
),
- CTGC = ctgc_info(ForwardUse, BackwardUse, ReuseDesc),
+ CTGC = ctgc_goal_info(ForwardUse, BackwardUse, ReuseDesc),
MaybeCTGC = yes(CTGC)
),
(
+ MaybeRBMM0 = no,
+ MaybeRBMM = no
+ ;
+ MaybeRBMM0 = yes(RBMM0),
+ RBMM0 = rbmm_goal_info(Created0, Removed0, Carried0, Alloc0, NonAlloc0),
+ rename_vars_in_var_set(Must, Subn, Created0, Created),
+ rename_vars_in_var_set(Must, Subn, Removed0, Removed),
+ rename_vars_in_var_set(Must, Subn, Carried0, Carried),
+ rename_vars_in_var_set(Must, Subn, Alloc0, Alloc),
+ rename_vars_in_var_set(Must, Subn, NonAlloc0, NonAlloc),
+ RBMM = rbmm_goal_info(Created, Removed, Carried, Alloc, NonAlloc),
+ MaybeRBMM = yes(RBMM)
+ ),
+ (
MaybeMCI0 = no,
MaybeMCI = no
;
MaybeMCI0 = yes(MCI0),
- MCI0 = mode_constraint_goal_info(Occurring0, Producing0, Consuming0,
+ MCI0 = mode_constr_goal_info(Occurring0, Producing0, Consuming0,
MakeVisible0, NeedVisible0),
rename_vars_in_var_set(Must, Subn, Occurring0, Occurring),
rename_vars_in_var_set(Must, Subn, Producing0, Producing),
rename_vars_in_var_set(Must, Subn, Consuming0, Consuming),
rename_vars_in_var_set(Must, Subn, MakeVisible0, MakeVisible),
rename_vars_in_var_set(Must, Subn, NeedVisible0, NeedVisible),
- MCI = mode_constraint_goal_info(Occurring, Producing, Consuming,
+ MCI = mode_constr_goal_info(Occurring, Producing, Consuming,
MakeVisible, NeedVisible),
MaybeMCI = yes(MCI)
),
- ExtraInfo = extra_goal_info(Context, HO_Values, MaybeCTGC, MaybeMCI),
+ ExtraInfo = extra_goal_info(Context, HO_Values, MaybeCTGC, MaybeRBMM,
+ MaybeMCI),
!:GoalInfo = goal_info(Detism, InstMapDelta, NonLocals, Purity,
Features, GoalPath, CodeGenInfo, ExtraInfo).
@@ -2631,7 +2645,7 @@
goal_list_nonlocals(Goals, NonLocals) :-
UnionNonLocals = (pred(Goal::in, Vars0::in, Vars::out) is det :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, Vars1),
+ Vars1 = goal_info_get_nonlocals(GoalInfo),
set.union(Vars0, Vars1, Vars)
),
set.init(NonLocals0),
@@ -2640,7 +2654,7 @@
goal_list_instmap_delta(Goals, InstMapDelta) :-
ApplyDelta = (pred(Goal::in, Delta0::in, Delta::out) is det :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, Delta1),
+ Delta1 = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_apply_instmap_delta(Delta0, Delta1, test_size, Delta)
),
instmap_delta_init_reachable(InstMapDelta0),
@@ -2649,18 +2663,18 @@
goal_list_determinism(Goals, Determinism) :-
ComputeDeterminism = (pred(Goal::in, Det0::in, Det::out) is det :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_determinism(GoalInfo, Det1),
+ Det1 = goal_info_get_determinism(GoalInfo),
det_conjunction_detism(Det0, Det1, Det)
),
list.foldl(ComputeDeterminism, Goals, detism_det, Determinism).
-goal_list_purity(Goals, Purity) :-
- ComputePurity = (func(Goal, Purity0) = Purity1 :-
+goal_list_purity(Goals, GoalsPurity) :-
+ ComputePurity = (pred(Goal::in, Purity0::in, Purity::out) is det :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_purity(GoalInfo, GoalPurity),
- worst_purity(GoalPurity, Purity0) = Purity1
+ Purity1 = goal_info_get_purity(GoalInfo),
+ worst_purity(Purity0, Purity1) = Purity
),
- Purity = list.foldl(ComputePurity, Goals, purity_pure).
+ list.foldl(ComputePurity, Goals, purity_pure, GoalsPurity).
%-----------------------------------------------------------------------------%
Index: compiler/hlds_llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_llds.m,v
retrieving revision 1.18
diff -u -b -r1.18 hlds_llds.m
--- compiler/hlds_llds.m 2 Aug 2007 01:24:00 -0000 1.18
+++ compiler/hlds_llds.m 2 Aug 2007 07:46:36 -0000
@@ -368,7 +368,7 @@
%-----------------------------------------------------------------------------%
goal_info_get_pre_births(GoalInfo, PreBirths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( PreBirthsPrime = CodeGenInfo ^ llds_code_gen ^ pre_births ->
PreBirths = PreBirthsPrime
;
@@ -376,7 +376,7 @@
).
goal_info_get_post_births(GoalInfo, PostBirths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( PostBirthsPrime = CodeGenInfo ^ llds_code_gen ^ post_births ->
PostBirths = PostBirthsPrime
;
@@ -384,7 +384,7 @@
).
goal_info_get_pre_deaths(GoalInfo, PreDeaths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( PreDeathsPrime = CodeGenInfo ^ llds_code_gen ^ pre_deaths ->
PreDeaths = PreDeathsPrime
;
@@ -392,7 +392,7 @@
).
goal_info_get_post_deaths(GoalInfo, PostDeaths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( PostDeathsPrime = CodeGenInfo ^ llds_code_gen ^ post_deaths ->
PostDeaths = PostDeathsPrime
;
@@ -400,7 +400,7 @@
).
goal_info_get_follow_vars(GoalInfo, FollowVars) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( FollowVarsPrime = CodeGenInfo ^ llds_code_gen ^ follow_vars ->
FollowVars = FollowVarsPrime
;
@@ -408,7 +408,7 @@
).
goal_info_get_store_map(GoalInfo, StoreMap) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( StoreMapPrime = CodeGenInfo ^ llds_code_gen ^ store_map ->
StoreMap = StoreMapPrime
;
@@ -416,7 +416,7 @@
).
goal_info_get_resume_point(GoalInfo, ResumePoint) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( ResumePointPrime = CodeGenInfo ^ llds_code_gen ^ resume_point ->
ResumePoint = ResumePointPrime
;
@@ -424,7 +424,7 @@
).
goal_info_get_maybe_need_across_call(GoalInfo, MaybeNeedAtCall) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need ->
( MaybeNeed = need_call(NeedAtCall) ->
MaybeNeedAtCall = yes(NeedAtCall)
@@ -436,7 +436,7 @@
).
goal_info_get_maybe_need_in_resume(GoalInfo, MaybeNeedInResume) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need ->
( MaybeNeed = need_resume(NeedInResume) ->
MaybeNeedInResume = yes(NeedInResume)
@@ -448,7 +448,7 @@
).
goal_info_get_maybe_need_in_par_conj(GoalInfo, MaybeNeedInParConj) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
( MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need ->
( MaybeNeed = need_par_conj(NeedInParConj) ->
MaybeNeedInParConj = yes(NeedInParConj)
@@ -463,47 +463,47 @@
%-----------------------------------------------------------------------------%
goal_info_maybe_get_pre_births(GoalInfo, PreBirths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
PreBirths = CodeGenInfo ^ llds_code_gen ^ pre_births.
goal_info_maybe_get_post_births(GoalInfo, PostBirths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
PostBirths = CodeGenInfo ^ llds_code_gen ^ post_births.
goal_info_maybe_get_pre_deaths(GoalInfo, PreDeaths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
PreDeaths = CodeGenInfo ^ llds_code_gen ^ pre_deaths.
goal_info_maybe_get_post_deaths(GoalInfo, PostDeaths) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
PostDeaths = CodeGenInfo ^ llds_code_gen ^ post_deaths.
goal_info_maybe_get_follow_vars(GoalInfo, FollowVars) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
FollowVars = CodeGenInfo ^ llds_code_gen ^ follow_vars.
goal_info_maybe_get_store_map(GoalInfo, StoreMap) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
StoreMap = CodeGenInfo ^ llds_code_gen ^ store_map.
goal_info_maybe_get_resume_point(GoalInfo, ResumePoint) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
ResumePoint = CodeGenInfo ^ llds_code_gen ^ resume_point.
goal_info_maybe_get_maybe_need_across_call(GoalInfo, MaybeNeedAcrossCall) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need,
MaybeNeed = need_call(NeedAcrossCall),
MaybeNeedAcrossCall = yes(NeedAcrossCall).
goal_info_maybe_get_maybe_need_in_resume(GoalInfo, MaybeNeedInResume) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need,
MaybeNeed = need_resume(NeedInResume),
MaybeNeedInResume = yes(NeedInResume).
goal_info_maybe_get_maybe_need_in_par_conj(GoalInfo, MaybeNeedInParConj) :-
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
MaybeNeed = CodeGenInfo ^ llds_code_gen ^ maybe_need,
MaybeNeed = need_par_conj(NeedInParConj),
MaybeNeedInParConj = yes(NeedInParConj).
@@ -512,7 +512,7 @@
goal_info_initialize_liveness_info(PreBirths, PostBirths,
PreDeaths, PostDeaths, ResumePoint, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
some [!LLDSInfo] (
!:LLDSInfo = get_details(CodeGenInfo0),
!:LLDSInfo = !.LLDSInfo ^ pre_births := PreBirths,
@@ -525,70 +525,70 @@
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_pre_births(PreBirths, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ pre_births := PreBirths,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_post_births(PostBirths, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ post_births := PostBirths,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_pre_deaths(PreDeaths, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ pre_deaths := PreDeaths,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_post_deaths(PostDeaths, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ post_deaths := PostDeaths,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_follow_vars(FollowVars, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ follow_vars := FollowVars,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_store_map(StoreMap, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ store_map := StoreMap,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_resume_point(ResumePoint, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ resume_point := ResumePoint,
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_need_across_call(NeedAcrossCall, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ maybe_need := need_call(NeedAcrossCall),
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_need_in_resume(NeedInResume, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ maybe_need := need_resume(NeedInResume),
CodeGenInfo = llds_code_gen_info(LLDSInfo),
goal_info_set_code_gen_info(CodeGenInfo, !GoalInfo).
goal_info_set_need_in_par_conj(NeedInParConj, !GoalInfo) :-
- goal_info_get_code_gen_info(!.GoalInfo, CodeGenInfo0),
+ CodeGenInfo0 = goal_info_get_code_gen_info(!.GoalInfo),
LLDSInfo0 = get_details(CodeGenInfo0),
LLDSInfo = LLDSInfo0 ^ maybe_need := need_par_conj(NeedInParConj),
CodeGenInfo = llds_code_gen_info(LLDSInfo),
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.428
diff -u -b -r1.428 hlds_out.m
--- compiler/hlds_out.m 6 Jul 2007 02:35:21 -0000 1.428
+++ compiler/hlds_out.m 2 Aug 2007 07:37:42 -0000
@@ -1215,7 +1215,7 @@
Indent, Follow, TypeQual, !IO) :-
globals.io_lookup_string_option(dump_hlds_options, Verbose, !IO),
( string.contains_char(Verbose, 'c') ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_file(Context, FileName),
term.context_line(Context, LineNumber),
( FileName \= "" ->
@@ -1232,7 +1232,7 @@
true
),
( string.contains_char(Verbose, 'P') ->
- goal_info_get_goal_path(GoalInfo, Path),
+ Path = goal_info_get_goal_path(GoalInfo),
(
Path = [_ | _],
write_indent(Indent, !IO),
@@ -1246,7 +1246,7 @@
true
),
( string.contains_char(Verbose, 'n') ->
- goal_info_get_nonlocals(GoalInfo, NonLocalsSet),
+ NonLocalsSet = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocalsSet, NonLocalsList),
(
NonLocalsList = [_ | _],
@@ -1340,14 +1340,14 @@
( string.contains_char(Verbose, 'd') ->
write_indent(Indent, !IO),
io.write_string("% determinism: ", !IO),
- goal_info_get_determinism(GoalInfo, Determinism),
+ Determinism = goal_info_get_determinism(GoalInfo),
io.write_string(determinism_to_string(Determinism), !IO),
io.write_string("\n", !IO)
;
true
),
( string.contains_char(Verbose, 'z') ->
- goal_info_get_purity(GoalInfo, Purity),
+ Purity = goal_info_get_purity(GoalInfo),
(
Purity = purity_pure
;
@@ -1365,7 +1365,7 @@
write_goal_2(GoalExpr, ModuleInfo, VarSet, AppendVarNums, Indent, Follow,
TypeQual, !IO),
( string.contains_char(Verbose, 'i') ->
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
(
instmap_delta_is_reachable(InstMapDelta),
instmap_delta_changed_vars(InstMapDelta, Vars),
@@ -1419,9 +1419,9 @@
),
( string.contains_char(Verbose, 'R') ->
(
- goal_info_maybe_get_lfu(GoalInfo, LFU),
- goal_info_maybe_get_lbu(GoalInfo, LBU),
- goal_info_maybe_get_reuse(GoalInfo, ReuseDescription),
+ yes(LFU) = goal_info_get_maybe_lfu(GoalInfo),
+ yes(LBU) = goal_info_get_maybe_lbu(GoalInfo),
+ yes(ReuseDescription) = goal_info_get_maybe_reuse(GoalInfo),
set.to_sorted_list(LFU, ListLFU),
set.to_sorted_list(LBU, ListLBU)
->
@@ -1464,7 +1464,7 @@
;
true
),
- goal_info_get_code_gen_info(GoalInfo, CodeGenInfo),
+ CodeGenInfo = goal_info_get_code_gen_info(GoalInfo),
(
CodeGenInfo = no_code_gen_info
;
@@ -1473,7 +1473,7 @@
Verbose, !IO)
),
( string.contains_char(Verbose, 'g') ->
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
set.to_sorted_list(Features, FeatureList),
(
FeatureList = []
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.228
diff -u -b -r1.228 hlds_pred.m
--- compiler/hlds_pred.m 31 May 2007 08:12:53 -0000 1.228
+++ compiler/hlds_pred.m 2 Aug 2007 05:43:03 -0000
@@ -1126,7 +1126,7 @@
VarSet0, InstVarSet, Markers, IsAddressTaken, VarNameRemap,
ModuleInfo0, ModuleInfo, PredProcId) :-
Goal0 = hlds_goal(_GoalExpr, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
% XXX The set of existentially quantified type variables
@@ -1143,7 +1143,7 @@
IsAddressTaken, Globals, TypeInfoLiveness),
(
TypeInfoLiveness = yes,
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
goal_util.extra_nonlocal_typeinfos(RttiVarMaps, VarTypes0,
ExistQVars, NonLocals, ExtraTypeInfos0),
set.delete_list(ExtraTypeInfos0, ArgVars0, ExtraTypeInfos1),
@@ -1155,8 +1155,8 @@
ExtraTypeInfos = []
),
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_determinism(GoalInfo, Detism),
+ Context = goal_info_get_context(GoalInfo),
+ Detism = goal_info_get_determinism(GoalInfo),
compute_arg_types_modes(ArgVars, VarTypes0, InstMap0, InstMap,
ArgTypes, ArgModes),
Index: compiler/implicit_parallelism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/implicit_parallelism.m,v
retrieving revision 1.3
diff -u -b -r1.3 implicit_parallelism.m
--- compiler/implicit_parallelism.m 23 May 2007 10:09:16 -0000 1.3
+++ compiler/implicit_parallelism.m 2 Aug 2007 08:17:51 -0000
@@ -744,9 +744,9 @@
:- pred goal_depends_on_goal(hlds_goal::in, hlds_goal::in) is semidet.
goal_depends_on_goal(hlds_goal(_, GoalInfo1), hlds_goal(_, GoalInfo2)) :-
- goal_info_get_instmap_delta(GoalInfo1, InstmapDelta1),
+ InstmapDelta1 = goal_info_get_instmap_delta(GoalInfo1),
instmap_delta_changed_vars(InstmapDelta1, ChangedVars1),
- goal_info_get_nonlocals(GoalInfo2, NonLocals2),
+ NonLocals2 = goal_info_get_nonlocals(GoalInfo2),
set.intersect(ChangedVars1, NonLocals2, Intersection),
\+ set.empty(Intersection).
Index: compiler/inlining.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/inlining.m,v
retrieving revision 1.155
diff -u -b -r1.155 inlining.m
--- compiler/inlining.m 2 Aug 2007 01:24:00 -0000 1.155
+++ compiler/inlining.m 2 Aug 2007 08:19:13 -0000
@@ -647,17 +647,14 @@
% If some of the output variables are not used in the calling
% procedure, requantify the procedure.
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
( set.list_to_set(ArgVars) = NonLocals ->
Requantify = Requantify0
;
Requantify = yes
),
- (
- goal_info_get_purity(GoalInfo0, Purity),
- goal_info_get_purity(GoalInfo, Purity)
- ->
+ ( goal_info_get_purity(GoalInfo0) = goal_info_get_purity(GoalInfo) ->
PurityChanged = PurityChanged0
;
PurityChanged = yes
@@ -666,9 +663,8 @@
% If the inferred determinism of the called goal differs from the
% declared determinism, flag that we should re-run determinism analysis
% on this proc.
- goal_info_get_determinism(GoalInfo0, Determinism0),
- goal_info_get_determinism(GoalInfo, Determinism),
- DidInlining = yes,
+ Determinism0 = goal_info_get_determinism(GoalInfo0),
+ Determinism = goal_info_get_determinism(GoalInfo),
( Determinism0 = Determinism ->
DetChanged = DetChanged0
;
@@ -684,6 +680,8 @@
InlinedParallel = InlinedParallel0
),
+ DidInlining = yes,
+
!:Info = inline_info(VarThresh, HighLevelCode, AnyTracing,
InlinedProcs, ModuleInfo, HeadTypeParams, Markers,
VarSet, VarTypes, TypeVarSet, RttiVarMaps, DidInlining,
Index: compiler/interval.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/interval.m,v
retrieving revision 1.31
diff -u -b -r1.31 interval.m
--- compiler/interval.m 2 Aug 2007 01:24:00 -0000 1.31
+++ compiler/interval.m 2 Aug 2007 07:43:48 -0000
@@ -426,13 +426,13 @@
NondetLiveVars),
VarsOnStack0 = set.union_list([ForwardVars, ResumeVars,
NondetLiveVars]),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
CallAnchor = anchor_call_site(GoalPath),
get_cur_interval(AfterCallId, !.IntervalInfo),
new_interval_id(BeforeCallId, !IntervalInfo),
record_interval_start(AfterCallId, CallAnchor, !IntervalInfo),
record_interval_end(BeforeCallId, CallAnchor, !IntervalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
IntParams = !.IntervalInfo ^ interval_params,
(
( instmap_delta_is_reachable(InstMapDelta)
@@ -449,11 +449,14 @@
),
set_cur_interval(BeforeCallId, !IntervalInfo),
assign_open_intervals_to_anchor(CallAnchor, !IntervalInfo),
- goal_info_get_code_model(GoalInfo, CodeModel),
- ( CodeModel = model_non ->
+ CodeModel = goal_info_get_code_model(GoalInfo),
+ (
+ CodeModel = model_non,
record_model_non_anchor(CallAnchor, !IntervalInfo)
;
- true
+ ( CodeModel = model_det
+ ; CodeModel = model_semi
+ )
),
one_open_interval(BeforeCallId, !IntervalInfo),
require_flushed(VarsOnStack, !IntervalInfo),
@@ -524,7 +527,7 @@
reached_branch_end(GoalInfo, MaybeResumeGoal, Construct,
StartAnchor, EndAnchor, BeforeIntervalId, AfterIntervalId,
MaybeResumeVars, !IntervalInfo, !Acc) :-
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
record_branch_end_info(GoalPath, !IntervalInfo),
(
MaybeResumeGoal = yes(hlds_goal(_ResumeGoalExpr, ResumeGoalInfo)),
@@ -549,7 +552,7 @@
EndAnchor = anchor_branch_end(Construct, GoalPath),
StartAnchor = anchor_branch_start(Construct, GoalPath),
assign_open_intervals_to_anchor(EndAnchor, !IntervalInfo),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
( CodeModel = model_non ->
record_model_non_anchor(EndAnchor, !IntervalInfo)
;
@@ -591,7 +594,7 @@
interval_info::out) is det.
reached_cond_then(GoalInfo, !IntervalInfo) :-
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
record_cond_end(GoalPath, !IntervalInfo),
get_cur_interval(ThenStartId, !.IntervalInfo),
record_interval_start(ThenStartId, CondThenAnchor, !IntervalInfo),
@@ -1096,7 +1099,7 @@
MaybeNeedAcrossCall),
MaybeNeedAcrossCall = yes(_NeedAcrossCall)
->
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
Anchor = anchor_call_site(GoalPath),
lookup_inserts(InsertMap, Anchor, Inserts),
insert_goals_after(Goal1, Goal, !VarInfo, !:VarRename, Inserts,
@@ -1193,7 +1196,7 @@
construct_anchors(Construct, Goal, StartAnchor, EndAnchor) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
StartAnchor = anchor_branch_start(Construct, GoalPath),
EndAnchor = anchor_branch_end(Construct, GoalPath).
Index: compiler/ite_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ite_gen.m,v
retrieving revision 1.99
diff -u -b -r1.99 ite_gen.m
--- compiler/ite_gen.m 31 Jul 2007 01:56:35 -0000 1.99
+++ compiler/ite_gen.m 2 Aug 2007 07:48:48 -0000
@@ -71,7 +71,7 @@
generate_ite(CodeModel, CondGoal0, ThenGoal, ElseGoal, IteGoalInfo, Code,
!CI) :-
CondGoal0 = hlds_goal(CondExpr, CondInfo0),
- goal_info_get_code_model(CondInfo0, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondInfo0),
(
CodeModel = model_non,
CondCodeModel \= model_non
@@ -486,7 +486,7 @@
UseMinimalModelStackCopyPNeg = yes,
not goal_info_has_feature(GoalInfo, feature_will_not_call_mm_tabled)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_file(Context, File),
term.context_line(Context, Line),
(
@@ -560,7 +560,7 @@
code_info.get_forward_live_vars(!.CI, ForwardLiveVars),
LiveRegionVars = filter_region_vars(!.CI, ForwardLiveVars),
- goal_info_get_nonlocals(CondGoalInfo, CondNonLocals),
+ CondNonLocals = goal_info_get_nonlocals(CondGoalInfo),
CondNonlocalRegionVars = filter_region_vars(!.CI, CondNonLocals),
% XXX CondRemovedRegionVars should be the set of region vars whose
@@ -658,7 +658,7 @@
release_reg(SnapshotNumRegLval, !CI),
release_reg(AddrRegLval, !CI),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
CondCodeModel = model_non,
CondKind = region_ite_nondet_cond
Index: compiler/lambda.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lambda.m,v
retrieving revision 1.129
diff -u -b -r1.129 lambda.m
--- compiler/lambda.m 17 May 2007 03:52:44 -0000 1.129
+++ compiler/lambda.m 2 Aug 2007 08:19:43 -0000
@@ -327,7 +327,7 @@
% (see the documentation at top of this file).
ExistQVars = [],
LambdaGoal = hlds_goal(_, LambdaGoalInfo),
- goal_info_get_nonlocals(LambdaGoalInfo, LambdaGoalNonLocals),
+ LambdaGoalNonLocals = goal_info_get_nonlocals(LambdaGoalInfo),
set.insert_list(LambdaGoalNonLocals, Vars, LambdaNonLocals),
goal_util.extra_nonlocal_typeinfos(RttiVarMaps, VarTypes, ExistQVars,
LambdaNonLocals, ExtraTypeInfos),
@@ -392,7 +392,7 @@
% back-end (i.e. not --high-level-code), det is compatible with nondet.
% If we're using the MLDS back-end, then predicates and functions have
% different calling conventions.
- proc_info_interface_code_model(Call_ProcInfo, Call_CodeModel),
+ Call_CodeModel = proc_info_interface_code_model(Call_ProcInfo),
determinism_to_code_model(Detism, CodeModel),
module_info_get_globals(ModuleInfo0, Globals),
globals.lookup_bool_option(Globals, highlevel_code, HighLevelCode),
@@ -441,14 +441,14 @@
list.append(ArgVars, Vars, AllArgVars),
module_info_get_name(ModuleInfo0, ModuleName),
- goal_info_get_context(LambdaGoalInfo, OrigContext),
+ OrigContext = goal_info_get_context(LambdaGoalInfo),
term.context_file(OrigContext, OrigFile),
term.context_line(OrigContext, OrigLine),
module_info_next_lambda_count(OrigContext, LambdaCount,
ModuleInfo0, ModuleInfo1),
make_pred_name_with_context(ModuleName, "IntroducedFrom",
PredOrFunc, OrigPredName, OrigLine, LambdaCount, PredName),
- goal_info_get_context(LambdaGoalInfo, LambdaContext),
+ LambdaContext = goal_info_get_context(LambdaGoalInfo),
% The TVarSet is a superset of what it really ought be,
% but that shouldn't matter.
% Existentially typed lambda expressions are not yet supported
Index: compiler/lco.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lco.m,v
retrieving revision 1.45
diff -u -b -r1.45 lco.m
--- compiler/lco.m 19 Jan 2007 07:04:17 -0000 1.45
+++ compiler/lco.m 2 Aug 2007 08:20:43 -0000
@@ -487,8 +487,7 @@
RevGoalExpr = plain_call(PredId, ProcId, Args, Builtin, UnifyContext,
SymName),
set.member(proc(PredId, ProcId), ConstInfo ^ cur_scc),
- goal_info_get_determinism(RevGoalInfo, RevGoalDetism),
- RevGoalDetism = ConstInfo ^ cur_proc_detism,
+ goal_info_get_determinism(RevGoalInfo) = ConstInfo ^ cur_proc_detism,
module_info_pred_proc_info(ModuleInfo, PredId, ProcId,
_CalleePredInfo, CalleeProcInfo),
@@ -722,7 +721,7 @@
SubInfo0 = construct_sub_info(no, TermSizeSlot)
)
->
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
update_construct_args(Subst, 1, ArgVars, UpdatedArgVars, AddrFields,
InstMapDelta0, InstMapDelta),
(
Index: compiler/live_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/live_vars.m,v
retrieving revision 1.130
diff -u -b -r1.130 live_vars.m
--- compiler/live_vars.m 30 Apr 2007 07:05:09 -0000 1.130
+++ compiler/live_vars.m 2 Aug 2007 07:50:07 -0000
@@ -208,7 +208,7 @@
% stackslot because they are passed out by reference to that stackslot.
% Variables needed on backtracking must be available in a stackslot
% past the parallel conjunction as well.
- goal_info_get_code_gen_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_code_gen_nonlocals(GoalInfo0),
LiveSet = set.union_list([NonLocals, !.Liveness, ResumeVars0]),
InnerNonLocals = LiveSet `set.union` OuterNonLocals,
@@ -261,7 +261,7 @@
% disjuncts'; the disjunction as a whole can be model_non
% without any disjunct being model_non.
(
- goal_info_get_code_model(GoalInfo, model_non),
+ goal_info_get_code_model(GoalInfo) = model_non,
some [Disjunct] (
list.member(Disjunct, Goals),
Disjunct = hlds_goal(_, DisjunctGoalInfo),
@@ -326,10 +326,13 @@
% code following the "some" can reuse any stack slots needed by nondet
% code in the inner goal.
- goal_info_get_code_model(GoalInfo, CodeModel),
- ( CodeModel = model_non ->
- true
+ CodeModel = goal_info_get_code_model(GoalInfo),
+ (
+ CodeModel = model_non
;
+ ( CodeModel = model_det
+ ; CodeModel = model_semi
+ ),
!:NondetLiveness = NondetLiveness0
).
@@ -386,7 +389,7 @@
ArgVars = list.map(foreign_arg_var, Args),
arg_info.partition_proc_call_args(ProcInfo, VarTypes, ModuleInfo,
ArgVars, _InVars, OutVars, _UnusedVars),
- goal_info_get_code_model(GoalInfo0, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo0),
(
% We don't need to save any variables onto the stack before a
% foreign_proc if we know that it can't succeed more than once
@@ -437,7 +440,7 @@
maybe_add_typeinfo_liveness(AllocData ^ proc_info,
AllocData ^ typeinfo_liveness, OutVars, ForwardVars0, ForwardVars),
- goal_info_get_determinism(GoalInfo0, Detism),
+ Detism = goal_info_get_determinism(GoalInfo0),
(
Detism = detism_erroneous,
AllocData ^ opt_no_return_calls = yes
@@ -453,7 +456,7 @@
% If this is a nondet call, then all the stack slots we need
% must be protected against reuse in following code.
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
( CodeModel = model_non ->
set.union(!.NondetLiveness, ForwardVars, !:NondetLiveness)
;
@@ -483,7 +486,7 @@
AllocData, !StackAlloc, !Liveness, !NondetLiveness, !ParStackVars) :-
(
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_is_unreachable(InstMapDelta)
->
build_live_sets_in_goal(Goal0, Goal, ResumeVars0, AllocData,
@@ -542,7 +545,7 @@
build_live_sets_in_disj(Goals0, Goals, DisjGoalInfo, ResumeVars0,
AllocData, !StackAlloc, Liveness0, _Liveness2,
NondetLiveness0, NondetLiveness2, !ParStackVars),
- goal_info_get_code_model(DisjGoalInfo, DisjCodeModel),
+ DisjCodeModel = goal_info_get_code_model(DisjGoalInfo),
( DisjCodeModel = model_non ->
% NondetLiveness should be a set of prog_var sets. Instead of taking
% the union of the NondetLive sets at the ends of disjuncts, we should
Index: compiler/liveness.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/liveness.m,v
retrieving revision 1.155
diff -u -b -r1.155 liveness.m
--- compiler/liveness.m 19 Jan 2007 07:04:17 -0000 1.155
+++ compiler/liveness.m 2 Aug 2007 08:08:10 -0000
@@ -367,7 +367,7 @@
BaseNonLocals, CompletedNonLocals),
set.difference(CompletedNonLocals, Liveness0, NewVarsSet),
set.to_sorted_list(NewVarsSet, NewVarsList),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo0),
set.init(Empty),
( instmap_delta_is_unreachable(InstMapDelta) ->
Births = Empty
@@ -447,7 +447,7 @@
% in the else part should be put in the post-birth set of the then part
% by add_liveness_after_goal, and the other sets should be empty.
Cond = hlds_goal(_, CondInfo),
- goal_info_get_instmap_delta(CondInfo, CondDelta),
+ CondDelta = goal_info_get_instmap_delta(CondInfo),
( instmap_delta_is_unreachable(CondDelta) ->
LivenessThen = LivenessCond,
Then1 = Then0
@@ -498,7 +498,7 @@
detect_liveness_in_goal(Goal0, Goal, !Liveness, LiveInfo),
(
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_is_unreachable(InstmapDelta)
->
% If we continued processing goals, the final value of Liveness
@@ -659,14 +659,14 @@
liveness.get_nonlocals_and_typeinfos(LiveInfo, GoalInfo,
_, CompletedNonLocals),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_reachable(InstmapDelta) ->
Cond0 = hlds_goal(_, CondGoalInfo),
- goal_info_get_instmap_delta(CondGoalInfo, CondInstmapDelta),
+ CondInstmapDelta = goal_info_get_instmap_delta(CondGoalInfo),
Then0 = hlds_goal(_, ThenGoalInfo),
- goal_info_get_instmap_delta(ThenGoalInfo, ThenInstmapDelta),
+ ThenInstmapDelta = goal_info_get_instmap_delta(ThenGoalInfo),
Else0 = hlds_goal(_, ElseGoalInfo),
- goal_info_get_instmap_delta(ElseGoalInfo, ElseInstmapDelta),
+ ElseInstmapDelta = goal_info_get_instmap_delta(ElseGoalInfo),
(
instmap_delta_is_reachable(CondInstmapDelta),
instmap_delta_is_reachable(ThenInstmapDelta)
@@ -734,7 +734,7 @@
detect_deadness_in_conj([Goal0 | Goals0], [Goal | Goals], !Deadness,
Liveness0, LiveInfo) :-
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_unreachable(InstmapDelta) ->
Goals = Goals0,
detect_deadness_in_goal(Goal0, Goal, !Deadness, Liveness0, LiveInfo)
@@ -760,7 +760,7 @@
detect_deadness_in_goal(Goal0, Goal1, Deadness0, DeadnessGoal,
Liveness0, LiveInfo),
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_instmap_delta(GoalInfo1, InstmapDelta1),
+ InstmapDelta1 = goal_info_get_instmap_delta(GoalInfo1),
( instmap_delta_is_reachable(InstmapDelta1) ->
InstmapReachable = yes
;
@@ -790,7 +790,7 @@
detect_deadness_in_goal(Goal0, Goal1, Deadness0, DeadnessGoal,
Liveness0, LiveInfo),
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_instmap_delta(GoalInfo1, InstmapDelta1),
+ InstmapDelta1 = goal_info_get_instmap_delta(GoalInfo1),
( instmap_delta_is_reachable(InstmapDelta1) ->
InstmapReachable = yes
;
@@ -822,7 +822,7 @@
Liveness0, CompletedNonLocals, LiveInfo, !Union,
CompletedNonLocalUnion),
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_instmap_delta(GoalInfo1, InstmapDelta1),
+ InstmapDelta1 = goal_info_get_instmap_delta(GoalInfo1),
( instmap_delta_is_reachable(InstmapDelta1) ->
InstmapReachable = yes
;
@@ -941,11 +941,11 @@
update_liveness_expr(if_then_else(_, Cond, Then, Else), _GoalInfo, LiveInfo,
!Liveness) :-
Else = hlds_goal(_, ElseGoalInfo),
- goal_info_get_instmap_delta(ElseGoalInfo, ElseInstmapDelta),
+ ElseInstmapDelta = goal_info_get_instmap_delta(ElseGoalInfo),
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_instmap_delta(CondGoalInfo, CondInstmapDelta),
+ CondInstmapDelta = goal_info_get_instmap_delta(CondGoalInfo),
Then = hlds_goal(_, ThenGoalInfo),
- goal_info_get_instmap_delta(ThenGoalInfo, ThenInstmapDelta),
+ ThenInstmapDelta = goal_info_get_instmap_delta(ThenGoalInfo),
(
instmap_delta_is_reachable(ElseInstmapDelta)
->
@@ -978,7 +978,7 @@
find_reachable_goal([Goal | Goals], ReachableGoal) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_reachable(InstmapDelta) ->
ReachableGoal = Goal
;
@@ -989,7 +989,7 @@
find_reachable_case([case(_, Goal) | Cases], ReachableGoal) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_unreachable(InstmapDelta) ->
find_reachable_case(Cases, ReachableGoal)
;
@@ -1284,11 +1284,15 @@
detect_resume_points_in_goal_2(disj(Goals0), disj(Goals), !Liveness, GoalInfo,
LiveInfo, ResumeVars0) :-
- goal_info_get_code_model(GoalInfo, CodeModel),
- ( CodeModel = model_non ->
+ CodeModel = goal_info_get_code_model(GoalInfo),
+ (
+ CodeModel = model_non,
detect_resume_points_in_non_disj(Goals0, Goals, !Liveness,
LiveInfo, ResumeVars0, _)
;
+ ( CodeModel = model_det
+ ; CodeModel = model_semi
+ ),
detect_resume_points_in_pruned_disj(Goals0, Goals, !Liveness,
LiveInfo, ResumeVars0, _)
).
@@ -1323,7 +1327,7 @@
% the amount of data movement code we emit between such labels.
(
cannot_stack_flush(Cond1),
- goal_info_get_code_model(GoalInfo0, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo0),
CodeModel \= model_non
->
CondResumeLocs = resume_locs_orig_only
@@ -1459,7 +1463,7 @@
detect_resume_points_in_pruned_disj([Goal0 | Goals0], [Goal | Goals],
Liveness0, Liveness, LiveInfo, ResumeVars0, Needed) :-
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Detism0),
+ Detism0 = goal_info_get_determinism(GoalInfo0),
determinism_components(Detism0, CanFail0, _),
(
% This disjunct establishes a resumption point only if
@@ -1616,7 +1620,7 @@
%
module_info_get_globals(ModuleInfo, Globals),
proc_info_get_goal(ProcInfo, hlds_goal(_Goal, GoalInfo)),
- goal_info_get_code_gen_nonlocals(GoalInfo, NonLocals0),
+ NonLocals0 = goal_info_get_code_gen_nonlocals(GoalInfo),
module_info_pred_info(ModuleInfo, PredId, PredInfo),
proc_info_get_rtti_varmaps(ProcInfo, RttiVarMaps),
body_should_use_typeinfo_liveness(PredInfo, Globals, TypeinfoLiveness),
@@ -1727,7 +1731,7 @@
liveness.get_nonlocals_and_typeinfos(LiveInfo, GoalInfo,
NonLocals, CompletedNonLocals) :-
- goal_info_get_code_gen_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_code_gen_nonlocals(GoalInfo),
liveness.maybe_complete_with_typeinfos(LiveInfo,
NonLocals, CompletedNonLocals).
Index: compiler/lookup_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_switch.m,v
retrieving revision 1.76
diff -u -b -r1.76 lookup_switch.m
--- compiler/lookup_switch.m 31 Jul 2007 01:56:37 -0000 1.76
+++ compiler/lookup_switch.m 2 Aug 2007 07:52:32 -0000
@@ -167,7 +167,7 @@
code_info.get_globals(!.CI, Globals),
globals.lookup_bool_option(Globals, static_ground_terms, yes),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
(
( CodeModel = model_non
; CodeModel = model_semi
@@ -327,7 +327,7 @@
Goal = hlds_goal(GoalExpr, GoalInfo),
% Goals with these features need special treatment in generate_goal.
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
not set.member(feature_call_table_gen, Features),
not set.member(feature_save_deep_excp_vars, Features),
Index: compiler/lookup_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_util.m,v
retrieving revision 1.4
diff -u -b -r1.4 lookup_util.m
--- compiler/lookup_util.m 6 Jan 2007 09:23:40 -0000 1.4
+++ compiler/lookup_util.m 2 Aug 2007 07:52:51 -0000
@@ -91,7 +91,7 @@
:- import_module solutions.
figure_out_output_vars(CI, GoalInfo, OutVars) :-
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_unreachable(InstMapDelta) ->
OutVars = []
;
@@ -113,7 +113,7 @@
goal_is_conj_of_unify(Goal) :-
Goal = hlds_goal(_GoalExpr, GoalInfo),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
CodeModel = model_det,
goal_to_conj_list(Goal, Conj),
only_constant_goals(Conj).
@@ -148,7 +148,7 @@
!MaybeEnd, Liveness, !CI) :-
code_info.remember_position(!.CI, BranchStart),
Goal = hlds_goal(_GoalExpr, GoalInfo),
- goal_info_get_code_model(GoalInfo, CodeModel),
+ CodeModel = goal_info_get_code_model(GoalInfo),
code_gen.generate_goal(CodeModel, Goal, Code, !CI),
tree.tree_of_lists_is_empty(Code),
code_info.get_forward_live_vars(!.CI, Liveness),
Index: compiler/loop_inv.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/loop_inv.m,v
retrieving revision 1.41
diff -u -b -r1.41 loop_inv.m
--- compiler/loop_inv.m 17 May 2007 03:52:45 -0000 1.41
+++ compiler/loop_inv.m 2 Aug 2007 08:22:42 -0000
@@ -438,10 +438,13 @@
invariant_goal_candidates_handle_non_recursive_call(
Goal @ hlds_goal(_GoalExpr, GoalInfo), IGCs) =
- ( if not model_non(GoalInfo),
- goal_info_get_purity(GoalInfo, purity_pure)
- then IGCs ^ path_candidates := [Goal | IGCs ^ path_candidates]
- else IGCs
+ (
+ not model_non(GoalInfo),
+ goal_info_get_purity(GoalInfo) = purity_pure
+ ->
+ IGCs ^ path_candidates := [Goal | IGCs ^ path_candidates]
+ ;
+ IGCs
).
%-----------------------------------------------------------------------------%
@@ -449,7 +452,7 @@
:- pred model_non(hlds_goal_info::in) is semidet.
model_non(GoalInfo) :-
- hlds_goal.goal_info_get_determinism(GoalInfo, Detism),
+ Detism = hlds_goal.goal_info_get_determinism(GoalInfo),
code_model.determinism_to_code_model(Detism, model_non).
%-----------------------------------------------------------------------------%
@@ -586,7 +589,7 @@
:- pred has_uniquely_used_arg(prog_vars::in, hlds_goal::in) is semidet.
has_uniquely_used_arg(UUVs, hlds_goal(_GoalExpr, GoalInfo)) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
list.member(UUV, UUVs),
set.member(UUV, NonLocals).
@@ -664,14 +667,14 @@
:- pred impure_goal(hlds_goal::in) is semidet.
impure_goal(Goal) :-
- goal_get_purity(Goal, purity_impure).
+ goal_get_purity(Goal) = purity_impure.
%-----------------------------------------------------------------------------%
:- pred cannot_succeed(hlds_goal::in) is semidet.
cannot_succeed(hlds_goal(_GoalExpr, GoalInfo)) :-
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _CanFail, MaxSolns),
MaxSolns = at_most_zero.
@@ -746,7 +749,7 @@
compute_initial_aux_instmap(Gs, IM) = list.foldl(ApplyGoalInstMap, Gs, IM) :-
ApplyGoalInstMap =
( func(hlds_goal(_GoalExpr, GoalInfo), IM0) = IM1 :-
- goal_info_get_instmap_delta(GoalInfo, IMD),
+ IMD = goal_info_get_instmap_delta(GoalInfo),
apply_instmap_delta(IM0, IMD, IM1)
).
@@ -780,7 +783,7 @@
PredName = pred_info_name(PredInfo),
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_line(Context, Line),
hlds_pred.proc_id_to_int(ProcId, ProcNo),
AuxNamePrefix = string.format("loop_inv_%d", [i(ProcNo)]),
Index: compiler/make_hlds_warn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds_warn.m,v
retrieving revision 1.23
diff -u -b -r1.23 make_hlds_warn.m
--- compiler/make_hlds_warn.m 2 Aug 2007 01:24:01 -0000 1.23
+++ compiler/make_hlds_warn.m 2 Aug 2007 07:46:43 -0000
@@ -186,14 +186,14 @@
ModuleInfo, !Specs)
;
GoalExpr = plain_call(_, _, Args, _, _, _),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
warn_singletons_goal_vars(Args, GoalInfo, NonLocals, QuantVars, VarSet,
PredCallId, !Specs)
;
GoalExpr = generic_call(GenericCall, Args0, _, _),
goal_util.generic_call_vars(GenericCall, Args1),
list.append(Args0, Args1, Args),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
warn_singletons_goal_vars(Args, GoalInfo, NonLocals, QuantVars, VarSet,
PredCallId, !Specs)
;
@@ -202,7 +202,7 @@
PredCallId, ModuleInfo, !Specs)
;
GoalExpr = call_foreign_proc(Attrs, _, _, Args, _, _, PragmaImpl),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Lang = get_foreign_language(Attrs),
NamesModes = list.map(foreign_arg_maybe_name_mode, Args),
warn_singletons_in_pragma_foreign_proc(PragmaImpl, Lang,
@@ -255,12 +255,12 @@
warn_singletons_in_unify(X, rhs_var(Y), GoalInfo, QuantVars, VarSet,
CallPredId, _, !Specs) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
warn_singletons_goal_vars([X, Y], GoalInfo, NonLocals, QuantVars,
VarSet, CallPredId, !Specs).
warn_singletons_in_unify(X, rhs_functor(_ConsId, _, Vars), GoalInfo,
QuantVars, VarSet, CallPredId, _, !Specs) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
warn_singletons_goal_vars([X | Vars], GoalInfo, NonLocals, QuantVars,
VarSet, CallPredId, !Specs).
warn_singletons_in_unify(X, rhs_lambda_goal(_Purity, _PredOrFunc, _Eval,
@@ -268,13 +268,13 @@
GoalInfo, QuantVars, VarSet, CallPredId, ModuleInfo, !Specs) :-
% Warn if any lambda-quantified variables occur only in the quantifier.
LambdaGoal = hlds_goal(_, LambdaGoalInfo),
- goal_info_get_nonlocals(LambdaGoalInfo, LambdaNonLocals),
+ LambdaNonLocals = goal_info_get_nonlocals(LambdaGoalInfo),
warn_singletons_goal_vars(LambdaVars, GoalInfo, LambdaNonLocals, QuantVars,
VarSet, CallPredId, !Specs),
% Warn if X (the variable we're unifying the lambda expression with)
% is singleton.
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
warn_singletons_goal_vars([X], GoalInfo, NonLocals, QuantVars,
VarSet, CallPredId, !Specs),
@@ -327,8 +327,7 @@
SinglesPieces = [words("warning: variables"), SingleVarsPiece,
words("occur only once in this scope."), nl]
),
- goal_info_get_context(GoalInfo, Context1),
- SinglesMsg = simple_msg(Context1,
+ SinglesMsg = simple_msg(goal_info_get_context(GoalInfo),
[option_is_set(warn_singleton_vars, yes,
[always(SinglesPreamble ++ SinglesPieces)])]),
SingleSeverity = severity_conditional(warn_singleton_vars, yes,
@@ -358,8 +357,7 @@
MultiPieces = [words("warning: variables"), MultiVarsPiece,
words("ccur more than once in this scope."), nl]
),
- goal_info_get_context(GoalInfo, Context2),
- MultiMsg = simple_msg(Context2,
+ MultiMsg = simple_msg(goal_info_get_context(GoalInfo),
[option_is_set(warn_singleton_vars, yes,
[always(MultiPreamble ++ MultiPieces)])]),
MultiSeverity = severity_conditional(warn_singleton_vars, yes,
Index: compiler/ml_closure_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_closure_gen.m,v
retrieving revision 1.49
diff -u -b -r1.49 ml_closure_gen.m
--- compiler/ml_closure_gen.m 19 Jan 2007 07:04:20 -0000 1.49
+++ compiler/ml_closure_gen.m 2 Aug 2007 07:58:13 -0000
@@ -672,7 +672,7 @@
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
proc_info_get_headvars(ProcInfo, ProcHeadVars),
proc_info_get_argmodes(ProcInfo, ProcArgModes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
proc_info_get_varset(ProcInfo, ProcVarSet),
ProcArity = list.length(ProcHeadVars),
ProcHeadVarNames = ml_gen_var_names(ProcVarSet, ProcHeadVars),
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.201
diff -u -b -r1.201 ml_code_gen.m
--- compiler/ml_code_gen.m 25 Jul 2007 06:12:20 -0000 1.201
+++ compiler/ml_code_gen.m 2 Aug 2007 08:00:55 -0000
@@ -1325,7 +1325,7 @@
module_info_pred_proc_info(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo),
pred_info_get_import_status(PredInfo, ImportStatus),
pred_info_get_arg_types(PredInfo, ArgTypes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
proc_info_get_headvars(ProcInfo, HeadVars),
proc_info_get_argmodes(ProcInfo, Modes),
proc_info_get_goal(ProcInfo, Goal0),
@@ -1337,13 +1337,13 @@
% declared.
Goal0 = hlds_goal(GoalExpr, GoalInfo0),
- goal_info_get_code_gen_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_code_gen_nonlocals(GoalInfo0),
set.list_to_set(HeadVars, HeadVarsSet),
set.intersect(HeadVarsSet, NonLocals0, NonLocals),
goal_info_set_code_gen_nonlocals(NonLocals, GoalInfo0, GoalInfo),
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
some [!Info] (
!:Info = ml_gen_info_init(ModuleInfo, PredId, ProcId),
@@ -1495,7 +1495,7 @@
ml_gen_all_local_var_decls(Goal, VarSet, VarTypes, HeadVars, MLDS_LocalVars,
!Info) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
goal_util.goal_vars(Goal, AllVarsSet),
set.delete_list(AllVarsSet, HeadVars, LocalVarsSet),
set.to_sorted_list(LocalVarsSet, LocalVars),
@@ -1532,7 +1532,7 @@
ml_gen_proc_body(CodeModel, HeadVars, ArgTypes, ArgModes, CopiedOutputVars,
Goal, Decls, Statements, !Info) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
% First just generate the code for the procedure's goal.
DoGenGoal = ml_gen_goal(CodeModel, Goal),
@@ -1671,7 +1671,7 @@
ml_gen_goal(CodeModel, Goal, Statement, !Info) :-
ml_gen_goal(CodeModel, Goal, Decls, Statements, !Info),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Statement = ml_gen_block(Decls, Statements, Context).
% Generate MLDS code for the specified goal in the specified code model.
@@ -1680,7 +1680,7 @@
%
ml_gen_goal(CodeModel, Goal, Decls, Statements, !Info) :-
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
% Generate the local variables for this goal. We need to declare any
% variables which are local to this goal (including its subgoals),
% but which are not local to a subgoal. (If they're local to a subgoal,
@@ -1702,7 +1702,7 @@
!Info),
% Generate code for the goal in its own code model.
- goal_info_get_code_model(GoalInfo, GoalCodeModel),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo),
ml_gen_goal_expr(GoalExpr, GoalCodeModel, Context,
GoalDecls, GoalStatements0, !Info),
@@ -1724,7 +1724,7 @@
goal_util.goal_vars(Goal, GoalVars),
% Delete the non-locals.
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_code_gen_nonlocals(GoalInfo, NonLocalVars),
+ NonLocalVars = goal_info_get_code_gen_nonlocals(GoalInfo),
set.difference(GoalVars, NonLocalVars, LocalVars).
:- func union_of_direct_subgoal_locals(hlds_goal) = set(prog_var).
@@ -1815,8 +1815,8 @@
ml_gen_commit(Goal, CodeModel, Context, Decls, Statements, !Info) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_code_model(GoalInfo, GoalCodeModel),
- goal_info_get_context(GoalInfo, GoalContext),
+ GoalCodeModel = goal_info_get_code_model(GoalInfo),
+ GoalContext = goal_info_get_context(GoalInfo),
(
GoalCodeModel = model_non,
@@ -2079,8 +2079,8 @@
globals.lookup_bool_option(Globals, nondet_copy_out, NondetCopyOut),
(
NondetCopyOut = yes,
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ Context = goal_info_get_context(GoalInfo),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
ml_gen_info_get_byref_output_vars(!.Info, ByRefOutputVars),
VarsToCopy = set.intersect(set.list_to_set(ByRefOutputVars),
NonLocals),
@@ -3484,7 +3484,7 @@
ml_gen_ite(CodeModel, Cond, Then, Else, Context, Decls, Statements, !Info) :-
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
% model_det Cond:
% <(Cond -> Then ; Else)>
@@ -3567,7 +3567,7 @@
% Generate the `then_func'.
% push nesting level
Then = hlds_goal(_, ThenGoalInfo),
- goal_info_get_context(ThenGoalInfo, ThenContext),
+ ThenContext = goal_info_get_context(ThenGoalInfo),
ml_gen_set_cond_var(!.Info, CondVar, const(mlconst_true), ThenContext,
SetCondTrue),
ml_gen_goal(CodeModel, Then, ThenStatement, !Info),
@@ -3600,7 +3600,7 @@
ml_gen_negation(Cond, CodeModel, Context, Decls, Statements, !Info) :-
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
+ CondCodeModel = goal_info_get_code_model(CondGoalInfo),
(
% model_det negation:
% <not(Goal)>
@@ -3665,7 +3665,7 @@
ml_gen_conj([First | Rest], CodeModel, Context, Decls, Statements, !Info) :-
Rest = [_ | _],
First = hlds_goal(_, FirstGoalInfo),
- goal_info_get_determinism(FirstGoalInfo, FirstDeterminism),
+ FirstDeterminism = goal_info_get_determinism(FirstGoalInfo),
( determinism_components(FirstDeterminism, _, at_most_zero) ->
% the `Rest' code is unreachable
ml_gen_goal(CodeModel, First, Decls, Statements, !Info)
@@ -3746,7 +3746,7 @@
% }
First = hlds_goal(_, FirstGoalInfo),
- goal_info_get_code_model(FirstGoalInfo, FirstCodeModel),
+ FirstCodeModel = goal_info_get_code_model(FirstGoalInfo),
(
FirstCodeModel = model_det,
ml_gen_goal(model_det, First, Decls, Statements, !Info)
Index: compiler/ml_code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ml_code_util.m,v
retrieving revision 1.122
diff -u -b -r1.122 ml_code_util.m
--- compiler/ml_code_util.m 19 Jan 2007 07:04:20 -0000 1.122
+++ compiler/ml_code_util.m 2 Aug 2007 08:01:54 -0000
@@ -1011,7 +1011,7 @@
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
pred_info_get_arg_types(PredInfo, HeadTypes),
proc_info_get_argmodes(ProcInfo, HeadModes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
HeadVarNames = ml_gen_var_names(VarSet, HeadVars),
FuncParams = ml_gen_params(ModuleInfo, HeadVarNames, HeadTypes,
HeadModes, PredOrFunc, CodeModel).
@@ -1024,7 +1024,7 @@
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
pred_info_get_arg_types(PredInfo, HeadTypes),
proc_info_get_argmodes(ProcInfo, HeadModes),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
HeadVarNames = ml_gen_var_names(VarSet, HeadVars),
% We must not generate GC tracing code for no_type_info_builtin
% procedures, because the generated GC tracing code would refer
@@ -1239,7 +1239,7 @@
ml_is_output_det_function(ModuleInfo, PredId, ProcId, RetArgVar) :-
module_info_pred_proc_info(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo),
pred_info_is_pred_or_func(PredInfo) = pf_function,
- proc_info_interface_code_model(ProcInfo, model_det),
+ proc_info_interface_code_model(ProcInfo) = model_det,
proc_info_get_argmodes(ProcInfo, Modes),
pred_info_get_arg_types(PredInfo, ArgTypes),
@@ -2036,8 +2036,7 @@
ml_gen_make_type_info_var(ActualType, Context,
TypeInfoVar, HLDS_TypeInfoGoals, !Info),
NonLocalsList = list.map(
- (func(hlds_goal(_G, GI)) = NL :-
- goal_info_get_nonlocals(GI, NL)),
+ (func(hlds_goal(_GX, GI)) = goal_info_get_nonlocals(GI)),
HLDS_TypeInfoGoals),
NonLocals = set.union_list(NonLocalsList),
instmap_delta_from_assoc_list([TypeInfoVar - ground(shared, none)],
Index: compiler/mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_constraints.m,v
retrieving revision 1.41
diff -u -b -r1.41 mode_constraints.m
--- compiler/mode_constraints.m 17 May 2007 03:52:45 -0000 1.41
+++ compiler/mode_constraints.m 2 Aug 2007 03:34:17 -0000
@@ -409,8 +409,8 @@
number_robdd_variables_in_goal(InstGraph, ParentNonLocals, Occurring,
hlds_goal(GoalExpr0, GoalInfo0), hlds_goal(GoalExpr, GoalInfo),
!RInfo) :-
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
number_robdd_variables_in_goal_2(InstGraph, GoalPath, ParentNonLocals,
NonLocals, Occurring, GoalExpr0, GoalExpr, !RInfo),
goal_info_set_occurring_vars(Occurring, GoalInfo0, GoalInfo).
@@ -1117,7 +1117,7 @@
true
),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
goal_info_get_occurring_vars(GoalInfo0, Vars),
% Number the vars we want to keep for this goal.
@@ -1127,7 +1127,7 @@
), set.to_sorted_list(Vars), !GCInfo),
save_thresh(Threshold, !GCInfo),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
InstGraph = !.GCInfo ^ inst_graph,
NonLocalReachable = solutions.solutions_set(inst_graph.reachable_from_list(
@@ -2075,8 +2075,8 @@
:- func goal_path(hlds_goal) = goal_path.
-goal_path(hlds_goal(_, GoalInfo)) = GoalPath :-
- goal_info_get_goal_path(GoalInfo, GoalPath).
+goal_path(hlds_goal(_, GoalInfo)) =
+ goal_info_get_goal_path(GoalInfo).
:- func vars(hlds_goal) = set(prog_var).
Index: compiler/mode_errors.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_errors.m,v
retrieving revision 1.117
diff -u -b -r1.117 mode_errors.m
--- compiler/mode_errors.m 31 Jul 2007 03:53:30 -0000 1.117
+++ compiler/mode_errors.m 2 Aug 2007 03:34:25 -0000
@@ -425,7 +425,7 @@
;
Culprit = goals_followed_by_impure_goal(ImpureGoal),
ImpureGoal = hlds_goal(_, ImpureGoalInfo),
- goal_info_get_context(ImpureGoalInfo, ImpureGoalContext),
+ ImpureGoalContext = goal_info_get_context(ImpureGoalInfo),
Pieces1 = [words("The goal could not be reordered,"),
words("because it was followed by an impure goal.")],
Pieces2 = [words("This is the location of the impure goal.")],
Index: compiler/mode_ordering.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_ordering.m,v
retrieving revision 1.22
diff -u -b -r1.22 mode_ordering.m
--- compiler/mode_ordering.m 17 May 2007 03:52:46 -0000 1.22
+++ compiler/mode_ordering.m 2 Aug 2007 03:45:57 -0000
@@ -284,7 +284,7 @@
RHS = rhs_lambda_goal(A, B, C, NonLocals, LambdaVars, Modes,
G, SubGoal),
- goal_info_get_goal_path(!.GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(!.GoalInfo),
enter_lambda_goal(GoalPath, !MOI),
mode_order_goal(SubGoal0, SubGoal, !MOI),
leave_lambda_goal(!MOI),
@@ -414,8 +414,7 @@
GoalMap = list.foldl((func(G, GM) = map.det_insert(GM, Index, G) :-
(
G = hlds_goal(_, GI),
- goal_info_get_goal_path(GI, GP),
- GP = [step_conj(Index0) | _]
+ goal_info_get_goal_path(GI) = [step_conj(Index0) | _]
->
Index = Index0
;
@@ -470,7 +469,7 @@
set_atomic_prod_vars(ProdVars, !GoalInfo, !MOI) :-
LambdaNesting = !.MOI ^ lambda_nesting,
AtomicProdVars = !.MOI ^ prodvars_map,
- goal_info_get_goal_path(!.GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(!.GoalInfo),
(
map.search(AtomicProdVars, stack.push(LambdaNesting, GoalPath),
ProdVars0)
Index: compiler/mode_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_util.m,v
retrieving revision 1.198
diff -u -b -r1.198 mode_util.m
--- compiler/mode_util.m 2 May 2007 06:08:49 -0000 1.198
+++ compiler/mode_util.m 2 Aug 2007 03:37:08 -0000
@@ -960,7 +960,7 @@
;
recompute_instmap_delta_2(RecomputeAtomic, GoalExpr0, GoalInfo0,
GoalExpr, VarTypes, InstMap0, InstMapDelta0, !RI),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
instmap_delta_restrict(NonLocals, InstMapDelta0, InstMapDelta1),
goal_info_set_instmap_delta(InstMapDelta1, GoalInfo0, GoalInfo1)
),
@@ -974,7 +974,7 @@
GoalInfo = GoalInfo1
),
Goal = hlds_goal(GoalExpr, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta).
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo).
:- type recompute_info
---> recompute_info(
@@ -1003,9 +1003,9 @@
switch(Var, Det, Cases), VarTypes, InstMap, InstMapDelta, !RI) :-
( goal_info_has_feature(GoalInfo, feature_mode_check_clauses_goal) ->
Cases = Cases0,
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta)
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo)
;
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
recompute_instmap_delta_cases(Atomic, Var, Cases0, Cases,
VarTypes, InstMap, NonLocals, InstMapDelta, !RI)
).
@@ -1019,9 +1019,9 @@
VarTypes, InstMap, InstMapDelta, !RI) :-
( goal_info_has_feature(GoalInfo, feature_mode_check_clauses_goal) ->
Goals = Goals0,
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta)
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo)
;
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
recompute_instmap_delta_disj(Atomic, Goals0, Goals,
VarTypes, InstMap, NonLocals, InstMapDelta, !RI)
).
@@ -1044,7 +1044,7 @@
InstMapDeltaElse, !RI),
instmap_delta_apply_instmap_delta(InstMapDeltaCond, InstMapDeltaThen,
test_size, InstMapDeltaCondThen),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
update_module_info(
merge_instmap_delta(InstMap0, NonLocals,
VarTypes, InstMapDeltaElse, InstMapDeltaCondThen),
@@ -1091,7 +1091,7 @@
;
Atomic = no,
UniMode = UniMode0,
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta)
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo)
).
recompute_instmap_delta_2(_,
@@ -1107,7 +1107,7 @@
InstMapDelta = InstMapDelta0
;
ExtraArgs = [_ | _],
- goal_info_get_instmap_delta(GoalInfo, OldInstMapDelta),
+ OldInstMapDelta = goal_info_get_instmap_delta(GoalInfo),
ExtraArgVars = list.map(foreign_arg_var, ExtraArgs),
instmap_delta_restrict(set.list_to_set(ExtraArgVars),
OldInstMapDelta, ExtraArgsInstMapDelta),
@@ -1333,7 +1333,7 @@
% Get the final inst of the deconstructed var, which will be the same
% as in the old instmap.
%
- goal_info_get_instmap_delta(GoalInfo, OldInstMapDelta),
+ OldInstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.lookup_var(InstMap, Var, InitialInst),
( instmap_delta_search_var(OldInstMapDelta, Var, FinalInst1) ->
% XXX we need to merge the information in InitialInst
@@ -1359,9 +1359,9 @@
UniMode = UniMode0
;
Uni = construct(Var, ConsId, Args, _, _, _, _),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.member(Var, NonLocals),
- goal_info_get_instmap_delta(GoalInfo, OldInstMapDelta),
+ OldInstMapDelta = goal_info_get_instmap_delta(GoalInfo),
\+ instmap_delta_search_var(OldInstMapDelta, Var, _),
MaybeInst = cons_id_to_shared_inst(ModuleInfo, ConsId, length(Args)),
MaybeInst = yes(Inst)
@@ -1370,7 +1370,7 @@
instmap_delta_init_reachable(InstMapDelta0),
instmap_delta_set(Var, Inst, InstMapDelta0, InstMapDelta)
;
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
UniMode = UniMode0
).
@@ -1490,7 +1490,7 @@
fixup_switch_var(Var, InstMap0, InstMap, Goal0, Goal) :-
Goal0 = hlds_goal(GoalExpr, GoalInfo0),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
instmap.lookup_var(InstMap0, Var, Inst0),
instmap.lookup_var(InstMap, Var, Inst),
( Inst = Inst0 ->
Index: compiler/modecheck_unify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.116
diff -u -b -r1.116 modecheck_unify.m
--- compiler/modecheck_unify.m 28 May 2007 01:06:18 -0000 1.116
+++ compiler/modecheck_unify.m 2 Aug 2007 03:37:21 -0000
@@ -330,7 +330,7 @@
% non-local variables, since it could get called more than once, or
% from inside a negation.)
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.delete_list(NonLocals0, Vars, NonLocals),
set.to_sorted_list(NonLocals, NonLocalsList),
instmap.lookup_vars(NonLocalsList, InstMap1, NonLocalInsts),
@@ -1021,7 +1021,7 @@
mode_info::in, mode_info::out) is det.
record_optimize_away(GoalInfo, Var1, Var2, !ModeInfo) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
(
set.member(Var1, NonLocals),
set.member(Var2, NonLocals)
Index: compiler/modes.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.358
diff -u -b -r1.358 modes.m
--- compiler/modes.m 25 Jun 2007 00:58:11 -0000 1.358
+++ compiler/modes.m 2 Aug 2007 03:50:29 -0000
@@ -829,14 +829,14 @@
Cases0 = [_ | _],
ClausesForm0 = clause_switch(SwitchVar0, CanFail0, Cases0)
),
- goal_info_get_nonlocals(BodyGoalInfo0, BodyNonLocals),
+ BodyNonLocals = goal_info_get_nonlocals(BodyGoalInfo0),
mode_info_get_var_types(!.ModeInfo, VarTypes0),
SolverNonLocals = list.filter(
is_solver_var(VarTypes0, !.ModuleInfo),
set.to_sorted_list(BodyNonLocals)),
SolverNonLocals = []
->
- goal_info_get_context(BodyGoalInfo0, BodyContext),
+ BodyContext = goal_info_get_context(BodyGoalInfo0),
term.context_init(EmptyContext),
( BodyContext = EmptyContext ->
true
@@ -866,8 +866,8 @@
;
WhatToCheck = check_unique_modes,
mode_info_get_nondet_live_vars(!.ModeInfo, NondetLiveVars0),
- goal_info_get_determinism(BodyGoalInfo0, Detism),
- goal_info_get_nonlocals(BodyGoalInfo0, NonLocals),
+ Detism = goal_info_get_determinism(BodyGoalInfo0),
+ NonLocals = goal_info_get_nonlocals(BodyGoalInfo0),
( determinism_components(Detism, _, at_most_many) ->
true
;
@@ -1235,7 +1235,7 @@
prepend_initialisation_call(Var, VarType, InitialInst, Goal0, Goal,
!ModeInfo) :-
Goal0 = hlds_goal(_GoalExpr0, GoalInfo0),
- hlds_goal.goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
CallUnifyContext = no,
construct_initialisation_call(Var, VarType, InitialInst, Context,
CallUnifyContext, InitVarGoal, !ModeInfo),
@@ -1250,7 +1250,7 @@
% Note: any changes here may need to be duplicated in unique_modes.m.
% Store the current context in the mode_info.
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
term.context_init(EmptyContext),
( Context = EmptyContext ->
true
@@ -1283,7 +1283,7 @@
instmap_delta_init_reachable(DeltaInstMap),
mode_info_set_instmap(InstMap0, !ModeInfo)
;
- goal_info_get_nonlocals(!.GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(!.GoalInfo),
mode_info_get_instmap(!.ModeInfo, InstMap),
compute_instmap_delta(InstMap0, InstMap, NonLocals, DeltaInstMap)
),
@@ -1325,7 +1325,7 @@
% modecheck_clause_disj or the code that calls it.
Disjs0 = [_ | _],
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
modecheck_disj_list(Disjs0, Disjs1, InstMapList0, !ModeInfo, !IO),
mode_info_get_var_types(!.ModeInfo, VarTypes),
handle_solver_vars_in_disjs(set.to_sorted_list(NonLocals),
@@ -1339,8 +1339,8 @@
modecheck_goal_expr(if_then_else(Vars, Cond0, Then0, Else0), GoalInfo0,
GoalExpr, !ModeInfo, !IO) :-
mode_checkpoint(enter, "if-then-else", !ModeInfo, !IO),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
- goal_get_nonlocals(Then0, ThenVars),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
+ ThenVars = goal_get_nonlocals(Then0),
mode_info_get_instmap(!.ModeInfo, InstMap0),
% We need to lock the non-local variables, to ensure that the condition
@@ -1375,7 +1375,7 @@
GoalExpr = if_then_else(Vars, Cond, Then, Else),
mode_info_get_instmap(!.ModeInfo, InstMap),
( mode_info_get_in_promise_purity_scope(!.ModeInfo, no) ->
- goal_get_nonlocals(Cond, CondNonLocals0),
+ CondNonLocals0 = goal_get_nonlocals(Cond),
CondNonLocals =
set.to_sorted_list(CondNonLocals0 `intersect` NonLocals),
check_no_inst_any_vars(if_then_else, CondNonLocals,
@@ -1388,7 +1388,7 @@
modecheck_goal_expr(negation(SubGoal0), GoalInfo0, negation(SubGoal),
!ModeInfo, !IO) :-
mode_checkpoint(enter, "not", !ModeInfo, !IO),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
mode_info_get_instmap(!.ModeInfo, InstMap0),
% When analyzing a negated goal, nothing is forward-live (live on forward
@@ -1408,7 +1408,7 @@
mode_info_unlock_vars(var_lock_negation, NonLocals, !ModeInfo),
mode_info_set_instmap(InstMap0, !ModeInfo),
( mode_info_get_in_promise_purity_scope(!.ModeInfo, no) ->
- goal_info_get_nonlocals(GoalInfo0, NegNonLocals),
+ NegNonLocals = goal_info_get_nonlocals(GoalInfo0),
instmap.init_unreachable(Unreachable),
check_no_inst_any_vars(negation, set.to_sorted_list(NegNonLocals),
InstMap0, Unreachable, !ModeInfo)
@@ -1423,7 +1423,7 @@
Reason = trace_goal(_, _, _, _, _),
mode_checkpoint(enter, "scope", !ModeInfo, !IO),
mode_info_get_instmap(!.ModeInfo, InstMap0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
% We need to lock the non-local variables, to ensure that
% the trace goal does not bind them. If it did, then the code
% would not be valid with the trace goal disabled.
@@ -1625,9 +1625,8 @@
% modecheck_clause_switch or the code that calls it.
Cases0 = [_ | _],
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
- modecheck_case_list(Cases0, Var, Cases, InstMapList,
- !ModeInfo, !IO),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
+ modecheck_case_list(Cases0, Var, Cases, InstMapList, !ModeInfo, !IO),
instmap_merge(NonLocals, InstMapList, disj, !ModeInfo)
),
mode_checkpoint(exit, "switch", !ModeInfo, !IO).
@@ -1726,7 +1725,7 @@
% % InstMapAtEnd (from the ModeInfo) is here
% Recompute the new set of non-local variables for the main goal.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.list_to_set(Args0, OldArgVars),
set.list_to_set(Args, NewArgVars),
set.difference(NewArgVars, OldArgVars, IntroducedVars),
@@ -1736,7 +1735,7 @@
% Combine the main goal and the extra goals into a conjunction.
Goal0 = hlds_goal(MainGoal, GoalInfo),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
handle_extra_goals_contexts(BeforeGoals0, Context, BeforeGoals),
handle_extra_goals_contexts(AfterGoals0, Context, AfterGoals),
list.append(BeforeGoals, [Goal0 | AfterGoals], GoalList0),
@@ -1878,7 +1877,7 @@
append_init_calls_to_goal(InitedVars, InitCalls, Goal0) = Goal :-
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
NonLocals = set.union(InitedVars, NonLocals0),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo),
( GoalExpr0 = disj(Disjs0) ->
@@ -1934,7 +1933,7 @@
modecheck_conj_list_no_delay([], [], !ModeInfo, !IO).
modecheck_conj_list_no_delay([Goal0 | Goals0], [Goal | Goals], !ModeInfo,
!IO) :-
- goal_get_nonlocals(Goal0, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal0),
mode_info_remove_live_vars(NonLocals, !ModeInfo),
modecheck_goal(Goal0, Goal, !ModeInfo, !IO),
mode_info_get_instmap(!.ModeInfo, InstMap),
@@ -2035,7 +2034,7 @@
->
mode_info_add_goals_live_vars(ConjType, ConjGoals, !ModeInfo)
;
- goal_get_nonlocals(Goal, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal),
mode_info_add_live_vars(NonLocals, !ModeInfo)
).
@@ -2048,7 +2047,7 @@
->
mode_info_remove_goals_live_vars(ConjGoals, !ModeInfo)
;
- goal_get_nonlocals(Goal, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal),
mode_info_remove_live_vars(NonLocals, !ModeInfo)
),
mode_info_remove_goals_live_vars(Goals, !ModeInfo).
@@ -2091,7 +2090,7 @@
%
modecheck_conj_list_3(ConjType, Goal0, Goals0, Goals, !ImpurityErrors,
!ModeInfo, !IO) :-
- goal_get_purity(Goal0, Purity),
+ Purity = goal_get_purity(Goal0),
( Purity = purity_impure ->
Impure = yes,
check_for_impurity_error(Goal0, ScheduledSolverGoals,
@@ -2107,7 +2106,7 @@
% Modecheck the goal, noting first that the non-locals
% which occur in the goal might not be live anymore.
- goal_get_nonlocals(Goal0, NonLocalVars),
+ NonLocalVars = goal_get_nonlocals(Goal0),
mode_info_remove_live_vars(NonLocalVars, !ModeInfo),
modecheck_goal(Goal0, Goal, !ModeInfo, !IO),
@@ -2440,7 +2439,7 @@
GoalExpr = if_then_else(_LocalVars, CondGoal, ThenGoal, ElseGoal),
CondGoal = hlds_goal(_CondGoalExpr, CondGoalInfo),
- goal_info_get_nonlocals(CondGoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(CondGoalInfo),
mode_info_get_module_info(ModeInfo, ModuleInfo),
mode_info_get_var_types(ModeInfo, VarTypes),
NonSolverNonLocals =
Index: compiler/ordering_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ordering_mode_constraints.m,v
retrieving revision 1.15
diff -u -b -r1.15 ordering_mode_constraints.m
--- compiler/ordering_mode_constraints.m 17 May 2007 03:52:48 -0000 1.15
+++ compiler/ordering_mode_constraints.m 2 Aug 2007 03:41:00 -0000
@@ -507,8 +507,8 @@
make_conjunct_nonlocal_repvars(PredId, Goal, !RepvarMap) :-
GoalInfo = Goal ^ hlds_goal_info,
- goal_info_get_nonlocals(GoalInfo, Nonlocals),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ Nonlocals = goal_info_get_nonlocals(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
set.fold(
(pred(NL::in, RMap0::in, RMap::out) is det :-
@@ -758,7 +758,7 @@
:- pred dump_goal_goal_paths(int::in, hlds_goal::in, io::di, io::uo) is det.
dump_goal_goal_paths(Indent, hlds_goal(GoalExpr, GoalInfo), !IO) :-
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
GoalPathFormat = [words(goal_path_to_string(GoalPath)), nl],
write_error_pieces_maybe_with_context(no, Indent, GoalPathFormat, !IO),
dump_goal_expr_goal_paths(Indent+1, GoalExpr, !IO).
Index: compiler/par_conj_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/par_conj_gen.m,v
retrieving revision 1.34
diff -u -b -r1.34 par_conj_gen.m
--- compiler/par_conj_gen.m 31 Jul 2007 01:56:39 -0000 1.34
+++ compiler/par_conj_gen.m 2 Aug 2007 07:53:07 -0000
@@ -172,10 +172,10 @@
code_info.get_known_variables(!.CI, Vars),
code_info.save_variables_on_stack(Vars, SaveCode, !CI),
- goal_info_get_code_gen_nonlocals(GoalInfo, Nonlocals),
+ Nonlocals = goal_info_get_code_gen_nonlocals(GoalInfo),
set.to_sorted_list(Nonlocals, Variables),
code_info.get_instmap(!.CI, Initial),
- goal_info_get_instmap_delta(GoalInfo, Delta),
+ Delta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(Initial, Delta, Final),
code_info.get_module_info(!.CI, ModuleInfo),
find_outputs(Variables, Initial, Final, ModuleInfo, [], Outputs),
Index: compiler/pd_cost.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_cost.m,v
retrieving revision 1.33
diff -u -b -r1.33 pd_cost.m
--- compiler/pd_cost.m 6 Jan 2007 09:23:46 -0000 1.33
+++ compiler/pd_cost.m 2 Aug 2007 08:22:49 -0000
@@ -97,7 +97,7 @@
Cost = Cost0 + cost_of_stack_flush + cost_of_higher_order_call.
goal_expr_cost(unify(_, _, _, Unification, _), GoalInfo, Cost) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
unify_cost(NonLocals, Unification, Cost).
goal_expr_cost(call_foreign_proc(Attributes, _, _, Args, _, _, _), _, Cost) :-
Index: compiler/pd_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_debug.m,v
retrieving revision 1.24
diff -u -b -r1.24 pd_debug.m
--- compiler/pd_debug.m 6 Jan 2007 09:23:46 -0000 1.24
+++ compiler/pd_debug.m 2 Aug 2007 08:23:00 -0000
@@ -147,7 +147,7 @@
io.write_string(" cost delta: ", !IO),
io.write_int(CostDelta, !IO),
io.nl(!IO),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
module_info_pred_proc_info(ModuleInfo, PredId, ProcId, _, ProcInfo),
proc_info_get_varset(ProcInfo, VarSet),
instmap_restrict(NonLocals, InstMap, InstMap1),
Index: compiler/pd_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_info.m,v
retrieving revision 1.34
diff -u -b -r1.34 pd_info.m
--- compiler/pd_info.m 17 May 2007 03:52:48 -0000 1.34
+++ compiler/pd_info.m 2 Aug 2007 08:23:27 -0000
@@ -199,7 +199,7 @@
pd_info_update_goal(hlds_goal(_, GoalInfo), !PDInfo) :-
pd_info_get_instmap(!.PDInfo, InstMap0),
- goal_info_get_instmap_delta(GoalInfo, Delta),
+ Delta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, Delta, InstMap),
pd_info_set_instmap(InstMap, !PDInfo).
@@ -571,7 +571,7 @@
pd_util.goals_match(ModuleInfo, OldGoal, OldArgs, OldArgTypes,
NewGoal, NewVarTypes, OldNewRenaming, TypeRenaming),
OldGoal = hlds_goal(_, OldGoalInfo),
- goal_info_get_nonlocals(OldGoalInfo, OldNonLocals0),
+ OldNonLocals0 = goal_info_get_nonlocals(OldGoalInfo),
set.to_sorted_list(OldNonLocals0, OldNonLocalsList),
pd_info.check_insts(ModuleInfo, OldNonLocalsList, OldNewRenaming,
OldInstMap, NewInstMap, NewVarTypes, exact, Exact),
@@ -619,14 +619,14 @@
pd_info.define_new_pred(Origin, Goal, PredProcId, CallGoal, !PDInfo) :-
pd_info_get_instmap(!.PDInfo, InstMap),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, Args),
pd_info_get_counter(!.PDInfo, Counter0),
counter.allocate(Count, Counter0, Counter),
pd_info_set_counter(Counter, !PDInfo),
pd_info_get_pred_info(!.PDInfo, PredInfo),
PredName = pred_info_name(PredInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_line(Context, Line),
pd_info_get_module_info(!.PDInfo, ModuleInfo0),
module_info_get_name(ModuleInfo0, ModuleName),
Index: compiler/pd_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_util.m,v
retrieving revision 1.62
diff -u -b -r1.62 pd_util.m
--- compiler/pd_util.m 28 May 2007 01:06:21 -0000 1.62
+++ compiler/pd_util.m 2 Aug 2007 08:41:30 -0000
@@ -207,7 +207,7 @@
proc_info_get_varset(ProcInfo0, VarSet0),
constraint_info_init(ModuleInfo0, VarTypes0, VarSet0, InstMap, CInfo0),
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
constraint.propagate_constraints_in_goal(!Goal, CInfo0, CInfo, !IO),
constraint_info_deconstruct(CInfo, ModuleInfo, VarTypes, VarSet,
Changed),
@@ -326,9 +326,9 @@
get_goal_live_vars(PDInfo, hlds_goal(_, GoalInfo), !:Vars) :-
pd_info_get_module_info(PDInfo, ModuleInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
pd_info_get_instmap(PDInfo, InstMap),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, NonLocalsList),
set.init(!:Vars),
get_goal_live_vars_2(ModuleInfo, NonLocalsList, InstMap, InstMapDelta,
@@ -361,8 +361,8 @@
rerun_det_analysis(Goal0, Goal, !PDInfo, !IO) :-
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Det),
- det_get_soln_context(Det, SolnContext),
+ Detism = goal_info_get_determinism(GoalInfo0),
+ det_get_soln_context(Detism, SolnContext),
% det_infer_goal looks up the proc_info in the module_info for the
% vartypes, so we'd better stick them back in the module_info.
@@ -542,7 +542,7 @@
get_branch_vars_goal_2(ModuleInfo, [Goal | Goals], !.FoundBranch,
VarTypes, InstMap0, !LeftVars, !Vars) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
( get_branch_instmap_deltas(Goal, InstMapDeltas) ->
% Only look for goals with one top-level branched goal,
@@ -568,21 +568,21 @@
Cond = hlds_goal(_, CondInfo),
Then = hlds_goal(_, ThenInfo),
Else = hlds_goal(_, ElseInfo),
- goal_info_get_instmap_delta(CondInfo, CondDelta),
- goal_info_get_instmap_delta(ThenInfo, ThenDelta),
- goal_info_get_instmap_delta(ElseInfo, ElseDelta).
+ CondDelta = goal_info_get_instmap_delta(CondInfo),
+ ThenDelta = goal_info_get_instmap_delta(ThenInfo),
+ ElseDelta = goal_info_get_instmap_delta(ElseInfo).
get_branch_instmap_deltas(hlds_goal(switch(_, _, Cases), _), InstMapDeltas) :-
GetCaseInstMapDelta =
(pred(Case::in, InstMapDelta::out) is det :-
Case = case(_, hlds_goal(_, CaseInfo)),
- goal_info_get_instmap_delta(CaseInfo, InstMapDelta)
+ InstMapDelta = goal_info_get_instmap_delta(CaseInfo)
),
list.map(GetCaseInstMapDelta, Cases, InstMapDeltas).
get_branch_instmap_deltas(hlds_goal(disj(Disjuncts), _), InstMapDeltas) :-
GetDisjunctInstMapDelta =
(pred(Disjunct::in, InstMapDelta::out) is det :-
Disjunct = hlds_goal(_, DisjInfo),
- goal_info_get_instmap_delta(DisjInfo, InstMapDelta)
+ InstMapDelta = goal_info_get_instmap_delta(DisjInfo)
),
list.map(GetDisjunctInstMapDelta, Disjuncts, InstMapDeltas).
@@ -659,7 +659,7 @@
Goal = hlds_goal(GoalExpr, GoalInfo),
( GoalExpr = if_then_else(_, Cond, Then, Else) ->
Cond = hlds_goal(_, CondInfo),
- goal_info_get_instmap_delta(CondInfo, CondDelta),
+ CondDelta = goal_info_get_instmap_delta(CondInfo),
instmap.apply_instmap_delta(InstMap0, CondDelta, InstMap1),
goal_to_conj_list(Then, ThenList),
examine_branch(!.ModuleInfo, ProcArgInfo, 1, ThenList,
@@ -676,7 +676,7 @@
;
Vars2 = Vars0
),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
get_sub_branch_vars_goal(ProcArgInfo, GoalList,
VarTypes, InstMap, Vars2, SubVars, !ModuleInfo).
@@ -741,7 +741,7 @@
true
),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap, InstMapDelta, InstMap1),
examine_branch(ModuleInfo, ProcArgInfo, BranchNo,
Goals, VarTypes, InstMap1, !Vars).
@@ -966,7 +966,7 @@
),
list.map(Search, OldArgs, NewArgs),
NewGoal = hlds_goal(_, NewGoalInfo),
- goal_info_get_nonlocals(NewGoalInfo, NewNonLocals),
+ NewNonLocals = goal_info_get_nonlocals(NewGoalInfo),
set.delete_list(NewNonLocals, NewArgs, UnmatchedNonLocals),
set.empty(UnmatchedNonLocals),
@@ -1099,8 +1099,8 @@
EarlierGoal = hlds_goal(_, EarlierGoalInfo),
LaterGoal = hlds_goal(_, LaterGoalInfo),
- goal_info_get_determinism(EarlierGoalInfo, EarlierDetism),
- goal_info_get_determinism(LaterGoalInfo, LaterDetism),
+ EarlierDetism = goal_info_get_determinism(EarlierGoalInfo),
+ LaterDetism = goal_info_get_determinism(LaterGoalInfo),
% Check that the reordering would not violate determinism correctness
% by moving a goal out of a single solution context by placing a goal
@@ -1135,9 +1135,9 @@
:- pred goal_depends_on_goal(hlds_goal::in, hlds_goal::in) is semidet.
goal_depends_on_goal(hlds_goal(_, GoalInfo1), hlds_goal(_, GoalInfo2)) :-
- goal_info_get_instmap_delta(GoalInfo1, InstmapDelta1),
+ InstmapDelta1 = goal_info_get_instmap_delta(GoalInfo1),
instmap_delta_changed_vars(InstmapDelta1, ChangedVars1),
- goal_info_get_nonlocals(GoalInfo2, NonLocals2),
+ NonLocals2 = goal_info_get_nonlocals(GoalInfo2),
set.intersect(ChangedVars1, NonLocals2, Intersection),
\+ set.empty(Intersection).
Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.319
diff -u -b -r1.319 polymorphism.m
--- compiler/polymorphism.m 17 May 2007 03:52:48 -0000 1.319
+++ compiler/polymorphism.m 2 Aug 2007 03:42:37 -0000
@@ -935,7 +935,7 @@
ActualExistConstraints),
ExistQVarsForCall = [],
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
make_typeclass_info_vars(ActualExistConstraints,
ExistQVarsForCall, Context, ExistTypeClassVars,
ExtraTypeClassGoals, !Info),
@@ -1176,7 +1176,7 @@
list.append(NonLocalTypeInfosList, ArgVars0, ArgVars),
Y1 = rhs_lambda_goal(Purity, PredOrFunc, EvalMethod, ArgVars,
LambdaVars, Modes, Det, LambdaGoal),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.union(NonLocals0, NonLocalTypeInfos, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo),
@@ -1220,7 +1220,7 @@
% Insert the TypeInfoVars into the nonlocals field of the goal_info
% for the unification goal.
- goal_info_get_nonlocals(!.GoalInfo, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(!.GoalInfo),
set.insert_list(NonLocals0, TypeInfoVars, NonLocals),
goal_info_set_nonlocals(NonLocals, !GoalInfo),
@@ -1279,7 +1279,7 @@
->
% Convert the higher order pred term to a lambda goal.
poly_info_get_varset(!.Info, VarSet0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
proc(PredId, ProcId) = unshroud_pred_proc_id(ShroudedPredProcId),
convert_pred_to_lambda_goal(Purity, EvalMethod, X0, PredId, ProcId,
ArgVars0, CalleeArgTypes, UnifyContext, GoalInfo0, Context,
@@ -1317,7 +1317,7 @@
IsConstruction, ActualArgTypes, TypeOfX, GoalInfo0,
ExtraVars, ExtraGoals, !Info),
list.append(ExtraVars, ArgVars0, ArgVars),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.insert_list(NonLocals0, ExtraVars, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo1),
@@ -1369,11 +1369,11 @@
% the nonlocals field in the goal_info correctly. The goal_path is needed
% to compute constraint_ids correctly.
%
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
set.insert_list(NonLocals, LambdaVars, OutsideVars),
set.list_to_set(Args, InsideVars),
set.intersect(OutsideVars, InsideVars, LambdaNonLocals),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
goal_info_init(LambdaGoalInfo0),
goal_info_set_context(Context, LambdaGoalInfo0, LambdaGoalInfo1),
goal_info_set_nonlocals(LambdaNonLocals, LambdaGoalInfo1, LambdaGoalInfo2),
@@ -1454,9 +1454,9 @@
% Create type_class_info variables for the type class constraints.
poly_info_get_constraint_map(!.Info, ConstraintMap),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
list.length(ParentExistentialConstraints, NumExistentialConstraints),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
IsConstruction = yes,
% Assume it's a construction.
@@ -1783,7 +1783,7 @@
% Make the universally quantified typeclass_infos for the call.
poly_info_get_constraint_map(!.Info, ConstraintMap),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
list.length(ParentUnivConstraints, NumUnivConstraints),
lookup_hlds_constraint_list(ConstraintMap, unproven, GoalPath,
NumUnivConstraints, ActualUnivConstraints),
@@ -1797,7 +1797,7 @@
;
unexpected(this_file, "existq_tvar bound")
),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
make_typeclass_info_vars(ActualUnivConstraints, ActualExistQVars,
Context, ExtraUnivClassVars, ExtraUnivClassGoals, !Info),
@@ -1831,7 +1831,7 @@
++ ExtraUnivClassVars ++ ExtraExistClassVars,
% Update the nonlocals.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.insert_list(NonLocals0, ExtraVars, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo)
).
@@ -1906,7 +1906,7 @@
polymorphism_make_type_info_vars(ActualTypeInfoTypes, Ctxt,
ExtraArgs, ExtraGoals, !Info),
CallArgs = ExtraArgs ++ CallArgs0,
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
NonLocals1 = set.list_to_set(ExtraArgs),
NonLocals = set.union(NonLocals0, NonLocals1),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo),
@@ -1976,7 +1976,7 @@
poly_info_get_varset(!.Info, VarSet0),
poly_info_get_var_types(!.Info, VarTypes0),
!.Goal = hlds_goal(_, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
set.insert_list(NonLocals, ArgVars, NonLocalsPlusArgs0),
set.insert_list(NonLocalsPlusArgs0, LambdaVars, NonLocalsPlusArgs),
goal_util.extra_nonlocal_typeinfos(RttiVarMaps0, VarTypes0,
Index: compiler/post_typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/post_typecheck.m,v
retrieving revision 1.119
diff -u -b -r1.119 post_typecheck.m
--- compiler/post_typecheck.m 17 May 2007 03:52:49 -0000 1.119
+++ compiler/post_typecheck.m 2 Aug 2007 03:43:40 -0000
@@ -579,7 +579,7 @@
module_info_pred_info(ModuleInfo, PredId, CallPredInfo),
pred_info_get_import_status(CallPredInfo, ImportStatus),
( status_defined_in_impl_section(ImportStatus) = yes ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
PredOrFunc = pred_info_is_pred_or_func(CallPredInfo),
Arity = pred_info_orig_arity(CallPredInfo),
IdPieces =
@@ -593,7 +593,7 @@
GoalExpr = generic_call(_, _, _, _)
;
GoalExpr = unify(Var, RHS, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
in_interface_check_unify_rhs(ModuleInfo, PredInfo, RHS, Var, Context,
!Specs)
;
@@ -601,7 +601,7 @@
module_info_pred_info(ModuleInfo, PredId, PragmaPredInfo),
pred_info_get_import_status(PragmaPredInfo, ImportStatus),
( status_defined_in_impl_section(ImportStatus) = yes ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
PredOrFunc = pred_info_is_pred_or_func(PragmaPredInfo),
Name = pred_info_name(PragmaPredInfo),
SymName = unqualified(Name),
@@ -977,7 +977,7 @@
map.apply_to_list(ArgVars0, !.VarTypes, ArgTypes0),
list.append(ArgTypes0, [TypeOfX], ArgTypes),
pred_info_get_constraint_map(!.PredInfo, ConstraintMap),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
ConstraintSearch =
search_hlds_constraint_list(ConstraintMap, unproven, GoalPath),
find_matching_pred_id(ModuleInfo, PredIds, TVarSet, ArgTypes,
@@ -1130,7 +1130,7 @@
get_constructor_containing_field(ModuleInfo, TermType, FieldName,
ConsId, FieldNumber),
- goal_info_get_goal_path(OldGoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(OldGoalInfo),
get_cons_id_arg_types_adding_existq_tvars(ModuleInfo, GoalPath, ConsId,
TermType, ArgTypes0, ExistQVars, !PredInfo),
@@ -1165,7 +1165,7 @@
list.append(VarsBeforeField, [FieldVar | VarsAfterField], ArgVars),
- goal_info_get_nonlocals(OldGoalInfo, RestrictNonLocals),
+ RestrictNonLocals = goal_info_get_nonlocals(OldGoalInfo),
create_pure_atomic_unification_with_nonlocals(TermInputVar,
rhs_functor(ConsId, no, ArgVars), OldGoalInfo, RestrictNonLocals,
[FieldVar, TermInputVar], UnifyContext, FunctorGoal),
@@ -1185,7 +1185,7 @@
get_constructor_containing_field(ModuleInfo, TermType, FieldName,
ConsId0, FieldNumber),
- goal_info_get_goal_path(OldGoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(OldGoalInfo),
get_cons_id_arg_types_adding_existq_tvars(ModuleInfo, GoalPath, ConsId0,
TermType, ArgTypes, ExistQVars, !PredInfo),
@@ -1199,7 +1199,7 @@
% Build a goal to deconstruct the input.
list.append(VarsBeforeField, [SingletonFieldVar | VarsAfterField],
DeconstructArgs),
- goal_info_get_nonlocals(OldGoalInfo, OldNonLocals),
+ OldNonLocals = goal_info_get_nonlocals(OldGoalInfo),
list.append(VarsBeforeField, VarsAfterField, NonLocalArgs),
set.insert_list(OldNonLocals, NonLocalArgs,
DeconstructRestrictNonLocals),
@@ -1417,8 +1417,8 @@
create_pure_atomic_unification_with_nonlocals(Var, RHS, OldGoalInfo,
RestrictNonLocals, VarsList, UnifyContext, Goal) :-
- goal_info_get_context(OldGoalInfo, Context),
- goal_info_get_goal_path(OldGoalInfo, GoalPath),
+ Context = goal_info_get_context(OldGoalInfo),
+ GoalPath = goal_info_get_goal_path(OldGoalInfo),
UnifyContext = unify_context(UnifyMainContext, UnifySubContext),
create_pure_atomic_complicated_unification(Var, RHS,
Context, UnifyMainContext, UnifySubContext, Goal0),
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.106
diff -u -b -r1.106 pragma_c_gen.m
--- compiler/pragma_c_gen.m 31 Jul 2007 01:56:40 -0000 1.106
+++ compiler/pragma_c_gen.m 2 Aug 2007 07:53:21 -0000
@@ -571,7 +571,7 @@
C_Code_Comp = foreign_proc_user_code(Context, AffectsLiveness, C_Code),
% <for semidet code, check of SUCCESS_INDICATOR>
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
( CodeModel = model_semi ->
( Detism = detism_failure ->
CheckSuccess_Comp = foreign_proc_noop,
@@ -621,7 +621,7 @@
MayCallMercury = proc_will_not_call_mercury
;
MayCallMercury = proc_may_call_mercury,
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
( instmap_delta_is_reachable(InstMapDelta) ->
OkToDelete = no
;
Index: compiler/proc_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/proc_gen.m,v
retrieving revision 1.20
diff -u -b -r1.20 proc_gen.m
--- compiler/proc_gen.m 31 Jul 2007 01:56:40 -0000 1.20
+++ compiler/proc_gen.m 2 Aug 2007 07:53:34 -0000
@@ -297,7 +297,7 @@
ensure_all_headvars_are_named(ProcInfo0, ProcInfo),
proc_info_interface_determinism(ProcInfo, Detism),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
proc_info_get_goal(ProcInfo, Goal),
Goal = hlds_goal(_, GoalInfo),
goal_info_get_follow_vars(GoalInfo, MaybeFollowVars),
@@ -330,7 +330,7 @@
Clauses = [],
% This predicate must have been created by the compiler. In that case,
% the context of the body goal is the best we can do.
- goal_info_get_context(GoalInfo, ProcContext)
+ ProcContext = goal_info_get_context(GoalInfo)
;
Clauses = [FirstClause | _],
ProcContext = FirstClause ^ clause_context
Index: compiler/prog_rep.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_rep.m,v
retrieving revision 1.53
diff -u -b -r1.53 prog_rep.m
--- compiler/prog_rep.m 12 Jun 2007 06:06:30 -0000 1.53
+++ compiler/prog_rep.m 2 Aug 2007 07:54:19 -0000
@@ -83,7 +83,7 @@
represent_proc_as_bytecodes(HeadVars, Goal, InstMap0, VarTypes, VarNumMap,
ModuleInfo, !StackInfo, ProcRepBytes) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_file(Context, FileName),
MaxVarNum = map.foldl(max_var_num, VarNumMap, 0),
( MaxVarNum =< 255 ->
@@ -144,7 +144,7 @@
goal_expr_to_byte_list(if_then_else(_, Cond, Then, Else), _, InstMap0, Info,
!StackInfo, Bytes) :-
Cond = hlds_goal(_, CondGoalInfo),
- goal_info_get_instmap_delta(CondGoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(CondGoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap1),
goal_to_byte_list(Cond, InstMap0, Info, !StackInfo, CondBytes),
goal_to_byte_list(Then, InstMap1, Info, !StackInfo, ThenBytes),
@@ -213,8 +213,8 @@
goal_expr_to_byte_list(scope(_, Goal), GoalInfo, InstMap0, Info, !StackInfo,
Bytes) :-
Goal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_determinism(GoalInfo, OuterDetism),
- goal_info_get_determinism(InnerGoalInfo, InnerDetism),
+ OuterDetism = goal_info_get_determinism(GoalInfo),
+ InnerDetism = goal_info_get_determinism(InnerGoalInfo),
( InnerDetism = OuterDetism ->
MaybeCut = 0
;
@@ -327,8 +327,8 @@
atomic_goal_info_to_byte_list(GoalInfo, InstMap0, Info, !StackInfo, Bytes,
BoundVars) :-
- goal_info_get_determinism(GoalInfo, Detism),
- goal_info_get_context(GoalInfo, Context),
+ Detism = goal_info_get_determinism(GoalInfo),
+ Context = goal_info_get_context(GoalInfo),
term.context_file(Context, FileName0),
( FileName0 = Info ^ filename ->
FileName = ""
@@ -336,7 +336,7 @@
FileName = FileName0
),
term.context_line(Context, LineNo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap),
instmap_changed_vars(InstMap0, InstMap, Info ^ vartypes,
Info ^ module_info, ChangedVars),
@@ -384,7 +384,7 @@
conj_to_byte_list([Goal | Goals], InstMap0, Info, !StackInfo, Bytes) :-
goal_to_byte_list(Goal, InstMap0, Info, !StackInfo, GoalBytes),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap1),
conj_to_byte_list(Goals, InstMap1, Info, !StackInfo, GoalsBytes),
Bytes = GoalBytes ++ GoalsBytes.
Index: compiler/prop_mode_constraints.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prop_mode_constraints.m,v
retrieving revision 1.17
diff -u -b -r1.17 prop_mode_constraints.m
--- compiler/prop_mode_constraints.m 17 May 2007 03:52:50 -0000 1.17
+++ compiler/prop_mode_constraints.m 2 Aug 2007 03:44:05 -0000
@@ -292,7 +292,7 @@
;
!.GoalExpr = plain_call(CalleePredId, CalleeProcId, Args0,
Builtin, UnifyContext, SymName),
- goal_info_get_context(!.GoalInfo, Context),
+ Context = goal_info_get_context(!.GoalInfo),
make_unifications(Context, Unifications, Args0, Args, !SeenSoFar,
!Varset, !Vartypes),
(
@@ -311,7 +311,7 @@
;
!.GoalExpr = generic_call(Details, Args0, Modes, Determinism),
- goal_info_get_context(!.GoalInfo, Context),
+ Context = goal_info_get_context(!.GoalInfo),
make_unifications(Context, Unifications, Args0, Args, !SeenSoFar,
!Varset, !Vartypes),
(
@@ -457,8 +457,8 @@
replace_call_with_conjunction(CallGoalExpr, Unifications, NewArgs, GoalExpr,
!GoalInfo) :-
CallGoalInfo0 = !.GoalInfo,
- goal_info_get_context(CallGoalInfo0, Context),
- goal_info_get_nonlocals(CallGoalInfo0, CallNonlocals0),
+ Context = goal_info_get_context(CallGoalInfo0),
+ CallNonlocals0 = goal_info_get_nonlocals(CallGoalInfo0),
CallNonlocals = set.insert_list(CallNonlocals0, NewArgs),
goal_info_set_nonlocals(CallNonlocals, CallGoalInfo0, CallGoalInfo),
Goals = list.cons(hlds_goal(CallGoalExpr, CallGoalInfo), Unifications),
Index: compiler/purity.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.113
diff -u -b -r1.113 purity.m
--- compiler/purity.m 23 May 2007 10:09:21 -0000 1.113
+++ compiler/purity.m 2 Aug 2007 03:44:53 -0000
@@ -494,8 +494,8 @@
PredId = PredId0,
Goal = Goal0
),
- goal_info_get_purity(GoalInfo, DeclaredPurity),
- goal_info_get_context(GoalInfo, CallContext),
+ DeclaredPurity = goal_info_get_purity(GoalInfo),
+ CallContext = goal_info_get_context(GoalInfo),
perform_goal_purity_checks(CallContext, PredId,
DeclaredPurity, ActualPurity, !Info).
compute_expr_purity(generic_call(GenericCall0, Args, Modes0, Det),
@@ -532,9 +532,9 @@
GoalExpr = unify(Var, RHS, Mode, Unification, UnifyContext),
% the unification itself is always pure,
% even if the lambda expression body is impure
- goal_info_get_purity(GoalInfo, DeclaredPurity),
+ DeclaredPurity = goal_info_get_purity(GoalInfo),
( DeclaredPurity \= purity_pure ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Spec = impure_unification_expr_error(Context, DeclaredPurity),
purity_info_add_message(Spec, !Info)
;
@@ -714,12 +714,12 @@
ActualPurity = purity_pure,
% Check for a bogus purity annotation on the unification.
- goal_info_get_purity(GoalInfo, DeclaredPurity),
+ DeclaredPurity = goal_info_get_purity(GoalInfo),
(
DeclaredPurity \= purity_pure,
!.Info ^ implicit_purity = dont_make_implicit_promises
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Spec = impure_unification_expr_error(Context, DeclaredPurity),
purity_info_add_message(Spec, !Info)
;
@@ -935,7 +935,7 @@
;
GoalPurity = purity_impure,
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
Spec = impure_parallel_conjunct_error(Context, GoalPurity),
purity_info_add_message(Spec, !Info)
),
@@ -951,7 +951,7 @@
check_closure_purity(GoalInfo, DeclaredPurity, ActualPurity, !Info) :-
( ActualPurity `less_pure` DeclaredPurity ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Spec = report_error_closure_purity(Context,
DeclaredPurity, ActualPurity),
purity_info_add_message(Spec, !Info)
Index: compiler/qual_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/qual_info.m,v
retrieving revision 1.21
diff -u -b -r1.21 qual_info.m
--- compiler/qual_info.m 19 Jan 2007 07:04:29 -0000 1.21
+++ compiler/qual_info.m 2 Aug 2007 05:44:20 -0000
@@ -297,7 +297,7 @@
pred_args_to_func_args(Args, FuncArgs, RetArg),
list.length(FuncArgs, Arity),
ConsId = cons(SymName, Arity),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
create_pure_atomic_complicated_unification(RetArg,
rhs_functor(ConsId, no, FuncArgs), Context, umc_explicit, [],
hlds_goal(GoalExpr, _)),
Index: compiler/quantification.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/quantification.m,v
retrieving revision 1.119
diff -u -b -r1.119 quantification.m
--- compiler/quantification.m 2 Aug 2007 01:24:01 -0000 1.119
+++ compiler/quantification.m 2 Aug 2007 07:26:56 -0000
@@ -309,7 +309,7 @@
% to become local when previously it was nonlocal),
% then we may need to likewise shrink the instmap delta.
- goal_info_get_instmap_delta(GoalInfo2, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo2),
instmap_delta_restrict(NonLocalVarsSet, InstMapDelta0, InstMapDelta),
goal_info_set_instmap_delta(InstMapDelta, GoalInfo2, GoalInfo),
Goal = hlds_goal(GoalExpr, GoalInfo).
@@ -372,7 +372,7 @@
Vars = Vars0,
Reason = Reason1
;
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
warn_overlapping_scope(RenameVars, Context, !Info),
rename_apart(RenameVars, RenameMap, Goal0, Goal1, !Info),
rename_var_list(no, RenameMap, Vars0, Vars),
@@ -468,7 +468,7 @@
Then1 = Then0,
Vars = Vars0
;
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
warn_overlapping_scope(RenameVars, Context, !Info),
rename_apart(RenameVars, RenameMap, Cond0, Cond1, !Info),
rename_some_vars_in_goal(RenameMap, Then0, Then1),
@@ -665,7 +665,7 @@
% ===>
% (not (LHS, not RHS)), (not (RHS, not LHS))
- goal_info_get_context(OldGoalInfo, Context),
+ Context = goal_info_get_context(OldGoalInfo),
goal_info_init(GoalInfo0),
goal_info_set_context(Context, GoalInfo0, GoalInfo1),
set_goal_nonlocals(LHS_NonLocalVars, GoalInfo1, LHS_GI, !Info),
@@ -742,7 +742,7 @@
( empty(RenameVars0) ->
true
;
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
warn_overlapping_scope(RenameVars0, Context, !Info)
),
% We need to rename apart any of the lambda vars that we have already seen,
@@ -790,7 +790,7 @@
% the quantified variables.
Goal = hlds_goal(_, LambdaGoalInfo),
- goal_info_get_nonlocals(LambdaGoalInfo, LambdaGoalNonLocals),
+ LambdaGoalNonLocals = goal_info_get_nonlocals(LambdaGoalInfo),
list.filter(contains(LambdaGoalNonLocals),
LambdaNonLocals0, LambdaNonLocals),
Index: compiler/saved_vars.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/saved_vars.m,v
retrieving revision 1.74
diff -u -b -r1.74 saved_vars.m
--- compiler/saved_vars.m 13 Apr 2007 04:56:40 -0000 1.74
+++ compiler/saved_vars.m 2 Aug 2007 07:54:49 -0000
@@ -115,7 +115,7 @@
GoalExpr0 = conj(ConjType, Goals0),
(
ConjType = plain_conj,
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
saved_vars_in_conj(Goals0, Goals, NonLocals, !SlotInfo),
conj_list_to_goal(Goals, GoalInfo0, Goal)
;
@@ -184,7 +184,7 @@
(
Goal0 = hlds_goal(unify(_, _, _, Unif, _), GoalInfo),
Unif = construct(Var, _, [], _, _, _, _),
- goal_info_get_features(GoalInfo, Features),
+ Features = goal_info_get_features(GoalInfo),
( all [Feature]
(
set.member(Feature, Features)
@@ -263,7 +263,7 @@
can_push(Var, First) :-
First = hlds_goal(FirstExpr, FirstInfo),
- goal_info_get_nonlocals(FirstInfo, FirstNonLocals),
+ FirstNonLocals = goal_info_get_nonlocals(FirstInfo),
( set.member(Var, FirstNonLocals) ->
(
FirstExpr = conj(plain_conj, _)
@@ -314,7 +314,7 @@
saved_vars_delay_goal([Goal0 | Goals0], Goals, Construct, Var, IsNonLocal,
!SlotInfo) :-
Goal0 = hlds_goal(Goal0Expr, Goal0Info),
- goal_info_get_nonlocals(Goal0Info, Goal0NonLocals),
+ Goal0NonLocals = goal_info_get_nonlocals(Goal0Info),
( set.member(Var, Goal0NonLocals) ->
(
Goal0Expr = unify(_, _, _, _, _),
@@ -452,7 +452,7 @@
push_into_goal_rename(Goal0, Goal, Construct, Var, !SlotInfo) :-
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
( set.member(Var, NonLocals) ->
rename_var(Var, NewVar, Subst, !SlotInfo),
rename_some_vars_in_goal(Subst, Construct, NewConstruct),
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.214
diff -u -b -r1.214 simplify.m
--- compiler/simplify.m 17 Jul 2007 23:48:29 -0000 1.214
+++ compiler/simplify.m 2 Aug 2007 05:20:00 -0000
@@ -454,7 +454,7 @@
(
MayDuplicate = proc_may_duplicate,
( check_marker(Markers, marker_user_marked_no_inline) ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Error: the `may_duplicate' attribute"),
words("on the foreign_proc"),
words("contradicts the `no_inline' pragma"),
@@ -470,7 +470,7 @@
;
MayDuplicate = proc_may_not_duplicate,
( check_marker(Markers, marker_user_marked_inline) ->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Error: the `may_not_duplicate' attribute"),
words("on the foreign_proc"),
words("contradicts the `inline' pragma"),
@@ -547,7 +547,7 @@
simplify_info_get_rtti_varmaps(!.Info, RttiVarMaps0),
( simplify_info_requantify(!.Info) ->
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_nonlocals(GoalInfo1, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo1),
implicitly_quantify_goal(NonLocals, _, Goal1, Goal2,
VarSet0, VarSet1, VarTypes0, VarTypes1,
RttiVarMaps0, RttiVarMaps1),
@@ -571,8 +571,8 @@
),
( simplify_info_rerun_det(!.Info) ->
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Det),
- det_get_soln_context(Det, SolnContext),
+ Detism = goal_info_get_determinism(GoalInfo0),
+ det_get_soln_context(Detism, SolnContext),
% det_infer_goal looks up the proc_info in the module_info
% for the vartypes, so we'd better stick them back in the module_info.
@@ -618,13 +618,13 @@
;
true
),
- goal_info_get_determinism(GoalInfo0, Detism),
+ Detism = goal_info_get_determinism(GoalInfo0),
simplify_info_get_det_info(!.Info, DetInfo),
simplify_info_get_module_info(!.Info, ModuleInfo0),
goal_can_loop_or_throw(Goal0, Goal0CanLoopOrThrow, ModuleInfo0, ModuleInfo,
!IO),
simplify_info_set_module_info(ModuleInfo, !Info),
- goal_info_get_purity(GoalInfo0, Purity),
+ Purity = goal_info_get_purity(GoalInfo0),
(
% If --no-fully-strict, replace goals with determinism failure
% with `fail'.
@@ -639,7 +639,7 @@
% `builtin.false/0' or some goal containing `fail' or a call to
% `builtin.false/0'.
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
(
simplify_do_warn_simple_code(!.Info),
\+ (
@@ -668,7 +668,7 @@
),
% If the goal had any non-locals we should requantify.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
( set.empty(NonLocals0) ->
true
;
@@ -687,8 +687,8 @@
%
determinism_components(Detism, cannot_fail, MaxSoln),
MaxSoln \= at_most_zero,
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta),
- goal_info_get_nonlocals(GoalInfo0, NonLocalVars),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo0),
+ NonLocalVars = goal_info_get_nonlocals(GoalInfo0),
simplify_info_get_instmap(!.Info, InstMap0),
det_no_output_vars(NonLocalVars, InstMap0, InstMapDelta, DetInfo),
( Purity = purity_pure ; Purity = purity_semipure ),
@@ -733,7 +733,7 @@
% ),
% If the goal had any non-locals we should requantify.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
( set.empty(NonLocals0) ->
true
;
@@ -741,7 +741,7 @@
),
goal_cost(Goal0, CostDelta),
simplify_info_incr_cost_delta(CostDelta, !Info),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
Goal1 = true_goal_with_context(Context)
;
Goal1 = Goal0
@@ -782,19 +782,19 @@
simplify_info::in, simplify_info::out) is det.
enforce_unreachability_invariant(GoalInfo0, GoalInfo, !Info) :-
- goal_info_get_determinism(GoalInfo0, Determinism0),
- goal_info_get_instmap_delta(GoalInfo0, DeltaInstmap0),
+ Determinism0 = goal_info_get_determinism(GoalInfo0),
+ InstmapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
determinism_components(Determinism0, CanFail0, NumSolns0),
(
NumSolns0 = at_most_zero,
- instmap_delta_is_reachable(DeltaInstmap0)
+ instmap_delta_is_reachable(InstmapDelta0)
->
instmap_delta_init_unreachable(UnreachableInstMapDelta),
goal_info_set_instmap_delta(UnreachableInstMapDelta,
GoalInfo0, GoalInfo),
simplify_info_set_rerun_det(!Info)
;
- instmap_delta_is_unreachable(DeltaInstmap0),
+ instmap_delta_is_unreachable(InstmapDelta0),
NumSolns0 \= at_most_zero
->
determinism_components(Determinism, CanFail0, at_most_zero),
@@ -812,35 +812,100 @@
%-----------------------------------------------------------------------------%
+:- inst goal_expr_conj == bound(conj(ground, ground)).
+:- inst goal_expr_plain_conj == bound(conj(bound(plain_conj), ground)).
+:- inst goal_expr_parallel_conj == bound(conj(bound(parallel_conj), ground)).
+:- inst goal_expr_disj == bound(disj(ground)).
+:- inst goal_expr_switch == bound(switch(ground, ground, ground)).
+:- inst goal_expr_generic_call == bound(generic_call(ground, ground, ground,
+ ground)).
+:- inst goal_expr_plain_call == bound(plain_call(ground, ground, ground,
+ ground, ground, ground)).
+:- inst goal_expr_unify == bound(unify(ground, ground, ground, ground,
+ ground)).
+:- inst goal_expr_ite == bound(if_then_else(ground, ground, ground, ground)).
+:- inst goal_expr_neg == bound(negation(ground)).
+:- inst goal_expr_scope == bound(scope(ground, ground)).
+:- inst goal_expr_foreign_proc == bound(call_foreign_proc(ground, ground,
+ ground, ground, ground, ground, ground)).
+:- inst goal_expr_shorthand == bound(shorthand(ground)).
+
:- pred simplify_goal_2(hlds_goal_expr::in, hlds_goal_expr::out,
hlds_goal_info::in, hlds_goal_info::out,
simplify_info::in, simplify_info::out, io::di, io::uo) is det.
-simplify_goal_2(conj(ConjType, Goals0), Goal, GoalInfo0, GoalInfo,
- !Info, !IO) :-
+simplify_goal_2(!GoalExpr, !GoalInfo, !Info, !IO) :-
+ (
+ !.GoalExpr = conj(ConjType, Goals),
(
ConjType = plain_conj,
+ simplify_goal_2_plain_conj(Goals, !:GoalExpr, !GoalInfo, !Info,
+ !IO)
+ ;
+ ConjType = parallel_conj,
+ simplify_goal_2_parallel_conj(Goals, !:GoalExpr, !GoalInfo, !Info,
+ !IO)
+ )
+ ;
+ !.GoalExpr = disj(_),
+ simplify_goal_2_disj(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = switch(_, _, _),
+ simplify_goal_2_switch(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = generic_call(_, _, _, _),
+ simplify_goal_2_generic_call(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = plain_call(_, _, _, _, _, _),
+ simplify_goal_2_plain_call(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = unify(_, _, _, _, _),
+ simplify_goal_2_unify(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = if_then_else(_, _, _, _),
+ simplify_goal_2_ite(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = negation(_),
+ simplify_goal_2_neg(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = scope(_, _),
+ simplify_goal_2_scope(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = call_foreign_proc(_, _, _, _, _, _, _),
+ simplify_goal_2_foreign_proc(!GoalExpr, !GoalInfo, !Info, !IO)
+ ;
+ !.GoalExpr = shorthand(_),
+ % These should have been expanded out by now.
+ unexpected(this_file, "goal_2: unexpected shorthand")
+ ).
+
+:- pred simplify_goal_2_plain_conj(list(hlds_goal)::in, hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_plain_conj(Goals0, GoalExpr, GoalInfo0, GoalInfo,
+ !Info, !IO) :-
simplify_info_get_instmap(!.Info, InstMap0),
excess_assigns_in_conj(GoalInfo0, Goals0, Goals1, !Info),
simplify_conj(Goals1, [], Goals, GoalInfo0, !Info, !IO),
simplify_info_set_instmap(InstMap0, !Info),
(
Goals = [],
- goal_info_get_context(GoalInfo0, Context),
- hlds_goal(Goal, GoalInfo) = true_goal_with_context(Context)
+ Context = goal_info_get_context(GoalInfo0),
+ hlds_goal(GoalExpr, GoalInfo) = true_goal_with_context(Context)
;
Goals = [hlds_goal(SingleGoal, SingleGoalInfo)],
% A singleton conjunction is equivalent to the goal itself.
maybe_wrap_goal(GoalInfo0, SingleGoalInfo, SingleGoal,
- Goal, GoalInfo, !Info)
+ GoalExpr, GoalInfo, !Info)
;
Goals = [_, _ | _],
- % Conjunctions that cannot produce solutions may nevertheless
- % contain nondet and multi goals. If this happens, the conjunction
- % is put inside a `scope' to appease the code generator.
+ % Conjunctions that cannot produce solutions may nevertheless contain
+ % nondet and multi goals. If this happens, the conjunction is put
+ % inside a scope to appease the code generator.
- goal_info_get_determinism(GoalInfo0, Detism),
+ Detism = goal_info_get_determinism(GoalInfo0),
(
simplify_do_once(!.Info),
determinism_components(Detism, CanFail, at_most_zero),
@@ -849,55 +914,65 @@
determinism_components(InnerDetism, CanFail, at_most_many),
goal_info_set_determinism(InnerDetism, GoalInfo0, InnerInfo),
InnerGoal = hlds_goal(conj(plain_conj, Goals), InnerInfo),
- Goal = scope(commit(dont_force_pruning), InnerGoal)
+ GoalExpr = scope(commit(dont_force_pruning), InnerGoal)
;
- Goal = conj(plain_conj, Goals)
+ GoalExpr = conj(plain_conj, Goals)
),
GoalInfo = GoalInfo0
- )
- ;
- ConjType = parallel_conj,
+ ).
+
+:- pred simplify_goal_2_parallel_conj(list(hlds_goal)::in, hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_parallel_conj(Goals0, GoalExpr, GoalInfo0, GoalInfo,
+ !Info, !IO) :-
(
Goals0 = [],
- goal_info_get_context(GoalInfo0, Context),
- hlds_goal(Goal, GoalInfo) = true_goal_with_context(Context)
+ Context = goal_info_get_context(GoalInfo0),
+ hlds_goal(GoalExpr, GoalInfo) = true_goal_with_context(Context)
;
Goals0 = [SingleGoal0],
simplify_goal(SingleGoal0, hlds_goal(SingleGoal, SingleGoalInfo),
!Info, !IO),
- maybe_wrap_goal(GoalInfo0, SingleGoalInfo, SingleGoal,
- Goal, GoalInfo, !Info)
+ maybe_wrap_goal(GoalInfo0, SingleGoalInfo, SingleGoal, GoalExpr,
+ GoalInfo, !Info)
;
Goals0 = [_, _ | _],
GoalInfo = GoalInfo0,
simplify_par_conj(Goals0, Goals, !.Info, !Info, !IO),
- Goal = conj(parallel_conj, Goals),
+ GoalExpr = conj(parallel_conj, Goals),
simplify_info_set_has_parallel_conj(yes, !Info)
- )
).
-simplify_goal_2(disj(Disjuncts0), Goal, GoalInfo0, GoalInfo, !Info, !IO) :-
+:- pred simplify_goal_2_disj(
+ hlds_goal_expr::in(goal_expr_disj), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_disj(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
+ GoalExpr0 = disj(Disjuncts0),
simplify_info_get_instmap(!.Info, InstMap0),
simplify_disj(Disjuncts0, [], Disjuncts, [], InstMaps, !.Info, !Info, !IO),
(
Disjuncts = [],
- goal_info_get_context(GoalInfo0, Context),
- hlds_goal(Goal, GoalInfo) = fail_goal_with_context(Context)
+ Context = goal_info_get_context(GoalInfo0),
+ hlds_goal(GoalExpr, GoalInfo) = fail_goal_with_context(Context)
;
Disjuncts = [SingleGoal],
% A singleton disjunction is equivalent to the goal itself.
SingleGoal = hlds_goal(Goal1, GoalInfo1),
- maybe_wrap_goal(GoalInfo0, GoalInfo1, Goal1, Goal, GoalInfo, !Info)
+ maybe_wrap_goal(GoalInfo0, GoalInfo1, Goal1, GoalExpr, GoalInfo, !Info)
;
Disjuncts = [_, _ | _],
- Goal = disj(Disjuncts),
+ GoalExpr = disj(Disjuncts),
( goal_info_has_feature(GoalInfo0, feature_mode_check_clauses_goal) ->
% Recomputing the instmap delta would take very long
% and is very unlikely to get any better precision.
GoalInfo = GoalInfo0
;
simplify_info_get_module_info(!.Info, ModuleInfo1),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
simplify_info_get_var_types(!.Info, VarTypes),
merge_instmap_deltas(InstMap0, NonLocals, VarTypes, InstMaps,
NewDelta, ModuleInfo1, ModuleInfo2),
@@ -909,12 +984,12 @@
list.length(Disjuncts0, Disjuncts0Length),
( DisjunctsLength \= Disjuncts0Length ->
% If we pruned some disjuncts, variables used by those disjuncts
- % may no longer be non-local to the disjunction. Also, the determinism
- % may have changed (especially if we pruned all the disjuncts).
- % If the disjunction now can't succeed, it is necessary to recompute
- % instmap_deltas and rerun determinism analysis to avoid aborts
- % in the code generator because the disjunction now cannot produce
- % variables it did before.
+ % may no longer be non-local to the disjunction. Also, the
+ % determinism may have changed (especially if we pruned all the
+ % disjuncts). If the disjunction now can't succeed, it is necessary
+ % to recompute instmap_deltas and rerun determinism analysis
+ % to avoid aborts in the code generator because the disjunction
+ % now cannot produce variables it did before.
simplify_info_set_requantify(!Info),
simplify_info_set_rerun_det(!Info)
@@ -922,8 +997,13 @@
true
).
-simplify_goal_2(switch(Var, SwitchCanFail0, Cases0), Goal,
- GoalInfo0, GoalInfo, !Info, !IO) :-
+:- pred simplify_goal_2_switch(
+ hlds_goal_expr::in(goal_expr_switch), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_switch(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
+ GoalExpr0 = switch(Var, SwitchCanFail0, Cases0),
simplify_info_get_instmap(!.Info, InstMap0),
simplify_info_get_module_info(!.Info, ModuleInfo0),
instmap.lookup_var(InstMap0, Var, VarInst),
@@ -942,8 +1022,8 @@
Cases = [],
% An empty switch always fails.
simplify_info_incr_cost_delta(cost_of_eliminate_switch, !Info),
- goal_info_get_context(GoalInfo0, Context),
- hlds_goal(Goal, GoalInfo) = fail_goal_with_context(Context)
+ Context = goal_info_get_context(GoalInfo0),
+ hlds_goal(GoalExpr, GoalInfo) = fail_goal_with_context(Context)
;
Cases = [case(ConsId, SingleGoal)],
% A singleton switch is equivalent to the goal itself with a
@@ -962,8 +1042,8 @@
map.lookup(VarTypes1, Var, Type),
simplify_info_get_module_info(!.Info, ModuleInfo1),
( type_util.is_existq_cons(ModuleInfo1, Type, ConsId) ->
- Goal = switch(Var, SwitchCanFail, Cases),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ GoalExpr = switch(Var, SwitchCanFail, Cases),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
simplify_info_get_var_types(!.Info, VarTypes),
merge_instmap_deltas(InstMap0, NonLocals, VarTypes,
InstMaps, NewDelta, ModuleInfo1, ModuleInfo2),
@@ -978,40 +1058,39 @@
% Work out the nonlocals, instmap_delta
% and determinism of the entire conjunction.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.insert(NonLocals0, Var, NonLocals),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo0),
simplify_info_get_instmap(!.Info, InstMap),
- instmap_delta_bind_var_to_functor(Var, Type, ConsId,
- InstMap, InstMapDelta0, InstMapDelta,
- ModuleInfo1, ModuleInfo),
+ instmap_delta_bind_var_to_functor(Var, Type, ConsId, InstMap,
+ InstMapDelta0, InstMapDelta, ModuleInfo1, ModuleInfo),
simplify_info_set_module_info(ModuleInfo, !Info),
- goal_info_get_determinism(GoalInfo0, CaseDetism),
+ CaseDetism = goal_info_get_determinism(GoalInfo0),
det_conjunction_detism(detism_semi, CaseDetism, Detism),
goal_list_purity(GoalList, Purity),
goal_info_init(NonLocals, InstMapDelta, Detism, Purity,
CombinedGoalInfo),
simplify_info_set_requantify(!Info),
- Goal = conj(plain_conj, GoalList),
+ GoalExpr = conj(plain_conj, GoalList),
GoalInfo = CombinedGoalInfo
)
;
% The var can only be bound to this cons_id, so a test
% is unnecessary.
- SingleGoal = hlds_goal(Goal, GoalInfo)
+ SingleGoal = hlds_goal(GoalExpr, GoalInfo)
),
simplify_info_incr_cost_delta(cost_of_eliminate_switch, !Info)
;
Cases = [_, _ | _],
- Goal = switch(Var, SwitchCanFail, Cases),
+ GoalExpr = switch(Var, SwitchCanFail, Cases),
( goal_info_has_feature(GoalInfo0, feature_mode_check_clauses_goal) ->
% Recomputing the instmap delta would take very long and is
% very unlikely to get any better precision.
GoalInfo = GoalInfo0
;
simplify_info_get_module_info(!.Info, ModuleInfo1),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
simplify_info_get_var_types(!.Info, VarTypes),
merge_instmap_deltas(InstMap0, NonLocals, VarTypes, InstMaps,
NewDelta, ModuleInfo1, ModuleInfo2),
@@ -1035,8 +1114,14 @@
true
).
-simplify_goal_2(Goal0, Goal, GoalInfo, GoalInfo, !Info, !IO) :-
- Goal0 = generic_call(GenericCall, Args, Modes, Det),
+:- pred simplify_goal_2_generic_call(
+ hlds_goal_expr::in(goal_expr_generic_call), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_generic_call(GoalExpr0, GoalExpr, GoalInfo, GoalInfo,
+ !Info, !IO) :-
+ GoalExpr0 = generic_call(GenericCall, Args, Modes, Det),
(
GenericCall = higher_order(Closure, Purity, _, _),
(
@@ -1047,7 +1132,7 @@
Purity = purity_pure
->
common_optimise_higher_order_call(Closure, Args, Modes, Det,
- GoalInfo, Goal0, Goal, !Info)
+ GoalInfo, GoalExpr0, GoalExpr, !Info)
;
simplify_do_warn_duplicate_calls(!.Info),
% XXX Should we handle impure/semipure higher-order calls too?
@@ -1056,24 +1141,30 @@
% We need to do the pass, for the warnings, but we ignore
% the optimized goal and instead use the original one.
common_optimise_higher_order_call(Closure, Args, Modes, Det,
- GoalInfo, Goal0, _Goal1, !Info),
- Goal = Goal0
+ GoalInfo, GoalExpr0, _GoalExpr1, !Info),
+ GoalExpr = GoalExpr0
;
- Goal = Goal0
+ GoalExpr = GoalExpr0
)
;
GenericCall = event_call(_),
simplify_info_set_has_user_event(yes, !Info),
- Goal = Goal0
+ GoalExpr = GoalExpr0
;
( GenericCall = class_method(_, _, _, _)
; GenericCall = cast(_)
),
- Goal = Goal0
+ GoalExpr = GoalExpr0
).
-simplify_goal_2(Goal0, Goal, GoalInfo0, GoalInfo, !Info, !IO) :-
- Goal0 = plain_call(PredId, ProcId, Args, IsBuiltin, _, _),
+:- pred simplify_goal_2_plain_call(
+ hlds_goal_expr::in(goal_expr_plain_call), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_plain_call(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo,
+ !Info, !IO) :-
+ GoalExpr0 = plain_call(PredId, ProcId, Args, IsBuiltin, _, _),
simplify_info_get_module_info(!.Info, ModuleInfo),
module_info_pred_info(ModuleInfo, PredId, PredInfo),
ModuleName = hlds_pred.pred_info_module(PredInfo),
@@ -1083,10 +1174,10 @@
;
true
),
- %
+
% Convert calls to builtin @=<, @<, @>=, @> into the corresponding
% calls to builtin.compare/3.
- %
+
(
Args = [TI, X, Y],
ModuleName = mercury_public_builtin_module,
@@ -1097,20 +1188,25 @@
)
->
inequality_goal(TI, X, Y, Inequality, Invert, GoalInfo0,
- Goal, GoalInfo, !Info)
+ GoalExpr, GoalInfo, !Info)
;
- call_goal(PredId, ProcId, Args, IsBuiltin, Goal0, Goal,
+ call_goal(PredId, ProcId, Args, IsBuiltin, GoalExpr0, GoalExpr,
GoalInfo0, GoalInfo, !Info)
).
-simplify_goal_2(Goal0, Goal, GoalInfo0, GoalInfo, !Info, !IO) :-
- Goal0 = unify(LT0, RT0, M, U0, C),
+:- pred simplify_goal_2_unify(
+ hlds_goal_expr::in(goal_expr_unify), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_unify(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
+ GoalExpr0 = unify(LT0, RT0, M, U0, C),
(
% A unification of the form X = X can be safely optimised away.
RT0 = rhs_var(LT0)
->
- goal_info_get_context(GoalInfo0, Context),
- hlds_goal(Goal, GoalInfo) = true_goal_with_context(Context)
+ Context = goal_info_get_context(GoalInfo0),
+ hlds_goal(GoalExpr, GoalInfo) = true_goal_with_context(Context)
;
RT0 = rhs_lambda_goal(Purity, PredOrFunc, EvalMethod, NonLocals,
Vars, Modes, LambdaDeclaredDet, LambdaGoal0)
@@ -1134,15 +1230,15 @@
RT = rhs_lambda_goal(Purity, PredOrFunc, EvalMethod, NonLocals,
Vars, Modes, LambdaDeclaredDet, LambdaGoal),
simplify_info_leave_lambda(!Info),
- Goal = unify(LT0, RT, M, U0, C),
+ GoalExpr = unify(LT0, RT, M, U0, C),
GoalInfo = GoalInfo0
;
U0 = complicated_unify(UniMode, CanFail, TypeInfoVars)
->
( RT0 = rhs_var(V) ->
process_compl_unify(LT0, V, UniMode, CanFail, TypeInfoVars, C,
- GoalInfo0, Goal1, !Info, !IO),
- Goal1 = hlds_goal(Goal, GoalInfo)
+ GoalInfo0, GoalExpr1, !Info, !IO),
+ GoalExpr1 = hlds_goal(GoalExpr, GoalInfo)
;
unexpected(this_file, "invalid RHS for complicated unify")
)
@@ -1150,7 +1246,7 @@
simplify_do_common_struct(!.Info)
->
common_optimise_unification(U0, LT0, RT0, M, C,
- Goal0, Goal, GoalInfo0, GoalInfo, !Info)
+ GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info)
;
( simplify_do_opt_duplicate_calls(!.Info)
; simplify_do_warn_duplicate_calls(!.Info)
@@ -1161,16 +1257,20 @@
% But we don't want to perform the optimization, so we disregard
% the optimized goal and instead use the original one.
common_optimise_unification(U0, LT0, RT0, M, C,
- Goal0, _Goal1, GoalInfo0, _GoalInfo1, !Info),
- Goal = Goal0,
+ GoalExpr0, _GoalExpr1, GoalInfo0, _GoalInfo1, !Info),
+ GoalExpr = GoalExpr0,
GoalInfo = GoalInfo0
;
- Goal = Goal0,
+ GoalExpr = GoalExpr0,
GoalInfo = GoalInfo0
).
-simplify_goal_2(if_then_else(Vars, Cond0, Then0, Else0), Goal,
- GoalInfo0, GoalInfo, !Info, !IO) :-
+:- pred simplify_goal_2_ite(
+ hlds_goal_expr::in(goal_expr_ite), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_ite(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
% (A -> B ; C) is logically equivalent to (A, B ; ~A, C).
% If the determinism of A means that one of these disjuncts
% cannot succeed, then we replace the if-then-else with the
@@ -1196,15 +1296,16 @@
% conjunction construct. This will change when constraint pushing
% is finished, or when we start doing coroutining.
+ GoalExpr0 = if_then_else(Vars, Cond0, Then0, Else0),
Cond0 = hlds_goal(_, CondInfo0),
- goal_info_get_determinism(CondInfo0, CondDetism0),
+ CondDetism0 = goal_info_get_determinism(CondInfo0),
determinism_components(CondDetism0, CondCanFail0, CondSolns0),
( CondCanFail0 = cannot_fail ->
goal_to_conj_list(Cond0, CondList),
goal_to_conj_list(Then0, ThenList),
list.append(CondList, ThenList, List),
simplify_goal(hlds_goal(conj(plain_conj, List), GoalInfo0),
- hlds_goal(Goal, GoalInfo), !Info, !IO),
+ hlds_goal(GoalExpr, GoalInfo), !Info, !IO),
simplify_info_get_inside_duplicated_for_switch(!.Info,
InsideDuplForSwitch),
(
@@ -1215,7 +1316,7 @@
% the exact same piece of source code.
;
InsideDuplForSwitch = no,
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
Pieces = [words("Warning: the condition of this if-then-else"),
words("cannot fail.")],
Msg = simple_msg(Context,
@@ -1264,7 +1365,7 @@
goal_to_conj_list(Else0, ElseList),
List = [Cond | ElseList],
simplify_goal(hlds_goal(conj(plain_conj, List), GoalInfo0),
- hlds_goal(Goal, GoalInfo), !Info, !IO),
+ hlds_goal(GoalExpr, GoalInfo), !Info, !IO),
simplify_info_get_inside_duplicated_for_switch(!.Info,
InsideDuplForSwitch),
(
@@ -1275,7 +1376,7 @@
% the exact same piece of source code.
;
InsideDuplForSwitch = no,
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
Pieces = [words("Warning: the condition of this if-then-else"),
words("cannot succeed.")],
Msg = simple_msg(Context,
@@ -1294,7 +1395,7 @@
goal_to_conj_list(Then0, ThenList),
list.append(CondList, ThenList, List),
simplify_goal(hlds_goal(conj(plain_conj, List), GoalInfo0),
- hlds_goal(Goal, GoalInfo), !Info, !IO),
+ hlds_goal(GoalExpr, GoalInfo), !Info, !IO),
simplify_info_set_requantify(!Info),
simplify_info_set_rerun_det(!Info)
;
@@ -1310,14 +1411,14 @@
simplify_goal(Else0, Else, !Info, !IO),
simplify_info_post_branch_update(Info0, !Info),
Cond = hlds_goal(_, CondInfo),
- goal_info_get_instmap_delta(CondInfo, CondDelta),
+ CondDelta = goal_info_get_instmap_delta(CondInfo),
Then = hlds_goal(_, ThenInfo),
- goal_info_get_instmap_delta(ThenInfo, ThenDelta),
+ ThenDelta = goal_info_get_instmap_delta(ThenInfo),
instmap_delta_apply_instmap_delta(CondDelta, ThenDelta,
test_size, CondThenDelta),
Else = hlds_goal(_, ElseInfo),
- goal_info_get_instmap_delta(ElseInfo, ElseDelta),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ ElseDelta = goal_info_get_instmap_delta(ElseInfo),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
simplify_info_get_module_info(!.Info, ModuleInfo0),
simplify_info_get_var_types(!.Info, VarTypes),
merge_instmap_deltas(InstMap0, NonLocals, VarTypes,
@@ -1327,11 +1428,11 @@
goal_info_set_instmap_delta(NewDelta, GoalInfo0, GoalInfo1),
IfThenElse = if_then_else(Vars, Cond, Then, Else),
- goal_info_get_determinism(GoalInfo0, IfThenElseDetism0),
+ IfThenElseDetism0 = goal_info_get_determinism(GoalInfo0),
determinism_components(IfThenElseDetism0, IfThenElseCanFail,
IfThenElseNumSolns),
- goal_info_get_determinism(CondInfo, CondDetism),
+ CondDetism = goal_info_get_determinism(CondInfo),
determinism_components(CondDetism, CondCanFail, CondSolns),
(
% Check again if we can apply one of the above simplifications
@@ -1344,7 +1445,7 @@
)
->
simplify_info_undo_goal_updates(Info0, !Info),
- simplify_goal_2(IfThenElse, Goal, GoalInfo1, GoalInfo, !Info,
+ simplify_goal_2(IfThenElse, GoalExpr, GoalInfo1, GoalInfo, !Info,
!IO)
;
(
@@ -1361,25 +1462,31 @@
determinism_components(InnerDetism,
IfThenElseCanFail, at_most_many),
goal_info_set_determinism(InnerDetism, GoalInfo1, InnerInfo),
- Goal = scope(commit(dont_force_pruning),
+ GoalExpr = scope(commit(dont_force_pruning),
hlds_goal(IfThenElse, InnerInfo))
;
- Goal = IfThenElse
+ GoalExpr = IfThenElse
),
GoalInfo = GoalInfo1
)
).
-simplify_goal_2(negation(Goal0), Goal, GoalInfo0, GoalInfo, !Info, !IO) :-
+:- pred simplify_goal_2_neg(
+ hlds_goal_expr::in(goal_expr_neg), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_neg(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
+ GoalExpr0 = negation(SubGoal0),
% Can't use calls or unifications seen within a negation,
% since non-local variables may not be bound within the negation.
simplify_info_get_common_info(!.Info, Common),
- simplify_goal(Goal0, Goal1, !Info, !IO),
+ simplify_goal(SubGoal0, SubGoal1, !Info, !IO),
simplify_info_set_common_info(Common, !Info),
- Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_determinism(GoalInfo1, Detism),
+ SubGoal1 = hlds_goal(_, SubGoalInfo1),
+ Detism = goal_info_get_determinism(SubGoalInfo1),
determinism_components(Detism, CanFail, MaxSoln),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
( CanFail = cannot_fail ->
Pieces = [words("Warning: the negated goal cannot fail.")],
Msg = simple_msg(Context,
@@ -1403,34 +1510,41 @@
),
(
% replace `not true' with `fail'
- Goal1 = hlds_goal(conj(plain_conj, []), _)
+ SubGoal1 = hlds_goal(conj(plain_conj, []), _)
->
- hlds_goal(Goal, GoalInfo) = fail_goal_with_context(Context)
+ hlds_goal(GoalExpr, GoalInfo) = fail_goal_with_context(Context)
;
% replace `not fail' with `true'
- Goal1 = hlds_goal(disj([]), _)
+ SubGoal1 = hlds_goal(disj([]), _)
->
- hlds_goal(Goal, GoalInfo) = true_goal_with_context(Context)
+ hlds_goal(GoalExpr, GoalInfo) = true_goal_with_context(Context)
;
% remove double negation
- Goal1 = hlds_goal(negation(hlds_goal(SubGoal, SubGoalInfo)), _),
+ SubGoal1 =
+ hlds_goal(negation(hlds_goal(SubSubGoal, SubSubGoalInfo)), _),
% XXX BUG! This optimization is only safe if it preserves
% mode correctness, which means in particular that the
% the negated goal must not clobber any variables.
% For now I've just disabled the optimization.
semidet_fail
->
- maybe_wrap_goal(GoalInfo0, SubGoalInfo, SubGoal, Goal, GoalInfo, !Info)
+ maybe_wrap_goal(GoalInfo0, SubSubGoalInfo, SubSubGoal, GoalExpr,
+ GoalInfo, !Info)
;
- Goal = negation(Goal1),
+ GoalExpr = negation(SubGoal1),
GoalInfo = GoalInfo0
).
-simplify_goal_2(scope(Reason0, SubGoal0), GoalExpr, ScopeGoalInfo, GoalInfo,
- !Info, !IO) :-
+:- pred simplify_goal_2_scope(
+ hlds_goal_expr::in(goal_expr_scope), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_scope(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, !Info, !IO) :-
+ GoalExpr0 = scope(Reason0, SubGoal0),
simplify_info_get_common_info(!.Info, Common),
simplify_goal(SubGoal0, SubGoal, !Info, !IO),
- nested_scopes(Reason0, SubGoal, ScopeGoalInfo, Goal1),
+ nested_scopes(Reason0, SubGoal, GoalInfo0, Goal1),
Goal1 = hlds_goal(GoalExpr1, GoalInfo1),
( GoalExpr1 = scope(FinalReason, FinalSubGoal) ->
(
@@ -1477,7 +1591,7 @@
),
(
KeepGoal = no,
- goal_info_get_context(ScopeGoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo0),
Goal = true_goal_with_context(Context)
;
KeepGoal = yes,
@@ -1543,7 +1657,7 @@
% we do here.
EvalCode = "",
EvalInstMapDeltaSrc = [],
- goal_info_get_context(ScopeGoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo0),
generate_foreign_proc(PrivateBuiltin, EvalPredName,
pf_predicate, only_mode, detism_semi, purity_semipure,
EvalAttributes, [], [], yes(RuntimeExpr), EvalCode,
@@ -1578,7 +1692,12 @@
),
Goal = hlds_goal(GoalExpr, GoalInfo).
-simplify_goal_2(GoalExpr0, GoalExpr, !GoalInfo, !Info, !IO) :-
+:- pred simplify_goal_2_foreign_proc(
+ hlds_goal_expr::in(goal_expr_foreign_proc), hlds_goal_expr::out,
+ hlds_goal_info::in, hlds_goal_info::out,
+ simplify_info::in, simplify_info::out, io::di, io::uo) is det.
+
+simplify_goal_2_foreign_proc(GoalExpr0, GoalExpr, !GoalInfo, !Info, !IO) :-
GoalExpr0 = call_foreign_proc(Attributes, PredId, ProcId,
Args0, ExtraArgs0, MaybeTraceRuntimeCond, Impl),
(
@@ -1618,7 +1737,7 @@
),
(
simplify_do_opt_duplicate_calls(!.Info),
- goal_info_get_purity(!.GoalInfo, purity_pure),
+ goal_info_get_purity(!.GoalInfo) = purity_pure,
ExtraArgs = []
->
ArgVars = list.map(foreign_arg_var, Args),
@@ -1629,10 +1748,6 @@
)
).
-simplify_goal_2(shorthand(_), _, _, _, _, _, _, _) :-
- % These should have been expanded out by now.
- unexpected(this_file, "goal_2: unexpected shorthand").
-
:- func make_arg_always_boxed(foreign_arg) = foreign_arg.
make_arg_always_boxed(Arg) = Arg ^ arg_box_policy := always_boxed.
@@ -1701,7 +1816,7 @@
simplify_info_set_var_types(VarTypes, !Info),
% Construct the call to compare/3.
- hlds_goal.goal_info_get_context(GoalInfo, Context),
+ Context = hlds_goal.goal_info_get_context(GoalInfo),
Args = [TI, R, X, Y],
simplify_info_get_instmap(!.Info, InstMap),
@@ -1722,8 +1837,8 @@
mode_no(ModeNo), detism_det, purity_pure, Args, [], ArgInsts,
ModuleInfo, Context, CmpGoal0),
CmpGoal0 = hlds_goal(CmpExpr, CmpInfo0),
- goal_info_get_nonlocals(CmpInfo0, CmpNonLocals0),
- goal_info_set_nonlocals(CmpNonLocals0 `insert` R, CmpInfo0, CmpInfo),
+ CmpNonLocals0 = goal_info_get_nonlocals(CmpInfo0),
+ goal_info_set_nonlocals(set.insert(CmpNonLocals0, R), CmpInfo0, CmpInfo),
CmpGoal = hlds_goal(CmpExpr, CmpInfo),
% Construct the unification R = Inequality.
@@ -1735,8 +1850,8 @@
UContext = unify_context(umc_implicit(
"replacement of inequality with call to compare/3"), []),
UfyExpr = unify(R, RHS, UMode, UKind, UContext),
- goal_info_get_nonlocals(GoalInfo, UfyNonLocals0),
- goal_info_set_nonlocals(UfyNonLocals0 `insert` R, GoalInfo, UfyInfo),
+ UfyNonLocals0 = goal_info_get_nonlocals(GoalInfo),
+ goal_info_set_nonlocals(set.insert(UfyNonLocals0, R), GoalInfo, UfyInfo),
UfyGoal = hlds_goal(UfyExpr, UfyInfo),
(
@@ -1759,7 +1874,7 @@
simplify_info_get_module_info(!.Info, ModuleInfo0),
module_info_pred_proc_info(ModuleInfo0, PredId, ProcId,
PredInfo, ProcInfo),
- goal_info_get_context(!.GoalInfo, GoalContext),
+ GoalContext = goal_info_get_context(!.GoalInfo),
% Check for calls to predicates with `pragma obsolete' declarations.
(
simplify_do_warn_obsolete(!.Info),
@@ -1888,13 +2003,13 @@
% Check for duplicate calls to the same procedure.
(
simplify_do_opt_duplicate_calls(!.Info),
- goal_info_get_purity(!.GoalInfo, purity_pure)
+ goal_info_get_purity(!.GoalInfo) = purity_pure
->
common_optimise_call(PredId, ProcId, Args, !.GoalInfo, !GoalExpr,
!Info)
;
simplify_do_warn_duplicate_calls(!.Info),
- goal_info_get_purity(!.GoalInfo, purity_pure)
+ goal_info_get_purity(!.GoalInfo) = purity_pure
->
% We need to do the pass, for the warnings, but we ignore
% the optimized goal and instead use the original one.
@@ -1976,7 +2091,7 @@
map.lookup(VarTypes, Y, Type),
type_definitely_has_no_user_defined_equality_pred(ModuleInfo, Type),
- goal_info_get_context(!.GoalInfo, Context),
+ Context = goal_info_get_context(!.GoalInfo),
goal_util.generate_simple_call(mercury_private_builtin_module,
"builtin_compound_eq", pf_predicate, only_mode, detism_semi,
purity_pure, [X, Y], [], [], ModuleInfo, Context, CondEq),
@@ -2078,7 +2193,7 @@
MaybeUnifyContext, OpSymName),
OpGoalInfo0 = !.GoalInfo,
- goal_info_get_nonlocals(OpGoalInfo0, OpNonLocals0),
+ OpNonLocals0 = goal_info_get_nonlocals(OpGoalInfo0),
set.insert(OpNonLocals0, ConstVar, OpNonLocals),
goal_info_set_nonlocals(OpNonLocals, OpGoalInfo0, OpGoalInfo),
OpGoal = hlds_goal(OpGoalExpr, OpGoalInfo),
@@ -2107,13 +2222,12 @@
simplify_info_get_var_types(!.Info, VarTypes),
map.lookup(VarTypes, XVar, Type),
( Type = type_variable(TypeVar, Kind) ->
- %
% Convert polymorphic unifications into calls to `unify/2',
% the general unification predicate, passing the appropriate type_info:
% unify(TypeInfoVar, X, Y)
% where TypeInfoVar is the type_info variable associated with
% the type of the variables that are being unified.
- %
+
type_info_locn(TypeVar, Kind, TypeInfoVar, ExtraGoals, !Info),
call_generic_unify(TypeInfoVar, XVar, YVar, ModuleInfo, !.Info,
Context, GoalInfo0, Call)
@@ -2121,7 +2235,7 @@
; type_is_higher_order(Type) ->
% Convert higher-order unifications into calls to
% builtin_unify_pred (which calls error/1).
- goal_info_get_context(GoalInfo0, GContext),
+ GContext = goal_info_get_context(GoalInfo0),
generate_simple_call(mercury_private_builtin_module,
"builtin_unify_pred", pf_predicate, mode_no(0), detism_semi,
purity_pure, [XVar, YVar], [], [], ModuleInfo, GContext,
@@ -2201,7 +2315,7 @@
call_generic_unify(TypeInfoVar, XVar, YVar, ModuleInfo, _, _, GoalInfo,
Call) :-
ArgVars = [TypeInfoVar, XVar, YVar],
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
goal_util.generate_simple_call(mercury_public_builtin_module,
"unify", pf_predicate, mode_no(0), detism_semi, purity_pure, ArgVars,
[], [], ModuleInfo, Context, Call).
@@ -2226,7 +2340,7 @@
yes(CallContext), SymName),
% Add the extra type_info vars to the nonlocals for the call.
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.insert_list(NonLocals0, TypeInfoVars, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, CallGoalInfo).
@@ -2234,7 +2348,7 @@
hlds_goal_info::in, hlds_goal::out) is det.
call_builtin_compound_eq(XVar, YVar, ModuleInfo, GoalInfo, Call) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
goal_util.generate_simple_call(mercury_private_builtin_module,
"builtin_compound_eq", pf_predicate, only_mode, detism_semi,
purity_pure, [XVar, YVar], [], [], ModuleInfo, Context, Call).
@@ -2331,7 +2445,7 @@
%-----------------------------------------------------------------------------%
- % input_args_are_equiv(Args, HeadVars, Modes, CommonInfo, ModuleInfo1):
+ % input_args_are_equiv(Args, HeadVars, Modes, CommonInfo, ModuleInfo):
%
% Succeeds if all the input arguments (determined by looking at `Modes')
% in `Args' are equivalent (according to the equivalence class specified
@@ -2363,8 +2477,9 @@
InnerGoal = hlds_goal(_, GoalInfo),
(
Reason = exist_quant(_),
- goal_info_get_determinism(GoalInfo, Detism),
- goal_info_get_determinism(OuterGoalInfo, Detism)
+ Detism = goal_info_get_determinism(GoalInfo),
+ OuterDetism = goal_info_get_determinism(OuterGoalInfo),
+ Detism = OuterDetism
->
% If the inner and outer detisms match the `some' scope is unnecessary.
Goal = InnerGoal
@@ -2440,16 +2555,18 @@
hlds_goal_expr::in, hlds_goal_expr::out, hlds_goal_info::out,
simplify_info::in, simplify_info::out) is det.
-maybe_wrap_goal(OuterGoalInfo, InnerGoalInfo, Goal1, Goal, GoalInfo, !Info) :-
+maybe_wrap_goal(OuterGoalInfo, InnerGoalInfo, GoalExpr1, GoalExpr, GoalInfo,
+ !Info) :-
(
- goal_info_get_determinism(InnerGoalInfo, Det),
- goal_info_get_determinism(OuterGoalInfo, Det)
+ InnerDet = goal_info_get_determinism(InnerGoalInfo),
+ OuterDet = goal_info_get_determinism(OuterGoalInfo),
+ InnerDet = OuterDet
->
- Goal = Goal1,
+ GoalExpr = GoalExpr1,
GoalInfo = InnerGoalInfo
;
- Goal = scope(commit(dont_force_pruning),
- hlds_goal(Goal1, InnerGoalInfo)),
+ GoalExpr = scope(commit(dont_force_pruning),
+ hlds_goal(GoalExpr1, InnerGoalInfo)),
GoalInfo = OuterGoalInfo,
simplify_info_set_rerun_det(!Info)
).
@@ -2484,7 +2601,7 @@
instmap.is_unreachable(InstMap1)
;
Goal1 = hlds_goal(_, GoalInfo1),
- goal_info_get_determinism(GoalInfo1, Detism1),
+ Detism1 = goal_info_get_determinism(GoalInfo1),
determinism_components(Detism1, _, at_most_zero)
)
->
@@ -2505,7 +2622,7 @@
% specification, mode analysis does not use inferred
% determinism information when deciding what can never succeed.
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
FailGoal = fail_goal_with_context(Context),
conjoin_goal_and_rev_goal_list(FailGoal, !RevGoals)
),
@@ -2553,7 +2670,7 @@
excess_assigns_in_conj(ConjInfo, Goals0, Goals, !Info) :-
( simplify_do_excess_assign(!.Info) ->
- goal_info_get_nonlocals(ConjInfo, ConjNonLocals),
+ ConjNonLocals = goal_info_get_nonlocals(ConjInfo),
map.init(Subn0),
simplify_info_get_module_info(!.Info, ModuleInfo),
module_info_get_globals(ModuleInfo, Globals),
@@ -2713,7 +2830,7 @@
% variable does not appear in this branch's instmap_delta, the inst
% before the goal would be used, resulting in a mode error.
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo),
simplify_info_get_module_info(!.Info, ModuleInfo2),
instmap_delta_bind_var_to_functor(Var, Type, ConsId,
InstMap0, InstMapDelta0, InstMapDelta, ModuleInfo2, ModuleInfo),
@@ -2788,12 +2905,12 @@
Info0, !Info, !IO) :-
simplify_goal(Goal0, Goal, !Info, !IO),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_purity(GoalInfo, Purity),
+ Purity = goal_info_get_purity(GoalInfo),
(
% Don't prune or warn about impure disjuncts that can't succeed.
Purity \= purity_impure,
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _CanFail, MaxSolns),
MaxSolns = at_most_zero
->
@@ -2804,7 +2921,7 @@
% succeed due to sub-typing in the modes.
Goal0 \= hlds_goal(disj([]), _)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Pieces = [words("Warning: this disjunct"),
words("will never have any solutions.")],
Msg = simple_msg(Context,
@@ -2832,12 +2949,12 @@
RevGoals1 = RevGoals0
;
RevGoals1 = [Goal | RevGoals0],
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
!:PostBranchInstMaps = [InstMapDelta | !.PostBranchInstMaps]
)
;
RevGoals1 = [Goal | RevGoals0],
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
!:PostBranchInstMaps = [InstMapDelta | !.PostBranchInstMaps]
),
@@ -2918,17 +3035,17 @@
det_disj_to_ite(Disjuncts, GoalInfo, Rest),
Rest = hlds_goal(_RestGoal, RestGoalInfo),
- goal_info_get_nonlocals(CondGoalInfo, CondNonLocals),
- goal_info_get_nonlocals(RestGoalInfo, RestNonLocals),
+ CondNonLocals = goal_info_get_nonlocals(CondGoalInfo),
+ RestNonLocals = goal_info_get_nonlocals(RestGoalInfo),
set.union(CondNonLocals, RestNonLocals, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo, NewGoalInfo0),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta0),
+ InstMapDelta0 = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_restrict(NonLocals, InstMapDelta0, InstMapDelta),
goal_info_set_instmap_delta(InstMapDelta, NewGoalInfo0, NewGoalInfo1),
- goal_info_get_determinism(CondGoalInfo, CondDetism),
- goal_info_get_determinism(RestGoalInfo, RestDetism),
+ CondDetism = goal_info_get_determinism(CondGoalInfo),
+ RestDetism = goal_info_get_determinism(RestGoalInfo),
determinism_components(CondDetism, CondCanFail, CondMaxSoln),
determinism_components(RestDetism, RestCanFail, RestMaxSoln),
det_disjunction_canfail(CondCanFail, RestCanFail, CanFail),
@@ -2950,7 +3067,7 @@
contains_multisoln_goal(Goals) :-
list.member(hlds_goal(_GoalExpr, GoalInfo), Goals),
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _, at_most_many).
%-----------------------------------------------------------------------------%
Index: compiler/size_prof.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/size_prof.m,v
retrieving revision 1.52
diff -u -b -r1.52 size_prof.m
--- compiler/size_prof.m 19 Jan 2007 07:04:30 -0000 1.52
+++ compiler/size_prof.m 2 Aug 2007 08:25:54 -0000
@@ -700,7 +700,7 @@
Args, ArgModes, How, Unique, GoalInfo0, GoalExpr, !Info) :-
FunctorSize = compute_functor_size(Args, !.Info),
find_defined_args(Args, ArgModes, DefinedArgs, NonDefinedArgs, !.Info),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
process_args(DefinedArgs, FunctorSize, KnownSize,
no, MaybeDynamicSizeVar, Context, ArgGoals, !Info),
(
@@ -726,7 +726,7 @@
Unification = construct(Var, ConsId, Args, ArgModes, How, Unique,
construct_sub_info(no, yes(dynamic_size(SizeVar)))),
UnifyExpr = unify(LHS, RHS, UniMode, Unification, UnifyContext),
- goal_info_get_nonlocals(GoalInfo0, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo0),
set.insert(NonLocals0, SizeVar, NonLocals),
goal_info_set_nonlocals(NonLocals, GoalInfo0, GoalInfo),
UnifyGoal = hlds_goal(UnifyExpr, GoalInfo),
@@ -743,7 +743,7 @@
process_cons_deconstruct(Var, Args, ArgModes, UnifyGoal, GoalExpr, !Info) :-
find_defined_args(Args, ArgModes, DefinedArgs, _NonDefArgs, !.Info),
UnifyGoal = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
process_args(DefinedArgs, 0, KnownSize,
no, MaybeDynamicSizeVar, Context, ArgGoals, !Info),
(
Index: compiler/smm_common.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/smm_common.m,v
retrieving revision 1.2
diff -u -b -r1.2 smm_common.m
--- compiler/smm_common.m 23 May 2007 09:41:47 -0000 1.2
+++ compiler/smm_common.m 2 Aug 2007 08:26:14 -0000
@@ -139,8 +139,8 @@
% filled with path information, i.e. call to fill_goal_path_slots(...).
%
program_point_init(GoalInfo) = ProgPoint :-
- goal_info_get_context(GoalInfo, Context),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ Context = goal_info_get_context(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
ProgPoint = pp(Context, GoalPath).
dump_program_point(pp(Context, GoalPath), !IO):-
Index: compiler/stack_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_alloc.m,v
retrieving revision 1.22
diff -u -b -r1.22 stack_alloc.m
--- compiler/stack_alloc.m 5 Dec 2006 03:50:59 -0000 1.22
+++ compiler/stack_alloc.m 2 Aug 2007 07:54:56 -0000
@@ -106,7 +106,7 @@
DummyVars),
graph_colour.group_elements(LiveSets, ColourSets),
set.to_sorted_list(ColourSets, ColourList),
- proc_info_interface_code_model(!.ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(!.ProcInfo),
allocate_stack_slots(ColourList, CodeModel, NumReservedSlots,
MaybeReservedVarInfo, StackSlots1),
allocate_dummy_stack_slots(DummyVars, CodeModel, -1,
Index: compiler/stack_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_opt.m,v
retrieving revision 1.33
diff -u -b -r1.33 stack_opt.m
--- compiler/stack_opt.m 6 Jan 2007 10:56:17 -0000 1.33
+++ compiler/stack_opt.m 2 Aug 2007 07:55:05 -0000
@@ -549,7 +549,7 @@
PotentialAnchorList, !IntervalInfo, !StackOptInfo,
set.init, InsertAnchors),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
MatchingResult = matching_result(CellVar, ConsId,
ArgVars, ViaCellVars, GoalPath,
PotentialIntervals, InsertIntervals,
Index: compiler/store_alloc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/store_alloc.m,v
retrieving revision 1.104
diff -u -b -r1.104 store_alloc.m
--- compiler/store_alloc.m 6 Jan 2007 09:23:52 -0000 1.104
+++ compiler/store_alloc.m 2 Aug 2007 07:55:12 -0000
@@ -255,7 +255,7 @@
(
% XXX should be threading the instmap.
Goal0 = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap_delta_is_unreachable(InstMapDelta)
->
store_alloc_in_goal(Goal0, Goal, !Liveness, !LastLocns,
Index: compiler/stratify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stratify.m,v
retrieving revision 1.60
diff -u -b -r1.60 stratify.m
--- compiler/stratify.m 19 Jan 2007 07:04:31 -0000 1.60
+++ compiler/stratify.m 2 Aug 2007 05:21:06 -0000
@@ -204,7 +204,7 @@
Negated = yes,
list.member(proc(CPred, CProc), WholeScc)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
emit_message(ThisPredProcId, Context,
"call introduces a non-stratified loop.", Error, !ModuleInfo, !IO)
;
@@ -220,7 +220,7 @@
Negated = yes,
list.member(Callee, WholeScc)
->
- goal_info_get_context(GInfo, Context),
+ Context = goal_info_get_context(GInfo),
emit_message(ThisPredProcId, Context,
"call introduces a non-stratified loop.", Error, !ModuleInfo, !IO)
;
@@ -359,7 +359,7 @@
),
Name = "solutions"
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
emit_message(ThisPredProcId, Context,
"call to solutions/2 introduces a non-stratified loop.",
Error, !ModuleInfo, !IO)
@@ -377,7 +377,7 @@
; GenericCall = class_method(_, _, _, _), Msg = "class method"
)
->
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
ErrorMsg = Msg ++ " call may introduce a non-stratified loop.",
emit_message(ThisPredProcId, Context, ErrorMsg, Error, !ModuleInfo,
!IO)
Index: compiler/structure_reuse.direct.detect_garbage.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.direct.detect_garbage.m,v
retrieving revision 1.9
diff -u -b -r1.9 structure_reuse.direct.detect_garbage.m
--- compiler/structure_reuse.direct.detect_garbage.m 6 Jan 2007 09:23:52 -0000 1.9
+++ compiler/structure_reuse.direct.detect_garbage.m 2 Aug 2007 08:10:09 -0000
@@ -101,7 +101,7 @@
PredId, ProcId, ActualVars, !SharingAs)
;
GoalExpr = generic_call(_GenDetails, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
context_to_string(Context, ContextString),
!:SharingAs = sharing_as_top_sharing_accumulate(
"generic call (" ++ ContextString ++ ")", !.SharingAs)
@@ -141,7 +141,7 @@
;
GoalExpr = call_foreign_proc(Attributes, ForeignPredId, ForeignProcId,
_Args, _ExtraArgs, _MaybeTraceRuntimeCond, _Impl),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
!:SharingAs = add_foreign_proc_sharing(ModuleInfo, ProcInfo,
proc(ForeignPredId, ForeignProcId), Attributes, Context,
!.SharingAs)
Index: compiler/structure_reuse.indirect.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.indirect.m,v
retrieving revision 1.11
diff -u -b -r1.11 structure_reuse.indirect.m
--- compiler/structure_reuse.indirect.m 6 Jul 2007 02:35:22 -0000 1.11
+++ compiler/structure_reuse.indirect.m 2 Aug 2007 08:10:28 -0000
@@ -284,7 +284,7 @@
!:Goal = hlds_goal(GoalExpr0, GoalInfo)
;
GoalExpr0 = generic_call(_GenDetails, _, _, _),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
context_to_string(Context, ContextString),
!:AnalysisInfo = !.AnalysisInfo ^ sharing_as :=
sharing_as_top_sharing_accumulate("generic call ("
@@ -375,7 +375,7 @@
;
GoalExpr0 = call_foreign_proc(Attributes, ForeignPredId, ForeignProcId,
_Args, _ExtraArgs, _MaybeTraceRuntimeCond, _Impl),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
!:AnalysisInfo = !.AnalysisInfo ^ sharing_as :=
add_foreign_proc_sharing(ModuleInfo, ProcInfo,
proc(ForeignPredId, ForeignProcId), Attributes, Context,
Index: compiler/structure_reuse.lbu.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_reuse.lbu.m,v
retrieving revision 1.8
diff -u -b -r1.8 structure_reuse.lbu.m
--- compiler/structure_reuse.lbu.m 6 Jan 2007 09:23:53 -0000 1.8
+++ compiler/structure_reuse.lbu.m 2 Aug 2007 08:10:38 -0000
@@ -85,7 +85,7 @@
!.Expr = unify(_, _, _, _, _)
;
!.Expr = plain_call(_,_, _, _, _, _),
- goal_info_get_determinism(Info0, Det),
+ Det = goal_info_get_determinism(Info0),
(
detism_allows_multiple_solns(Det)
->
Index: compiler/structure_sharing.analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/structure_sharing.analysis.m,v
retrieving revision 1.22
diff -u -b -r1.22 structure_sharing.analysis.m
--- compiler/structure_sharing.analysis.m 17 May 2007 03:52:51 -0000 1.22
+++ compiler/structure_sharing.analysis.m 2 Aug 2007 08:10:58 -0000
@@ -336,7 +336,7 @@
SharingTable), Goals, !FixpointTable, !SharingAs, !IO)
;
ConjType = parallel_conj,
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
context_to_string(Context, ContextString),
!:SharingAs = sharing_as_top_sharing_accumulate(
"par_conj (" ++ ContextString ++ ")", !.SharingAs)
@@ -359,7 +359,7 @@
RenamedSharing, !.SharingAs)
;
GoalExpr = generic_call(_GenDetails, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
context_to_string(Context, ContextString),
!:SharingAs = sharing_as_top_sharing_accumulate(
"generic call (" ++ ContextString ++ ")", !.SharingAs)
@@ -401,7 +401,7 @@
;
GoalExpr = call_foreign_proc(Attributes, ForeignPredId, ForeignProcId,
_Args, _ExtraArgs, _MaybeTraceRuntimeCond, _Impl),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
!:SharingAs = add_foreign_proc_sharing(ModuleInfo, ProcInfo,
proc(ForeignPredId, ForeignProcId), Attributes, Context,
!.SharingAs)
Index: compiler/switch_detection.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/switch_detection.m,v
retrieving revision 1.134
diff -u -b -r1.134 switch_detection.m
--- compiler/switch_detection.m 19 Jan 2007 07:04:31 -0000 1.134
+++ compiler/switch_detection.m 2 Aug 2007 05:21:14 -0000
@@ -195,7 +195,7 @@
Goal = disj([])
;
Goals0 = [_ | _],
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocals, NonLocalsList),
detect_switches_in_disj(NonLocalsList, Goals0, GoalInfo, InstMap0,
VarTypes, NonLocalsList, ModuleInfo, [], Goal, !Requant)
Index: compiler/table_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.133
diff -u -b -r1.133 table_gen.m
--- compiler/table_gen.m 17 May 2007 03:52:52 -0000 1.133
+++ compiler/table_gen.m 2 Aug 2007 08:41:52 -0000
@@ -161,10 +161,13 @@
proc_info_has_io_state_pair(!.ModuleInfo, ProcInfo0,
_InArgNum, _OutArgNum)
->
- proc_info_interface_code_model(ProcInfo0, CodeModel),
- ( CodeModel = model_det ->
- true
+ CodeModel = proc_info_interface_code_model(ProcInfo0),
+ (
+ CodeModel = model_det
;
+ ( CodeModel = model_semi
+ ; CodeModel = model_non
+ ),
pred_id_to_int(PredId, PredIdInt),
Msg = string.format("I/O procedure pred id %d not model_det",
[i(PredIdInt)]),
@@ -631,8 +634,8 @@
% than getting it from the nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
ModuleInfo = !.TableInfo ^ table_module_info,
generate_simple_call_table_lookup_goal(loop_status_type,
@@ -685,7 +688,7 @@
InactiveGoalExpr = conj(plain_conj, [OrigGoal, MarkInactiveGoal])
;
CodeModel = model_semi,
- goal_info_get_instmap_delta(OrigGoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
create_renaming(OutputVars, InstMapDelta, !VarSet, !VarTypes,
Unifies, NewVars, Renaming),
rename_some_vars_in_goal(Renaming, OrigGoal, RenamedOrigGoal),
@@ -708,7 +711,7 @@
AfterGoalInfo),
AfterGoal = hlds_goal(AfterGoalExpr, AfterGoalInfo),
FirstGoalExpr = conj(plain_conj, [OrigGoal, AfterGoal]),
- goal_info_get_nonlocals(OrigGoalInfo, OrigGINonLocals),
+ OrigGINonLocals = goal_info_get_nonlocals(OrigGoalInfo),
set.insert(OrigGINonLocals, TableTipVar, FirstNonlocals),
goal_info_set_nonlocals(FirstNonlocals, OrigGoalInfo, FirstGoalInfo),
FirstGoal = hlds_goal(FirstGoalExpr, FirstGoalInfo),
@@ -872,8 +875,8 @@
% than getting it from the nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
ModuleInfo = !.TableInfo ^ table_module_info,
determinism_to_code_model(Detism, CodeModel),
@@ -995,8 +998,8 @@
% than getting it from the nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
ModuleInfo = !.TableInfo ^ table_module_info,
list.length(NumberedOutputVars, BlockSize),
@@ -1196,8 +1199,8 @@
NewGoal = OrigGoal,
ModuleInfo = ModuleInfo0
),
- goal_info_get_nonlocals(OrigGoalInfo, OrigNonLocals),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigNonLocals = goal_info_get_nonlocals(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
(
TableIoStates = yes,
@@ -1264,7 +1267,7 @@
MaybeProcTableInfo = no
),
list.length(NumberedSaveVars, BlockSize),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
generate_memo_restore_goal(NumberedRestoreVars, OrigInstMapDelta, TipVar,
Context, !VarSet, !VarTypes, !.TableInfo, RestoreAnswerGoal0),
(
@@ -1294,8 +1297,8 @@
create_instmap_delta([RestoreAnswerGoal0, IoStateAssignGoal],
RestoreAnswerInstMapDelta0),
RestoreAnswerGoal0 = hlds_goal(_, RestoreAnswerGoal0Info),
- goal_info_get_nonlocals(RestoreAnswerGoal0Info,
- RestoreAnswer0NonLocals),
+ RestoreAnswer0NonLocals =
+ goal_info_get_nonlocals(RestoreAnswerGoal0Info),
set.insert_list(RestoreAnswer0NonLocals,
[IoStateAssignFromVar, IoStateAssignToVar],
RestoreAnswerNonLocals),
@@ -1440,8 +1443,8 @@
% than getting it from the nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
ModuleInfo = !.TableInfo ^ table_module_info,
list.length(NumberedOutputVars, BlockSize),
@@ -1566,8 +1569,8 @@
% than getting it from the nonlocals field in the original goal.
set.list_to_set(HeadVars, OrigNonLocals),
OrigGoal = hlds_goal(_, OrigGoalInfo),
- goal_info_get_instmap_delta(OrigGoalInfo, OrigInstMapDelta),
- goal_info_get_context(OrigGoalInfo, Context),
+ OrigInstMapDelta = goal_info_get_instmap_delta(OrigGoalInfo),
+ Context = goal_info_get_context(OrigGoalInfo),
list.length(NumberedInputVars, NumInputVars),
ModuleInfo = !.TableInfo ^ table_module_info,
@@ -1755,7 +1758,7 @@
OrigGoal = hlds_goal(_, OrigGoalInfo),
MainGoalExpr = conj(plain_conj, [OrigGoal | SaveReturnAnswerGoals]),
- goal_info_get_determinism(OrigGoalInfo, Detism),
+ Detism = goal_info_get_determinism(OrigGoalInfo),
set.insert(OrigNonLocals, GeneratorVar, NonLocals),
goal_info_init(NonLocals, OrigInstMapDelta, Detism, purity_impure, Context,
MainGoalInfo0),
@@ -2246,7 +2249,7 @@
attach_call_table_tip(hlds_goal(GoalExpr, GoalInfo0),
hlds_goal(GoalExpr, GoalInfo)) :-
- goal_info_get_features(GoalInfo0, Features0),
+ Features0 = goal_info_get_features(GoalInfo0),
set.insert(Features0, feature_call_table_gen, Features),
goal_info_set_features(Features, GoalInfo0, GoalInfo).
@@ -3008,8 +3011,8 @@
append_fail(Goal, GoalAndThenFail) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocals),
- goal_info_get_context(GoalInfo, Context),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
+ Context = goal_info_get_context(GoalInfo),
instmap_delta_init_unreachable(UnreachInstMapDelta),
goal_info_init_hide(NonLocals, UnreachInstMapDelta, detism_failure,
purity_impure, Context, ConjGoalInfo),
@@ -3180,7 +3183,7 @@
instmap_delta_from_assoc_list([], IMD).
create_instmap_delta([Goal | Rest], IMD) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, IMD0),
+ IMD0 = goal_info_get_instmap_delta(GoalInfo),
create_instmap_delta(Rest, IMD1),
instmap_delta_apply_instmap_delta(IMD0, IMD1, test_size, IMD).
Index: compiler/term_constr_build.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_constr_build.m,v
retrieving revision 1.17
diff -u -b -r1.17 term_constr_build.m
--- compiler/term_constr_build.m 17 May 2007 03:52:52 -0000 1.17
+++ compiler/term_constr_build.m 2 Aug 2007 08:39:21 -0000
@@ -478,7 +478,7 @@
->
true
;
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
Error = Context - foreign_proc_called(proc(PredId, ProcId)),
info_update_errors(Error, !Info)
),
@@ -493,7 +493,7 @@
%
build_abstract_goal_2(GoalExpr, GoalInfo, AbstractGoal, !Info) :-
GoalExpr = generic_call(_, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
AbstractGoal = term_primitive(polyhedron.universe, [], []),
info_update_ho_info(Context, !Info).
@@ -526,7 +526,7 @@
traversal_info::out) is det.
build_abstract_call(CalleePPId, CallerArgs, GoalInfo, AbstractGoal, !Info) :-
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
( if list.member(CalleePPId, !.Info ^ scc)
then build_recursive_call(CalleePPId, CallerArgs, Context,
AbstractGoal, !Info)
@@ -936,7 +936,7 @@
:- func local_vars(hlds_goal) = prog_vars.
local_vars(hlds_goal(GoalExpr, GoalInfo)) = Locals :-
- goal_info_get_nonlocals(GoalInfo, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
QuantVars = free_goal_vars(hlds_goal(GoalExpr, GoalInfo)),
LocalsSet = set.difference(QuantVars, NonLocals),
Locals = set.to_sorted_list(LocalsSet).
@@ -947,7 +947,7 @@
:- pred partition_vars(hlds_goal::in, prog_vars::out, prog_vars::out) is det.
partition_vars(hlds_goal(GoalExpr, GoalInfo), Locals, NonLocals) :-
- goal_info_get_nonlocals(GoalInfo, NonLocals0),
+ NonLocals0 = goal_info_get_nonlocals(GoalInfo),
QuantVars = free_goal_vars(hlds_goal(GoalExpr, GoalInfo)),
Locals = set.to_sorted_list(set.difference(QuantVars, NonLocals0)),
NonLocals = set.to_sorted_list(NonLocals0).
@@ -1031,7 +1031,7 @@
->
AbstractGoal = AbstractGoal0
;
- goal_info_get_nonlocals(Goal ^ hlds_goal_info, NonLocalProgVars0),
+ NonLocalProgVars0 = goal_info_get_nonlocals(Goal ^ hlds_goal_info),
NonLocalProgVars = set.to_sorted_list(NonLocalProgVars0),
NonLocalSizeVars = prog_vars_to_size_vars(Info ^ var_map,
NonLocalProgVars),
Index: compiler/term_pass1.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_pass1.m,v
retrieving revision 1.35
diff -u -b -r1.35 term_pass1.m
--- compiler/term_pass1.m 17 May 2007 03:52:52 -0000 1.35
+++ compiler/term_pass1.m 2 Aug 2007 08:27:38 -0000
@@ -334,18 +334,17 @@
CallPPId = proc(CallPredId, CallProcId),
module_info_pred_proc_info(!.ModuleInfo, CallPPId, _, ProcInfo),
proc_info_get_maybe_termination_info(ProcInfo, TerminationInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
TerminationInfo = yes(can_loop(_)),
TermError = Context - can_loop_proc_called(PPId, CallPPId),
list.cons(TermError, !Errors)
;
( TerminationInfo = yes(cannot_loop(_))
- ; TerminationInfo = no)
+ ; TerminationInfo = no
+ )
),
- (
- horder_vars(Args, VarTypes)
- ->
+ ( horder_vars(Args, VarTypes) ->
HigherOrderError = Context - horder_args(PPId, CallPPId),
list.cons(HigherOrderError, !Errors)
;
@@ -355,7 +354,7 @@
!IO) :-
% XXX Use closure analysis results here.
Goal = generic_call(_, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
list.cons(Context - horder_call, !Errors).
check_goal_expr_non_term_calls(PPId, VarTypes, Goal, _, !Errors, !ModuleInfo,
!IO) :-
Index: compiler/term_traversal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_traversal.m,v
retrieving revision 1.54
diff -u -b -r1.54 term_traversal.m
--- compiler/term_traversal.m 6 Jan 2007 09:23:55 -0000 1.54
+++ compiler/term_traversal.m 2 Aug 2007 08:28:15 -0000
@@ -126,7 +126,7 @@
traverse_goal(Goal, Params, !Info, !ModuleInfo, !IO) :-
Goal = hlds_goal(GoalExpr, GoalInfo),
(
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
determinism_components(Detism, _, at_most_zero)
->
cannot_succeed(!Info)
@@ -215,7 +215,7 @@
proc_info_get_argmodes(CallProcInfo, CallArgModes),
ArgVars = list.map(foreign_arg_var, Args),
partition_call_args(!.ModuleInfo, CallArgModes, ArgVars, _InVars, OutVars),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
( is_termination_known(!.ModuleInfo, proc(CallPredId, CallProcId)) ->
error_if_intersect(OutVars, Context, pragma_foreign_code, !Info)
@@ -229,7 +229,7 @@
traverse_goal_2(Goal, GoalInfo, Params, !Info, !ModuleInfo, !IO) :-
Goal = generic_call(Details, Args, ArgModes, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
Details = higher_order(Var, _, _, _),
ClosureValueMap = goal_info_get_ho_values(GoalInfo),
@@ -277,7 +277,7 @@
traverse_goal_2(Goal, GoalInfo, Params, !Info, !ModuleInfo, !IO) :-
Goal = plain_call(CallPredId, CallProcId, Args, _, _, _),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
params_get_ppid(Params, PPId),
CallPPId = proc(CallPredId, CallProcId),
Index: compiler/trace_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trace_gen.m,v
retrieving revision 1.18
diff -u -b -r1.18 trace_gen.m
--- compiler/trace_gen.m 31 Jul 2007 01:56:41 -0000 1.18
+++ compiler/trace_gen.m 2 Aug 2007 07:56:04 -0000
@@ -300,7 +300,7 @@
do_we_need_maxfr_slot(Globals, ModuleInfo, PredInfo0, !ProcInfo) :-
globals.get_trace_level(Globals, TraceLevel),
- proc_info_interface_code_model(!.ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(!.ProcInfo),
(
eff_trace_level_is_none(ModuleInfo, PredInfo0, !.ProcInfo, TraceLevel)
= no,
@@ -403,7 +403,7 @@
FixedSlots = yes,
Fixed = 3, % event#, call#, call depth
(
- proc_info_interface_code_model(ProcInfo, model_non),
+ proc_info_interface_code_model(ProcInfo) = model_non,
eff_trace_needs_port(ModuleInfo, PredInfo, ProcInfo, TraceLevel,
TraceSuppress, port_redo) = yes
->
@@ -684,7 +684,7 @@
(
MaybeTraceInfo = yes(TraceInfo),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_goal_path(GoalInfo, Path),
+ Path = goal_info_get_goal_path(GoalInfo),
(
Path = [LastStep | _],
(
@@ -724,7 +724,7 @@
TraceInfo ^ trace_suppress_items, Port) = yes
->
goal_info_get_pre_deaths(GoalInfo, PreDeaths),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
(
goal_info_has_feature(OutsideGoalInfo,
feature_hide_debug_event)
@@ -762,8 +762,8 @@
TraceInfo ^ trace_suppress_items, Port) = yes
->
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_goal_path(GoalInfo, Path),
- goal_info_get_context(GoalInfo, Context),
+ Path = goal_info_get_goal_path(GoalInfo),
+ Context = goal_info_get_context(GoalInfo),
( goal_info_has_feature(OutsideGoalInfo, feature_hide_debug_event) ->
HideEvent = yes
;
@@ -794,8 +794,8 @@
).
generate_user_event_code(UserInfo, GoalInfo, Code, !CI) :-
- goal_info_get_goal_path(GoalInfo, Path),
- goal_info_get_context(GoalInfo, Context),
+ Path = goal_info_get_goal_path(GoalInfo),
+ Context = goal_info_get_context(GoalInfo),
Port = port_user,
PortInfo = port_info_user(Path),
MaybeTraceInfo = no,
Index: compiler/trailing_analysis.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/trailing_analysis.m,v
retrieving revision 1.25
diff -u -b -r1.25 trailing_analysis.m
--- compiler/trailing_analysis.m 19 Jan 2007 07:04:33 -0000 1.25
+++ compiler/trailing_analysis.m 2 Aug 2007 08:29:00 -0000
@@ -436,8 +436,8 @@
check_goal_for_trail_mods(SCC, VarTypes, InnerGoal, Result0,
MaybeAnalysisStatus, !ModuleInfo, !IO),
InnerGoal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_code_model(InnerGoalInfo, InnerCodeModel),
- goal_info_get_code_model(OuterGoalInfo, OuterCodeModel),
+ InnerCodeModel = goal_info_get_code_model(InnerGoalInfo),
+ OuterCodeModel = goal_info_get_code_model(OuterGoalInfo),
%
% `trail_conditional' scope goals (of the type that require extra trailing
% code) will have there status changed to `trail_may_modify'.
@@ -474,8 +474,7 @@
%
Result0 = trail_will_not_modify,
Cond = hlds_goal(_CondGoalExpr, CondGoalInfo),
- goal_info_get_code_model(CondGoalInfo, CondCodeModel),
- CondCodeModel \= model_non
+ goal_info_get_code_model(CondGoalInfo) \= model_non
->
Result = trail_will_not_modify
;
@@ -946,8 +945,8 @@
!.Goal = scope(Reason, InnerGoal0),
annotate_goal(VarTypes, InnerGoal0, InnerGoal, Status0, !ModuleInfo, !IO),
InnerGoal = hlds_goal(_, InnerGoalInfo),
- goal_info_get_code_model(InnerGoalInfo, InnerCodeModel),
- goal_info_get_code_model(OuterGoalInfo, OuterCodeModel),
+ InnerCodeModel = goal_info_get_code_model(InnerGoalInfo),
+ OuterCodeModel = goal_info_get_code_model(OuterGoalInfo),
Status = scope_implies_trail_mod(InnerCodeModel, OuterCodeModel, Status0),
!:Goal = scope(Reason, InnerGoal).
annotate_goal_2(VarTypes, _, !Goal, Status, !ModuleInfo, !IO) :-
Index: compiler/transform.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/transform.m,v
retrieving revision 1.29
diff -u -b -r1.29 transform.m
--- compiler/transform.m 6 Jan 2007 09:23:55 -0000 1.29
+++ compiler/transform.m 2 Aug 2007 08:29:08 -0000
@@ -70,7 +70,7 @@
;
WokenGoals = [],
Goal0 = hlds_goal(_Goal0Goal, Goal0Info),
- goal_info_get_instmap_delta(Goal0Info, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(Goal0Info),
instmap.apply_instmap_delta(InstMap0, InstMapDelta, InstMap1),
mode_info_set_instmap(InstMap1, !ModeInfo),
reschedule_conj(Goals0, Goals1, !ModeInfo),
Index: compiler/tupling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tupling.m,v
retrieving revision 1.37
diff -u -b -r1.37 tupling.m
--- compiler/tupling.m 17 May 2007 03:52:54 -0000 1.37
+++ compiler/tupling.m 2 Aug 2007 08:29:37 -0000
@@ -751,7 +751,7 @@
PredName = pred_info_name(PredInfo),
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_line(Context, Line),
proc_id_to_int(ProcId, ProcNo),
AuxNamePrefix = string.format("tupling_%d", [i(ProcNo)]),
@@ -1132,8 +1132,8 @@
ResetCountInfo, ElseCountInfo),
ProcCounts = CountInfo ^ count_info_proc_counts,
- goal_info_get_goal_path(Then ^ hlds_goal_info, ThenGoalPath),
- goal_info_get_goal_path(Else ^ hlds_goal_info, ElseGoalPath),
+ ThenGoalPath = goal_info_get_goal_path(Then ^ hlds_goal_info),
+ ElseGoalPath = goal_info_get_goal_path(Else ^ hlds_goal_info),
get_ite_relative_frequencies(ProcCounts,
ThenGoalPath, ElseGoalPath,
ThenRelFreq, ElseRelFreq),
@@ -1279,7 +1279,7 @@
count_load_stores_in_goal(Goal, CountInfo,
BranchCountState0, BranchCountState),
ProcCounts = CountInfo ^ count_info_proc_counts,
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
get_disjunct_relative_frequency(ProcCounts, GoalPath, RelFreq),
add_branch_costs(BranchCountState, RelFreq, !CountState),
count_load_stores_in_disj(Goals, CountInfo, !CountState).
@@ -1302,7 +1302,7 @@
count_load_stores_in_goal(Goal, CountInfo, BranchCountState0,
BranchCountState),
ProcCounts = CountInfo ^ count_info_proc_counts,
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
get_case_relative_frequency(ProcCounts, GoalPath, RelFreq),
add_branch_costs(BranchCountState, RelFreq, !CountState),
count_load_stores_in_cases(Cases, CountInfo, !CountState).
Index: compiler/typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.423
diff -u -b -r1.423 typecheck.m
--- compiler/typecheck.m 17 May 2007 03:52:54 -0000 1.423
+++ compiler/typecheck.m 2 Aug 2007 05:21:40 -0000
@@ -1053,7 +1053,7 @@
%
typecheck_goal(hlds_goal(GoalExpr0, GoalInfo0), hlds_goal(GoalExpr, GoalInfo),
!Info) :-
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
term.context_init(EmptyContext),
( Context = EmptyContext ->
EnclosingContext = !.Info ^ tc_info_context,
@@ -1175,7 +1175,7 @@
list.length(Args, Arity),
CurCall = simple_call_id(pf_predicate, Name, Arity),
typecheck_info_set_called_predid(plain_call_id(CurCall), !Info),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
typecheck_call_pred(CurCall, Args, GoalPath, PredId, !Info),
GoalExpr = plain_call(PredId, ProcId, Args, BI, UC, Name)
;
@@ -1214,7 +1214,7 @@
),
!:Info = !.Info ^ tc_info_arg_num := 0,
!:Info = !.Info ^ tc_info_unify_context := UnifyContext,
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
typecheck_unification(LHS, RHS0, RHS, GoalPath, !Info),
GoalExpr = unify(LHS, RHS, UnifyMode, Unification, UnifyContext)
;
@@ -1229,7 +1229,7 @@
% than the way it is done below, though.)
OrigTypeAssignSet = !.Info ^ tc_info_type_assign_set,
ArgVars = list.map(foreign_arg_var, Args),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
typecheck_call_pred_id(PredId, ArgVars, GoalPath, !Info),
perform_context_reduction(OrigTypeAssignSet, !Info),
GoalExpr = GoalExpr0
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.180
diff -u -b -r1.180 unify_gen.m
--- compiler/unify_gen.m 9 Jul 2007 13:28:28 -0000 1.180
+++ compiler/unify_gen.m 2 Aug 2007 07:56:21 -0000
@@ -557,7 +557,7 @@
% should be used as a goal, not an expression).
proc_info_get_goal(ProcInfo, ProcInfoGoal),
- proc_info_interface_code_model(ProcInfo, CodeModel),
+ CodeModel = proc_info_interface_code_model(ProcInfo),
proc_info_get_headvars(ProcInfo, ProcHeadVars),
(
EvalMethod = lambda_normal,
@@ -667,10 +667,10 @@
continuation_info.generate_closure_layout( ModuleInfo, PredId, ProcId,
ClosureInfo),
module_info_get_name(ModuleInfo, ModuleName),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_file(Context, FileName),
term.context_line(Context, LineNumber),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
GoalPathStr = goal_path_to_string(GoalPath),
code_info.get_cur_proc_label(!.CI, CallerProcLabel),
code_info.get_next_closure_seq_no(SeqNo, !CI),
Index: compiler/unify_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_proc.m,v
retrieving revision 1.188
diff -u -b -r1.188 unify_proc.m
--- compiler/unify_proc.m 2 Jul 2007 05:30:30 -0000 1.188
+++ compiler/unify_proc.m 2 Aug 2007 05:21:52 -0000
@@ -2066,7 +2066,7 @@
make_const_construction(Res, cons(qualified(Builtin, "="), 0),
EqualGoal),
EqualGoal = hlds_goal(_, EqualGoalInfo),
- goal_info_get_instmap_delta(EqualGoalInfo, InstmapDelta),
+ InstmapDelta = goal_info_get_instmap_delta(EqualGoalInfo),
goal_info_set_instmap_delta(InstmapDelta,
ContextGoalInfo, GoalInfo)
),
Index: compiler/unique_modes.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unique_modes.m,v
retrieving revision 1.121
diff -u -b -r1.121 unique_modes.m
--- compiler/unique_modes.m 28 May 2007 01:06:23 -0000 1.121
+++ compiler/unique_modes.m 2 Aug 2007 07:43:57 -0000
@@ -119,7 +119,7 @@
unique_modes_check_goal(Goal0, Goal, !ModeInfo, !IO) :-
Goal0 = hlds_goal(GoalExpr0, GoalInfo0),
- goal_info_get_context(GoalInfo0, Context),
+ Context = goal_info_get_context(GoalInfo0),
term.context_init(EmptyContext),
( Context = EmptyContext ->
true
@@ -139,7 +139,7 @@
% If the goal is not nondet, then nothing is nondet-live, so reset the bag
% of nondet-live vars to be empty.
- goal_info_get_determinism(GoalInfo0, Detism),
+ Detism = goal_info_get_determinism(GoalInfo0),
( determinism_components(Detism, _, at_most_many) ->
true
;
@@ -288,9 +288,9 @@
% "shallow" backtracking from semidet disjuncts. But we handle that
% separately for each disjunct, in unique_modes_check_disj.
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
- goal_info_get_determinism(GoalInfo0, Determinism),
- % does this disjunction create a choice point?
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
+ Determinism = goal_info_get_determinism(GoalInfo0),
+ % Does this disjunction create a choice point?
( determinism_components(Determinism, _, at_most_many) ->
mode_info_add_live_vars(NonLocals, !ModeInfo),
make_all_nondet_live_vars_mostly_uniq(!ModeInfo),
@@ -310,10 +310,10 @@
unique_modes_check_goal_2(if_then_else(Vars, Cond0, Then0, Else0), GoalInfo0,
Goal, !ModeInfo, !IO) :-
mode_checkpoint(enter, "if-then-else", !ModeInfo, !IO),
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
- goal_get_nonlocals(Cond0, Cond_Vars),
- goal_get_nonlocals(Then0, Then_Vars),
- goal_get_nonlocals(Else0, Else_Vars),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
+ Cond_Vars = goal_get_nonlocals(Cond0),
+ Then_Vars = goal_get_nonlocals(Then0),
+ Else_Vars = goal_get_nonlocals(Else0),
mode_info_get_instmap(!.ModeInfo, InstMap0),
mode_info_lock_vars(var_lock_if_then_else, NonLocals, !ModeInfo),
@@ -345,7 +345,7 @@
set.to_sorted_list(Cond_Vars, Cond_Vars_List),
select_live_vars(Cond_Vars_List, !.ModeInfo, Cond_Live_Vars),
Cond0 = hlds_goal(_, Cond0_GoalInfo),
- goal_info_get_instmap_delta(Cond0_GoalInfo, Cond0_DeltaInstMap),
+ Cond0_DeltaInstMap = goal_info_get_instmap_delta(Cond0_GoalInfo),
select_changed_inst_vars(Cond_Live_Vars, Cond0_DeltaInstMap, !.ModeInfo,
ChangedVars),
make_var_list_mostly_uniq(ChangedVars, !ModeInfo),
@@ -384,7 +384,7 @@
% as nondet-live for the negated goal, since if the negated goal fails,
% then the negation will succeed, and so these variables can be accessed
% again after backtracking.
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
set.to_sorted_list(NonLocals, NonLocalsList),
select_live_vars(NonLocalsList, !.ModeInfo, LiveNonLocals),
make_var_list_mostly_uniq(LiveNonLocals, !ModeInfo),
@@ -483,7 +483,7 @@
mode_info_set_instmap(InstMap, !ModeInfo)
;
Cases0 = [_ | _],
- goal_info_get_nonlocals(GoalInfo0, NonLocals),
+ NonLocals = goal_info_get_nonlocals(GoalInfo0),
unique_modes_check_case_list(Cases0, Var, Cases, InstMapList,
!ModeInfo, !IO),
instmap_merge(NonLocals, InstMapList, disj, !ModeInfo)
@@ -658,7 +658,7 @@
unique_modes_check_conj_2(ConjType, Goal0, Goals0, [Goal | Goals], !ModeInfo,
!IO) :-
- goal_get_nonlocals(Goal0, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal0),
mode_info_remove_live_vars(NonLocals, !ModeInfo),
unique_modes_check_goal(Goal0, Goal, !ModeInfo, !IO),
mode_info_get_instmap(!.ModeInfo, InstMap),
@@ -684,7 +684,7 @@
bag.init(Empty).
make_par_conj_nonlocal_multiset([Goal | Goals], NonLocalsMultiSet) :-
make_par_conj_nonlocal_multiset(Goals, NonLocalsMultiSet0),
- goal_get_nonlocals(Goal, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal),
set.to_sorted_list(NonLocals, NonLocalsList),
bag.from_list(NonLocalsList, NonLocalsMultiSet1),
bag.union(NonLocalsMultiSet0, NonLocalsMultiSet1, NonLocalsMultiSet).
@@ -739,7 +739,7 @@
unique_modes_check_par_conj_1([], [], [], !ModeInfo, !IO).
unique_modes_check_par_conj_1([Goal0 | Goals0], [Goal | Goals],
[InstMap - NonLocals | InstMaps], !ModeInfo, !IO) :-
- goal_get_nonlocals(Goal0, NonLocals),
+ NonLocals = goal_get_nonlocals(Goal0),
mode_info_get_instmap(!.ModeInfo, InstMap0),
unique_modes_check_goal(Goal0, Goal, !ModeInfo, !IO),
mode_info_get_instmap(!.ModeInfo, InstMap),
@@ -782,7 +782,7 @@
% in that case we need to mark all the non-locals as being only
% mostly-unique rather than unique.
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_determinism(GoalInfo0, Determinism),
+ Determinism = goal_info_get_determinism(GoalInfo0),
determinism_components(Determinism, CanFail, _),
CanFail = can_fail
->
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.42
diff -u -b -r1.42 unneeded_code.m
--- compiler/unneeded_code.m 19 Apr 2007 04:24:50 -0000 1.42
+++ compiler/unneeded_code.m 2 Aug 2007 08:40:59 -0000
@@ -299,7 +299,7 @@
proc_info_get_vartypes(!.ProcInfo, VarTypes0),
proc_info_get_initial_instmap(!.ProcInfo, !.ModuleInfo, InitInstMap),
Goal0 = hlds_goal(_, GoalInfo0),
- goal_info_get_instmap_delta(GoalInfo0, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo0),
instmap.apply_instmap_delta(InitInstMap, InstMapDelta, FinalInstMap),
proc_info_instantiated_head_vars(!.ModuleInfo, !.ProcInfo, NeededVarsList),
map.init(WhereNeededMap0),
@@ -321,8 +321,8 @@
this_file, "process_proc: goal reattachment unsuccessful"),
(
Changed = yes,
- % We need to fix up the goal_info by recalculating
- % the nonlocal vars and the non-atomic instmap deltas.
+ % We need to fix up the goal_info by recalculating the nonlocal vars
+ % and the non-atomic instmap deltas.
proc_info_get_headvars(!.ProcInfo, HeadVars),
proc_info_get_inst_varset(!.ProcInfo, InstVarSet),
proc_info_get_rtti_varmaps(!.ProcInfo, RttiVarMaps0),
@@ -365,12 +365,8 @@
Goal = true_goal,
!:Changed = yes
),
- undemand_virgin_outputs(Goal0, ModuleInfo, InitInstMap,
- !WhereNeededMap),
- (
- goal_get_purity(Goal, Purity),
- Purity = purity_impure
- ->
+ undemand_virgin_outputs(Goal0, ModuleInfo, InitInstMap, !WhereNeededMap),
+ ( goal_get_purity(Goal) = purity_impure ->
% By saying that all vars that are live before the impure goal are
% needed everywhere, we prevent the movement of the goals producing
% those vars across the impure goal.
@@ -420,7 +416,7 @@
map.init(Empty),
!:WhereInfo = branches(Empty),
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_goal_path(GoalInfo, CurrentPath),
+ CurrentPath = goal_info_get_goal_path(GoalInfo),
list.foldl(collect_where_needed(CurrentPath, WhereNeededMap), ChangedVars,
!WhereInfo),
adjust_where_needed(Goal, Options, !WhereInfo).
@@ -450,13 +446,12 @@
% Do not move goals that can fail, since doing so can cause
% execution to reach goals it shouldn't, and those goals may have
% undesirable behavior (e.g. infinite loops).
- goal_info_get_determinism(GoalInfo, Detism),
+ Detism = goal_info_get_determinism(GoalInfo),
detism_is_moveable(Detism, no)
;
% Do not move impure or semipure goals, since their ordering
% wrt other such goals must be preserved.
- goal_info_get_purity(GoalInfo, Purity),
- Purity \= purity_pure
+ goal_info_get_purity(GoalInfo) \= purity_pure
;
% With --fully-strict, we cannot optimize away infinite loops
% or exceptions.
@@ -515,8 +510,8 @@
demand_inputs(Goal, ModuleInfo, InitInstMap, WhereNeeded, !WhereNeededMap) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocalSet),
- goal_info_get_goal_path(GoalInfo, GoalPath),
+ NonLocalSet = goal_info_get_nonlocals(GoalInfo),
+ GoalPath = goal_info_get_goal_path(GoalInfo),
set.to_sorted_list(NonLocalSet, NonLocals),
list.filter(nonlocal_may_be_input(ModuleInfo, InitInstMap), NonLocals,
Inputs),
@@ -536,7 +531,7 @@
undemand_virgin_outputs(Goal, ModuleInfo, InstMap, !WhereNeededMap) :-
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_nonlocals(GoalInfo, NonLocalSet),
+ NonLocalSet = goal_info_get_nonlocals(GoalInfo),
set.to_sorted_list(NonLocalSet, NonLocals),
list.filter(nonlocal_is_virgin_output(ModuleInfo, InstMap), NonLocals,
VirginOutputs),
@@ -624,7 +619,7 @@
GoalExpr0 = switch(SwitchVar, CanFail, Cases0),
(
Cases0 = [case(_, hlds_goal(_, FirstCaseGoalInfo)) | _],
- goal_info_get_goal_path(FirstCaseGoalInfo, FirstCaseGoalPath),
+ FirstCaseGoalPath = goal_info_get_goal_path(FirstCaseGoalInfo),
FirstCaseGoalPath = [SwitchStep | _],
SwitchStep = step_switch(_, MaybeNumAltPrime)
->
@@ -632,7 +627,7 @@
;
unexpected(this_file, "process_goal_internal: switch count")
),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
BranchPoint = branch_point(GoalPath, alt_switch(MaybeNumAlt)),
map.map_values(demand_var_everywhere, !WhereNeededMap),
map.init(BranchNeededMap0),
@@ -646,7 +641,7 @@
Goal = hlds_goal(GoalExpr, GoalInfo0)
;
GoalExpr0 = disj(Disjuncts0),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
map.map_values(demand_var_everywhere, !WhereNeededMap),
process_disj(Disjuncts0, Disjuncts, InitInstMap, FinalInstMap,
VarTypes, ModuleInfo, Options, GoalPath,
@@ -656,7 +651,7 @@
Goal = hlds_goal(GoalExpr, GoalInfo0)
;
GoalExpr0 = if_then_else(Quant, Cond0, Then0, Else0),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
BranchPoint = branch_point(GoalPath, alt_ite),
map.map_values(demand_var_everywhere, !WhereNeededMap),
process_ite(Cond0, Cond, Then0, Then, Else0, Else, BranchPoint,
@@ -709,7 +704,7 @@
BracketedGoals = []
;
Goal = hlds_goal(_, GoalInfo),
- goal_info_get_instmap_delta(GoalInfo, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
instmap.apply_instmap_delta(InitInstMap, InstMapDelta, FinalInstMap),
build_bracketed_conj(Goals, FinalInstMap, BracketedTail),
BracketedGoal = bracketed_goal(Goal, InitInstMap, FinalInstMap),
@@ -796,7 +791,7 @@
InitInstMap, FinalInstMap, VarTypes, ModuleInfo, Options,
CurrentPath, !WhereNeededMap, !RefinedGoals, !Changed) :-
Cond0 = hlds_goal(_, CondInfo0),
- goal_info_get_instmap_delta(CondInfo0, InstMapDelta),
+ InstMapDelta = goal_info_get_instmap_delta(CondInfo0),
instmap.apply_instmap_delta(InitInstMap, InstMapDelta, InstMapCond),
process_goal(Else0, Else, InitInstMap, FinalInstMap, VarTypes, ModuleInfo,
@@ -912,19 +907,19 @@
)
;
GoalExpr0 = switch(SwitchVar, CanFail, Cases0),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
refine_cases(Cases0, Cases, !RefinedGoals, GoalPath, 1),
GoalExpr = switch(SwitchVar, CanFail, Cases),
Goal = hlds_goal(GoalExpr, GoalInfo0)
;
GoalExpr0 = disj(Disjuncts0),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
refine_disj(Disjuncts0, Disjuncts, !RefinedGoals, GoalPath, 1),
GoalExpr = disj(Disjuncts),
Goal = hlds_goal(GoalExpr, GoalInfo0)
;
GoalExpr0 = if_then_else(Quant, Cond0, Then0, Else0),
- goal_info_get_goal_path(GoalInfo0, GoalPath),
+ GoalPath = goal_info_get_goal_path(GoalInfo0),
refine_ite(Cond0, Cond, Then0, Then, Else0, Else, !RefinedGoals,
GoalPath),
GoalExpr = if_then_else(Quant, Cond, Then, Else),
Index: compiler/untupling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/untupling.m,v
retrieving revision 1.27
diff -u -b -r1.27 untupling.m
--- compiler/untupling.m 17 May 2007 03:52:55 -0000 1.27
+++ compiler/untupling.m 2 Aug 2007 08:31:10 -0000
@@ -268,7 +268,7 @@
expand_args_in_proc_3(HeadVars0, ArgModes0, ListOfHeadVars,
ListOfArgModes, Goal0, hlds_goal(GoalExpr, GoalInfo1), !VarSet,
!VarTypes, [], TypeTable),
- goal_info_get_context(Goal0 ^ hlds_goal_info, Context),
+ Context = goal_info_get_context(Goal0 ^ hlds_goal_info),
goal_info_set_context(Context, GoalInfo1, GoalInfo),
list.condense(ListOfHeadVars, HeadVars),
list.condense(ListOfArgModes, ArgModes),
@@ -426,7 +426,7 @@
PredName = pred_info_name(PredInfo),
PredOrFunc = pred_info_is_pred_or_func(PredInfo),
- goal_info_get_context(GoalInfo, Context),
+ Context = goal_info_get_context(GoalInfo),
term.context_line(Context, Line),
proc_id_to_int(ProcId, ProcNo),
AuxNamePrefix = string.format("untupling_%d", [i(ProcNo)]),
Index: compiler/unused_args.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.143
diff -u -b -r1.143 unused_args.m
--- compiler/unused_args.m 17 May 2007 03:52:56 -0000 1.143
+++ compiler/unused_args.m 2 Aug 2007 08:31:19 -0000
@@ -1692,7 +1692,7 @@
hlds_goal_info::out) is det.
fixup_goal_info(UnusedVars, !GoalInfo) :-
- goal_info_get_instmap_delta(!.GoalInfo, InstMap0),
+ InstMap0 = goal_info_get_instmap_delta(!.GoalInfo),
instmap_delta_delete_vars(UnusedVars, InstMap0, InstMap),
goal_info_set_instmap_delta(InstMap, !GoalInfo).
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
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/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
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/gears
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/log4m
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/mopenssl
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/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
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/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
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/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
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 slice
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/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
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 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