[m-rev.] for review: don't issue warnings over promise_pure so often
Tyson Dowd
trd at cs.mu.OZ.AU
Sat Feb 9 19:15:31 AEDT 2002
Hi,
This should improve the situation with regards to sourceforge bug
514142. It will now be ok to have both a promise_pure pragma and an
attribute on the foreign_proc.
===================================================================
Estimated hours taken: 4
Branches: main
compiler/purity.m:
Don't issue warnings about unnecessary promise pure declarations
if they refer to a pragma or mixed clauses and pragma clause.
These are only marginally useful, and can cause problems.
We might want a promise_pure pragma to handle multiple
clauses with different modes, and it should still be fine to have
promise_pure attributes on any foriegn_procs used to implement
the predicate.
Index: compiler/purity.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/purity.m,v
retrieving revision 1.41
diff -u -r1.41 purity.m
--- compiler/purity.m 30 Jan 2002 01:40:30 -0000 1.41
+++ compiler/purity.m 8 Feb 2002 03:40:03 -0000
@@ -884,7 +884,9 @@
PurityCheckResult = inconsistent_promise
;
% You shouldn't promise pure unnecessarily.
- PromisedPurity \= (impure), ActualPurity = PromisedPurity
+ % It's OK in the case of foreign_procs though.
+ PromisedPurity \= (impure), ActualPurity = PromisedPurity,
+ not pred_info_pragma_goal_type(PredInfo)
->
PurityCheckResult = unnecessary_promise_pure
;
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list