[m-rev.] for review: C foreign types

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 19 14:05:51 AEDT 2002


On 18-Mar-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> > Why are you checking the value of the `target_code_only' option here?
> > That should be completely irrelevant.  Checking that here is wrong.
> > Maybe there is something you need to check, but `target_code_only' is not it.
> This is the code that checks that there is pragma foreign_type for the
> backend target that you are compiling to.  I was under the impression
> that target_code_only was set whenever you were actually compiling to a
> specific backend.

No.  `--target-code-only' is set if you are generating *only* target code,
not object code.  If you are generating target code and then compiling
that target code to object code, then `--target-code-only' will not be set.

> What I was worried about was having the check be
> enabled when for example you were writing out the interface file.
> 
> Do you know what option I should check?

You would need to use something like

		{ bool__or_list([GenerateDependencies, MakeInterface,
			MakePrivateInterface, MakeShortInterface,
			MakeOptimizationInt, MakeTransOptInt,
			ConvertToMercury, TypecheckOnly, ErrorcheckOnly

Although ideally it should be abstracted out into a sub-routine.

Or alternatively you could add a new compiler option, for internal
use only, and set it appropriately in handle_options.m.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  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