diff: pragma obsolete bugfix

Fergus Henderson fjh at cs.mu.oz.au
Mon Jul 14 15:59:48 AEST 1997


compiler/simplify.m:
	Don't warn about (directly) recursive calls to `pragma obsolete'
	predicates, because that causes spurious warnings, in the case
	of builtin predicates or predicates defined using pragma C code.

Index: simplify.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/simplify.m,v
retrieving revision 1.38
diff -u -r1.38 simplify.m
--- simplify.m	1997/07/12 17:40:36	1.38
+++ simplify.m	1997/07/14 05:56:45
@@ -402,7 +402,16 @@
 		simplify_info_get_module_info(Info0, ModuleInfo),
 		module_info_pred_info(ModuleInfo, PredId, PredInfo),
 		pred_info_get_marker_list(PredInfo, Markers),
-		list__member(request(obsolete), Markers)
+		list__member(request(obsolete), Markers),
+		%
+		% Don't warn about directly recursive calls.
+		% (That would cause spurious warnings, particularly
+		% with builtin predicates, or preds defined using
+		% pragma c_code.)
+		%
+		simplify_info_get_det_info(Info0, DetInfo0),
+		det_info_get_pred_id(DetInfo0, ThisPredId),
+		PredId \= ThisPredId
 	->
 
 		goal_info_get_context(GoalInfo, Context1),
-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list