[m-dev.] [reuse] diff: minor cleanup

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Thu Feb 8 00:54:02 AEDT 2001


Hi,


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


Estimated hours taken: 1

Clean up and use the previously added proc_info_real_headvars predicate
instead of an obsolete predicate. 

hlds_pred.m:
	Extra documentation to the predicate proc_info_real_headvars
	that has been added a while ago. 

sr_dead.m:
sr_indirect.m:
	Use proc_info_real_headvars instead of its copy in sr_util. 

sr_util.m:
	Remove the pseudo-predicate compute_real_headvars which was
	used before. 



Index: hlds_pred.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.81.2.10
diff -u -r1.81.2.10 hlds_pred.m
--- hlds_pred.m	2001/02/07 10:18:52	1.81.2.10
+++ hlds_pred.m	2001/02/07 13:17:54
@@ -1332,6 +1332,10 @@
 :- pred proc_info_set_headvars(proc_info, list(prog_var), proc_info).
 :- mode proc_info_set_headvars(in, in, out) is det.
 
+	% retreive the list of real headvars. With real headvars
+	% we think of those variables with which the predicate
+	% was initially declared (and not containing additional
+	% headvars that are added during the compilation process).
 :- pred proc_info_real_headvars(proc_info, list(prog_var)).
 :- mode proc_info_real_headvars(in, out) is det.
 
@@ -1567,6 +1571,7 @@
 			prog_varset	:: prog_varset,
 			var_types	:: vartypes,
 			real_head_vars  :: list(prog_var),
+					% see proc_info_real_headvars/2
 			head_vars	:: list(prog_var),
 			actual_head_modes :: list(mode),
 			inst_varset :: inst_varset,
Index: sr_dead.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_dead.m,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 sr_dead.m
--- sr_dead.m	2001/02/07 10:19:11	1.1.2.9
+++ sr_dead.m	2001/02/07 13:17:56
@@ -35,10 +35,9 @@
 :- import_module pa_alias_as, pa_run.
 :- import_module sr_util.
 
-process_goal( PredId, ProcInfo, ModuleInfo, Goal0, Goal) :- 
+process_goal( _PredId, ProcInfo, ModuleInfo, Goal0, Goal) :- 
 	pa_alias_as__init(Alias0), 
-	sr_util__compute_real_headvars(ModuleInfo, PredId, 
-				ProcInfo, RealHeadVars), 
+	hlds_pred__proc_info_real_headvars(ProcInfo, RealHeadVars), 
 	dead_cell_pool_init(RealHeadVars, Pool0), 
 	annotate_goal(ProcInfo, ModuleInfo, Goal0, Goal, 
 			Pool0, _Pool, Alias0, _Alias).
Index: sr_indirect.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_indirect.m,v
retrieving revision 1.1.2.15
diff -u -r1.1.2.15 sr_indirect.m
--- sr_indirect.m	2001/02/07 10:19:11	1.1.2.15
+++ sr_indirect.m	2001/02/07 13:17:56
@@ -202,7 +202,7 @@
 		pa_alias_as__init(Alias0),
 		%	OK
 		% 4. initialize reuses-information
-		compute_real_headvars( HLDS, PredId, ProcInfo, HVs), 
+		hlds_pred__proc_info_real_headvars(ProcInfo, HVs), 
 		% do not change the state of the fixpoint table by
 		% simply consulting it now for initialization.
 		sr_fixpoint_table_get_final_reuse( PredProcId, 
Index: sr_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_util.m,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 sr_util.m
--- sr_util.m	2000/10/12 15:03:49	1.1.2.1
+++ sr_util.m	2001/02/07 13:17:56
@@ -13,44 +13,38 @@
 :- interface.
 
 :- import_module list.
-:- import_module hlds_module, hlds_pred, prog_data.
 
-:- pred compute_real_headvars(module_info, pred_id, proc_info, 
-		list(prog_var)).
-:- mode compute_real_headvars(in, in, in, out) is det.
+:- pred sr_util__list_drop_det(int,list(T),list(T)).
+:- mode sr_util__list_drop_det(in,in,out) is det.
 
 
-:- pred list_drop_det(int,list(T),list(T)).
-:- mode list_drop_det(in,in,out) is det.
-
-
-:- pred list_map3( pred( T, T1, T2, T3 ), list(T), list(T1), list(T2), 
+:- pred sr_util__list_map3( pred( T, T1, T2, T3 ), list(T), list(T1), list(T2), 
 			list(T3) ).
-:- mode list_map3( pred( in, out, out, out) is det, in, 
+:- mode sr_util__list_map3( pred( in, out, out, out) is det, in, 
 			out, out, out) is det.
 
-:- pred list_map_foldl2( 
+:- pred sr_util__list_map_foldl2( 
 		pred( T, T1, T2, T2, T3, T3 ), 
 		list(T), 
 		list(T1),
 		T2, T2, T3, T3).
-:- mode list_map_foldl2( pred( in, out, in, out, in, out) is det,
+:- mode sr_util__list_map_foldl2( pred( in, out, in, out, in, out) is det,
 			in, out, in, out, in, out) is det.
 
-:- pred list_map3_foldl( pred(T1, T2, T3, T4, T5, T5), 
+:- pred sr_util__list_map3_foldl( pred(T1, T2, T3, T4, T5, T5), 
 			list(T1), list(T2), list(T3), list(T4),
 			T5, T5).
-:- mode list_map3_foldl( pred(in, out, out, out, in, out) is det,
+:- mode sr_util__list_map3_foldl( pred(in, out, out, out, in, out) is det,
 			in, out, out, out, in, out) is det.
 
-:- pred list_map_foldl3( pred(T1, T2, T3, T3, T4, T4, T5, T5), 
+:- pred sr_util__list_map_foldl3( pred(T1, T2, T3, T3, T4, T4, T5, T5), 
 			list(T1), list(T2),
 			T3, T3, T4, T4, T5, T5).
-:- mode list_map_foldl3( pred(in, out, in, out, in, out, in, out) is det,
+:- mode sr_util__list_map_foldl3( pred(in, out, in, out, in, out, in, out) is det,
 			in, out, in, out, in, out, in, out) is det.
 
-:- pred list_ho_member(pred(T,T), T, list(T)).
-:- mode list_ho_member(pred(in, in) is semidet, in, in) is semidet.
+:- pred sr_util__list_ho_member(pred(T,T), T, list(T)).
+:- mode sr_util__list_ho_member(pred(in, in) is semidet, in, in) is semidet.
 
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
@@ -58,15 +52,6 @@
 :- implementation.
 
 :- import_module int.
-
-compute_real_headvars( HLDS, PredId, ProcInfo, HVS ) :- 
-	module_info_pred_info( HLDS, PredId, PredInfo),
-	pred_info_arity(PredInfo, Arity),
-	proc_info_headvars(ProcInfo, HeadVars),
-	list__length(HeadVars, PseudoArity) ,
-        NumberOfTypeInfos = PseudoArity - Arity ,
-        list_drop_det(NumberOfTypeInfos, HeadVars, RealHeadVars) ,
-        HVS = RealHeadVars.
 
 list_drop_det(Len,List,End):-
         (

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