Patchwork [2/2] rm pp_c_base sub classes should just inherit from c_pretty_printer and things should just work

login
register
mail settings
Submitter Trevor Saunders
Date Aug. 1, 2013, 1:14 a.m.
Message ID <1375319690-12939-3-git-send-email-tsaunders@mozilla.com>
Download mbox | patch
Permalink /patch/263854/
State New
Headers show

Comments

Trevor Saunders - Aug. 1, 2013, 1:14 a.m.
bootstrapped and same test results on x86_64-linux-gnu against r201084

gcc/c-family/
	* c-pretty-print.h (PP_C_BASE): remove macro.
	* c-pretty-print.c adjust accordingly.

	gcc/cp/
	* cxx-pretty-print.c adjust accordingly.
	* cxx-pretty-print.h adjust accordingly.
	* error.c adjust accordingly.

---
 gcc/c-family/c-pretty-print.c |  2 +-
 gcc/c-family/c-pretty-print.h | 61 ++++++++++++++++++--------------------
 gcc/cp/cxx-pretty-print.c     | 68 +++++++++++++++++++++----------------------
 gcc/cp/cxx-pretty-print.h     | 43 +++++++++++++--------------
 gcc/cp/error.c                | 13 ++++-----
 5 files changed, 88 insertions(+), 99 deletions(-)
Gabriel Dos Reis - Aug. 1, 2013, 3:04 a.m.
On Wed, Jul 31, 2013 at 8:14 PM, Trevor Saunders <tsaunders@mozilla.com> wrote:
> bootstrapped and same test results on x86_64-linux-gnu against r201084
>
> gcc/c-family/
>         * c-pretty-print.h (PP_C_BASE): remove macro.
>         * c-pretty-print.c adjust accordingly.
>
>         gcc/cp/
>         * cxx-pretty-print.c adjust accordingly.
>         * cxx-pretty-print.h adjust accordingly.
>         * error.c adjust accordingly.

See my comments for the first part of this patch series.
Use inheritance AND virtual functions.  Remove the casts.
Add constructors.

-- Gaby

Patch

diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index b8af90c..b347d44 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -703,7 +703,7 @@  pp_c_direct_declarator (c_pretty_printer *pp, tree t)
     case FUNCTION_DECL:
       pp_c_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
       pp_c_tree_decl_identifier (pp, t);
-      if (pp_c_base (pp)->flags & pp_c_flag_abstract)
+      if (pp->flags & pp_c_flag_abstract)
 	pp_abstract_declarator (pp, TREE_TYPE (t));
       else
 	{
diff --git a/gcc/c-family/c-pretty-print.h b/gcc/c-family/c-pretty-print.h
index 04b72c4..beccc1d 100644
--- a/gcc/c-family/c-pretty-print.h
+++ b/gcc/c-family/c-pretty-print.h
@@ -44,9 +44,8 @@  typedef void (*c_pretty_print_fn) (c_pretty_printer *, tree);
 /* The datatype that contains information necessary for pretty-printing
    a tree that represents a C construct.  Any pretty-printer for a
    language using C/c++ syntax can derive from this datatype and reuse
-   facilities provided here.  It can do so by having a subobject of type
-   c_pretty_printer and override the macro pp_c_base to return a pointer
-   to that subobject.  Such a pretty-printer has the responsibility to
+   facilities provided here.  It can do so by having a sub class of 
+   c_pretty_printer.  Such a pretty-printer has the responsibility to
    initialize the pp_base() part, then call pp_c_pretty_printer_init
    to set up the components that are specific to the C pretty-printer.
    A derived pretty-printer can override any function listed in the
@@ -92,70 +91,66 @@  struct c_pretty_print_info
 };
 
 /* Override the pp_base macro.  Derived pretty-printers should not
-   touch this macro.  Instead they should override pp_c_base instead.  */
+   touch this macro.*/
 #undef pp_base
-#define pp_base(PP)  (&pp_c_base (PP)->base)
+#define pp_base(PP)  (&(PP)->base)
 
 
 #define pp_c_tree_identifier(PPI, ID)              \
    pp_c_identifier (PPI, IDENTIFIER_POINTER (ID))
 
 #define pp_declaration(PPI, T)                    \
-   pp_c_base (PPI)->declaration (pp_c_base (PPI), T)
+   PPI->declaration (PPI, T)
 #define pp_declaration_specifiers(PPI, D)         \
-   pp_c_base (PPI)->declaration_specifiers (pp_c_base (PPI), D)
+   PPI->declaration_specifiers (PPI, D)
 #define pp_abstract_declarator(PP, D)             \
-   pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D)
+   PP->abstract_declarator (PP, D)
 #define pp_type_specifier_seq(PPI, D)             \
-   pp_c_base (PPI)->type_specifier_seq (pp_c_base (PPI), D)
+   PPI->type_specifier_seq (PPI, D)
 #define pp_declarator(PPI, D)                     \
-   pp_c_base (PPI)->declarator (pp_c_base (PPI), D)
+   PPI->declarator (PPI, D)
 #define pp_direct_declarator(PPI, D)              \
-   pp_c_base (PPI)->direct_declarator (pp_c_base (PPI), D)
+   PPI->direct_declarator (PPI, D)
 #define pp_direct_abstract_declarator(PP, D)      \
-   pp_c_base (PP)->direct_abstract_declarator (pp_c_base (PP), D)
+   PP->direct_abstract_declarator (PP, D)
 #define pp_ptr_operator(PP, D)                    \
-   pp_c_base (PP)->ptr_operator (pp_c_base (PP), D)
+   PP->ptr_operator (PP, D)
 #define pp_parameter_list(PPI, T)                 \
-  pp_c_base (PPI)->parameter_list (pp_c_base (PPI), T)
+  PPI->parameter_list (PPI, T)
 #define pp_type_id(PPI, D)                        \
-  pp_c_base (PPI)->type_id (pp_c_base (PPI), D)
+  PPI->type_id (PPI, D)
 #define pp_simple_type_specifier(PP, T)           \
-  pp_c_base (PP)->simple_type_specifier (pp_c_base (PP), T)
+  PP->simple_type_specifier (PP, T)
 #define pp_function_specifier(PP, D)              \
-  pp_c_base (PP)->function_specifier (pp_c_base (PP), D)
+  PP->function_specifier (PP, D)
 #define pp_storage_class_specifier(PP, D)         \
-  pp_c_base (PP)->storage_class_specifier (pp_c_base (PP), D);
+  PP->storage_class_specifier (PP, D);
 
 #define pp_statement(PPI, S)                      \
-  pp_c_base (PPI)->statement (pp_c_base (PPI), S)
+  PPI->statement (PPI, S)
 
 #define pp_constant(PP, E) \
-  pp_c_base (PP)->constant (pp_c_base (PP), E)
+  PP->constant (PP, E)
 #define pp_id_expression(PP, E)  \
-  pp_c_base (PP)->id_expression (pp_c_base (PP), E)
+  PP->id_expression (PP, E)
 #define pp_primary_expression(PPI, E)             \
-  pp_c_base (PPI)->primary_expression (pp_c_base (PPI), E)
+  PPI->primary_expression (PPI, E)
 #define pp_postfix_expression(PPI, E)             \
-  pp_c_base (PPI)->postfix_expression (pp_c_base (PPI), E)
+  PPI->postfix_expression (PPI, E)
 #define pp_unary_expression(PPI, E)               \
-  pp_c_base (PPI)->unary_expression (pp_c_base (PPI), E)
+  PPI->unary_expression (PPI, E)
 #define pp_initializer(PPI, E)                    \
-  pp_c_base (PPI)->initializer (pp_c_base (PPI), E)
+  PPI->initializer (PPI, E)
 #define pp_multiplicative_expression(PPI, E)      \
-  pp_c_base (PPI)->multiplicative_expression (pp_c_base (PPI), E)
+  PPI->multiplicative_expression (PPI, E)
 #define pp_conditional_expression(PPI, E)         \
-  pp_c_base (PPI)->conditional_expression (pp_c_base (PPI), E)
+  PPI->conditional_expression (PPI, E)
 #define pp_assignment_expression(PPI, E)          \
-   pp_c_base (PPI)->assignment_expression (pp_c_base (PPI), E)
+   PPI->assignment_expression (PPI, E)
 #define pp_expression(PP, E)                      \
-   pp_c_base (PP)->expression (pp_c_base (PP), E)
+   PP->expression (PP, E)
 
 
-/* Returns the c_pretty_printer base object of PRETTY-PRINTER.  This
-   macro must be overridden by any subclass of c_pretty_print_info.  */
-#define pp_c_base(PP)  (PP)
-
 extern void pp_c_pretty_printer_init (c_pretty_printer *);
 void pp_c_whitespace (c_pretty_printer *);
 void pp_c_left_paren (c_pretty_printer *);
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 89d14da..099953c 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -62,15 +62,15 @@  pp_cxx_nonconsecutive_character (cxx_pretty_printer *pp, int c)
 }
 
 #define pp_cxx_storage_class_specifier(PP, T) \
-   pp_c_storage_class_specifier (pp_c_base (PP), T)
+   pp_c_storage_class_specifier (PP, T)
 #define pp_cxx_expression_list(PP, T)    \
-   pp_c_expression_list (pp_c_base (PP), T)
+   pp_c_expression_list (PP, T)
 #define pp_cxx_space_for_pointer_operator(PP, T)  \
-   pp_c_space_for_pointer_operator (pp_c_base (PP), T)
+   pp_c_space_for_pointer_operator (PP, T)
 #define pp_cxx_init_declarator(PP, T)    \
-   pp_c_init_declarator (pp_c_base (PP), T)
+   pp_c_init_declarator (PP, T)
 #define pp_cxx_call_argument_list(PP, T) \
-   pp_c_call_argument_list (pp_c_base (PP), T)
+   pp_c_call_argument_list (PP, T)
 
 void
 pp_cxx_colon_colon (cxx_pretty_printer *pp)
@@ -331,7 +331,7 @@  pp_cxx_constant (cxx_pretty_printer *pp, tree t)
 	const bool in_parens = PAREN_STRING_LITERAL_P (t);
 	if (in_parens)
 	  pp_cxx_left_paren (pp);
-	pp_c_constant (pp_c_base (pp), t);
+	pp_c_constant (pp, t);
 	if (in_parens)
 	  pp_cxx_right_paren (pp);
       }
@@ -346,7 +346,7 @@  pp_cxx_constant (cxx_pretty_printer *pp, tree t)
       /* else fall through.  */
 
     default:
-      pp_c_constant (pp_c_base (pp), t);
+      pp_c_constant (pp, t);
       break;
     }
 }
@@ -465,7 +465,7 @@  pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_primary_expression (pp_c_base (pp), t);
+      pp_c_primary_expression (pp, t);
       break;
     }
 }
@@ -643,7 +643,7 @@  pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_postfix_expression (pp_c_base (pp), t);
+      pp_c_postfix_expression (pp, t);
       break;
     }
 }
@@ -699,7 +699,7 @@  pp_cxx_new_expression (cxx_pretty_printer *pp, tree t)
 	{
 	  pp_left_paren (pp);
 	  if (TREE_CODE (init) == TREE_LIST)
-	    pp_c_expression_list (pp_c_base (pp), init);
+	    pp_c_expression_list (pp, init);
 	  else if (init == void_zero_node)
 	    ;			/* OK, empty initializer list.  */
 	  else
@@ -736,7 +736,7 @@  pp_cxx_delete_expression (cxx_pretty_printer *pp, tree t)
 	  pp_right_bracket (pp);
 	  pp_space (pp);
 	}
-      pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0));
+      pp_c_cast_expression (pp, TREE_OPERAND (t, 0));
       break;
 
     default:
@@ -835,7 +835,7 @@  pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_unary_expression (pp_c_base (pp), t);
+      pp_c_unary_expression (pp, t);
       break;
     }
 }
@@ -856,7 +856,7 @@  pp_cxx_cast_expression (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_cast_expression (pp_c_base (pp), t);
+      pp_c_cast_expression (pp, t);
       break;
     }
 }
@@ -939,7 +939,7 @@  pp_cxx_conditional_expression (cxx_pretty_printer *pp, tree e)
 {
   if (TREE_CODE (e) == COND_EXPR)
     {
-      pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+      pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
       pp_space (pp);
       pp_question (pp);
       pp_space (pp);
@@ -948,7 +948,7 @@  pp_cxx_conditional_expression (cxx_pretty_printer *pp, tree e)
       pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 2));
     }
   else
-    pp_c_logical_or_expression (pp_c_base (pp), e);
+    pp_c_logical_or_expression (pp, e);
 }
 
 /* Pretty-print a compound assignment operator token as indicated by T.  */
@@ -1007,7 +1007,7 @@  pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e)
     {
     case MODIFY_EXPR:
     case INIT_EXPR:
-      pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+      pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
       pp_space (pp);
       pp_equal (pp);
       pp_space (pp);
@@ -1021,7 +1021,7 @@  pp_cxx_assignment_expression (cxx_pretty_printer *pp, tree e)
       break;
 
     case MODOP_EXPR:
-      pp_c_logical_or_expression (pp_c_base (pp), TREE_OPERAND (e, 0));
+      pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
       pp_cxx_assignment_operator (pp, TREE_OPERAND (e, 1));
       pp_cxx_assignment_expression (pp, TREE_OPERAND (e, 2));
       break;
@@ -1174,7 +1174,7 @@  pp_cxx_expression (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_expression (pp_c_base (pp), t);
+      pp_c_expression (pp, t);
       break;
     }
 }
@@ -1198,7 +1198,7 @@  pp_cxx_function_specifier (cxx_pretty_printer *pp, tree t)
       else if (DECL_CONSTRUCTOR_P (t) && DECL_NONCONVERTING_P (t))
 	pp_cxx_ws_string (pp, "explicit");
       else
-	pp_c_function_specifier (pp_c_base (pp), t);
+	pp_c_function_specifier (pp, t);
 
     default:
       break;
@@ -1242,7 +1242,7 @@  pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t)
 	pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (t)));
       else
 	default:
-      pp_c_declaration_specifiers (pp_c_base (pp), t);
+      pp_c_declaration_specifiers (pp, t);
       break;
     }
 }
@@ -1287,7 +1287,7 @@  pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_type_specifier (pp_c_base (pp), t);
+      pp_c_type_specifier (pp, t);
       break;
     }
 }
@@ -1342,7 +1342,7 @@  pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
 
     default:
       if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
-	pp_c_specifier_qualifier_list (pp_c_base (pp), t);
+	pp_c_specifier_qualifier_list (pp, t);
     }
 }
 
@@ -1362,8 +1362,7 @@  pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
     case POINTER_TYPE:
       if (TYPE_PTR_OR_PTRMEM_P (TREE_TYPE (t)))
 	pp_cxx_ptr_operator (pp, TREE_TYPE (t));
-      pp_c_attributes_display (pp_c_base (pp),
-			       TYPE_ATTRIBUTES (TREE_TYPE (t)));
+      pp_c_attributes_display (pp, TYPE_ATTRIBUTES (TREE_TYPE (t)));
       if (TYPE_PTR_P (t))
 	{
 	  pp_star (pp);
@@ -1436,8 +1435,7 @@  pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t)
   tree args = TYPE_P (t) ? NULL : FUNCTION_FIRST_USER_PARM (t);
   tree types =
     TYPE_P (t) ? TYPE_ARG_TYPES (t) : FUNCTION_FIRST_USER_PARMTYPE (t);
-  const bool abstract = args == NULL
-    || pp_c_base (pp)->flags & pp_c_flag_abstract;
+  const bool abstract = args == NULL || pp->flags & pp_c_flag_abstract;
   bool first = true;
 
   /* Skip artificial parameter for nonstatic member functions.  */
@@ -1451,7 +1449,7 @@  pp_cxx_parameter_declaration_clause (cxx_pretty_printer *pp, tree t)
 	pp_cxx_separate_with (pp, ',');
       first = false;
       pp_cxx_parameter_declaration (pp, abstract ? TREE_VALUE (types) : args);
-      if (!abstract && pp_c_base (pp)->flags & pp_cxx_flag_default_argument)
+      if (!abstract && pp->flags & pp_cxx_flag_default_argument)
 	{
 	  pp_cxx_whitespace (pp);
 	  pp_equal (pp);
@@ -1572,7 +1570,7 @@  pp_cxx_direct_declarator (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_direct_declarator (pp_c_base (pp), t);
+      pp_c_direct_declarator (pp, t);
       break;
     }
 }
@@ -1704,7 +1702,7 @@  pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_direct_abstract_declarator (pp_c_base (pp), t);
+      pp_c_direct_abstract_declarator (pp, t);
       break;
     }
 }
@@ -1715,8 +1713,8 @@  pp_cxx_direct_abstract_declarator (cxx_pretty_printer *pp, tree t)
 static void
 pp_cxx_type_id (cxx_pretty_printer *pp, tree t)
 {
-  pp_flags saved_flags = pp_c_base (pp)->flags;
-  pp_c_base (pp)->flags |= pp_c_flag_abstract;
+  pp_flags saved_flags = pp->flags;
+  pp->flags |= pp_c_flag_abstract;
 
   switch (TREE_CODE (t))
     {
@@ -1744,11 +1742,11 @@  pp_cxx_type_id (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_type_id (pp_c_base (pp), t);
+      pp_c_type_id (pp, t);
       break;
     }
 
-  pp_c_base (pp)->flags = saved_flags;
+  pp->flags = saved_flags;
 }
 
 /* template-argument-list:
@@ -2021,7 +2019,7 @@  pp_cxx_statement (cxx_pretty_printer *pp, tree t)
       break;
 
     default:
-      pp_c_statement (pp_c_base (pp), t);
+      pp_c_statement (pp, t);
       break;
     }
 }
@@ -2437,7 +2435,7 @@  typedef c_pretty_print_fn pp_fun;
 void
 pp_cxx_pretty_printer_init (cxx_pretty_printer *pp)
 {
-  pp_c_pretty_printer_init (pp_c_base (pp));
+  pp_c_pretty_printer_init (pp);
   pp_set_line_maximum_length (pp, 0);
 
   pp->declaration = (pp_fun) pp_cxx_declaration;
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index f93287e..0baf323 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -23,9 +23,6 @@  along with GCC; see the file COPYING3.  If not see
 
 #include "c-family/c-pretty-print.h"
 
-#undef pp_c_base
-#define pp_c_base(PP) (PP)
-
 typedef enum
 {
   /* Ask for a qualified-id.  */
@@ -40,28 +37,28 @@  struct cxx_pretty_printer : public c_pretty_printer
 };
 
 #define pp_cxx_cv_qualifier_seq(PP, T)   \
-   pp_c_type_qualifier_list (pp_c_base (PP), T)
+   pp_c_type_qualifier_list (PP, T)
 #define pp_cxx_cv_qualifiers(PP, CV)   \
-   pp_c_cv_qualifiers (pp_c_base (PP), CV, false)
-
-#define pp_cxx_whitespace(PP)		pp_c_whitespace (pp_c_base (PP))
-#define pp_cxx_left_paren(PP)		pp_c_left_paren (pp_c_base (PP))
-#define pp_cxx_right_paren(PP)		pp_c_right_paren (pp_c_base (PP))
-#define pp_cxx_left_brace(PP)		pp_c_left_brace (pp_c_base (PP))
-#define pp_cxx_right_brace(PP)		pp_c_right_brace (pp_c_base (PP))
-#define pp_cxx_left_bracket(PP)		pp_c_left_bracket (pp_c_base (PP))
-#define pp_cxx_right_bracket(PP)	pp_c_right_bracket (pp_c_base (PP))
-#define pp_cxx_dot(PP)			pp_c_dot (pp_c_base (PP))
-#define pp_cxx_ampersand(PP)		pp_c_ampersand (pp_c_base (PP))
-#define pp_cxx_star(PP)			pp_c_star (pp_c_base (PP))
-#define pp_cxx_arrow(PP)		pp_c_arrow (pp_c_base (PP))
-#define pp_cxx_semicolon(PP)		pp_c_semicolon (pp_c_base (PP))
-#define pp_cxx_complement(PP)		pp_c_complement (pp_c_base (PP))
-
-#define pp_cxx_ws_string(PP, I)		pp_c_ws_string (pp_c_base (PP), I)
-#define pp_cxx_identifier(PP, I)	pp_c_identifier (pp_c_base (PP), I)
+   pp_c_cv_qualifiers (PP, CV, false)
+
+#define pp_cxx_whitespace(PP)		pp_c_whitespace (PP)
+#define pp_cxx_left_paren(PP)		pp_c_left_paren (PP)
+#define pp_cxx_right_paren(PP)		pp_c_right_paren (PP)
+#define pp_cxx_left_brace(PP)		pp_c_left_brace (PP)
+#define pp_cxx_right_brace(PP)		pp_c_right_brace (PP)
+#define pp_cxx_left_bracket(PP)		pp_c_left_bracket (PP)
+#define pp_cxx_right_bracket(PP)	pp_c_right_bracket (PP)
+#define pp_cxx_dot(PP)			pp_c_dot (PP)
+#define pp_cxx_ampersand(PP)		pp_c_ampersand (PP)
+#define pp_cxx_star(PP)			pp_c_star (PP)
+#define pp_cxx_arrow(PP)		pp_c_arrow (PP)
+#define pp_cxx_semicolon(PP)		pp_c_semicolon (PP)
+#define pp_cxx_complement(PP)		pp_c_complement (PP)
+
+#define pp_cxx_ws_string(PP, I)		pp_c_ws_string (PP, I)
+#define pp_cxx_identifier(PP, I)	pp_c_identifier (PP, I)
 #define pp_cxx_tree_identifier(PP, T) \
-  pp_c_tree_identifier (pp_c_base (PP), T)
+  pp_c_tree_identifier (PP, T)
 
 void pp_cxx_pretty_printer_init (cxx_pretty_printer *);
 void pp_cxx_begin_template_argument_list (cxx_pretty_printer *);
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a8f52cd..6509811 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -706,8 +706,7 @@  dump_type_prefix (tree t, int flags)
 	  {
 	    pp_cxx_whitespace (cxx_pp);
 	    pp_cxx_left_paren (cxx_pp);
-	    pp_c_attributes_display (pp_c_base (cxx_pp),
-				     TYPE_ATTRIBUTES (sub));
+	    pp_c_attributes_display (cxx_pp, TYPE_ATTRIBUTES (sub));
 	  }
 	if (TYPE_PTR_P (t))
 	  pp_character(cxx_pp, '*');
@@ -1048,7 +1047,7 @@  dump_decl (tree t, int flags)
 	  flags &= ~TFF_UNQUALIFIED_NAME;
 	  if (DECL_NAME (t) == NULL_TREE)
             {
-              if (!(pp_c_base (cxx_pp)->flags & pp_c_flag_gnu_v3))
+              if (!(cxx_pp->flags & pp_c_flag_gnu_v3))
                 pp_cxx_ws_string (cxx_pp, M_("{anonymous}"));
               else
                 pp_cxx_ws_string (cxx_pp, M_("(anonymous namespace)"));
@@ -2659,10 +2658,10 @@  decl_as_dwarf_string (tree decl, int flags)
   const char *name;
   /* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting the flag
      here will be adequate to get the desired behaviour.  */
-  pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
+  cxx_pp->flags |= pp_c_flag_gnu_v3;
   name = decl_as_string (decl, flags);
   /* Subsequent calls to the pretty printer shouldn't use this style.  */
-  pp_c_base (cxx_pp)->flags &= ~pp_c_flag_gnu_v3;
+  cxx_pp->flags &= ~pp_c_flag_gnu_v3;
   return name;
 }
 
@@ -2691,10 +2690,10 @@  lang_decl_dwarf_name (tree decl, int v, bool translate)
   const char *name;
   /* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting the flag
      here will be adequate to get the desired behaviour.  */
-  pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
+  cxx_pp->flags |= pp_c_flag_gnu_v3;
   name = lang_decl_name (decl, v, translate);
   /* Subsequent calls to the pretty printer shouldn't use this style.  */
-  pp_c_base (cxx_pp)->flags &= ~pp_c_flag_gnu_v3;
+  cxx_pp->flags &= ~pp_c_flag_gnu_v3;
   return name;
 }