From: Cary Coutant <ccoutant@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
Ian Lance Taylor <iant@google.com>
Subject: Re: [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters
Date: Fri, 30 May 2014 17:37:00 -0000 [thread overview]
Message-ID: <CAHACq4rB4hFWj9ouX_+3yxVfpFiiwVNFXCDTyTKJxi01=MmiYQ@mail.gmail.com> (raw)
In-Reply-To: <1401191856-27585-3-git-send-email-palves@redhat.com>
> Fix this by adding a new DEMANGLE_COMPONENT_CONVERSION component type,
> which does what DEMANGLE_COMPONENT_CAST does today, and making
> DEMANGLE_COMPONENT_CAST just simply print its component subtree.
>
> I think we could instead reuse DEMANGLE_COMPONENT_CAST and in
> d_print_comp_inner still do:
>
> @@ -5001,9 +5013,9 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
> d_print_comp (dpi, options, dc->u.s_extended_operator.name);
> return;
>
> case DEMANGLE_COMPONENT_CAST:
> d_append_string (dpi, "operator ");
> - d_print_cast (dpi, options, dc);
> + d_print_conversion (dpi, options, dc);
> return;
>
> leaving the unary cast case below calling d_print_cast, but seems to
> me that spliting the component types makes it easier to reason about
> the code.
I agree.
> libiberty/
> 2014-05-27 Pedro Alves <palves@redhat.com>
>
> PR other/61321
> PR other/61233
> * demangle.h (enum demangle_component_type)
> <DEMANGLE_COMPONENT_CONVERSION>: New value.
> * cp-demangle.c (d_demangle_callback, d_make_comp): Handle
> DEMANGLE_COMPONENT_CONVERSION.
> (is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
> instead of DEMANGLE_COMPONENT_CAST.
> (d_operator_name): Return a DEMANGLE_COMPONENT_CONVERSION
> component if handling a conversion.
> (d_count_templates_scopes, d_print_comp_inner): Handle
> DEMANGLE_COMPONENT_CONVERSION.
> (d_print_comp_inner): Handle DEMANGLE_COMPONENT_CONVERSION instead
> of DEMANGLE_COMPONENT_CAST.
> (d_print_cast): Rename as ...
> (d_print_conversion): ... this. Adjust comments.
> (d_print_cast): Rewrite - simply print the left subcomponent.
> * cp-demint.c (cplus_demangle_fill_component): Handle
> DEMANGLE_COMPONENT_CONVERSION.
>
> * testsuite/demangle-expected: Add tests.
Looks good to me. Thanks!
Ian, does this look good to you?
-cary
next prev parent reply other threads:[~2014-05-30 17:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-27 11:57 [PATCH 0/3] mangler/demangler dogfooding Pedro Alves
2014-05-27 11:57 ` [PATCH 3/3] " Pedro Alves
2014-05-27 18:16 ` Mike Stump
2014-05-28 22:31 ` [PATCH v2 " Pedro Alves
2014-06-02 13:38 ` Jason Merrill
2014-05-27 11:57 ` [PATCH 1/3] Fix demangler testsuite crashes with CP_DEMANGLE_DEBUG defined Pedro Alves
2014-05-27 13:56 ` Ian Lance Taylor
2014-05-28 22:20 ` Pedro Alves
2014-05-27 11:57 ` [PATCH 2/3] PR other/61321 - demangler crash on casts in template parameters Pedro Alves
2014-05-30 17:37 ` Cary Coutant [this message]
2014-05-30 18:05 ` Ian Lance Taylor
2014-05-30 19:00 ` Pedro Alves
2014-06-02 13:42 ` Jason Merrill
2014-07-24 22:44 ` Cary Coutant
2014-07-25 9:55 ` Pedro Alves
2014-10-13 18:46 ` Cary Coutant
2014-11-10 21:45 ` Cary Coutant
2014-11-12 15:16 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHACq4rB4hFWj9ouX_+3yxVfpFiiwVNFXCDTyTKJxi01=MmiYQ@mail.gmail.com' \
--to=ccoutant@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=iant@google.com \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).