+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.
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. */