diff: improved --debug-modes messages

Zoltan Somogyi zs at cs.mu.oz.au
Thu Apr 3 09:13:57 AEST 1997


mercury_to_mercury:
	Add predicates for printing out insts in a structured form.
	The resulting printed insts are not fully syntactically valid,
	but they are much better for debugging than the output of the
	existing predicates.

mode_info:
	Add an extra field to the mode_info structure. This field, which
	is set and used only when --debug-modes was given, holds the binding
	of each variable at the last mode checkpoint.

mode_debug:
	At each mode checkpoint, print full insts only for the variables
	whose inst has changed since the last checkpoint. Print these insts
	using the new predicates in mercury_to_mercury.

	This change also introduces tabs in many places in the code
	where the original code used groups of eight spaces.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/mercury_to_mercury.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_to_mercury.m,v
retrieving revision 1.97
diff -u -r1.97 mercury_to_mercury.m
--- mercury_to_mercury.m	1997/03/18 19:58:42	1.97
+++ mercury_to_mercury.m	1997/04/03 00:54:27
@@ -78,15 +78,28 @@
 			io__state, io__state).
 :- mode mercury_output_mode_defn(in, in, in, di, uo) is det.
 
+	% Output a list of insts in a format that makes them easy to read
+	% but may not be valid Mercury.
+
+:- pred mercury_output_structured_inst_list(list(inst), int, varset,
+			io__state, io__state).
+:- mode mercury_output_structured_inst_list(in, in, in, di, uo) is det.
+
+:- pred mercury_output_inst_list(list(inst), varset, io__state, io__state).
+:- mode mercury_output_inst_list(in, in, di, uo) is det.
+
+	% Output an inst in a format that makes it easy to read
+	% but may not be valid Mercury.
+
+:- pred mercury_output_structured_inst(inst, int, varset, io__state, io__state).
+:- mode mercury_output_structured_inst(in, in, in, di, uo) is det.
+
 :- pred mercury_output_inst(inst, varset, io__state, io__state).
 :- mode mercury_output_inst(in, in, di, uo) is det.
 
 :- pred mercury_output_cons_id(cons_id, bool, io__state, io__state).
 :- mode mercury_output_cons_id(in, in, di, uo) is det.
 
-:- pred mercury_output_inst_list(list(inst), varset, io__state, io__state).
-:- mode mercury_output_inst_list(in, in, di, uo) is det.
-
 :- pred mercury_output_mode(mode, varset, io__state, io__state).
 :- mode mercury_output_mode(in, in, di, uo) is det.
 
@@ -369,6 +382,11 @@
 	mercury_output_inst(Body, VarSet),
 	io__write_string(".\n").
 
+mercury_output_structured_inst_list([], _, _) --> [].
+mercury_output_structured_inst_list([Inst | Insts], Indent0, VarSet) -->
+	mercury_output_structured_inst(Inst, Indent0, VarSet),
+	mercury_output_structured_inst_list(Insts, Indent0, VarSet).
+
 mercury_output_inst_list([], _) --> [].
 mercury_output_inst_list([Inst | Insts], VarSet) -->
 	mercury_output_inst(Inst, VarSet),
@@ -379,6 +397,77 @@
 		mercury_output_inst_list(Insts, VarSet)
 	).
 
+mercury_output_structured_inst(any(Uniq), Indent, _) -->
+	mercury_output_tabs(Indent),
+	mercury_output_any_uniqueness(Uniq),
+	io__write_string("\n").
+mercury_output_structured_inst(free, Indent, _) -->
+	mercury_output_tabs(Indent),
+	io__write_string("free\n").
+mercury_output_structured_inst(free(_T), Indent, _) -->
+	mercury_output_tabs(Indent),
+	io__write_string("free(with some type)\n").
+mercury_output_structured_inst(bound(Uniq, BoundInsts), Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	mercury_output_uniqueness(Uniq, "bound"),
+	io__write_string("(\n"),
+	mercury_output_structured_bound_insts(BoundInsts, Indent, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst(ground(Uniq, MaybePredInfo), Indent, VarSet)
+		-->
+	mercury_output_tabs(Indent),
+	(	
+		{ MaybePredInfo = yes(pred_inst_info(PredOrFunc, Modes, Det)) }
+	->
+		( { Uniq = shared } ->
+			[]
+		;
+			io__write_string("/* "),
+			mercury_output_uniqueness(Uniq, "ground"),
+			io__write_string(" */")
+		),
+		(
+			{ PredOrFunc = predicate },
+			( { Modes = [] } ->
+				io__write_string("(pred) is "),
+				mercury_output_det(Det),
+				io__write_string(")\n")
+			;
+				io__write_string("(pred("),
+				mercury_output_mode_list(Modes, VarSet),
+				io__write_string(") is "),
+				mercury_output_det(Det),
+				io__write_string(")\n")
+			)
+		;
+			{ PredOrFunc = function },
+			{ pred_args_to_func_args(Modes, ArgModes, RetMode) },
+			io__write_string("(func("),
+			mercury_output_mode_list(ArgModes, VarSet),
+			io__write_string(") = "),
+			mercury_output_mode(RetMode, VarSet),
+			io__write_string(" is "),
+			mercury_output_det(Det),
+			io__write_string(")\n")
+		)
+	;
+		mercury_output_uniqueness(Uniq, "ground"),
+		io__write_string("\n")
+	).
+mercury_output_structured_inst(inst_var(Var), Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	mercury_output_var(Var, VarSet, no),
+	io__write_string("\n").
+mercury_output_structured_inst(abstract_inst(Name, Args), Indent, VarSet) -->
+	mercury_output_structured_inst_name(user_inst(Name, Args), Indent,
+		VarSet).
+mercury_output_structured_inst(defined_inst(InstName), Indent, VarSet) -->
+	mercury_output_structured_inst_name(InstName, Indent, VarSet).
+mercury_output_structured_inst(not_reached, Indent, _) -->
+	mercury_output_tabs(Indent),
+	io__write_string("not_reached\n").
+
 mercury_output_inst(any(Uniq), _) -->
 	mercury_output_any_uniqueness(Uniq).
 mercury_output_inst(free, _) -->
@@ -436,6 +525,105 @@
 mercury_output_inst(not_reached, _) -->
 	io__write_string("not_reached").
 
+:- pred mercury_output_structured_inst_name(inst_name, int, varset,
+	io__state, io__state).
+:- mode mercury_output_structured_inst_name(in, in, in, di, uo) is det.
+
+mercury_output_structured_inst_name(user_inst(Name, Args), Indent, VarSet) -->
+	( { Args = [] } ->
+		mercury_output_tabs(Indent),
+		mercury_output_bracketed_sym_name(Name)
+	;
+		mercury_output_tabs(Indent),
+		mercury_output_sym_name(Name),
+		io__write_string("(\n"),
+		{ Indent1 is Indent + 1 },
+		mercury_output_structured_inst_list(Args, Indent1, VarSet),
+		mercury_output_tabs(Indent),
+		io__write_string(")\n")
+	).
+mercury_output_structured_inst_name(merge_inst(InstA, InstB), Indent, VarSet)
+		-->
+	mercury_output_tabs(Indent),
+	io__write_string("$merge_inst(\n"),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_list([InstA, InstB], Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(shared_inst(InstName), Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	io__write_string("$shared_inst(\n"),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_name(InstName, Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(mostly_uniq_inst(InstName), Indent, VarSet)
+		-->
+	mercury_output_tabs(Indent),
+	io__write_string("$mostly_uniq_inst(\n"),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_name(InstName, Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(unify_inst(Liveness, InstA, InstB, Real),
+		Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	io__write_string("$unify("),
+	( { Liveness = live } ->
+		io__write_string("live, ")
+	;
+		io__write_string("dead, ")
+	),
+	( { Real = real_unify } ->
+		io__write_string("real,\n")
+	;
+		io__write_string("fake,\n")
+	),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_list([InstA, InstB], Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(ground_inst(InstName, IsLive, Uniq, Real),
+		Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	io__write_string("$ground("),
+	( { IsLive = live } ->
+		io__write_string("live, ")
+	;
+		io__write_string("dead, ")
+	),
+	( { Real = real_unify } ->
+		io__write_string("real, ")
+	;
+		io__write_string("fake, ")
+	),
+	mercury_output_uniqueness(Uniq, "shared"),
+	io__write_string(",\n"),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_name(InstName, Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(typed_ground(Uniqueness, Type),
+		Indent, _VarSet) -->
+	mercury_output_tabs(Indent),
+	io__write_string("$typed_ground("),
+	mercury_output_uniqueness(Uniqueness, "shared"),
+	io__write_string(", "),
+	{ varset__init(TypeVarSet) },
+	mercury_output_term(Type, TypeVarSet, no),
+	io__write_string(")\n").
+mercury_output_structured_inst_name(typed_inst(Type, InstName),
+		Indent, VarSet) -->
+	mercury_output_tabs(Indent),
+	io__write_string("$typed_inst("),
+	{ varset__init(TypeVarSet) },
+	mercury_output_term(Type, TypeVarSet, no),
+	io__write_string(",\n"),
+	{ Indent1 is Indent + 1 },
+	mercury_output_structured_inst_name(InstName, Indent1, VarSet),
+	mercury_output_tabs(Indent),
+	io__write_string(")\n").
+
 :- pred mercury_output_inst_name(inst_name, varset, io__state, io__state).
 :- mode mercury_output_inst_name(in, in, di, uo) is det.
 
@@ -532,6 +720,36 @@
 	io__write_string("clobbered_any").
 mercury_output_any_uniqueness(mostly_clobbered) -->
 	io__write_string("mostly_clobbered_any").
+
+:- pred mercury_output_structured_bound_insts(list(bound_inst), int, varset,
+		io__state, io__state).
+:- mode mercury_output_structured_bound_insts(in, in, in, di, uo) is det.
+
+mercury_output_structured_bound_insts([], _, _) --> [].
+mercury_output_structured_bound_insts([functor(ConsId, Args) | BoundInsts],
+		Indent0, VarSet) -->
+	{ Indent1 is Indent0 + 1 },
+	{ Indent2 is Indent1 + 1 },
+	( { Args = [] } ->
+		mercury_output_tabs(Indent1),
+		mercury_output_cons_id(ConsId, yes),
+		io__write_string("\n")
+	;
+		mercury_output_tabs(Indent1),
+		mercury_output_cons_id(ConsId, no),
+		io__write_string("(\n"),
+		mercury_output_structured_inst_list(Args, Indent2, VarSet),
+		mercury_output_tabs(Indent1),
+		io__write_string(")\n")
+	),
+	( { BoundInsts = [] } ->
+		[]
+	;
+		mercury_output_tabs(Indent0),
+		io__write_string(";\n"),
+		mercury_output_structured_bound_insts(BoundInsts, Indent0,
+			VarSet)
+	).
 
 :- pred mercury_output_bound_insts(list(bound_inst), varset, io__state,
 		io__state).
Index: compiler/mode_debug.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mode_debug.m,v
retrieving revision 1.3
diff -u -r1.3 mode_debug.m
--- mode_debug.m	1996/12/30 11:31:05	1.3
+++ mode_debug.m	1997/04/02 09:41:36
@@ -18,16 +18,16 @@
 
 :- import_module hlds_module, hlds_pred, mode_info.
 
-        % Print a debugging message which includes the port, message string,
-        % and the current instmap (but only if `--debug-modes' was enabled).
-        %
+	% Print a debugging message which includes the port, message string,
+	% and the current instmap (but only if `--debug-modes' was enabled).
+	%
 :- pred mode_checkpoint(port, string, mode_info, mode_info).
 :- mode mode_checkpoint(in, in, mode_info_di, mode_info_uo) is det.
 
 :- type port
-        --->    enter
-        ;       exit
-        ;       wakeup.
+	--->	enter
+	;	exit
+	;	wakeup.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
@@ -39,72 +39,85 @@
 
 %-----------------------------------------------------------------------------%
 
-        % This code is used to trace the actions of the mode checker.
+	% This code is used to trace the actions of the mode checker.
 
 mode_checkpoint(Port, Msg, ModeInfo0, ModeInfo) :-
-        mode_info_get_io_state(ModeInfo0, IOState0),
-        globals__io_lookup_bool_option(debug_modes, DoCheckPoint,
-                IOState0, IOState1),
-        ( DoCheckPoint = yes ->
-                mode_checkpoint_2(Port, Msg, ModeInfo0, IOState1, IOState)
-        ;
-                IOState = IOState1
-        ),
-        mode_info_set_io_state(ModeInfo0, IOState, ModeInfo).
-
-:- pred mode_checkpoint_2(port, string, mode_info, io__state, io__state).
-:- mode mode_checkpoint_2(in, in, mode_info_ui, di, uo) is det.
-
-mode_checkpoint_2(Port, Msg, ModeInfo) -->
-        { mode_info_get_errors(ModeInfo, Errors) },
-        ( { Port = enter } ->
-                io__write_string("Enter "),
-                { Detail = yes }
-        ; { Port = wakeup } ->
-                io__write_string("Wake  "),
-                { Detail = no }
-        ; { Errors = [] } ->
-                io__write_string("Exit "),
-                { Detail = yes }
-        ;
-                io__write_string("Delay  "),
-                { Detail = no }
-        ),
-        io__write_string(Msg),
-        ( { Detail = yes } ->
-                io__write_string(":\n"),
-                globals__io_lookup_bool_option(statistics, Statistics),
-                maybe_report_stats(Statistics),
-                { mode_info_get_instmap(ModeInfo, InstMap) },
-                ( { instmap__is_reachable(InstMap) } ->
-                        { instmap__to_assoc_list(InstMap, AssocList) },
-                        { mode_info_get_varset(ModeInfo, VarSet) },
-                        { mode_info_get_instvarset(ModeInfo, InstVarSet) },
-                        write_var_insts(AssocList, VarSet, InstVarSet)
-                ;
-                        io__write_string("\tUnreachable\n")
-                )
-        ;
-                []
-        ),
-        io__write_string("\n").
-
-:- pred write_var_insts(assoc_list(var, inst), varset, varset,
-                        io__state, io__state).
-:- mode write_var_insts(in, in, in, di, uo) is det.
-
-write_var_insts([], _, _) --> [].
-write_var_insts([Var - Inst | VarInsts], VarSet, InstVarSet) -->
-        io__write_string("\t"),
-        mercury_output_var(Var, VarSet, no),
-        io__write_string(" :: "),
-        mercury_output_inst(Inst, InstVarSet),
-        ( { VarInsts = [] } ->
-                []
-        ;
-                io__write_string("\n"),
-                write_var_insts(VarInsts, VarSet, InstVarSet)
-        ).
+	mode_info_get_io_state(ModeInfo0, IOState0),
+	globals__io_lookup_bool_option(debug_modes, DoCheckPoint,
+		IOState0, IOState1),
+	( DoCheckPoint = yes ->
+		mode_info_get_last_checkpoint_insts(ModeInfo0, OldInsts),
+		mode_checkpoint_2(Port, Msg, OldInsts, NewInsts, ModeInfo0,
+			IOState1, IOState),
+		mode_info_set_last_checkpoint_insts(NewInsts, ModeInfo0,
+			ModeInfo1)
+	;
+		ModeInfo1 = ModeInfo0,
+		IOState = IOState1
+	),
+	mode_info_set_io_state(ModeInfo1, IOState, ModeInfo).
+
+:- pred mode_checkpoint_2(port, string, assoc_list(var, inst),
+	assoc_list(var, inst), mode_info, io__state, io__state).
+:- mode mode_checkpoint_2(in, in, in, out, mode_info_ui, di, uo) is det.
+
+mode_checkpoint_2(Port, Msg, OldInstList, NewInstList, ModeInfo) -->
+	{ mode_info_get_errors(ModeInfo, Errors) },
+	( { Port = enter } ->
+		io__write_string("Enter "),
+		{ Detail = yes }
+	; { Port = wakeup } ->
+		io__write_string("Wake "),
+		{ Detail = no }
+	; { Errors = [] } ->
+		io__write_string("Exit "),
+		{ Detail = yes }
+	;
+		io__write_string("Delay "),
+		{ Detail = no }
+	),
+	io__write_string(Msg),
+	( { Detail = yes } ->
+		io__write_string(":\n"),
+		globals__io_lookup_bool_option(statistics, Statistics),
+		maybe_report_stats(Statistics),
+		maybe_flush_output(Statistics),
+		{ mode_info_get_instmap(ModeInfo, InstMap) },
+		( { instmap__is_reachable(InstMap) } ->
+			{ instmap__to_assoc_list(InstMap, NewInstList) },
+			{ mode_info_get_varset(ModeInfo, VarSet) },
+			{ mode_info_get_instvarset(ModeInfo, InstVarSet) },
+			write_var_insts(NewInstList, OldInstList,
+				VarSet, InstVarSet)
+		;
+			{ NewInstList = [] },
+			io__write_string("\tUnreachable\n")
+		)
+	;
+		{ NewInstList = OldInstList }
+	),
+	io__write_string("\n"),
+	io__flush_output.
+
+:- pred write_var_insts(assoc_list(var, inst), assoc_list(var, inst),
+	varset, varset, io__state, io__state).
+:- mode write_var_insts(in, in, in, in, di, uo) is det.
+
+write_var_insts([], _, _, _) --> [].
+write_var_insts([Var - Inst | VarInsts], OldInstList, VarSet, InstVarSet) -->
+	io__write_string("\t"),
+	mercury_output_var(Var, VarSet, no),
+	io__write_string(" ::"),
+	(
+		{ assoc_list__search(OldInstList, Var, OldInst) },
+		{ Inst = OldInst }
+	->
+		io__write_string(" unchanged\n")
+	;
+		io__write_string("\n"),
+		mercury_output_structured_inst(Inst, 2, InstVarSet)
+	),
+	write_var_insts(VarInsts, OldInstList, VarSet, InstVarSet).
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/mode_info.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mode_info.m,v
retrieving revision 1.35
diff -u -r1.35 mode_info.m
--- mode_info.m	1996/11/19 01:18:16	1.35
+++ mode_info.m	1997/04/02 02:14:16
@@ -197,6 +197,14 @@
 :- pred mode_info_set_nondet_live_vars(list(set(var)), mode_info, mode_info).
 :- mode mode_info_set_nondet_live_vars(in, mode_info_di, mode_info_uo) is det.
 
+:- pred mode_info_get_last_checkpoint_insts(mode_info, assoc_list(var, inst)).
+:- mode mode_info_get_last_checkpoint_insts(mode_info_no_io, out) is det.
+
+:- pred mode_info_set_last_checkpoint_insts(assoc_list(var, inst),
+	mode_info, mode_info).
+:- mode mode_info_set_last_checkpoint_insts(in, mode_info_di, mode_info_uo)
+	is det.
+
 :- pred mode_info_get_changed_flag(mode_info, bool).
 :- mode mode_info_get_changed_flag(mode_info_no_io, out) is det.
 
@@ -210,7 +218,7 @@
 						ground, ground, ground,
 						ground, ground, ground, ground,
 						ground, ground, ground, ground,
-						ground, ground
+						ground, ground, ground
 					)
 				).
 */
@@ -229,7 +237,7 @@
 						dead, ground, ground, ground,
 						ground, ground, ground, ground,
 						ground, ground, ground, ground,
-						ground, ground
+						ground, ground, ground
 					)
 				).
 */
@@ -254,8 +262,8 @@
 
 :- implementation.
 
-:- import_module delay_info, mode_errors, prog_data.
-:- import_module require, std_util.
+:- import_module delay_info, mode_errors, prog_data, mode_util.
+:- import_module require, std_util, queue.
 
 :- type mode_info 
 	--->	mode_info(
@@ -296,6 +304,14 @@
 	% execution point, since those variables will *already* have
 	% been marked as mostly_unique rather than unique.)
 
+			assoc_list(var, inst),
+	% This field is used by the checkpoint code when debug_modes is on.
+	% It has the instmap that was current at the last mode checkpoint,
+	% so that checkpoints do not print out the insts of variables
+	% whose insts have not changed since the last checkpoint.
+	% This field will always contain an empty list if debug_modes is off,
+	% since its information is not needed then.
+
 			bool		% Changed flag
 					% If `yes', then we may need
 					% to repeat mode inference.
@@ -331,96 +347,97 @@
 	ModeInfo = mode_info(
 		IOState, ModuleInfo, PredId, ProcId, VarSet, VarTypes,
 		Context, ModeContext, InstMapping0, LockedVars, DelayInfo,
-		ErrorList, LiveVarsList, NondetLiveVarsList, Changed
+		ErrorList, LiveVarsList, NondetLiveVarsList, [],
+		Changed
 	).
 
 %-----------------------------------------------------------------------------%
 
 	% Lots of very boring access predicates.
 
-mode_info_get_io_state(mode_info(IOState0,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
+mode_info_get_io_state(mode_info(IOState0,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
 		IOState) :-
 	% XXX
 	copy(IOState0, IOState).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_io_state( mode_info(_,B,C,D,E,F,G,H,I,J,K,L,M,N,O), IOState0,
-			mode_info(IOState,B,C,D,E,F,G,H,I,J,K,L,M,N,O)) :-
+mode_info_set_io_state( mode_info(_,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P), IOState0,
+			mode_info(IOState,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P)) :-
 	% XXX
 	copy(IOState0, IOState).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_module_info(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_),
+mode_info_get_module_info(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_),
 				ModuleInfo).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_module_info(mode_info(A,_,C,D,E,F,G,H,I,J,K,L,M,N,O), ModuleInfo,
-			mode_info(A,ModuleInfo,C,D,E,F,G,H,I,J,K,L,M,N,O)).
+mode_info_set_module_info(mode_info(A,_,C,D,E,F,G,H,I,J,K,L,M,N,O,P), ModuleInfo,
+			mode_info(A,ModuleInfo,C,D,E,F,G,H,I,J,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_preds(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_), Preds) :-
+mode_info_get_preds(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_), Preds) :-
 	module_info_preds(ModuleInfo, Preds).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_modes(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_), Modes) :-
+mode_info_get_modes(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_), Modes) :-
 	module_info_modes(ModuleInfo, Modes).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_insts(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_), Insts) :-
+mode_info_get_insts(mode_info(_,ModuleInfo,_,_,_,_,_,_,_,_,_,_,_,_,_,_), Insts) :-
 	module_info_insts(ModuleInfo, Insts).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_predid(mode_info(_,_,PredId,_,_,_,_,_,_,_,_,_,_,_,_), PredId).
+mode_info_get_predid(mode_info(_,_,PredId,_,_,_,_,_,_,_,_,_,_,_,_,_), PredId).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_procid(mode_info(_,_,_,ProcId,_,_,_,_,_,_,_,_,_,_,_), ProcId).
+mode_info_get_procid(mode_info(_,_,_,ProcId,_,_,_,_,_,_,_,_,_,_,_,_), ProcId).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_varset(mode_info(_,_,_,_,VarSet,_,_,_,_,_,_,_,_,_,_), VarSet).
+mode_info_get_varset(mode_info(_,_,_,_,VarSet,_,_,_,_,_,_,_,_,_,_,_), VarSet).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_varset(VarSet, mode_info(A,B,C,D,_,F,G,H,I,J,K,L,M,N,O),
-				mode_info(A,B,C,D,VarSet,F,G,H,I,J,K,L,M,N,O)).
+mode_info_set_varset(VarSet, mode_info(A,B,C,D,_,F,G,H,I,J,K,L,M,N,O,P),
+				mode_info(A,B,C,D,VarSet,F,G,H,I,J,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_var_types(mode_info(_,_,_,_,_,VarTypes,_,_,_,_,_,_,_,_,_),
+mode_info_get_var_types(mode_info(_,_,_,_,_,VarTypes,_,_,_,_,_,_,_,_,_,_),
 				VarTypes).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_var_types(VarTypes, mode_info(A,B,C,D,E,_,G,H,I,J,K,L,M,N,O),
-			mode_info(A,B,C,D,E,VarTypes,G,H,I,J,K,L,M,N,O)).
+mode_info_set_var_types(VarTypes, mode_info(A,B,C,D,E,_,G,H,I,J,K,L,M,N,O,P),
+			mode_info(A,B,C,D,E,VarTypes,G,H,I,J,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_context(mode_info(_,_,_,_,_,_,Context,_,_,_,_,_,_,_,_), Context).
+mode_info_get_context(mode_info(_,_,_,_,_,_,Context,_,_,_,_,_,_,_,_,_), Context).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_context(Context, mode_info(A,B,C,D,E,F,_,H,I,J,K,L,M,N,O),
-			mode_info(A,B,C,D,E,F,Context,H,I,J,K,L,M,N,O)).
+mode_info_set_context(Context, mode_info(A,B,C,D,E,F,_,H,I,J,K,L,M,N,O,P),
+			mode_info(A,B,C,D,E,F,Context,H,I,J,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_mode_context(mode_info(_,_,_,_,_,_,_,ModeContext,_,_,_,_,_,_,_),
+mode_info_get_mode_context(mode_info(_,_,_,_,_,_,_,ModeContext,_,_,_,_,_,_,_,_),
 				ModeContext).
 
 %-----------------------------------------------------------------------------%
 
 mode_info_set_mode_context(ModeContext,
-		mode_info(A,B,C,D,E,F,G,_,I,J,K,L,M,N,O),
-		mode_info(A,B,C,D,E,F,G,ModeContext,I,J,K,L,M,N,O)).
+		mode_info(A,B,C,D,E,F,G,_,I,J,K,L,M,N,O,P),
+		mode_info(A,B,C,D,E,F,G,ModeContext,I,J,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
@@ -449,7 +466,7 @@
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_instmap(mode_info(_,_,_,_,_,_,_,_,InstMap,_,_,_,_,_,_), InstMap).
+mode_info_get_instmap(mode_info(_,_,_,_,_,_,_,_,InstMap,_,_,_,_,_,_,_), InstMap).
 
 	% mode_info_dcg_get_instmap/3 is the same as mode_info_get_instmap/2
 	% except that it's easier to use inside a DCG.
@@ -460,8 +477,8 @@
 %-----------------------------------------------------------------------------%
 
 mode_info_set_instmap( InstMap,
-		mode_info(A,B,C,D,E,F,G,H,InstMap0,J,DelayInfo0,L,M,N,O),
-		mode_info(A,B,C,D,E,F,G,H,InstMap,J,DelayInfo,L,M,N,O)) :-
+		mode_info(A,B,C,D,E,F,G,H,InstMap0,J,DelayInfo0,L,M,N,O,P),
+		mode_info(A,B,C,D,E,F,G,H,InstMap,J,DelayInfo,L,M,N,O,P)) :-
 	( instmap__is_unreachable(InstMap), instmap__is_reachable(InstMap0) ->
 		delay_info__bind_all_vars(DelayInfo0, DelayInfo)
 	;
@@ -470,28 +487,28 @@
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_locked_vars(mode_info(_,_,_,_,_,_,_,_,_,LockedVars,_,_,_,_,_),
+mode_info_get_locked_vars(mode_info(_,_,_,_,_,_,_,_,_,LockedVars,_,_,_,_,_,_),
 		LockedVars).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_locked_vars( mode_info(A,B,C,D,E,F,G,H,I,_,K,L,M,N,O), LockedVars,
-			mode_info(A,B,C,D,E,F,G,H,I,LockedVars,K,L,M,N,O)).
+mode_info_set_locked_vars( mode_info(A,B,C,D,E,F,G,H,I,_,K,L,M,N,O,P), LockedVars,
+			mode_info(A,B,C,D,E,F,G,H,I,LockedVars,K,L,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_errors(mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_), Errors).
+mode_info_get_errors(mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_,_), Errors).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_get_num_errors(mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_),
+mode_info_get_num_errors(mode_info(_,_,_,_,_,_,_,_,_,_,_,Errors,_,_,_,_),
 		NumErrors) :-
 	list__length(Errors, NumErrors).
 
 %-----------------------------------------------------------------------------%
 
-mode_info_set_errors( Errors, mode_info(A,B,C,D,E,F,G,H,I,J,K,_,M,N,O), 
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,Errors,M,N,O)).
+mode_info_set_errors( Errors, mode_info(A,B,C,D,E,F,G,H,I,J,K,_,M,N,O,P), 
+			mode_info(A,B,C,D,E,F,G,H,I,J,K,Errors,M,N,O,P)).
 
 %-----------------------------------------------------------------------------%
 
@@ -504,8 +521,11 @@
 	% the bag of nondet-live vars.
 
 mode_info_add_live_vars(NewLiveVars,
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,LiveVars0,NondetLiveVars0,O),
-		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,LiveVars,NondetLiveVars,O)) :-
+		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
+			LiveVars0,NondetLiveVars0,O,P),
+		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
+			LiveVars,NondetLiveVars,O,P)) :-
+
 	LiveVars = [NewLiveVars | LiveVars0],
 	NondetLiveVars = [NewLiveVars | NondetLiveVars0].
 
@@ -514,9 +534,9 @@
 
 mode_info_remove_live_vars(OldLiveVars, ModeInfo0, ModeInfo) :-
 	ModeInfo0 = mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-				LiveVars0, NondetLiveVars0,O),
+				LiveVars0, NondetLiveVars0,O,P),
 	ModeInfo1 = mode_info(A,B,C,D,E,F,G,H,I,J,K,L,
-				LiveVars, NondetLiveVars,O),
+				LiveVars, NondetLiveVars,O,P),
 	(
 		list__delete_first(LiveVars0, OldLiveVars, LiveVars1),
 		list__delete_first(NondetLiveVars0, OldLiveVars,
@@ -543,7 +563,7 @@
 
 	% Check whether a variable is live or not
 
-mode_info_var_is_live(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,_,_), Var,
+mode_info_var_is_live(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,_,_,_), Var,
 		Result) :-
 	(
 		% some [LiveVars] 
@@ -558,7 +578,7 @@
 	% Check whether a variable is nondet_live or not.
 
 mode_info_var_is_nondet_live(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,
-		NondetLiveVarsList,_), Var, Result) :-
+		NondetLiveVarsList,_,_), Var, Result) :-
 	(
 		% some [LiveVars] 
 		list__member(LiveVars, NondetLiveVarsList),
@@ -569,7 +589,7 @@
 		Result = dead
 	).
 
-mode_info_get_liveness(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,_,_),
+mode_info_get_liveness(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,LiveVarsList,_,_,_),
 		LiveVars) :-
 	set__init(LiveVars0),
 	mode_info_get_liveness_2(LiveVarsList, LiveVars0, LiveVars).
@@ -626,25 +646,33 @@
 		mode_info_var_is_locked_2(Sets, Var)
 	).
 
-mode_info_get_delay_info(mode_info(_,_,_,_,_,_,_,_,_,_,DelayInfo,_,_,_,_),
+mode_info_get_delay_info(mode_info(_,_,_,_,_,_,_,_,_,_,DelayInfo,_,_,_,_,_),
 	DelayInfo).
 
-mode_info_set_delay_info(DelayInfo, mode_info(A,B,C,D,E,F,G,H,I,J,_,L,M,N,O),
-			mode_info(A,B,C,D,E,F,G,H,I,J,DelayInfo,L,M,N,O)).
+mode_info_set_delay_info(DelayInfo, mode_info(A,B,C,D,E,F,G,H,I,J,_,L,M,N,O,P),
+			mode_info(A,B,C,D,E,F,G,H,I,J,DelayInfo,L,M,N,O,P)).
 
 mode_info_get_nondet_live_vars(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,
-			NondetLiveVars,_), NondetLiveVars).
+			NondetLiveVars,_,_), NondetLiveVars).
 
 mode_info_set_nondet_live_vars(NondetLiveVars,
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,_,O),
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,NondetLiveVars,O)).
+		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,_,O,P),
+		mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,NondetLiveVars,O,P)).
+
+mode_info_get_last_checkpoint_insts(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,
+		LastCheckpointInsts,_), LastCheckpointInsts).
+
+mode_info_set_last_checkpoint_insts(LastCheckpointInsts,
+			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,_,P),
+			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,
+				LastCheckpointInsts,P)).
 
-mode_info_get_changed_flag(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,Changed),
+mode_info_get_changed_flag(mode_info(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,Changed),
 				Changed).
 
 mode_info_set_changed_flag(Changed,
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,_),
-			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,Changed)).
+			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,_),
+			mode_info(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,Changed)).
 
 %-----------------------------------------------------------------------------%
 
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing runtime
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/mercury_calls_c
cvs diff: Diffing samples/diff
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/general
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trial
cvs diff: Diffing util



More information about the developers mailing list