aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-08-25 00:24:27 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-08-25 00:24:27 +0000
commit66dfe4c4f83eb1a3f42083251c989f271fa3b5cf (patch)
tree238b02b9d5f7acb7ad9b512c5376edf0261499fd /gcc/c-family
parent84deafd2c30fe64b6980d58ef9ac74395526fba8 (diff)
downloadgcc-66dfe4c4f83eb1a3f42083251c989f271fa3b5cf.zip
gcc-66dfe4c4f83eb1a3f42083251c989f271fa3b5cf.tar.gz
gcc-66dfe4c4f83eb1a3f42083251c989f271fa3b5cf.tar.bz2
c-pretty-print.h (c_pretty_printer::id_expression): Now a virtual function.
c-family/ * 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. cp/ * 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. From-SVN: r201973
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog11
-rw-r--r--gcc/c-family/c-pretty-print.c11
-rw-r--r--gcc/c-family/c-pretty-print.h5
3 files changed, 18 insertions, 9 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index ffac4dd..c3d9ab7 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,16 @@
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.
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 5291be7..a5dc62e 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -1422,7 +1422,7 @@ pp_c_brace_enclosed_initializer_list (c_pretty_printer *pp, tree l)
identifier */
void
-pp_c_id_expression (c_pretty_printer *pp, tree t)
+c_pretty_printer::id_expression (tree t)
{
switch (TREE_CODE (t))
{
@@ -1433,15 +1433,15 @@ pp_c_id_expression (c_pretty_printer *pp, tree 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;
}
}
@@ -1645,7 +1645,7 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e)
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. */
@@ -2339,7 +2339,6 @@ c_pretty_printer::c_pretty_printer ()
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;
diff --git a/gcc/c-family/c-pretty-print.h b/gcc/c-family/c-pretty-print.h
index 13b0fe5..91e635f 100644
--- a/gcc/c-family/c-pretty-print.h
+++ b/gcc/c-family/c-pretty-print.h
@@ -52,6 +52,7 @@ struct c_pretty_printer : pretty_printer
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;
@@ -77,7 +78,6 @@ struct c_pretty_printer : pretty_printer
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;
@@ -110,7 +110,7 @@ struct c_pretty_printer : pretty_printer
#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)
@@ -169,7 +169,6 @@ void pp_c_cast_expression (c_pretty_printer *, tree);
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);