From: Gabriel Dos Reis Date: Mon, 5 Aug 2013 06:29:18 +0000 (+0000) Subject: c-pretty-print.c (print_c_tree): Simplify. X-Git-Tag: upstream/12.2.0~68524 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0aec1e9303b523df5552689a20cd0e0309d4308;p=platform%2Fupstream%2Fgcc.git 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 --- 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 + + * c-pretty-print.c (print_c_tree): Simplify. Use non-static local + c_pretty_printer variable. + 2013-08-04 Gabriel Dos Reis * 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. */