summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-pretty-print.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-25 18:05:29 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-25 18:05:29 +0000
commitf873303af72355489684a20bb0d08edbb2d622ed (patch)
treee3e822c597db970f5994f185079de90625e74346 /gcc/c-family/c-pretty-print.c
parent8d68eb111ac5deb15742e74031eeec5a5481cb9b (diff)
downloadgcc-f873303af72355489684a20bb0d08edbb2d622ed.tar.gz
c-family/
* c-pretty-print.h (c_pretty_printer::primary_expression): Now a virtua member function. (pp_primary_expression): Adjust. (pp_c_primary_expression): Remove. * c-pretty-print.c (c_pretty_printer::primary_expression): Rename from pp_c_primary_expression. Adjust. (pp_c_initializer_list): Use pp_primary_expression. (c_pretty_printer::c_pretty_printer): Do not assign to primary_expression. cp/ * cxx-pretty-print.h (cxx_pretty_printer::primary_expression): Now an overrider of c_pretty_printer::primary_expression. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression): Rename from pp_cxx_primary_expression. Adjust. (pp_cxx_postfix_expression): Use pp_primary_expression. (pp_cxx_ctor_initializer): Likewise. (cxx_pretty_printer::cxx_pretty_printer): Do not assign to primary_expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-pretty-print.c')
-rw-r--r--gcc/c-family/c-pretty-print.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index ecc01734925..870a5c78fa9 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -1212,7 +1212,7 @@ pp_c_identifier (c_pretty_printer *pp, const char *id)
( expression ) */
void
-pp_c_primary_expression (c_pretty_printer *pp, tree e)
+c_pretty_printer::primary_expression (tree e)
{
switch (TREE_CODE (e))
{
@@ -1222,49 +1222,49 @@ pp_c_primary_expression (c_pretty_printer *pp, tree e)
case CONST_DECL:
case FUNCTION_DECL:
case LABEL_DECL:
- pp_c_tree_decl_identifier (pp, e);
+ pp_c_tree_decl_identifier (this, e);
break;
case IDENTIFIER_NODE:
- pp_c_tree_identifier (pp, e);
+ pp_c_tree_identifier (this, e);
break;
case ERROR_MARK:
- pp->translate_string ("<erroneous-expression>");
+ translate_string ("<erroneous-expression>");
break;
case RESULT_DECL:
- pp->translate_string ("<return-value>");
+ translate_string ("<return-value>");
break;
case INTEGER_CST:
case REAL_CST:
case FIXED_CST:
case STRING_CST:
- pp_constant (pp, e);
+ constant (e);
break;
case TARGET_EXPR:
- pp_c_ws_string (pp, "__builtin_memcpy");
- pp_c_left_paren (pp);
- pp_ampersand (pp);
- pp_primary_expression (pp, TREE_OPERAND (e, 0));
- pp_separate_with (pp, ',');
- pp_ampersand (pp);
- pp_initializer (pp, TREE_OPERAND (e, 1));
+ pp_c_ws_string (this, "__builtin_memcpy");
+ pp_c_left_paren (this);
+ pp_ampersand (this);
+ primary_expression (TREE_OPERAND (e, 0));
+ pp_separate_with (this, ',');
+ pp_ampersand (this);
+ pp_initializer (this, TREE_OPERAND (e, 1));
if (TREE_OPERAND (e, 2))
{
- pp_separate_with (pp, ',');
- pp_c_expression (pp, TREE_OPERAND (e, 2));
+ pp_separate_with (this, ',');
+ pp_c_expression (this, TREE_OPERAND (e, 2));
}
- pp_c_right_paren (pp);
+ pp_c_right_paren (this);
break;
default:
/* FIXME: Make sure we won't get into an infinite loop. */
- pp_c_left_paren (pp);
- pp_expression (pp, e);
- pp_c_right_paren (pp);
+ pp_c_left_paren (this);
+ pp_expression (this, e);
+ pp_c_right_paren (this);
break;
}
}
@@ -1356,7 +1356,7 @@ pp_c_initializer_list (c_pretty_printer *pp, tree e)
if (code == RECORD_TYPE || code == UNION_TYPE)
{
pp_c_dot (pp);
- pp_c_primary_expression (pp, TREE_PURPOSE (init));
+ pp_primary_expression (pp, TREE_PURPOSE (init));
}
else
{
@@ -2119,7 +2119,7 @@ pp_c_assignment_expression (c_pretty_printer *pp, tree e)
Implementation note: instead of going through the usual recursion
chain, I take the liberty of dispatching nodes to the appropriate
functions. This makes some redundancy, but it worths it. That also
- prevents a possible infinite recursion between pp_c_primary_expression ()
+ prevents a possible infinite recursion between pp_primary_expression ()
and pp_c_expression (). */
void
@@ -2344,7 +2344,6 @@ c_pretty_printer::c_pretty_printer ()
statement = pp_c_statement;
- primary_expression = pp_c_primary_expression;
postfix_expression = pp_c_postfix_expression;
unary_expression = pp_c_unary_expression;
initializer = pp_c_initializer;