substitutions

Alain Miniussi alainm at cup.hp.com
Tue Apr 18 19:16:38 UTC 2000


Suppose that we need to encode the following 

C1::C2
C1::C3::C4
C1::C3::C5

in a name, we'll get :

N2C12C2E .... NS<n1>_2C32C4E  NS<n2>_2C5E ......

The problem:

We accept the substitution only if the size of the encoded 
substitution is strictly smaller than the size of the
substituted entity.

Now, let's say that S<n2>_ is longuer than S<n1>_2C3, what should
we do ? 
Clearly, we can't write NS<n1>_2C3 instead of S<n2>_ because
n1 does not reffers to the same entity at that point. If we are
ready to replace n1 with it's updated value n1+delta, the rule
and the implementation becomes more complicated (imagine that 
we have something more complex than S<n1>_2C3, with some 
substitued template args and so on...).

Now, the typical size of a substitution will be 3, encoded source 
names are at least 2 char long (and I don't think it's the typical 
size).
So the only "real world" (but every one has it's own, so...) 
waste of space of more than 1 char/substitution I can think of 
involve builtin type. What about supressing the "smaller size" 
rule and saying that builtin types can't be source of further 
substitution ?

Alain




More information about the cxx-abi-dev mailing list