Commit e0aec1e9 by Gabriel Dos Reis Committed by Gabriel Dos Reis

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
parent 11a877b3
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.
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment