aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2004-09-11 19:48:58 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2004-09-11 19:48:58 +0000
commit05cf561db41aa56f53e0c77b4489987f25fe2efa (patch)
treebb1962bfc50766eb7a19c562763e5c166da579bc /gcc/tree-pretty-print.c
parenta0be84dd8c0a461050ab96d8c563c9e9482e0107 (diff)
downloadgcc-05cf561db41aa56f53e0c77b4489987f25fe2efa.zip
gcc-05cf561db41aa56f53e0c77b4489987f25fe2efa.tar.gz
gcc-05cf561db41aa56f53e0c77b4489987f25fe2efa.tar.bz2
re PR c++/17412 (tree check failure in fold-const)
PR c++/17412 * fold-const.c (fold): Do not try to fold the operand of a CLEANUP_POINT_EXPR if that operand does itself not have any operands. testsuite/ * g++.dg/parse/break-in-for.C: New test. PR middle-end/17417 * langhooks.c (lhd_decl_printable_name): Make sure that this function is called with is a decl node that has an identifier. * tree-pretty-print.c (dump_function_name): New function to wrap PRINT_FUNCTION_NAME and dump_decl_name. (print_call_name): Use it. From-SVN: r87363
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 5aa1743..d0b9aed 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -172,6 +172,17 @@ dump_decl_name (pretty_printer *buffer, tree node, int flags)
}
}
+/* Like the above, but used for pretty printing function calls. */
+
+static void
+dump_function_name (pretty_printer *buffer, tree node)
+{
+ if (DECL_NAME (node))
+ PRINT_FUNCTION_NAME (node);
+ else
+ dump_decl_name (buffer, node, 0);
+}
+
/* Dump a function declaration. NODE is the FUNCTION_TYPE. BUFFER, SPC and
FLAGS are as in dump_generic_node. */
@@ -1892,7 +1903,7 @@ print_call_name (pretty_printer *buffer, tree node)
{
case VAR_DECL:
case PARM_DECL:
- PRINT_FUNCTION_NAME (op0);
+ dump_function_name (buffer, op0);
break;
case ADDR_EXPR:
@@ -1914,7 +1925,7 @@ print_call_name (pretty_printer *buffer, tree node)
/* The function is a pointer contained in a structure. */
if (TREE_CODE (TREE_OPERAND (op0, 0)) == INDIRECT_REF ||
TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
- PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 1));
+ dump_function_name (buffer, TREE_OPERAND (op0, 1));
else
dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
/* else
@@ -1925,7 +1936,7 @@ print_call_name (pretty_printer *buffer, tree node)
case ARRAY_REF:
if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
- PRINT_FUNCTION_NAME (TREE_OPERAND (op0, 0));
+ dump_function_name (buffer, TREE_OPERAND (op0, 0));
else
dump_generic_node (buffer, op0, 0, 0, false);
break;