Mangling issues from today's meeting

Jim Dehnert dehnert at baalbek.engr.sgi.com
Fri May 5 01:24:28 UTC 2000


In today's C++ ABI meeting, we agreed that it was desirable to make
two changes in the substitution algorithm for mangling.  Since they're
significant, and some key people weren't there, I'll raise them in
email and listen for howls...

 1) To eliminate even the theoretical need to do a full unsubstituted
    mangling to get the length, we want to change the rule that
    substitution only occurs if it shortens the unsubstituted name.
    Instead, we want to say that (a) builtin types, and (b) template
    parameters are never substituted (and don't go into the dictionary
    for numbering), but everything else is always substituted without
    regard to length.

    There is a residual issue that didn't come up at the time:  does
    (a) include qualified builtin types like "const int"?  If sometimes
    but not always, where do we put the line?  I think that at least
    vendor-defined qualifiers should cause substitution.

 2) The numbering of substitution entities is defined as most recent
    first.  The original reason for that was so that a particular
    entity, once mangled as part of one name, could be mangled the
    same way as part of another name.  A month or so ago, we determined
    that this doesn't (and can't) work, and eliminated duplicates in
    the substitution dictionary on this basis.

    Numbering the entities backwards, however, has the effect that even
    within a single name, the substitution for a particular entity is
    always changing.  Although the implementation difference is trivial,
    the names would be easier for a mere human to read and explain if
    the numbering was forwards, i.e. the first one encountered is
    always S_, the second is S0_, etc.

Anyone have comments on either of these changes?  If so, please explain.
Otherwise, I'll make the changes early next week.

Jim

-		Jim Dehnert  x3-4272




More information about the cxx-abi-dev mailing list