[m-dev.] for review: fix inter-module optimization bugs

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Feb 10 16:21:55 AEDT 2001


On 10-Feb-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 07-Feb-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > Estimated hours taken: 3
> > 
> > Fix bugs in `:- pragma import' and `:- pragma export' with
> > inter-module optimizaton reported by Peter Ross (bug #131069).
> > 
> > compiler/mercury_to_mercury.m:
> > 	The code to output `:- pragma import' declarations was
> > 	writing `:- pragma import(p(Arg1::in, Arg2::out), "imported")'.
> > 	The correct output is `:- pragma import(p(in, out), "imported")'.
> > 
> > compiler/mercury_compile.m:
> > 	For modules containing `:- pragma export' declarations, add
> > 	":- pragma c_header_code("#include ModuleName.h")." to
> > 	the `.opt' file so the C compiler can find the function
> > 	prototypes for Mercury predicates exported to C when
> > 	compiling the C code in the `.opt' file.
> > 
> > 	Write the `.h' file for a module when writing the `.opt' file
> > 	when using the LLDS backend to avoid trying to use the `.h' file
> > 	before it has been created.
> 
> That change seems to have broken things.

One reason for that is that it makes the `.opt' files grade-dependent,
since that `#include' is (or should be) added only for the LLDS
back-end, not for the MLDS back-end, but currently it is assumed in
lots of places that `.opt' files are grade-independent.

For now I'm going to back out the change to mercury_compile.m.
You can put it back in if/when the problems are fixed.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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