public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [PATCH 3/5] C++: clean up cp_printer
Date: Fri, 27 Jul 2018 21:47:00 -0000	[thread overview]
Message-ID: <1532730752-10525-4-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1532730752-10525-1-git-send-email-dmalcolm@redhat.com>

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

  parent reply	other threads:[~2018-07-27 21:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 21:47 [PATCH 0/5] dump_printf support for middle-end types David Malcolm
2018-07-27 21:47 ` [PATCH 2/5] dumpfile.c: eliminate special-casing of dump_file/alt_dump_file David Malcolm
2018-07-31 12:54   ` Richard Biener
2018-07-31 15:34     ` David Malcolm
2018-07-31 15:37       ` Richard Biener
2018-07-27 21:47 ` [PATCH 4/5] c-family: clean up the data tables in c-format.c David Malcolm
2018-07-31 12:56   ` Richard Biener
2018-07-31 13:08     ` Marek Polacek
2018-07-27 21:47 ` [PATCH 5/5] Formatted printing for dump_* in the middle-end David Malcolm
2018-07-31 13:03   ` Richard Biener
2018-07-31 14:19     ` David Malcolm
2018-07-31 14:21       ` Richard Biener
2018-07-31 14:33         ` Richard Biener
2018-07-31 19:56       ` Joseph Myers
2018-08-02 17:09         ` [PATCH] v2: " David Malcolm
2018-08-09 22:11           ` Joseph Myers
2018-08-17  4:08           ` Jeff Law
2018-08-17 18:24             ` David Malcolm
2018-08-27  6:58           ` Jakub Jelinek
2018-08-27 23:46             ` [PATCH] Fix version check for ATTRIBUTE_GCC_DUMP_PRINTF David Malcolm
2018-08-28  6:44               ` Jakub Jelinek
2018-08-28 12:26                 ` Jakub Jelinek
2018-08-28 14:19                   ` David Malcolm
2018-07-27 21:47 ` [PATCH 1/5] Simplify dump_context by adding a dump_loc member function David Malcolm
2018-07-31 12:51   ` Richard Biener
2018-07-27 21:47 ` David Malcolm [this message]
2018-07-28 14:06   ` [PATCH 3/5] C++: clean up cp_printer Jason Merrill
2018-07-31 12:50 ` [PATCH 0/5] dump_printf support for middle-end types Richard Biener
2018-07-31 14:01   ` David Malcolm

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=1532730752-10525-4-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).