mirror of git://gcc.gnu.org/git/gcc.git
Improve readability of debug_tree() dumps for SSA_NAME and VECTOR_CST
gcc/ChangeLog: * print-tree.c (print_node) [VECTOR_CST]: Coalesce the output of identical consecutive elements. [SSA_NAME]: Print the name's def stmt on its own line. When printing the node's def stmt, avoid printing an unwanted trailing newline by replacing the call to print_gimple_stmt() with its inlined body and adjusting it to not set pp_needs_newline and to call pp_flush() instead of pp_newline_and_flush(). From-SVN: r239661
This commit is contained in:
parent
6dc198e3a5
commit
1321723711
|
|
@ -1,3 +1,13 @@
|
||||||
|
2016-08-22 Patrick Palka <ppalka@gcc.gnu.org>
|
||||||
|
|
||||||
|
* print-tree.c (print_node) [VECTOR_CST]: Coalesce the output of
|
||||||
|
identical consecutive elements.
|
||||||
|
[SSA_NAME]: Print the name's def stmt on its own line. When printing
|
||||||
|
the node's def stmt, avoid printing an unwanted trailing newline by
|
||||||
|
replacing the call to print_gimple_stmt() with its inlined body and
|
||||||
|
adjusting it to not set pp_needs_newline and to call pp_flush()
|
||||||
|
instead of pp_newline_and_flush().
|
||||||
|
|
||||||
2016-08-22 Joseph Myers <joseph@codesourcery.com>
|
2016-08-22 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* tree.h (CASE_FLT_FN_FLOATN_NX, float16_type_node)
|
* tree.h (CASE_FLT_FN_FLOATN_NX, float16_type_node)
|
||||||
|
|
|
||||||
|
|
@ -770,8 +770,18 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||||
|
|
||||||
for (i = 0; i < VECTOR_CST_NELTS (node); ++i)
|
for (i = 0; i < VECTOR_CST_NELTS (node); ++i)
|
||||||
{
|
{
|
||||||
sprintf (buf, "elt%u: ", i);
|
unsigned j;
|
||||||
|
/* Coalesce the output of identical consecutive elements. */
|
||||||
|
for (j = i + 1; j < VECTOR_CST_NELTS (node); j++)
|
||||||
|
if (VECTOR_CST_ELT (node, j) != VECTOR_CST_ELT (node, i))
|
||||||
|
break;
|
||||||
|
j--;
|
||||||
|
if (i == j)
|
||||||
|
sprintf (buf, "elt%u: ", i);
|
||||||
|
else
|
||||||
|
sprintf (buf, "elt%u...elt%u: ", i, j);
|
||||||
print_node (file, buf, VECTOR_CST_ELT (node, i), indent + 4);
|
print_node (file, buf, VECTOR_CST_ELT (node, i), indent + 4);
|
||||||
|
i = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -869,8 +879,14 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||||
|
|
||||||
case SSA_NAME:
|
case SSA_NAME:
|
||||||
print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
|
print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
|
||||||
|
indent_to (file, indent + 4);
|
||||||
fprintf (file, "def_stmt ");
|
fprintf (file, "def_stmt ");
|
||||||
print_gimple_stmt (file, SSA_NAME_DEF_STMT (node), indent + 4, 0);
|
{
|
||||||
|
pretty_printer buffer;
|
||||||
|
buffer.buffer->stream = file;
|
||||||
|
pp_gimple_stmt_1 (&buffer, SSA_NAME_DEF_STMT (node), indent + 4, 0);
|
||||||
|
pp_flush (&buffer);
|
||||||
|
}
|
||||||
|
|
||||||
indent_to (file, indent + 4);
|
indent_to (file, indent + 4);
|
||||||
fprintf (file, "version %u", SSA_NAME_VERSION (node));
|
fprintf (file, "version %u", SSA_NAME_VERSION (node));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue