CV qualifier and substitutions

Alain Miniussi alainm at cup.hp.com
Mon Apr 10 18:20:21 UTC 2000


Jim Dehnert wrote:
> 
> So, to restate Alain's note, the issue is this:
> 
> - The current definition treats the intermediately-qualified types to
>   be substituted, maximizing substitutability in some sense.
> 
> - But some implementations don't maintain internal symbol table entries
>   for the intermediate types.  So this probably violates our principle
>   of only mangling things with a convenient symbol table handle, for
>   those implementations at least.
> 
> Should we eliminate substitution for the intermediates, losing some
> opportunities but maybe easing some implementations?

Note that we don't lose a lot of opportunities, we are still able to
substitute the type and the cv-qualified type as long as the
cv qualification is the same (probably the most common case).
Basicaly, if we consider  V K r, we loose at most 2 charaters in
a given mangled name (ie, the loose is not repeated) and only if 
the second qualification is a suffix of the first one. 

> Can we get people's reactions to this issue?
> 
> Jim
> 
> > Date: Fri, 07 Apr 2000 17:42:14 -0700
> > From: Alain Miniussi <alainm at cup.hp.com>
> >
> > CV-qualifiers appears in two productions of the mangling grammar:
> > <type> ::= <CV-qualifier> <type> (actually, the <type> is missing
> >                                   in the html document)
> 
> It's there, in the  production -- not highly intuitive
> naming, I suppose.

You are right, but then, I am not sure how <CV-qualifier> fits in the 
<qualified-name> production (but I didn't had a close look).
 
> > <qualified-name> = <CV-qualifier> <qualified-name>
> >
> > It raise a question wrt substitution, consider the declaration:
> >      int* volatile const restrict p
> > Those mangled type is:
> >      rVKPi
> >
> > If i am correct, at the end of this mangled sample, we have:
> >
> > <type> S3_
> >   <cv>
> >     "restrict"
> >   <type> s2_
> >      <cv>
> >         "volatile"
> >      <type> S1_
> >         <cv>
> >           "const"
> >         <type> S0_
> >            "pointer to"
> >            <type> S_
> >              <builtin>
> >                  "int"
> >
> > IOW, the CV qualification is decomposed and "int*" "int* const"
> > "int* const volatile" "int* const volatile restrict" are all
> > possible sources for future substitution.
> >
> > Now, my question is: since a possible (widely used ?) implementation
> > for cv qualified name is to associate a cv-mask with a type (ie, we
> > don't systematicaly have a representation for each possible source
> > of substitution), maybe it would be better to only allow (just to
> > give the idea):
> >
> > <type> ::= <CV-qualifier>* <type>
> >
> > <type> S1_
> >   <cv>
> >     "restrict"
> >   <cv>
> >     "volatile"
> >   <cv>
> >     "const"
> >   <type> s0_
> >      "pointer to"
> >       <type> S_
> >         <builtin>
> >           "int"
> >
> > Any opinion ?
> >
> > Alain
> >
> -           Jim Dehnert         dehnert at sgi.com
>                                 (650)933-4272




More information about the cxx-abi-dev mailing list