diff options
Diffstat (limited to 'gcc/c-tree.h')
-rw-r--r-- | gcc/c-tree.h | 65 |
1 files changed, 52 insertions, 13 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 09f679ef8b1..37075518b83 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -131,6 +131,38 @@ struct c_expr enum tree_code original_code; }; +/* A sequence of declaration specifiers in C. */ +struct c_declspecs { + /* The type specified, not reflecting modifiers such as "short" and + "unsigned", or NULL_TREE if none. */ + tree type; + /* If the type was specified with a typedef, that typedef decl. */ + tree typedef_decl; + /* The attributes from a typedef decl. */ + tree decl_attr; + /* When parsing, the attributes. Outside the parser, this will be + NULL; attributes (possibly from multiple lists) will be passed + separately. */ + tree attrs; + /* The modifier bits present. */ + int specbits; + /* Whether something other than a storage class specifier or + attribute has been seen. This is used to warn for the + obsolescent usage of storage class specifiers other than at the + start of the list. (Doing this properly would require function + specifiers to be handled separately from storage class + specifiers.) */ + BOOL_BITFIELD non_sc_seen_p : 1; + /* Whether the specifiers include a deprecated typedef. */ + BOOL_BITFIELD deprecated_p : 1; + /* Whether "int" was explicitly specified. */ + BOOL_BITFIELD explicit_int_p : 1; + /* Whether "char" was explicitly specified. */ + BOOL_BITFIELD explicit_char_p : 1; + /* Whether "long" was specified more than once. */ + BOOL_BITFIELD long_long_p : 1; +}; + /* The various kinds of declarators in C. */ enum c_declarator_kind { /* An identifier. */ @@ -175,14 +207,14 @@ struct c_declarator { /* The array dimension, or NULL for [] and [*]. */ tree dimen; /* The qualifiers (and attributes, currently ignored) inside []. */ - tree quals; + struct c_declspecs *quals; /* Whether [static] was used. */ BOOL_BITFIELD static_p : 1; /* Whether [*] was used. */ BOOL_BITFIELD vla_unspec_p : 1; } array; /* For pointers, the qualifiers on the pointer type. */ - tree pointer_quals; + struct c_declspecs *pointer_quals; /* For attributes. */ tree attrs; } u; @@ -191,7 +223,7 @@ struct c_declarator { /* A type name. */ struct c_type_name { /* The declaration specifiers. */ - tree specs; + struct c_declspecs *specs; /* The declarator. */ struct c_declarator *declarator; }; @@ -199,7 +231,7 @@ struct c_type_name { /* A parameter. */ struct c_parm { /* The declaration specifiers, minus any prefix attributes. */ - tree specs; + struct c_declspecs *specs; /* The attributes. */ tree attrs; /* The declarator. */ @@ -246,7 +278,8 @@ extern void c_expand_body (tree); extern void c_init_decl_processing (void); extern void c_dup_lang_specific_decl (tree); extern void c_print_identifier (FILE *, tree, int); -extern struct c_declarator *build_array_declarator (tree, tree, bool, bool); +extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *, + bool, bool); extern tree build_enumerator (tree, tree); extern void check_for_loop_decls (void); extern void mark_forward_parm_decls (void); @@ -260,8 +293,7 @@ extern tree finish_enum (tree, tree, tree); extern void finish_function (void); extern tree finish_struct (tree, tree, tree); extern struct c_arg_info *get_parm_info (bool); -extern tree grokfield (struct c_declarator *, tree, tree); -extern void split_specs_attrs (tree, tree *, tree *); +extern tree grokfield (struct c_declarator *, struct c_declspecs *, tree); extern tree groktypename (struct c_type_name *); extern tree grokparm (const struct c_parm *); extern tree implicitly_declare (tree); @@ -277,24 +309,31 @@ extern struct c_declarator *set_array_declarator_inner (struct c_declarator *, bool); extern tree builtin_function (const char *, tree, int, enum built_in_class, const char *, tree); -extern void shadow_tag (tree); -extern void shadow_tag_warned (tree, int); +extern void shadow_tag (const struct c_declspecs *); +extern void shadow_tag_warned (const struct c_declspecs *, int); extern tree start_enum (tree); -extern int start_function (tree, struct c_declarator *, tree); -extern tree start_decl (struct c_declarator *, tree, bool, tree); +extern int start_function (struct c_declspecs *, struct c_declarator *, tree); +extern tree start_decl (struct c_declarator *, struct c_declspecs *, bool, + tree); extern tree start_struct (enum tree_code, tree); extern void store_parm_decls (void); extern void store_parm_decls_from (struct c_arg_info *); extern tree xref_tag (enum tree_code, tree); extern int c_expand_decl (tree); -extern struct c_parm *build_c_parm (tree, tree, struct c_declarator *); +extern struct c_parm *build_c_parm (struct c_declspecs *, tree, + struct c_declarator *); extern struct c_declarator *build_attrs_declarator (tree, struct c_declarator *); extern struct c_declarator *build_function_declarator (struct c_arg_info *, struct c_declarator *); extern struct c_declarator *build_id_declarator (tree); -extern struct c_declarator *make_pointer_declarator (tree, +extern struct c_declarator *make_pointer_declarator (struct c_declspecs *, struct c_declarator *); +extern struct c_declspecs *build_null_declspecs (void); +extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_type (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree); +extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree); /* in c-objc-common.c */ extern int c_disregard_inline_limits (tree); |