From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95449 invoked by alias); 28 Jul 2018 14:06:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 95035 invoked by uid 89); 28 Jul 2018 14:06:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f48.google.com Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Jul 2018 14:06:10 +0000 Received: by mail-oi0-f48.google.com with SMTP id q11-v6so13978126oic.12 for ; Sat, 28 Jul 2018 07:06:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:531d:0:0:0:0:0 with HTTP; Sat, 28 Jul 2018 07:05:48 -0700 (PDT) In-Reply-To: <1532730752-10525-4-git-send-email-dmalcolm@redhat.com> References: <1532730752-10525-1-git-send-email-dmalcolm@redhat.com> <1532730752-10525-4-git-send-email-dmalcolm@redhat.com> From: Jason Merrill Date: Sat, 28 Jul 2018 14:06:00 -0000 Message-ID: Subject: Re: [PATCH 3/5] C++: clean up cp_printer To: David Malcolm Cc: gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg01790.txt.bz2 OK. On Sat, Jul 28, 2018 at 8:02 AM, David Malcolm wrote: > This makes it easier to compare cp_printer with gcc_cxxdiag_char_table > in c-format.c. > > No functional change intended. > > gcc/cp/ChangeLog: > * error.c (cp_printer): In the leading comment, move "%H" and "I" > into alphabetical order, and add missing "%G" and "K". Within the > switch statement, move cases 'G', 'H', 'I' and 'K" so that the > cases are in alphabetical order. > --- > gcc/cp/error.c | 46 ++++++++++++++++++++-------------------------- > 1 file changed, 20 insertions(+), 26 deletions(-) > > diff --git a/gcc/cp/error.c b/gcc/cp/error.c > index b0d8e32..7a644fd 100644 > --- a/gcc/cp/error.c > +++ b/gcc/cp/error.c > @@ -4025,6 +4025,10 @@ defer_phase_2_of_type_diff (deferred_printed_type *deferred, > %D declaration. > %E expression. > %F function declaration. > + %G gcall * > + %H type difference (from). > + %I type difference (to). > + %K tree > %L language as used in extern "lang". > %O binary operator. > %P function parameter whose position is indicated by an integer. > @@ -4032,9 +4036,7 @@ defer_phase_2_of_type_diff (deferred_printed_type *deferred, > %S substitution (template + args) > %T type. > %V cv-qualifier. > - %X exception-specification. > - %H type difference (from) > - %I type difference (to). */ > + %X exception-specification. */ > static bool > cp_printer (pretty_printer *pp, text_info *text, const char *spec, > int precision, bool wide, bool set_locus, bool verbose, > @@ -4076,6 +4078,21 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec, > break; > case 'E': result = expr_to_string (next_tree); break; > case 'F': result = fndecl_to_string (next_tree, verbose); break; > + case 'G': > + percent_G_format (text); > + return true; > + case 'H': > + defer_phase_2_of_type_diff (&postprocessor->m_type_a, next_tree, > + buffer_ptr, verbose, *quoted); > + return true; > + case 'I': > + defer_phase_2_of_type_diff (&postprocessor->m_type_b, next_tree, > + buffer_ptr, verbose, *quoted); > + return true; > + case 'K': > + t = va_arg (*text->args_ptr, tree); > + percent_K_format (text, t); > + return true; > case 'L': result = language_to_string (next_lang); break; > case 'O': result = op_to_string (false, next_tcode); break; > case 'P': result = parm_to_string (next_int); break; > @@ -4090,29 +4107,6 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec, > case 'V': result = cv_to_string (next_tree, verbose); break; > case 'X': result = eh_spec_to_string (next_tree, verbose); break; > > - case 'G': > - percent_G_format (text); > - return true; > - > - case 'K': > - t = va_arg (*text->args_ptr, tree); > - percent_K_format (text, t); > - return true; > - > - case 'H': > - { > - defer_phase_2_of_type_diff (&postprocessor->m_type_a, next_tree, > - buffer_ptr, verbose, *quoted); > - return true; > - } > - > - case 'I': > - { > - defer_phase_2_of_type_diff (&postprocessor->m_type_b, next_tree, > - buffer_ptr, verbose, *quoted); > - return true; > - } > - > default: > return false; > } > -- > 1.8.5.3 >