From ab1ed77381f78a8940ca250ee0f5ef5cd6b87e7f Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 10 Nov 2016 14:54:00 +0100
Subject: [PATCH] Support no newline in print_gimple_stmt
gcc/ChangeLog:
2016-11-10 Martin Liska <mliska@suse.cz>
* gimple-pretty-print.c (print_gimple_stmt): Add new argument.
* gimple-pretty-print.h (print_gimple_stmt): Declare the new
argument.
* tree-ssa-dse.c (dse_optimize_stmt): Use the argument to not to
print a newline.
---
gcc/gimple-pretty-print.c | 7 +++++--
gcc/gimple-pretty-print.h | 2 +-
gcc/tree-ssa-dse.c | 5 +++--
3 files changed, 9 insertions(+), 5 deletions(-)
@@ -76,13 +76,16 @@ debug_gimple_stmt (gimple *gs)
FLAGS as in pp_gimple_stmt_1. */
void
-print_gimple_stmt (FILE *file, gimple *g, int spc, int flags)
+print_gimple_stmt (FILE *file, gimple *g, int spc, int flags,
+ bool newline)
{
pretty_printer buffer;
pp_needs_newline (&buffer) = true;
buffer.buffer->stream = file;
pp_gimple_stmt_1 (&buffer, g, spc, flags);
- pp_newline_and_flush (&buffer);
+ if (newline)
+ pp_newline (&buffer);
+ pp_flush (&buffer);
}
DEBUG_FUNCTION void
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
extern void debug_gimple_stmt (gimple *);
extern void debug_gimple_seq (gimple_seq);
extern void print_gimple_seq (FILE *, gimple_seq, int, int);
-extern void print_gimple_stmt (FILE *, gimple *, int, int);
+extern void print_gimple_stmt (FILE *, gimple *, int, int, bool newline = true);
extern void debug (gimple &ref);
extern void debug (gimple *ptr);
extern void print_gimple_expr (FILE *, gimple *, int, int);
@@ -237,7 +237,8 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Deleted dead call '");
- print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0);
+ print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0,
+ false);
fprintf (dump_file, "'\n");
}
@@ -293,7 +294,7 @@ dse_optimize_stmt (gimple_stmt_iterator *gsi)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Deleted dead store '");
- print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0);
+ print_gimple_stmt (dump_file, gsi_stmt (*gsi), dump_flags, 0, false);
fprintf (dump_file, "'\n");
}
--
2.10.1