aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-08-05 07:27:27 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-08-05 07:27:27 +0000
commitb3f80694f51873709e2e0fee9e32484a32d28f85 (patch)
tree4d9e5dc7a8d618f07df1de0d53b07b73195726e6 /gcc
parente0aec1e9303b523df5552689a20cd0e0309d4308 (diff)
downloadgcc-b3f80694f51873709e2e0fee9e32484a32d28f85.zip
gcc-b3f80694f51873709e2e0fee9e32484a32d28f85.tar.gz
gcc-b3f80694f51873709e2e0fee9e32484a32d28f85.tar.bz2
gimple-pretty-print.c (buffer): Remove.
* gimple-pretty-print.c (buffer): Remove. (initialized): Likewise. (maybe_init_pretty_print): Likewise. (print_gimple_stmt): Do not call it. Use non-static local pretty_printer variable. (print_gimple_expr): Likewise. (print_gimple_seq): Likewise. (gimple_dump_bb): Likewise. From-SVN: r201482
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/gimple-pretty-print.c39
2 files changed, 27 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d5c5fa..2fe5ac5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2013-08-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * gimple-pretty-print.c (buffer): Remove.
+ (initialized): Likewise.
+ (maybe_init_pretty_print): Likewise.
+ (print_gimple_stmt): Do not call it. Use non-static local
+ pretty_printer variable.
+ (print_gimple_expr): Likewise.
+ (print_gimple_seq): Likewise.
+ (gimple_dump_bb): Likewise.
+
+2013-08-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* asan.c (asan_pp): Remove.
(asan_pp_initialized): Likewise.
(asan_pp_initialize): Likewise.
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 436553a..1d40680 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -36,9 +36,6 @@ along with GCC; see the file COPYING3. If not see
#define INDENT(SPACE) \
do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
-static pretty_printer buffer;
-static bool initialized = false;
-
#define GIMPLE_NIY do_niy (buffer,gs)
/* Try to print on BUFFER a default message for the unrecognized
@@ -52,22 +49,6 @@ do_niy (pretty_printer *buffer, gimple gs)
}
-/* Initialize the pretty printer on FILE if needed. */
-
-static void
-maybe_init_pretty_print (FILE *file)
-{
- if (!initialized)
- {
- pp_construct (&buffer, NULL, 0);
- pp_needs_newline (&buffer) = true;
- initialized = true;
- }
-
- buffer.buffer->stream = file;
-}
-
-
/* Emit a newline and SPC indentation spaces to BUFFER. */
static void
@@ -93,7 +74,10 @@ debug_gimple_stmt (gimple gs)
void
print_gimple_stmt (FILE *file, gimple g, int spc, int flags)
{
- maybe_init_pretty_print (file);
+ pretty_printer buffer;
+ pp_construct (&buffer, NULL, 0);
+ pp_needs_newline (&buffer) = true;
+ buffer.buffer->stream = file;
pp_gimple_stmt_1 (&buffer, g, spc, flags);
pp_newline_and_flush (&buffer);
}
@@ -122,7 +106,10 @@ void
print_gimple_expr (FILE *file, gimple g, int spc, int flags)
{
flags |= TDF_RHS_ONLY;
- maybe_init_pretty_print (file);
+ pretty_printer buffer;
+ pp_construct (&buffer, NULL, 0);
+ pp_needs_newline (&buffer) = true;
+ buffer.buffer->stream = file;
pp_gimple_stmt_1 (&buffer, g, spc, flags);
pp_flush (&buffer);
}
@@ -155,7 +142,10 @@ dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc, int flags)
void
print_gimple_seq (FILE *file, gimple_seq seq, int spc, int flags)
{
- maybe_init_pretty_print (file);
+ pretty_printer buffer;
+ pp_construct (&buffer, NULL, 0);
+ pp_needs_newline (&buffer) = true;
+ buffer.buffer->stream = file;
dump_gimple_seq (&buffer, seq, spc, flags);
pp_newline_and_flush (&buffer);
}
@@ -2279,7 +2269,10 @@ gimple_dump_bb (FILE *file, basic_block bb, int indent, int flags)
dump_gimple_bb_header (file, bb, indent, flags);
if (bb->index >= NUM_FIXED_BLOCKS)
{
- maybe_init_pretty_print (file);
+ pretty_printer buffer;
+ pp_construct (&buffer, NULL, 0);
+ pp_needs_newline (&buffer) = true;
+ buffer.buffer->stream = file;
gimple_dump_bb_buff (&buffer, bb, indent, flags);
}
dump_gimple_bb_footer (file, bb, indent, flags);