Mangling: Special names
Martin von Loewis
loewis at informatik.hu-berlin.de
Mon Mar 27 22:09:14 UTC 2000
> 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.
Regards,
Martin
More information about the cxx-abi-dev
mailing list