summaryrefslogtreecommitdiff
path: root/gcc/c-pretty-print.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-26 21:58:06 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-26 21:58:06 +0000
commit6d5d708e56103fe5b3909c9782d2ade3a982350a (patch)
tree309434d678721acedb299f20cdc2b4778062b180 /gcc/c-pretty-print.c
parent98155838dbd82b97bb7bb16dfcbf98fa2ab27ca9 (diff)
downloadgcc-6d5d708e56103fe5b3909c9782d2ade3a982350a.tar.gz
2009-10-26 Ben Elliston <bje@au.ibm.com>
Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. * c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is defined, add the named address space keywords. (c_addr_space_name): New function. (complete_array_type): Preserve named address space. (handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15, RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE. (ADDR_SPACE_KEYWORD): New macro. (c_addr_space_name): Add prototype. * c-tree.h (struct c_declspecs): Add address_space member. (declspecs_add_addrspace): Add prototype. * c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces. * c-parser.c (c_parse_init): Add assertion. (typedef enum c_id_kind): Add C_ID_ADDRSPACE. (c_lex_one_token): Handle address space keywords. (c_token_starts_typename): Likewise. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_postfix_expression_after_paren_type): Diagnose compound literal within function qualified with named address space. * c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named address space qualifiers. (shadow_tag_warned): Warn about useless address space qualifiers. (quals_from_declspecs): Handle address space qualifiers. (grokdeclarator): Likewise. (build_null_declspecs): Likewise. (declspecs_add_addrspace): New function. * c-typeck.c (addr_space_superset): New function. (qualify_type): Handle named address spaces. (composite_type): Likewise. (common_pointer_type): Likewise. (comp_target_types): Likewise. (build_conditional_expr): Likewise. (handle_warn_cast_qual): Likewise. (build_c_cast): Likewise. (convert_for_assignment): Likewise. (build_binary_op): Likewise. (pointer_diff): Handle named address spaces. Use intermediate integer type of sufficient size if required. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153574 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pretty-print.c')
-rw-r--r--gcc/c-pretty-print.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index c4e6e96c296..01770014c21 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -225,7 +225,11 @@ pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
const
restrict -- C99
__restrict__ -- GNU C
- volatile */
+ address-space-qualifier -- GNU C
+ volatile
+
+ address-space-qualifier:
+ identifier -- GNU C */
void
pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
@@ -245,6 +249,12 @@ pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
pp_c_cv_qualifier (pp, "volatile");
if (qualifiers & TYPE_QUAL_RESTRICT)
pp_c_cv_qualifier (pp, flag_isoc99 ? "restrict" : "__restrict__");
+
+ if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (t)))
+ {
+ const char *as = c_addr_space_name (TYPE_ADDR_SPACE (t));
+ pp_c_identifier (pp, as);
+ }
}
/* pointer: