diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-14 03:22:18 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-14 03:22:18 +0000 |
commit | 980451feb8082d9b55d909b6fbf922ad1e83e6d3 (patch) | |
tree | cb98da8bf29b2cfca3865ce5df2f94daa1fe9f0d /gcc/c-pretty-print.c | |
parent | 4cc1be46ee0a2db8575399b4f8a333b4c1435d3a (diff) | |
download | gcc-980451feb8082d9b55d909b6fbf922ad1e83e6d3.tar.gz |
* c-pretty-print.h: Guard against multiple inclusion.
Robustify macros.
(pp_c_attributes): Declare.
* c-pretty-print.c (pp_c_attributes): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56273 138bc75d-0d04-0410-961f-82ee72b054a4
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 34498ad53d5..a04b92fddd0 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. */ |