diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-23 10:46:49 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-23 10:46:49 +0000 |
commit | b8ab5fbc4fbfd490f8930ff7cf28c736df92d7fd (patch) | |
tree | a220392ed347512ec6a0763fab4d85bfe02bf2ee /gcc/pretty-print.c | |
parent | 65e3f67337959cddb1ebe633e3b31a856c6e9a08 (diff) | |
download | gcc-b8ab5fbc4fbfd490f8930ff7cf28c736df92d7fd.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201940 138bc75d-0d04-0410-961f-82ee72b054a4
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 2d2541048f8..a46545400f8 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 |