Mangling: Back-referencing in compressions

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Mar 21 22:06:18 UTC 2000


I still find the description of the compression scheme confusing,
especially the sentence:

  All substitutable components are so numbered, including those that
  have been substituted already, but the substitution occurs only if
  "S<number>_" is strictly shorter than the unsubstituted encoding.

What I don't understand here is what exactly goes into the catalog, if
substitution occurs. Given

 void foo(Outer::Inner::x, Outer::Inner::y, Outer::Other)

I get (starting with least recent)

  Outer
  Outer::Inner
  Outer::Inner::x

so I can express the second parameter as S2_::y. After that, do I have a
catalog of

  Outer, Outer::Inner, Outer::Inner::x
  Outer, Outer::Inner, Outer::Inner::y

(ie. in case of substitution, all subcomponents went into the
catalog), or do I get

  Outer, Outer::Inner, Outer::Inner::x
  Outer::Inner, Outer::Inner::y

(i.e. only the entire substituted component goes into the
catalog). Depending on that, the external name would be either
_Z3fooN5Outer5Inner1xENS2_1yENS3_5OtherE or
_Z3fooN5Outer5Inner1xENS2_1yENS5_5OtherE

I think it would be sufficient to put only the entire component into
the catalog (*); its components are already in the catalog (further
back), so the can be identified as well.

Regards,
Martin

(*) This is different from what I wrote in an earlier message; I now
think there is no point in putting all elements of a deep structure
into the catalog, since that only results in a larger catalog, with no
benefit.




More information about the cxx-abi-dev mailing list