aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2013-08-05 06:29:18 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2013-08-05 06:29:18 +0000
commite0aec1e9303b523df5552689a20cd0e0309d4308 (patch)
tree5017ec054a1dd4c85f6272263dd1e7dbe73fd920 /gcc
parent11a877b33a138cc5218b7ea01698175847f8d836 (diff)
downloadgcc-e0aec1e9303b523df5552689a20cd0e0309d4308.zip
gcc-e0aec1e9303b523df5552689a20cd0e0309d4308.tar.gz
gcc-e0aec1e9303b523df5552689a20cd0e0309d4308.tar.bz2
c-pretty-print.c (print_c_tree): Simplify.
* c-pretty-print.c (print_c_tree): Simplify. Use non-static local c_pretty_printer variable. From-SVN: r201481
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-pretty-print.c23
2 files changed, 12 insertions, 16 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d985360..b83c536 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-05 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * c-pretty-print.c (print_c_tree): Simplify. Use non-static local
+ c_pretty_printer variable.
+
2013-08-04 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-pretty-print.h (c_pretty_printer): Derive from pretty_printer.
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index a453117..fed5802 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -2359,22 +2359,13 @@ pp_c_pretty_printer_init (c_pretty_printer *pp)
void
print_c_tree (FILE *file, tree t)
{
- static c_pretty_printer pp_rec;
- static bool initialized = 0;
- c_pretty_printer *pp = &pp_rec;
-
- if (!initialized)
- {
- initialized = 1;
- pp_construct (pp, NULL, 0);
- pp_c_pretty_printer_init (pp);
- pp_needs_newline (pp) = true;
- }
- pp->buffer->stream = file;
-
- pp_statement (pp, t);
-
- pp_newline_and_flush (pp);
+ c_pretty_printer pp;
+ pp_construct (&pp, NULL, 0);
+ pp_c_pretty_printer_init (&pp);
+ pp_needs_newline (&pp) = true;
+ pp.buffer->stream = file;
+ pp_statement (&pp, t);
+ pp_newline_and_flush (&pp);
}
/* Print the tree T in full, on stderr. */