diff: purity & intermod bug fix
Fergus Henderson
fjh at cs.mu.oz.au
Fri Dec 12 08:19:52 AEDT 1997
Fix bugs that broke impurity declarations if intermodule
optimization was enabled.
compiler/intermod.m:
Don't output `pragma' declarations for purity markers.
compiler/hlds_out.m:
For `promised_pure' markers, write out `promise_pure',
not `promised_pure', so that the pragma name is correct.
Index: intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.37
diff -u -u -r1.37 intermod.m
--- intermod.m 1997/12/09 04:00:47 1.37
+++ intermod.m 1997/12/11 21:06:02
@@ -945,17 +945,19 @@
intermod__write_pragmas(_, _, [], _) --> [].
intermod__write_pragmas(SymName, Arity, [Marker | Markers], PredOrFunc) -->
(
- \+ (
- % Since the inferred declarations are output, these
- % don't need to be done in the importing module.
- { Marker = infer_type }
- ; { Marker = infer_modes }
+ % Since the inferred declarations are output, these
+ % don't need to be done in the importing module.
+ % Also purity is output as part of the pred/func decl.
+ ( { Marker = infer_type }
+ ; { Marker = infer_modes }
+ ; { Marker = (impure) }
+ ; { Marker = (semipure) }
)
+ ;
+ []
->
{ hlds_out__marker_name(Marker, Name) },
mercury_output_pragma_decl(SymName, Arity, PredOrFunc, Name)
- ;
- []
),
intermod__write_pragmas(SymName, Arity, Markers, PredOrFunc).
Index: hlds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.176
diff -u -u -r1.176 hlds_out.m
--- hlds_out.m 1997/12/09 04:00:42 1.176
+++ hlds_out.m 1997/12/11 21:06:26
@@ -511,7 +511,7 @@
hlds_out__marker_name(memo, "memo").
hlds_out__marker_name((impure), "impure").
hlds_out__marker_name((semipure), "semipure").
-hlds_out__marker_name(promised_pure, "promised_pure").
+hlds_out__marker_name(promised_pure, "promise_pure").
hlds_out__marker_name(terminates, "terminates").
hlds_out__marker_name(check_termination, "check_termination").
hlds_out__marker_name(does_not_terminate, "does_not_terminate").
--
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