Mangling issues

Martin von Loewis loewis at informatik.hu-berlin.de
Thu Mar 2 13:46:30 UTC 2000


While reviewing the mangling spec, I found a number of open questions,
which you may want to consider today:

1. When compressing names using S backward references, is the usage of
   such a backward reference a type as well? I.e. given

   void foo(Hello,World,World,Hello)

   is this 

   _Z3foo5Hello5WorldS1_S3_

   or is this

   _Z3foo5Hello5WorldS1_S2_

   instead (in which case the occurence of S1_ would not be counted as
   a type). My feeling is that those backward references count as
   types themselves, so the first answer would be correct.

2. When composing types using qualifiers, do the nested types get
   numbers as well? I.e. given

   void foo(Hello&,Hello,Hello&)

   is that

   _Z3fooR5Hello5HelloS2_

   (as suggested by example 7), or is there a way to refer to Hello
   already in the second parameter - even though the first parameter
   is Hello&, not Hello. If so, do the enclosed types come before or
   after the composed types, i.e. is the example mangled as

   _Z3fooR5HelloS1_S3_

   or is it

   _Z3fooR5HelloS2_S2_

   Also, if there is a way to refer back to a composed type either by
   composing it again, or by referring to a earlier composition -
   which one must be used? E.g. in the third parameter, it could be
   either one of above solutions, or, say

   _Z3fooR5HelloS1_RS1_

   This alternative uses the most recent encoding of Hello, and
   composes it to get something that is strictly shorter than the
   uncompressed version. Of course, referring to a less recent but
   more composed type would give better compression.

Regards,
Martin





More information about the cxx-abi-dev mailing list