2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * c-pretty-print.h (c_pretty_printer::id_expression): Now a
+ virtual function.
+ (pp_c_id_expression): Remove.
+ (pp_id_expression): Adjust.
+ * c-pretty-print.c (c_pretty_printer::id_expression): Rename from
+ pp_c_id_expression. Adjust.
+ (pp_c_postfix_expression): Use pp_id_expression.
+ (c_pretty_printer::c_pretty_printer): Do not assign to id_expression.
+
+2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* c-pretty-print.h (c_pretty_printer::constant): Now a virtual
member function.
(pp_constant): Adjust.
identifier */
void
-pp_c_id_expression (c_pretty_printer *pp, tree t)
+c_pretty_printer::id_expression (tree t)
{
switch (TREE_CODE (t))
{
case FUNCTION_DECL:
case FIELD_DECL:
case LABEL_DECL:
- pp_c_tree_decl_identifier (pp, t);
+ pp_c_tree_decl_identifier (this, t);
break;
case IDENTIFIER_NODE:
- pp_c_tree_identifier (pp, t);
+ pp_c_tree_identifier (this, t);
break;
default:
- pp_unsupported_tree (pp, t);
+ pp_unsupported_tree (this, t);
break;
}
}
case ADDR_EXPR:
if (TREE_CODE (TREE_OPERAND (e, 0)) == FUNCTION_DECL)
{
- pp_c_id_expression (pp, TREE_OPERAND (e, 0));
+ pp_id_expression (pp, TREE_OPERAND (e, 0));
break;
}
/* else fall through. */
statement = pp_c_statement;
- id_expression = pp_c_id_expression;
primary_expression = pp_c_primary_expression;
postfix_expression = pp_c_postfix_expression;
unary_expression = pp_c_unary_expression;
c_pretty_printer ();
virtual void constant (tree);
+ virtual void id_expression (tree);
/* Points to the first element of an array of offset-list.
Not used yet. */
int *offset_list;
c_pretty_print_fn statement;
- c_pretty_print_fn id_expression;
c_pretty_print_fn primary_expression;
c_pretty_print_fn postfix_expression;
c_pretty_print_fn unary_expression;
#define pp_statement(PP, S) (PP)->statement (PP, S)
#define pp_constant(PP, E) (PP)->constant (E)
-#define pp_id_expression(PP, E) (PP)->id_expression (PP, E)
+#define pp_id_expression(PP, E) (PP)->id_expression (E)
#define pp_primary_expression(PP, E) (PP)->primary_expression (PP, E)
#define pp_postfix_expression(PP, E) (PP)->postfix_expression (PP, E)
#define pp_unary_expression(PP, E) (PP)->unary_expression (PP, E)
void pp_c_postfix_expression (c_pretty_printer *, tree);
void pp_c_primary_expression (c_pretty_printer *, tree);
void pp_c_init_declarator (c_pretty_printer *, tree);
-void pp_c_id_expression (c_pretty_printer *, tree);
void pp_c_ws_string (c_pretty_printer *, const char *);
void pp_c_identifier (c_pretty_printer *, const char *);
void pp_c_string_literal (c_pretty_printer *, tree);
2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * cxx-pretty-print.h (cxx_pretty_printer::id_expression): Declare.
+ * cxx-pretty-print.c (cxx_pretty_printer::id_expression): Rename
+ from pp_cxx_id_expression. Adjust.
+ (pp_cxx_userdef_literal): Use pp_id_expression.
+ (pp_cxx_primary_expression): Likewise.
+ (pp_cxx_direct_declarator): Likewise.
+ (cxx_pretty_printer::cxx_pretty_printer): Do not assign to
+ id_expression.
+
+2013-08-24 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* cxx-pretty-print.h (cxx_pretty_printer::constant): Now a member
function, overriding c_pretty_printer::constant.
* cxx-pretty-print.c (cxx_pretty_printer::constant): Rename from
unqualified-id
qualified-id */
-static inline void
-pp_cxx_id_expression (cxx_pretty_printer *pp, tree t)
+void
+cxx_pretty_printer::id_expression (tree t)
{
if (TREE_CODE (t) == OVERLOAD)
t = OVL_CURRENT (t);
if (DECL_P (t) && DECL_CONTEXT (t))
- pp_cxx_qualified_id (pp, t);
+ pp_cxx_qualified_id (this, t);
else
- pp_cxx_unqualified_id (pp, t);
+ pp_cxx_unqualified_id (this, t);
}
/* user-defined literal:
pp_cxx_userdef_literal (cxx_pretty_printer *pp, tree t)
{
pp_constant (pp, USERDEF_LITERAL_VALUE (t));
- pp_cxx_id_expression (pp, USERDEF_LITERAL_SUFFIX_ID (t));
+ pp_id_expression (pp, USERDEF_LITERAL_SUFFIX_ID (t));
}
case OVERLOAD:
case CONST_DECL:
case TEMPLATE_DECL:
- pp_cxx_id_expression (pp, t);
+ pp_id_expression (pp, t);
break;
case RESULT_DECL:
parameter pack. */
pp_cxx_ws_string (pp, "...");
- pp_cxx_id_expression (pp, DECL_NAME (t));
+ pp_id_expression (pp, DECL_NAME (t));
}
pp_cxx_abstract_declarator (pp, TREE_TYPE (t));
break;
case FUNCTION_DECL:
pp_cxx_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
- pp_cxx_id_expression (pp, t);
+ pp_id_expression (pp, t);
pp_cxx_parameter_declaration_clause (pp, t);
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
/* pp->statement = (pp_fun) pp_cxx_statement; */
- id_expression = (pp_fun) pp_cxx_id_expression;
primary_expression = (pp_fun) pp_cxx_primary_expression;
postfix_expression = (pp_fun) pp_cxx_postfix_expression;
unary_expression = (pp_fun) pp_cxx_unary_expression;
{
cxx_pretty_printer ();
- virtual void constant (tree);
+ void constant (tree);
+ void id_expression (tree);
/* This is the enclosing scope of the entity being pretty-printed. */
tree enclosing_scope;
};