diff options
author | David Malcolm <dmalcolm@redhat.com> | 2018-07-28 17:03:56 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2018-07-28 17:03:56 +0000 |
commit | 081b70a9021c3aa3a24b7357c0dfb4e39533ec8e (patch) | |
tree | 025b9bfecb995cb66be658580ebf342de2614c72 /gcc | |
parent | 0058495eea5871e12cead59601a5a3117700ee5e (diff) | |
download | gcc-081b70a9021c3aa3a24b7357c0dfb4e39533ec8e.zip gcc-081b70a9021c3aa3a24b7357c0dfb4e39533ec8e.tar.gz gcc-081b70a9021c3aa3a24b7357c0dfb4e39533ec8e.tar.bz2 |
C++: clean up cp_printer
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.
From-SVN: r263046
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/error.c | 46 |
2 files changed, 27 insertions, 26 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4edb661..d3b3cc2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-07-28 David Malcolm <dmalcolm@redhat.com> + + * 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. + 2018-07-25 Jakub Jelinek <jakub@redhat.com> * cp-tree.h (enum cp_tree_index): Add 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; } |