[m-rev.] for post-commit review: local foreign_decl's

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jun 19 16:59:10 AEST 2004


On 09-Jun-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> For review by Fergus, if he has the time.

I can at least review the documentation.

> +By default, the contents of @samp{pragma foreign_decl} declarations
> +are also visible in the same kinds of declarations in other modules
> +that import the module containing the @samp{pragma foreign_decl} declaration.
> +This is because they may be required to make sense of
> +types defined using @samp{pragma foreign_type} and/or
> +predicates defined using @samp{pragma foreign_code}
> +in the containing module,
> +and these may be visible in other modules,
> +especially in the presence of intermodule optimization,
> +
> +If you do not want the contents of a @samp{pragma foreign_decl} declaration
> +to be visible in foreign language code in other modules,
> +you can use the following variant of the declaration:
> +
> + at example
> +:- pragma foreign_decl("@var{Lang}", local, @var{DeclCode}).
> + at end example

I have a few questions:

- Does this declaration imply that any code which makes use of the
foreign_decl cannot be cross-module inlined?

If yes:
- Since the compiler can't easily tell when foreign code makes use of
a foreign decl, does that mean that this declaration entirely prevents
cross-module inlining of any foreign code from the module which contains it?

If no:
- How can the compiler do cross-module inlining in a way that preserves
the documented semantics of the 'local' annotation?

Cheers,
	Fergus.

-- 
Fergus Henderson                    |  "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-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