diff options
author | simartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 20:52:16 +0000 |
---|---|---|
committer | simartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-24 20:52:16 +0000 |
commit | b4c018995f8b4be4e77c61e16244c0a9ad29e7cb (patch) | |
tree | 8114578ec066c8fc958ebd7608cf29fdaca0d26e /gcc/tree-pretty-print.c | |
parent | c7addd8cb1e57b2c404c48c43a027360a96cb185 (diff) | |
download | gcc-b4c018995f8b4be4e77c61e16244c0a9ad29e7cb.tar.gz |
2007-04-24 Simon Martin <simartin@users.sourceforge.net>
PR diagnostic/25923
* tree-pass.h (TDF_DIAGNOSTIC): New dump control to specify that a
diagnostic message is being built.
* tree-pretty-print.c (dump_generic_node): Only write the formatted text
into BUFFER's stream if we are not building a diagnostic message.
* toplev.c (default_tree_printer): Pass TDF_DIAGNOSTIC to
dump_generic_node.
* Makefile.in (toplev.o): Depend on tree-pass.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index ab637a8822a..32f8ac00d37 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -431,8 +431,8 @@ dump_symbols (pretty_printer *buffer, bitmap syms, int flags) /* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent. - FLAGS specifies details to show in the dump (see TDF_* in tree.h). If - IS_STMT is true, the object printed is considered to be a statement + FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h). + If IS_STMT is true, the object printed is considered to be a statement and it is terminated by ';' if appropriate. */ int @@ -2055,7 +2055,11 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, if (is_stmt && is_expr) pp_semicolon (buffer); - pp_write_text_to_stream (buffer); + + /* If we're building a diagnostic, the formatted text will be written + into BUFFER's stream by the caller; otherwise, write it now. */ + if (!(flags & TDF_DIAGNOSTIC)) + pp_write_text_to_stream (buffer); return spc; } |