[m-dev.] [reuse] diff: fix create_reuse_pred and trans_opt

Peter Ross - KUL Peter.Ross at cs.kuleuven.ac.be
Mon Oct 16 04:25:03 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 2

sr_split.m:
    When creating a reuse pred use the mode number to distinguish
    between different modes of the same pred with reuse.

trans_opt.m:
    No longer write out all the types, because *I think* that is handled
    correctly in the .opt files.

Index: sr_split.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_split.m,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 sr_split.m
--- sr_split.m	2000/10/13 08:58:50	1.1.2.5
+++ sr_split.m	2000/10/15 17:10:07
@@ -28,6 +28,7 @@
 :- pred create_reuse_pred(pred_proc_id::in, memo_reuse::in,
 		maybe(hlds_goal)::in,
 		module_info::in, module_info::out) is det.
+
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -139,7 +140,8 @@
 			memo_reuse_is_conditional(Memo) 
 		->
 			% fetch the reuse goal
-			create_reuse_pred(Memo, yes(ReuseGoal), 
+
+			create_reuse_pred(Memo, PredProcId, yes(ReuseGoal), 
 					PredInfo0, ProcInfo0,
 					ReusePredInfo, _ReuseProcInfo0,
 					ReuseProcId, ReuseName),
@@ -179,7 +181,8 @@
 	module_info_pred_proc_info(HLDSin, PRED_PROC_ID, PredInfo0, 
 					ProcInfo0),
 	( memo_reuse_is_conditional(TREUSE) ->
-		create_reuse_pred(TREUSE, MaybeHLDS_GOAL, PredInfo0, ProcInfo0,
+		create_reuse_pred(TREUSE, PRED_PROC_ID,
+				MaybeHLDS_GOAL, PredInfo0, ProcInfo0,
 				ReusePredInfo, _ReuseProcInfo,
 				ReuseProcId, ReuseName),
 
@@ -210,12 +213,12 @@
 				PredInfo0, ProcInfo, HLDSout)
 	).
 
-:- pred create_reuse_pred(memo_reuse::in, maybe(hlds_goal)::in,
-		pred_info::in, proc_info::in,
+:- pred create_reuse_pred(memo_reuse::in, pred_proc_id::in,
+		maybe(hlds_goal)::in, pred_info::in, proc_info::in,
 		pred_info::out, proc_info::out,
 		proc_id::out, sym_name::out) is det.
 
-create_reuse_pred(TabledReuse, MaybeReuseGoal, PredInfo, ProcInfo,
+create_reuse_pred(TabledReuse, PredProcId, MaybeReuseGoal, PredInfo, ProcInfo,
 		ReusePredInfo, ReuseProcInfo, ReuseProcId, SymName) :-
 	proc_info_set_reuse_information(ProcInfo, 
 				TabledReuse, ReuseProcInfo0),
@@ -239,8 +242,11 @@
 
 	set__init(Assertions),
 
+	PredProcId = proc(_PredId, ProcId),
+	proc_id_to_int(ProcId, ProcIdInt),
+
 	Line = 0,
-	Counter = 0,
+	Counter = ProcIdInt,
 
 	make_pred_name_with_context(ModuleName, "reuse", PredOrFunc, Name,
 		Line, Counter, SymName),
Index: trans_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.15.4.3
diff -u -r1.15.4.3 trans_opt.m
--- trans_opt.m	2000/10/12 15:03:49	1.15.4.3
+++ trans_opt.m	2000/10/15 17:10:09
@@ -162,9 +162,10 @@
 			      )
 			    ),
 			AllTypes, 
-			Types ) },
+			_Types ) },
 		% { Types = AllTypes },
-		intermod__write_types( Types ), 
+			% XXX not necessary!
+		% intermod__write_types( Types ), 
 
 		% output possible-alias information.
 		io__write_string(

--------------------------------------------------------------------------
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