[m-dev.] [reuse] diff: no termination info for reuse-predicates

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Tue Nov 21 21:35:26 AEDT 2000


Hi,


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


Estimated hours taken: 0.5

Make sure that no termination-info is written out for compiler
generated extra reuse-predicates ("reuse__...").

code_util.m:
	New predicate to check whether a predicate is a reuse
	compiler generated predicate.

sr_split.m:
termination.m:
trans_opt.m:
	Do not output termination info of compiler generated
	reuse predicates.


Index: code_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.123.2.3
diff -u -r1.123.2.3 code_util.m
--- code_util.m	2000/11/13 18:35:34	1.123.2.3
+++ code_util.m	2000/11/21 10:32:26
@@ -130,6 +130,12 @@
 :- pred code_util__compiler_generated(pred_info).
 :- mode code_util__compiler_generated(in) is semidet.
 
+	% code_util__reuse_compiler_generated(PredInfo) succeeds iff
+	% the PredInfo is for a compiler generated separate reuse-predicate
+	% (reuse__*).
+:- pred code_util__reuse_compiler_generated(pred_info).
+:- mode code_util__reuse_compiler_generated(in) is semidet.
+
 :- pred code_util__predinfo_is_builtin(pred_info).
 :- mode code_util__predinfo_is_builtin(in) is semidet.
 
@@ -445,6 +451,11 @@
 	pred_info_name(PredInfo, PredName),
 	pred_info_arity(PredInfo, PredArity),
 	special_pred_name_arity(_, _, PredName, PredArity).
+
+:- import_module sr_split.
+code_util__reuse_compiler_generated(PredInfo) :-
+	pred_info_name(PredInfo, PredName), 
+	sr_split__reuse_predicate_name(PredName).
 
 %-----------------------------------------------------------------------------%
 
Index: sr_split.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Attic/sr_split.m,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 sr_split.m
--- sr_split.m	2000/10/15 17:23:49	1.1.2.6
+++ sr_split.m	2000/11/21 10:32:29
@@ -14,7 +14,7 @@
 :- module sr_split.
 :- interface.
 
-:- import_module hlds_module, io.
+:- import_module hlds_module, io, string.
 :- import_module hlds_pred, sr_data, std_util, hlds_goal.
 
 	% create_multiple_versions( VirginHLDS, ReuseHLDS, FinalHLDS ).
@@ -29,6 +29,9 @@
 		maybe(hlds_goal)::in,
 		module_info::in, module_info::out) is det.
 
+:- pred reuse_predicate_name(string).
+:- mode reuse_predicate_name(in) is semidet.
+
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -39,6 +42,9 @@
 :- import_module hlds_goal, prog_data, hlds_data, prog_util. 
 :- import_module sr_data. 
 
+
+reuse_predicate_name(PredName) :- 
+	string__prefix(PredName, "reuse__").
 
 sr_split__create_multiple_versions( VirginHLDS, ReuseHLDS, HLDS) --> 
 		% compute the strongly connected components
Index: termination.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.20.4.1
diff -u -r1.20.4.1 termination.m
--- termination.m	2000/09/25 17:05:23	1.20.4.1
+++ termination.m	2000/11/21 10:32:29
@@ -700,6 +700,7 @@
 	( 
 		{ ImportStatus = exported },
 		{ \+ code_util__compiler_generated(PredInfo) },
+		{ \+ code_util__reuse_compiler_generated(PredInfo) }, 
 
 		% XXX These should be allowed, but the predicate
 		% declaration for the specialized predicate is not produced
Index: trans_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trans_opt.m,v
retrieving revision 1.15.4.4
diff -u -r1.15.4.4 trans_opt.m
--- trans_opt.m	2000/10/15 17:23:50	1.15.4.4
+++ trans_opt.m	2000/11/21 10:32:29
@@ -146,27 +146,6 @@
 		(
 			{ PossibleAliases = yes }
 		->
-		% output type-information.
-		io__write_string(
-			"\n%----------- type-definitions ------------- \n\n"),
-		{ module_info_types( Module, TypesMap ) }, 
-		{ map__to_assoc_list( TypesMap, AllTypes) }, 
-		{ list__filter( 
-			pred( P::in ) is semidet :- 
-			    ( P = _TId - TDefn, 
-			      hlds_data__get_type_defn_status( TDefn, Stat), 
-			      ( hlds_pred__status_defined_in_this_module( Stat,
-								yes )
-			%	;
-			%	Stat = opt_imported
-			      )
-			    ),
-			AllTypes, 
-			_Types ) },
-		% { Types = AllTypes },
-			% XXX not necessary!
-		% intermod__write_types( Types ), 
-
 		% output possible-alias information.
 		io__write_string(
 			"\n%----------- pa_alias_info/3 ------------- \n\n"),

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