This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] PATCH to c-pretty-print.c: improve TARGET_EXPR,RETURN_STMT support
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Jul 2002 18:26:36 +0100
- Subject: [tree-ssa] PATCH to c-pretty-print.c: improve TARGET_EXPR,RETURN_STMT support
A void function can still have returned expressions.
2002-07-19 Jason Merrill <jason@redhat.com>
* c-pretty-print.c (dump_c_node) [TARGET_EXPR]: Handle.
[COND_EXPR]: Print a returned expression in a void function.
*** c-pretty-print.c.~1~ Wed Jul 17 17:41:33 2002
--- c-pretty-print.c Tue Jul 16 01:56:27 2002
*************** dump_c_node (buffer, node, spc)
*** 647,653 ****
break;
case TARGET_EXPR:
! NIY;
case COND_EXPR:
dump_c_node (buffer, TREE_OPERAND (node, 0), spc);
--- 647,657 ----
break;
case TARGET_EXPR:
! dump_c_node (buffer, TYPE_NAME (TREE_TYPE (node)), spc);
! output_add_character (buffer, '(');
! dump_c_node (buffer, TARGET_EXPR_INITIAL (node), spc);
! output_add_character (buffer, ')');
! break;
case COND_EXPR:
dump_c_node (buffer, TREE_OPERAND (node, 0), spc);
*************** dump_c_node (buffer, node, spc)
*** 1064,1070 ****
case RETURN_STMT:
INDENT (spc);
output_add_string (buffer, "return");
! if (TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl))) != VOID_TYPE)
{
output_add_space (buffer);
if (TREE_CODE (RETURN_EXPR (node)) == MODIFY_EXPR)
--- 1068,1074 ----
case RETURN_STMT:
INDENT (spc);
output_add_string (buffer, "return");
! if (RETURN_EXPR (node))
{
output_add_space (buffer);
if (TREE_CODE (RETURN_EXPR (node)) == MODIFY_EXPR)