diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2013-08-23 10:46:49 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2013-08-23 10:46:49 +0000 |
commit | 0fc80001f03a9051772198b99eda479f7bce80e1 (patch) | |
tree | a220392ed347512ec6a0763fab4d85bfe02bf2ee /gcc/pretty-print.c | |
parent | 520a5868fa96c928b8004702440253ac02f64b9d (diff) | |
download | gcc-0fc80001f03a9051772198b99eda479f7bce80e1.zip gcc-0fc80001f03a9051772198b99eda479f7bce80e1.tar.gz gcc-0fc80001f03a9051772198b99eda479f7bce80e1.tar.bz2 |
pretty-print.h (pp_newline_and_flush): Declare.
* pretty-print.h (pp_newline_and_flush): Declare. Remove macro
definition.
(pp_newline_and_indent): Likewise.
(pp_separate_with): Likewise.
* pretty-print.c (pp_newline_and_flush): Define.
(pp_newline_and_indent): Likewise.
(pp_separate_with): Likewise.
From-SVN: r201940
Diffstat (limited to 'gcc/pretty-print.c')
-rw-r--r-- | gcc/pretty-print.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index 2d25410..a465454 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -902,6 +902,37 @@ pp_maybe_space (pretty_printer *pp) pp->padding = pp_none; } } + +// Add a newline to the pretty printer PP and flush formatted text. + +void +pp_newline_and_flush (pretty_printer *pp) +{ + pp_newline (pp); + pp_flush (pp); + pp_needs_newline (pp) = false; +} + +// Add a newline to the pretty printer PP, followed by indentation. + +void +pp_newline_and_indent (pretty_printer *pp, int n) +{ + pp_indentation (pp) += n; + pp_newline (pp); + pp_indent (pp); + pp_needs_newline (pp) = false; +} + +// Add separator C, followed by a single whitespace. + +void +pp_separate_with (pretty_printer *pp, char c) +{ + pp_character (pp, c); + pp_space (pp); +} + /* The string starting at P has LEN (at least 1) bytes left; if they start with a valid UTF-8 sequence, return the length of that |