This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libiberty: support demangling of rvalue reference typenames
- From: Ian Lance Taylor <iant at google dot com>
- To: Artemiy Volkov <artemiyv at acm dot org>
- Cc: Ian Lance Taylor <ian at airs dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, DJ Delorie <dj at redhat dot com>
- Date: Tue, 5 Jan 2016 07:26:36 -0800
- Subject: Re: [PATCH] libiberty: support demangling of rvalue reference typenames
- Authentication-results: sourceware.org; auth=none
- References: <1451958209-29170-1-git-send-email-artemiyv at acm dot org> <m3y4c45zm3 dot fsf at pepe dot airs dot com> <20160105075727 dot GA2876 at gmail dot com> <m3twms5f97 dot fsf at pepe dot airs dot com> <20160105135903 dot GA32467 at gmail dot com>
On Tue, Jan 5, 2016 at 5:59 AM, Artemiy Volkov <artemiyv@acm.org> wrote:
> On Tue, Jan 05, 2016 at 05:26:28AM -0800, Ian Lance Taylor wrote:
>> Artemiy Volkov <artemiyv@acm.org> writes:
>>
>> > On Mon, Jan 04, 2016 at 10:06:44PM -0800, Ian Lance Taylor wrote:
>> >> Artemiy Volkov <artemiyv@acm.org> writes:
>> >>
>> >> > This patch adds handling of 'O' (rvalue ref) type codes in the C++
>> >> > demangling
>> >> > code which is done similarly to the 'R' (regular references)
>> >> > case. It also adds
>> >> > a few testcases for various demangling styles which are just
>> >> > mirrored versions
>> >> > of the corresponding regular references demangling tests.
>> >> >
>> >> > libiberty/ChangeLog:
>> >> >
>> >> > 2016-01-04 Artemiy Volkov <artemiyv@acm.org>
>> >> >
>> >> > * cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference
>> >> > constant.
>> >> > (demangle_template_value_parm): Handle tk_rvalue_reference
>> >> > type kind.
>> >> > (do_type): Support 'O' type id (rvalue references).
>> >>
>> >> Is there a compiler that actually generate these symbols?
>> >
>> > Sure, at least gcc and clang generate this. E.g. when compiling:
>> >
>> > void f(int&& b) { }
>> >
>> > you then have:
>> >
>> > â nm 1.o
>> > 0000000000000000 T _Z1fOi
>>
>> That symbol name is handled by code in cp-demangle.c, not cplus-dem.c.
>> It already works today. Try it. cplus-dem is the old (very old)
>> demangler. cp-demangle is the current demangler.
>
> Sorry, I believe I should have mentioned that this patch is for the
> needs of gdb, whose demangle command still pretty much uses the old
> demangler in cplus-dem.c. I was working on rvalue references support in
> gdb (https://sourceware.org/ml/gdb-patches/2015-12/msg00407.html) and
> AIUI all the patches for libiberty should go through this mailing list,
> that's why I sent the libiberty part here to later merge it to gdb.
If gdb is using the code in cplus-dem.c in any way for a program
compiled in the last 15 years, then gdb is doing something horribly
wrong. What function is gdb calling that makes your patch make a
difference?
Ian