diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-12-22 03:22:04 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-12-22 03:22:04 +0000 |
commit | 458e3389dc0700a327cbdfaa46e1ebfd4eeebe71 (patch) | |
tree | 055c6d9d2b6adecabef2597637817947105df5dc /gcc/tree-pretty-print.c | |
parent | dbb23ff70546717dd2054ff4cd73ad29b36885e6 (diff) | |
download | gcc-458e3389dc0700a327cbdfaa46e1ebfd4eeebe71.zip gcc-458e3389dc0700a327cbdfaa46e1ebfd4eeebe71.tar.gz gcc-458e3389dc0700a327cbdfaa46e1ebfd4eeebe71.tar.bz2 |
tree-pretty-print.c (dump_generic_node): Avoid outputing "(void) 0;" as the else branch of a COND_EXPR.
* tree-pretty-print.c (dump_generic_node): Avoid outputing "(void) 0;"
as the else branch of a COND_EXPR.
From-SVN: r120140
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index e4f85c1..7d895a1 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1093,9 +1093,14 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, || TREE_CODE (COND_EXPR_ELSE (node)) == GOTO_EXPR)) { pp_space (buffer); - dump_generic_node (buffer, COND_EXPR_THEN (node), 0, flags, true); - pp_string (buffer, " else "); - dump_generic_node (buffer, COND_EXPR_ELSE (node), 0, flags, true); + dump_generic_node (buffer, COND_EXPR_THEN (node), + 0, flags, true); + if (!IS_EMPTY_STMT (COND_EXPR_ELSE (node))) + { + pp_string (buffer, " else "); + dump_generic_node (buffer, COND_EXPR_ELSE (node), + 0, flags, true); + } } else if (!(flags & TDF_SLIM)) { @@ -1112,7 +1117,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, } /* Output COND_EXPR_ELSE. */ - if (COND_EXPR_ELSE (node)) + if (COND_EXPR_ELSE (node) + && !IS_EMPTY_STMT (COND_EXPR_ELSE (node))) { newline_and_indent (buffer, spc); pp_string (buffer, "else"); |