handle <local-source-name> in demangler

Ian Lance Taylor iant@google.com
Thu Nov 9 00:37:00 GMT 2006


Geoffrey Keating <geoffk@apple.com> writes:

> > How about adding a case to local-name?
> >
> > <local-name> ::= Z <(function) encoding> E <(entity) name> [<discriminator>]
> >              ::= Z <(function) encoding> E s [<discriminator>]
> >              ::= Z E <source-name> <discriminator>
> >
> > This is unambiguous, as 'E' can not appear at the start of <encoding>.
> > It is very unlikely that we would ever want 'E' to appear at the start
> > of <encoding>, since it is used in a number of places to mark the end
> > of a list.
> 
> You mean, in addition to the <local-source-name> change?

No, I meant that that would be the only change.  All you need is a
new way to mangle private names, right?  So then you would get, e.g.,
    _ZZE3foo_3

> This seems a little complex to me.  Maybe it would be easier to just do
> 
>      <unqualified-name> ::= <operator-name>
>                         ::= <ctor-dtor-name>
>                         ::= <source-name>
> 		       ::= <local-source-name>   // new
> 
>      <local-source-name> ::= Z E <source-name> <discriminator>  // new

I would prefer that we handle this exclusively within d_local_name, to
simplify matters.  That is what I was trying to suggest.

Ian



More information about the Binutils mailing list