[mercury-users] foreign_decl vs. foreign_code

Michael Day mikeday at bigpond.net.au
Wed Feb 13 12:55:08 AEDT 2002


> Short answer: put what you would put into a .h file into a foreign_decl,
> and what you would put into a .c file into foreign_code. (U of M reference:
> remember the rules I taught in 252.) In this case that requires a declaration
> for the variable that is separate from its definition.

Great, it compiles cleanly in both grades now, using an #ifdef around the 
typedef and a separate variable declaration and definition.

A comparison of the two grades shows that compiling in hlc.gc takes
slightly longer and results in code that runs slightly slower, at least
for this benchmark. I am using -O5 --intermodule-optimization
--trans-intermod-opt --constraint-propagation, are there any other
interesting optimizations I could try that are not enabled by default with
-O5 or -O6? Compiling with -O6 takes twice as long as -O5 and appears to
make no difference to the resulting code :)

Michael

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list