Commit Graph

2 Commits

Author SHA1 Message Date
Andrew Bromage
04125e10ba Fix a bug in the writing of .opt files.
Estimated hours taken: 1

Fix a bug in the writing of .opt files.

The problem occurs when you have a pragma inline declaration for an
exported function.  The declaration:

:- func addone(int) = int.
:- pragma inline(addone/1).
addone(I) = I + 1.

gets written to the .opt file as:

:- pragma inline((foo:addone)/2).

That is, the arity of the _predicate_ version is written rather than
the arity of the _function_.

compiler/intermod.m:
compiler/mercury_to_mercury.m:
	Add a pred_or_func argument to mercury_output_pragma_decl,
	and use that to determine the declared arity.

tests/valid/intermod_test.m:
tests/valid/intermod_test2.m:
	Regression test.
1997-11-21 00:38:57 +00:00
Simon Taylor
620b1a1162 Test case for inter-module optimization.
Estimated hours taken: 0.2

tests/valid/intermod_test.m
tests/valid/intermod_test2.m
	Test case for inter-module optimization.
1997-06-29 23:23:32 +00:00