CV qualifier and substitutions

Jim Dehnert dehnert at baalbek.engr.sgi.com
Sat Apr 8 05:03:32 UTC 2000


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?

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 <CV-qualifier> production -- not highly intuitive
naming, I suppose.

> <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