Mangling: Special names

Christophe de Dinechin ddd at cup.hp.com
Mon Mar 27 23:27:00 UTC 2000


Martin von Loewis wrote:
> 
> > This made me think: does it buy us something to have a special
> > encoding for copy constructor and assignment operator when, for
> > class C, their parameter is const C & ? In general, for members of
> > class C, could we reserve a one letter encoding for const C &?
> 
> I would not think so. If you follow my interpretation (i.e. Cx is an
> <unqualified-name>, qualified by the class of which it is a
> constructor), then the compression dictionary will have the type in it
> already. As a matter of fact, I think 'a::b::c::c(a::b::c const &)'
> will be
> 
> _ZN1a1b1cC1ERKS_
> 
> since the full class name was the last thing put into the dictionary
> when we came to the parameter list (unless the method name is also
> supposed to be in the dictionary, in which case the back-reference
> would be S1_). With a special encoding it would save us a total of one
> character on the first occurence, and nothing on the second - we will
> have the const-reference type already in the dictionary.
> 
> The same reasoning applies to member functions as well - the class
> will be in the compression table when we come to the parameter list.

I agree with all that. I was precisely proposing that we replace RKS_ with, say,
'@'. I believe that's three chars saved each time. Oh well, I don't know if it's
worth it.

Christophe




More information about the cxx-abi-dev mailing list