Commit 137a1a27 by Gabriel Dos Reis Committed by Gabriel Dos Reis

pretty-print.h (pp_bar_bar): New.

	* pretty-print.h (pp_bar_bar): New.
	(pp_ampersand_ampersand): Likewise.
	(pp_less_equal): Likewise.
	(pp_greater_equal): Likewise.
	* gimple-pretty-print.c (dump_ternary_rhs): Use specialized pretty
	printer functions instead of pp_string or operators and punctuators.
	(dump_gimple_call): Likewise.
	(dump_gimple_omp_for): Likewise.
	(dump_gimple_transaction): Likewise.
	(dump_gimple_phi): Likewise.
	(pp_gimple_stmt_1): Likewise.
	* sched-vis.c (print_insn): Likewise.
	* tree-mudflap.c (mf_varname_tree): Likewise.
	* tree-pretty-print.c (dump_block_node): Likewise.
	(dump_generic_node): Likewise.

c-family/ 
	* c-ada-spec.c (pp_ada_tree_identifier): Use specialized pretty
	printer functions instead of pp_string or operators and punctuators.
	(dump_generic_ada_node): Likewise.
	* c-pretty-print.c (pp_c_type_specifier): Likewise.
	(pp_c_relational_expression): Likewise.
	(pp_c_logical_or_expression): Likewise.

cp/
	* error.c (dump_type_prefix): Use specialized pretty printer
	functions instead of pp_string or operators and punctuators.
	(dump_decl): Likewise.
	(dump_expr): Likewise.

From-SVN: r201474
parent 8ee9fbe1
2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* pretty-print.h (pp_bar_bar): New.
(pp_ampersand_ampersand): Likewise.
(pp_less_equal): Likewise.
(pp_greater_equal): Likewise.
* gimple-pretty-print.c (dump_ternary_rhs): Use specialized pretty
printer functions instead of pp_string or operators and punctuators.
(dump_gimple_call): Likewise.
(dump_gimple_omp_for): Likewise.
(dump_gimple_transaction): Likewise.
(dump_gimple_phi): Likewise.
(pp_gimple_stmt_1): Likewise.
* sched-vis.c (print_insn): Likewise.
* tree-mudflap.c (mf_varname_tree): Likewise.
* tree-pretty-print.c (dump_block_node): Likewise.
(dump_generic_node): Likewise.
2013-08-02 Jan Hubicka <jh@suse.cz>
* lto-cgraph.c (compute_ltrans_boundary): Add abstract origins into
......
2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-ada-spec.c (pp_ada_tree_identifier): Use specialized pretty
printer functions instead of pp_string or operators and punctuators.
(dump_generic_ada_node): Likewise.
* c-pretty-print.c (pp_c_type_specifier): Likewise.
(pp_c_relational_expression): Likewise.
(pp_c_logical_or_expression): Likewise.
2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-ada-spec.c (print_ada_macros): Use specialized pretty printer
functions instead of pp_character.
(pp_ada_tree_identifier): Likewise.
......
......@@ -1266,7 +1266,7 @@ pp_ada_tree_identifier (pretty_printer *buffer, tree node, tree type,
{
pp_string (buffer, "Class_");
pp_string (buffer, s);
pp_string (buffer, ".");
pp_dot (buffer);
}
}
......@@ -1626,7 +1626,7 @@ dump_sloc (pretty_printer *buffer, tree node)
if (xloc.file)
{
pp_string (buffer, xloc.file);
pp_string (buffer, ":");
pp_colon (buffer);
pp_decimal_int (buffer, xloc.line);
}
}
......@@ -1886,14 +1886,14 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type,
bool first = true;
spc += INDENT_INCR;
newline_and_indent (buffer, spc - 1);
pp_string (buffer, "(");
pp_left_paren (buffer);
for (; value; value = TREE_CHAIN (value))
{
if (first)
first = false;
else
{
pp_string (buffer, ",");
pp_comma (buffer);
newline_and_indent (buffer, spc);
}
......@@ -1907,7 +1907,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type,
dump_generic_ada_node
(buffer, DECL_NAME (type) ? type : TYPE_NAME (node), type,
cpp_check, spc, 0, true);
pp_string (buffer, ")");
pp_right_paren (buffer);
}
else
{
......@@ -2032,7 +2032,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type,
pp_string (buffer, "pragma Convention (C, ");
dump_generic_ada_node
(buffer, type, 0, cpp_check, spc, false, true);
pp_string (buffer, ")");
pp_right_paren (buffer);
}
}
else
......
......@@ -370,7 +370,7 @@ pp_c_type_specifier (c_pretty_printer *pp, tree t)
pp_c_type_specifier (pp, t);
if (TYPE_PRECISION (t) != prec)
{
pp_string (pp, ":");
pp_colon (pp);
pp_decimal_int (pp, prec);
}
}
......@@ -393,7 +393,7 @@ pp_c_type_specifier (c_pretty_printer *pp, tree t)
gcc_unreachable ();
}
pp_decimal_int (pp, prec);
pp_string (pp, ">");
pp_greater (pp);
}
}
break;
......@@ -1920,9 +1920,9 @@ pp_c_relational_expression (c_pretty_printer *pp, tree e)
else if (code == GT_EXPR)
pp_greater (pp);
else if (code == LE_EXPR)
pp_string (pp, "<=");
pp_less_equal (pp);
else if (code == GE_EXPR)
pp_string (pp, ">=");
pp_greater_equal (pp);
pp_c_whitespace (pp);
pp_c_shift_expression (pp, TREE_OPERAND (e, 1));
break;
......@@ -2032,7 +2032,7 @@ pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
{
pp_c_logical_and_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
pp_string (pp, "&&");
pp_ampersand_ampersand (pp);
pp_c_whitespace (pp);
pp_c_inclusive_or_expression (pp, TREE_OPERAND (e, 1));
}
......@@ -2052,7 +2052,7 @@ pp_c_logical_or_expression (c_pretty_printer *pp, tree e)
{
pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
pp_string (pp, "||");
pp_bar_bar (pp);
pp_c_whitespace (pp);
pp_c_logical_and_expression (pp, TREE_OPERAND (e, 1));
}
......
2013-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* error.c (dump_type_prefix): Use specialized pretty printer
functions instead of pp_string or operators and punctuators.
(dump_decl): Likewise.
(dump_expr): Likewise.
2013-08-03 Jason Merrill <jason@redhat.com>
DR 1286
......
......@@ -714,7 +714,7 @@ dump_type_prefix (tree t, int flags)
else if (TREE_CODE (t) == REFERENCE_TYPE)
{
if (TYPE_REF_IS_RVALUE (t))
pp_string (cxx_pp, "&&");
pp_ampersand_ampersand (cxx_pp);
else
pp_ampersand (cxx_pp);
}
......@@ -1060,7 +1060,7 @@ dump_decl (tree t, int flags)
case SCOPE_REF:
dump_type (TREE_OPERAND (t, 0), flags);
pp_string (cxx_pp, "::");
pp_colon_colon (cxx_pp);
dump_decl (TREE_OPERAND (t, 1), TFF_UNQUALIFIED_NAME);
break;
......@@ -1075,9 +1075,9 @@ dump_decl (tree t, int flags)
dump_decl (ARRAY_NOTATION_ARRAY (t), flags | TFF_EXPR_IN_PARENS);
pp_cxx_left_bracket (cxx_pp);
dump_decl (ARRAY_NOTATION_START (t), flags | TFF_EXPR_IN_PARENS);
pp_string (cxx_pp, ":");
pp_colon (cxx_pp);
dump_decl (ARRAY_NOTATION_LENGTH (t), flags | TFF_EXPR_IN_PARENS);
pp_string (cxx_pp, ":");
pp_colon (cxx_pp);
dump_decl (ARRAY_NOTATION_STRIDE (t), flags | TFF_EXPR_IN_PARENS);
pp_cxx_right_bracket (cxx_pp);
break;
......@@ -2072,9 +2072,9 @@ dump_expr (tree t, int flags)
dump_expr (ARRAY_NOTATION_ARRAY (t), flags | TFF_EXPR_IN_PARENS);
pp_cxx_left_bracket (cxx_pp);
dump_expr (ARRAY_NOTATION_START (t), flags | TFF_EXPR_IN_PARENS);
pp_string (cxx_pp, ":");
pp_colon (cxx_pp);
dump_expr (ARRAY_NOTATION_LENGTH (t), flags | TFF_EXPR_IN_PARENS);
pp_string (cxx_pp, ":");
pp_colon (cxx_pp);
dump_expr (ARRAY_NOTATION_STRIDE (t), flags | TFF_EXPR_IN_PARENS);
pp_cxx_right_bracket (cxx_pp);
break;
......
......@@ -436,7 +436,7 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
pp_string (buffer, ", ");
dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
pp_string (buffer, ">");
pp_greater (buffer);
break;
case VEC_PERM_EXPR:
......@@ -446,7 +446,7 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
pp_string (buffer, ", ");
dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
pp_string (buffer, ">");
pp_greater (buffer);
break;
case REALIGN_LOAD_EXPR:
......@@ -456,7 +456,7 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
pp_string (buffer, ", ");
dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
pp_string (buffer, ">");
pp_greater (buffer);
break;
case COND_EXPR:
......@@ -474,7 +474,7 @@ dump_ternary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
pp_string (buffer, ", ");
dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
pp_string (buffer, ">");
pp_greater (buffer);
break;
default:
......@@ -757,7 +757,7 @@ dump_gimple_call (pretty_printer *buffer, gimple gs, int spc, int flags)
if (props & PR_READONLY)
pp_string (buffer, "readOnly ");
pp_string (buffer, "]");
pp_right_bracket (buffer);
}
}
......@@ -1145,10 +1145,10 @@ dump_gimple_omp_for (pretty_printer *buffer, gimple gs, int spc, int flags)
pp_greater (buffer);
break;
case LE_EXPR:
pp_string (buffer, "<=");
pp_less_equal (buffer);
break;
case GE_EXPR:
pp_string (buffer, ">=");
pp_greater_equal (buffer);
break;
default:
gcc_unreachable ();
......@@ -1420,7 +1420,7 @@ dump_gimple_transaction (pretty_printer *buffer, gimple gs, int spc, int flags)
}
if (subcode)
pp_printf (buffer, "0x%x ", subcode);
pp_string (buffer, "]");
pp_right_bracket (buffer);
}
}
......@@ -1641,7 +1641,7 @@ dump_gimple_phi (pretty_printer *buffer, gimple phi, int spc, int flags)
pp_string (buffer, " : ");
}
pp_decimal_int (buffer, xloc.line);
pp_string (buffer, ":");
pp_colon (buffer);
pp_decimal_int (buffer, xloc.column);
pp_string (buffer, "] ");
}
......@@ -1881,7 +1881,7 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
pp_string (buffer, " : ");
}
pp_decimal_int (buffer, xloc.line);
pp_string (buffer, ":");
pp_colon (buffer);
pp_decimal_int (buffer, xloc.column);
pp_string (buffer, "] ");
}
......
......@@ -246,10 +246,14 @@ pp_base_get_prefix (const pretty_printer *pp) { return pp->prefix; }
#define pp_equal(PP) pp_character (PP, '=')
#define pp_question(PP) pp_character (PP, '?')
#define pp_bar(PP) pp_character (PP, '|')
#define pp_bar_bar(PP) pp_string (PP, "||")
#define pp_carret(PP) pp_character (PP, '^')
#define pp_ampersand(PP) pp_character (PP, '&')
#define pp_ampersand_ampersand(PP) pp_string (PP, "&&")
#define pp_less(PP) pp_character (PP, '<')
#define pp_less_equal(PP) pp_string (PP, "<=")
#define pp_greater(PP) pp_character (PP, '>')
#define pp_greater_equal(PP) pp_string (PP, ">=")
#define pp_plus(PP) pp_character (PP, '+')
#define pp_minus(PP) pp_character (PP, '-')
#define pp_star(PP) pp_character (PP, '*')
......
......@@ -690,7 +690,7 @@ print_insn (pretty_printer *pp, const_rtx x, int verbose)
case JUMP_TABLE_DATA:
pp_string (pp, "jump_table_data{\n");
print_pattern (pp, PATTERN (x), verbose);
pp_string (pp, "}");
pp_right_brace (pp);
break;
case BARRIER:
pp_string (pp, "barrier");
......
......@@ -138,12 +138,12 @@ mf_varname_tree (tree decl)
if (sourceline != 0)
{
pp_string (buf, ":");
pp_colon (buf);
pp_decimal_int (buf, sourceline);
if (sourcecolumn != 0)
{
pp_string (buf, ":");
pp_colon (buf);
pp_decimal_int (buf, sourcecolumn);
}
}
......@@ -165,7 +165,7 @@ mf_varname_tree (tree decl)
pp_string (buf, ") ");
}
else
pp_string (buf, " ");
pp_space (buf);
/* Add <variable-declaration>, possibly demangled. */
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment