[m-dev.] diff: improve Aditi debugging output

Simon Taylor stayl at cs.mu.OZ.AU
Tue May 11 15:05:19 AEST 1999



Estimated hours taken: 0.5

compiler/rl_code.m:
compiler/rl_out.pp:
	 Add an argument to rl_PROC_materialise instructions to make
	 it easier to identify which materialise instruction causes
	 each part of the debugging output from Aditi.


Index: rl_code.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_code.m,v
retrieving revision 1.2
diff -u -u -r1.2 rl_code.m
--- rl_code.m	1999/03/08 06:09:38	1.2
+++ rl_code.m	1999/05/11 02:46:30
@@ -5,7 +5,7 @@
 %-----------------------------------------------------------------------------%
 % Do not edit - this file was automatically generated by
 % $ADITI_ROOT/src/rosi/create_rl_code_m.
-% Created Mon Mar  8 10:19:23 1999
+% Created Tue May 11 12:46:29 1999
 
 %-----------------------------------------------------------------------------%
 :- module rl_code.
@@ -297,7 +297,7 @@
 	;	rl_PROC_update(int32)
 	;	rl_PROC_modify
 	;	rl_PROC_project_torel
-	;	rl_PROC_materialise
+	;	rl_PROC_materialise(int32)
 	;	rl_PROC_insert_tuple
 	;	rl_PROC_whilenotempty(int32)
 	;	rl_PROC_while
@@ -1259,9 +1259,10 @@
 bytecode_to_intlist(rl_PROC_project_torel,	 Splits) :-
 	int16_to_bytecode(234, I234Codes),
 	list__condense([I234Codes], Splits).
-bytecode_to_intlist(rl_PROC_materialise,	 Splits) :-
+bytecode_to_intlist(rl_PROC_materialise(X0int32),	 Splits) :-
 	int16_to_bytecode(235, I235Codes),
-	list__condense([I235Codes], Splits).
+	int32_to_bytecode(X0int32, X0int32Codes),
+	list__condense([I235Codes,X0int32Codes], Splits).
 bytecode_to_intlist(rl_PROC_insert_tuple,	 Splits) :-
 	int16_to_bytecode(236, I236Codes),
 	list__condense([I236Codes], Splits).
@@ -1670,4 +1671,4 @@
 	int_to_byte_list(X, List).
 
 
-rl_code__version(1, 19).
+rl_code__version(1, 20).
Index: rl_out.pp
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/rl_out.pp,v
retrieving revision 1.2
diff -u -u -r1.2 rl_out.pp
--- rl_out.pp	1999/05/05 06:31:01	1.2
+++ rl_out.pp	1999/05/11 04:36:21
@@ -892,10 +892,11 @@
 	% will also add any necessary indexes.
 	rl_out__generate_instr(init(OutputRel) - "", InitCode),
 
+	rl_out_info_get_next_materialise_id(Id),
 	{ Code = 
 		tree(InitCode,
 		node([
-			rl_PROC_materialise,
+			rl_PROC_materialise(Id),
 			rl_PROC_stream,
 			rl_PROC_var(InputAddr, 0),
 			rl_PROC_stream_end,
@@ -1208,13 +1209,14 @@
 
 		{ LockSpec = 0 },	% default lock spec
 		rl_out__add_indexes_to_rel(Output, Indexes, IndexInstrs),
+		rl_out_info_get_next_materialise_id(Id),
 		{ Code = 
 			tree(node([
 				rl_PROC_createtemprel(TmpVar, SchemaOffset) |
 				IndexInstrs
 			]),
 			tree(node([
-				rl_PROC_materialise
+				rl_PROC_materialise(Id)
 			]),
 			tree(Stream,
 			tree(node([
@@ -1523,7 +1525,9 @@
 		int,				% expression PC
 		map(rl_const, int),		% procedure consts
 		int,				% next proc const address
-		unit,
+		int,				% next materialise number -
+						% used for debugging the
+						% generated code.
 		unit,
 		unit,
 		unit,
@@ -1570,11 +1574,12 @@
 	PC = 0,
 	FirstRelAddr = 0,
 	FirstConst = 1,
+	FirstMaterialise = 1,
 	Label = 0,
 	NextExprn = 0,
 	Info0 = rl_out_info(PC, CompareExprns, RelationAddrs, FirstRelAddr, 
 		Relations, Labels, unit, ModuleInfo, PC, Consts, 
-		FirstConst, unit, unit, unit, unit, Label, 
+		FirstConst, FirstMaterialise, unit, unit, unit, Label, 
 		[], unit, unit, unit, PermRels, [], [], 
 		NextExprn, TmpVars).
 
@@ -1590,11 +1595,11 @@
 	NextExprn = 0,
 	map__init(TmpVars),
 	Info0 = rl_out_info(_, _, _, NextAddr, _, _, _, 
-		ModuleInfo, _, ProcConsts, NextConst, _, _, _, _, _, Procs, _,
-		_, _, PermRelations, Variables, _, _, _),
+		ModuleInfo, _, ProcConsts, NextConst, Materialise, _, _,
+		_, _, Procs, _, _, _, PermRelations, Variables, _, _, _),
 	Info = rl_out_info(PC, CompareExprns, RelationAddrs, NextAddr,
 		Relations, Labels, unit, ModuleInfo, PC, ProcConsts,
-		NextConst, unit, unit, unit, unit, Label, Procs,
+		NextConst, Materialise, unit, unit, unit, Label, Procs,
 		unit, unit, unit, PermRelations, Variables, [], 
 		NextExprn, TmpVars).
 
@@ -1752,6 +1757,17 @@
 rl_out_info_get_consts(Consts, Info, Info) :-
 	Info = rl_out_info(_,_,_,_,_,_,_,_,_,Consts,
 			_,_,_,_,_,_,_,_,_,_,_,_,_,_,_).
+
+%-----------------------------------------------------------------------------%
+
+:- pred rl_out_info_get_next_materialise_id(int::out, 
+		rl_out_info::in, rl_out_info::out) is det.
+
+rl_out_info_get_next_materialise_id(MaterialiseId, Info0, Info) :-
+	Info0 = rl_out_info(A,B,C,D,E,F,G,H,I,J,K,
+			MaterialiseId, M,N,O,P,Q,R,S,T,U,V,W,X,Y),
+	Info = rl_out_info(A,B,C,D,E,F,G,H,I,J,K,
+			MaterialiseId + 1, M,N,O,P,Q,R,S,T,U,V,W,X,Y).
 
 %-----------------------------------------------------------------------------%
 
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list