diff options
author | Gabriel Dos Reis <gdr@nerim.net> | 2002-08-14 03:22:18 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2002-08-14 03:22:18 +0000 |
commit | 6bf346d484bb8158e3c54f5353fdad46f9b7231c (patch) | |
tree | cb98da8bf29b2cfca3865ce5df2f94daa1fe9f0d /gcc/c-pretty-print.c | |
parent | cbf2f4797d982be4607bcb1936dc8309e45bed2f (diff) | |
download | gcc-6bf346d484bb8158e3c54f5353fdad46f9b7231c.zip gcc-6bf346d484bb8158e3c54f5353fdad46f9b7231c.tar.gz gcc-6bf346d484bb8158e3c54f5353fdad46f9b7231c.tar.bz2 |
c-pretty-print.h: Guard against multiple inclusion.
* c-pretty-print.h: Guard against multiple inclusion.
Robustify macros.
(pp_c_attributes): Declare.
* c-pretty-print.c (pp_c_attributes): New function.
From-SVN: r56273
Diffstat (limited to 'gcc/c-pretty-print.c')
-rw-r--r-- | gcc/c-pretty-print.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index 34498ad..a04b92f 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -259,6 +259,35 @@ pp_c_parameter_declaration (pp, t) pp_unsupported_tree (pp, t); } +/* Pretty-print ATTRIBUTES using GNU C extension syntax. */ +void +pp_c_attributes (pp, attributes) + c_pretty_printer pp; + tree attributes; +{ + if (attributes == NULL_TREE) + return; + + pp_c_identifier (pp, "__attribute__"); + pp_c_left_paren (pp); + pp_c_left_paren (pp); + for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes)) + { + pp_tree_identifier (pp, TREE_PURPOSE (attributes)); + if (TREE_VALUE (attributes)) + { + pp_c_left_paren (pp); + pp_c_expression_list (pp, TREE_VALUE (attributes)); + pp_c_right_paren (pp); + } + + if (TREE_CHAIN (attributes)) + pp_separate_with (pp, ','); + } + pp_c_right_paren (pp); + pp_c_right_paren (pp); +} + /* Expressions. */ |