[m-rev.] diff: fix hlc link problem

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 21 19:31:19 AEDT 2002


On 18-Jan-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> I couldn't find any place that documents the naming scheme being followed 
> by the compiler for the TypeCtorInfos it generates in hlc grades

The naming scheme used for module-qualified RTTI data in the MLDS->C
back-end is "<MLDS package name>__<rtti name>", where the <rtti name>
is determined by rtti__addr_to_string.  The <MLDS package name> is the
same as the HLDS module name, except that modules in the Mercury standard
library get "mercury__" prefixed to their name.  For type_ctor_infos the
<rtti name> is "<HLDS module name>__type_ctor_info_<type name>_<type arity>".
As usual, the <type name> and each component of the HLDS module name
and MLDS package name are mangled using llds_out__name_mangle to make
sure they are valid for use in C identifiers.

The use of "__" for module qualifiers in the MLDS back-end is documented
in mlds.m.  So is the relationship between MLDS package names and HLDS
module names is documented in mlds.m.  The specific use of
"<MLDS package name>__<rtti name>" is not explicitly documented
anywhere, I'm pretty sure, but it is a fairly straight-forward
consequence of the use of "__" for module qualifiers.

The naming scheme used by rtti__addr_to_string for the <rtti name>
is not documented anywhere, as far as I know.  Hopefully the original
author of that procedure will be able to figure it out from the code ;-)

-- 
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