aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@nerim.net>2002-07-24 12:17:53 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2002-07-24 12:17:53 +0000
commit26ff2117a92699fbbf8ba5559248df3696b88ce1 (patch)
treea6a1bef25348c2529c289330dcb76d0f4383bc3b /gcc
parent6364054f3ae2db85eed718152cce6a21c313fa72 (diff)
downloadgcc-26ff2117a92699fbbf8ba5559248df3696b88ce1.zip
gcc-26ff2117a92699fbbf8ba5559248df3696b88ce1.tar.gz
gcc-26ff2117a92699fbbf8ba5559248df3696b88ce1.tar.bz2
pretty-print.h: Add macros from cp/error.c `:w
* pretty-print.h: Add macros from cp/error.c `:w From-SVN: r55703
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/pretty-print.h37
2 files changed, 27 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 540409a..3e488ab 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-24 Gabriel Dos Reis <gdr@nerim.net>
+
+ * pretty-print.h: Add macros from cp/error.c
+
2002-07-24 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000-protos.h (mask_operand_wrap): Declare.
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 6f4dd38..a4ae280 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -29,30 +29,39 @@ typedef struct pretty_print_info pretty_print_info;
/* The type of pretty-printer flags passed to clients. */
typedef unsigned int pp_flags;
-/* The type of pretty-print styles. */
-enum pp_style
+enum pp_padding
{
- pp_standard_c,
- pp_gnu_c,
- pp_standard_cxx,
- pp_gnu_cxx
+ pp_none, pp_before, pp_after
};
struct pretty_print_info
{
+ /* The entity to pretty-print. */
tree entity;
- tree scope;
- enum pp_style style;
pp_flags flags;
+ /* Where to put whitespace around the entity being formatted. */
+ enum pp_padding padding;
/* Where we print external representation of ENTITY. */
output_buffer *buffer;
- /* Client extenion hook. */
- void *x_data;
-
- void (*print_declaration) (pretty_print_info *);
- void (*print_statement) (pretty_print_info *);
- void (*print_expression) (pretty_print_info *);
};
+#define pp_sorry_for_unsupported_tree(PPI, T) \
+ output_verbatim ((PPI)->buffer, "\nsorry: `%s' not supported by %s\n",\
+ tree_code_name[(int) TREE_CODE (T)], __FUNCTION__)
+
+#define pp_left_paren(PPI) output_add_character ((PPI)->buffer, '(')
+#define pp_right_paren(PPI) output_add_character ((PPI)->buffer, ')')
+#define pp_left_bracket(PPI) output_add_character ((PPI)->buffer, '[')
+#define pp_right_bracket(PPI) output_add_character ((PPI)->buffer, '[')
+#define pp_semi_colon(PPI) output_add_character ((PPI)->buffer, ';')
+#define pp_comma(PPI) output_add_string ((PPI)->buffer, ", ")
+#define pp_dot(PPI) output_add_character ((PPI)->buffer, '.')
+#define pp_colon(PPI) output_add_character ((PPI)->buffer, ':')
+#define pp_colon_colon(PPI) output_add_string ((PPI)->buffer, "::")
+#define pp_quote(PPI) output_add_character ((PPI)->buffer, '\'')
+#define pp_backquote(PPI) output_add_character ((PPI)->buffer, '`')
+#define pp_doublequote(PPI) output_add_character ((PPI)->buffer, '"')
+
+
#endif /* GCC_PRETTY_PRINT_H */