This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][libstdc++ patch][c++ patch] Update mangling and demangling for rvalue references
Douglas Gregor <doug.gregor@gmail.com> writes:
> On Fri, 2007-06-29 at 21:20 -0700, Ian Lance Taylor wrote:
> > "Doug Gregor" <doug.gregor@gmail.com> writes:
> >
> > > On 29 Jun 2007 17:16:38 -0700, Ian Lance Taylor <iant@google.com> wrote:
> > > > Please put this up just after DEMANGLE_COMPONENT_REFERENCE.
> > >
> > > I can do that. My understanding was that include/demangle.h was a
> > > public interface, so I planned to put the new enumerator values at the
> > > bottom to keep the existing values the same.
> > >
> > > If that doesn't mater, it's cleaner to put it under
> > > DEMANGLE_COMPONENT_REFERENCE, of course.
> >
> > It is a public interface, but I don't see why the specific existing
> > values of the enumerators should matter.
>
> Keeping the ABI backward-compatible? If we just tack on the C++0x
> interface enumerators at the end, code compiled against older versions
> of the demangler will still continue to work so long as they only try to
> work with C++98 constructs. It's weak backward compatibility, but it
> might be useful.
In libstdc++/libsupc++, the only interfaces we expose are
__cxa_demangle and __gcclibcxx_demangle_callback. We don't expose the
cplus_demangle_v3_components function which is the only way to get the
enum values out, nor do we expose the cplus_demangle_print or
cplus_demangle_print_callback functions which are the only supported
ways to use them. So there is no ABI issue with libstdc++/libsupc++.
The interface is public in libiberty, but we don't provide any way to
build a libiberty.so shared library, only a libiberty.a library.
Anybody who is linking against libiberty.a should use the
corresponding version of demangle.h. So there is no ABI issue there
either.
So I think that changing enum values is OK.
The interface exists for use within gdb, which uses it to pull apart
mangled names for various reasons. I would be surprised if anybody
else uses it.
Ian