Mercurial > hg > CbC > CbC_gcc
comparison gcc/c-tree.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 1b10fe6932e1 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
20 <http://www.gnu.org/licenses/>. */ | 20 <http://www.gnu.org/licenses/>. */ |
21 | 21 |
22 #ifndef GCC_C_TREE_H | 22 #ifndef GCC_C_TREE_H |
23 #define GCC_C_TREE_H | 23 #define GCC_C_TREE_H |
24 | 24 |
25 #include "c-common.h" | 25 #include "c-family/c-common.h" |
26 #include "toplev.h" | |
27 #include "diagnostic.h" | 26 #include "diagnostic.h" |
28 | 27 |
29 /* struct lang_identifier is private to c-decl.c, but langhooks.c needs to | 28 /* struct lang_identifier is private to c-decl.c, but langhooks.c needs to |
30 know how big it is. This is sanity-checked in c-decl.c. */ | 29 know how big it is. This is sanity-checked in c-decl.c. */ |
31 #define C_SIZEOF_STRUCT_LANG_IDENTIFIER \ | 30 #define C_SIZEOF_STRUCT_LANG_IDENTIFIER \ |
97 /* Nonzero for a decl which either doesn't exist or isn't a prototype. | 96 /* Nonzero for a decl which either doesn't exist or isn't a prototype. |
98 N.B. Could be simplified if all built-in decls had complete prototypes | 97 N.B. Could be simplified if all built-in decls had complete prototypes |
99 (but this is presently difficult because some of them need FILE*). */ | 98 (but this is presently difficult because some of them need FILE*). */ |
100 #define C_DECL_ISNT_PROTOTYPE(EXP) \ | 99 #define C_DECL_ISNT_PROTOTYPE(EXP) \ |
101 (EXP == 0 \ | 100 (EXP == 0 \ |
102 || (TYPE_ARG_TYPES (TREE_TYPE (EXP)) == 0 \ | 101 || (!prototype_p (TREE_TYPE (EXP)) \ |
103 && !DECL_BUILT_IN (EXP))) | 102 && !DECL_BUILT_IN (EXP))) |
104 | 103 |
105 /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as | 104 /* For FUNCTION_TYPE, a hidden list of types of arguments. The same as |
106 TYPE_ARG_TYPES for functions with prototypes, but created for functions | 105 TYPE_ARG_TYPES for functions with prototypes, but created for functions |
107 without prototypes. */ | 106 without prototypes. */ |
133 | 132 |
134 /* A kind of type specifier. Note that this information is currently | 133 /* A kind of type specifier. Note that this information is currently |
135 only used to distinguish tag definitions, tag references and typeof | 134 only used to distinguish tag definitions, tag references and typeof |
136 uses. */ | 135 uses. */ |
137 enum c_typespec_kind { | 136 enum c_typespec_kind { |
137 /* No typespec. This appears only in struct c_declspec. */ | |
138 ctsk_none, | |
138 /* A reserved keyword type specifier. */ | 139 /* A reserved keyword type specifier. */ |
139 ctsk_resword, | 140 ctsk_resword, |
140 /* A reference to a tag, previously declared, such as "struct foo". | 141 /* A reference to a tag, previously declared, such as "struct foo". |
141 This includes where the previous declaration was as a different | 142 This includes where the previous declaration was as a different |
142 kind of tag, in which case this is only valid if shadowing that | 143 kind of tag, in which case this is only valid if shadowing that |
194 cts_void, | 195 cts_void, |
195 cts_bool, | 196 cts_bool, |
196 cts_char, | 197 cts_char, |
197 cts_int, | 198 cts_int, |
198 cts_float, | 199 cts_float, |
200 cts_int128, | |
199 cts_double, | 201 cts_double, |
200 cts_dfloat32, | 202 cts_dfloat32, |
201 cts_dfloat64, | 203 cts_dfloat64, |
202 cts_dfloat128, | 204 cts_dfloat128, |
203 cts_fract, | 205 cts_fract, |
223 /* The storage class specifier, or csc_none if none. */ | 225 /* The storage class specifier, or csc_none if none. */ |
224 enum c_storage_class storage_class; | 226 enum c_storage_class storage_class; |
225 /* Any type specifier keyword used such as "int", not reflecting | 227 /* Any type specifier keyword used such as "int", not reflecting |
226 modifiers such as "short", or cts_none if none. */ | 228 modifiers such as "short", or cts_none if none. */ |
227 ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8; | 229 ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8; |
230 /* The kind of type specifier if one has been seen, ctsk_none | |
231 otherwise. */ | |
232 ENUM_BITFIELD (c_typespec_kind) typespec_kind : 3; | |
228 /* Whether any expressions in typeof specifiers may appear in | 233 /* Whether any expressions in typeof specifiers may appear in |
229 constant expressions. */ | 234 constant expressions. */ |
230 BOOL_BITFIELD expr_const_operands : 1; | 235 BOOL_BITFIELD expr_const_operands : 1; |
231 /* Whether any declaration specifiers have been seen at all. */ | 236 /* Whether any declaration specifiers have been seen at all. */ |
232 BOOL_BITFIELD declspecs_seen_p : 1; | 237 BOOL_BITFIELD declspecs_seen_p : 1; |
233 /* Whether a type specifier has been seen. */ | |
234 BOOL_BITFIELD type_seen_p : 1; | |
235 /* Whether something other than a storage class specifier or | 238 /* Whether something other than a storage class specifier or |
236 attribute has been seen. This is used to warn for the | 239 attribute has been seen. This is used to warn for the |
237 obsolescent usage of storage class specifiers other than at the | 240 obsolescent usage of storage class specifiers other than at the |
238 start of the list. (Doing this properly would require function | 241 start of the list. (Doing this properly would require function |
239 specifiers to be handled separately from storage class | 242 specifiers to be handled separately from storage class |
240 specifiers.) */ | 243 specifiers.) */ |
241 BOOL_BITFIELD non_sc_seen_p : 1; | 244 BOOL_BITFIELD non_sc_seen_p : 1; |
242 /* Whether the type is specified by a typedef or typeof name. */ | 245 /* Whether the type is specified by a typedef or typeof name. */ |
243 BOOL_BITFIELD typedef_p : 1; | 246 BOOL_BITFIELD typedef_p : 1; |
244 /* Whether a struct, union or enum type either had its content | |
245 defined by a type specifier in the list or was the first visible | |
246 declaration of its tag. */ | |
247 BOOL_BITFIELD tag_defined_p : 1; | |
248 /* Whether the type is explicitly "signed" or specified by a typedef | 247 /* Whether the type is explicitly "signed" or specified by a typedef |
249 whose type is explicitly "signed". */ | 248 whose type is explicitly "signed". */ |
250 BOOL_BITFIELD explicit_signed_p : 1; | 249 BOOL_BITFIELD explicit_signed_p : 1; |
251 /* Whether the specifiers include a deprecated typedef. */ | 250 /* Whether the specifiers include a deprecated typedef. */ |
252 BOOL_BITFIELD deprecated_p : 1; | 251 BOOL_BITFIELD deprecated_p : 1; |
293 cdk_pointer, | 292 cdk_pointer, |
294 /* Parenthesized declarator with nested attributes. */ | 293 /* Parenthesized declarator with nested attributes. */ |
295 cdk_attrs | 294 cdk_attrs |
296 }; | 295 }; |
297 | 296 |
297 typedef struct c_arg_tag_d { | |
298 /* The argument name. */ | |
299 tree id; | |
300 /* The type of the argument. */ | |
301 tree type; | |
302 } c_arg_tag; | |
303 | |
304 DEF_VEC_O(c_arg_tag); | |
305 DEF_VEC_ALLOC_O(c_arg_tag,gc); | |
306 | |
298 /* Information about the parameters in a function declarator. */ | 307 /* Information about the parameters in a function declarator. */ |
299 struct c_arg_info { | 308 struct c_arg_info { |
300 /* A list of parameter decls. */ | 309 /* A list of parameter decls. */ |
301 tree parms; | 310 tree parms; |
302 /* A list of structure, union and enum tags defined. */ | 311 /* A list of structure, union and enum tags defined. */ |
303 tree tags; | 312 VEC(c_arg_tag,gc) *tags; |
304 /* A list of argument types to go in the FUNCTION_TYPE. */ | 313 /* A list of argument types to go in the FUNCTION_TYPE. */ |
305 tree types; | 314 tree types; |
306 /* A list of non-parameter decls (notably enumeration constants) | 315 /* A list of non-parameter decls (notably enumeration constants) |
307 defined with the parameters. */ | 316 defined with the parameters. */ |
308 tree others; | 317 tree others; |
415 extern void c_print_identifier (FILE *, tree, int); | 424 extern void c_print_identifier (FILE *, tree, int); |
416 extern int quals_from_declspecs (const struct c_declspecs *); | 425 extern int quals_from_declspecs (const struct c_declspecs *); |
417 extern struct c_declarator *build_array_declarator (location_t, tree, | 426 extern struct c_declarator *build_array_declarator (location_t, tree, |
418 struct c_declspecs *, | 427 struct c_declspecs *, |
419 bool, bool); | 428 bool, bool); |
420 extern tree build_enumerator (location_t, struct c_enum_contents *, tree, tree); | 429 extern tree build_enumerator (location_t, location_t, struct c_enum_contents *, |
421 extern tree check_for_loop_decls (location_t); | 430 tree, tree); |
431 extern tree check_for_loop_decls (location_t, bool); | |
422 extern void mark_forward_parm_decls (void); | 432 extern void mark_forward_parm_decls (void); |
423 extern void declare_parm_level (void); | 433 extern void declare_parm_level (void); |
424 extern void undeclared_variable (location_t, tree); | 434 extern void undeclared_variable (location_t, tree); |
425 extern tree lookup_label_for_goto (location_t, tree); | 435 extern tree lookup_label_for_goto (location_t, tree); |
426 extern tree declare_label (tree); | 436 extern tree declare_label (tree); |
432 extern void finish_decl (tree, location_t, tree, tree, tree); | 442 extern void finish_decl (tree, location_t, tree, tree, tree); |
433 extern tree finish_enum (tree, tree, tree); | 443 extern tree finish_enum (tree, tree, tree); |
434 extern void finish_function (void); | 444 extern void finish_function (void); |
435 extern tree finish_struct (location_t, tree, tree, tree, | 445 extern tree finish_struct (location_t, tree, tree, tree, |
436 struct c_struct_parse_info *); | 446 struct c_struct_parse_info *); |
447 extern struct c_arg_info *build_arg_info (void); | |
437 extern struct c_arg_info *get_parm_info (bool); | 448 extern struct c_arg_info *get_parm_info (bool); |
438 extern tree grokfield (location_t, struct c_declarator *, | 449 extern tree grokfield (location_t, struct c_declarator *, |
439 struct c_declspecs *, tree, tree *); | 450 struct c_declspecs *, tree, tree *); |
440 extern tree groktypename (struct c_type_name *, tree *, bool *); | 451 extern tree groktypename (struct c_type_name *, tree *, bool *); |
441 extern tree grokparm (const struct c_parm *); | 452 extern tree grokparm (const struct c_parm *); |
487 extern bool c_missing_noreturn_ok_p (tree); | 498 extern bool c_missing_noreturn_ok_p (tree); |
488 extern bool c_warn_unused_global_decl (const_tree); | 499 extern bool c_warn_unused_global_decl (const_tree); |
489 extern void c_initialize_diagnostics (diagnostic_context *); | 500 extern void c_initialize_diagnostics (diagnostic_context *); |
490 extern bool c_vla_unspec_p (tree x, tree fn); | 501 extern bool c_vla_unspec_p (tree x, tree fn); |
491 | 502 |
492 #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \ | |
493 c_build_qualified_type ((TYPE), \ | |
494 ((CONST_P) ? TYPE_QUAL_CONST : 0) | \ | |
495 ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0)) | |
496 | |
497 /* in c-typeck.c */ | 503 /* in c-typeck.c */ |
498 extern bool in_late_binary_op; | |
499 extern int in_alignof; | 504 extern int in_alignof; |
500 extern int in_sizeof; | 505 extern int in_sizeof; |
501 extern int in_typeof; | 506 extern int in_typeof; |
502 | 507 |
503 extern struct c_switch *c_switch_stack; | 508 extern struct c_switch *c_switch_stack; |
504 | 509 |
505 extern tree c_objc_common_truthvalue_conversion (location_t, tree); | 510 extern tree c_objc_common_truthvalue_conversion (location_t, tree); |
506 extern tree require_complete_type (tree); | 511 extern tree require_complete_type (tree); |
507 extern int same_translation_unit_p (const_tree, const_tree); | 512 extern int same_translation_unit_p (const_tree, const_tree); |
508 extern int comptypes (tree, tree); | 513 extern int comptypes (tree, tree); |
514 extern int comptypes_check_different_types (tree, tree, bool *); | |
509 extern bool c_vla_type_p (const_tree); | 515 extern bool c_vla_type_p (const_tree); |
510 extern bool c_mark_addressable (tree); | 516 extern bool c_mark_addressable (tree); |
511 extern void c_incomplete_type_error (const_tree, const_tree); | 517 extern void c_incomplete_type_error (const_tree, const_tree); |
512 extern tree c_type_promotes_to (tree); | 518 extern tree c_type_promotes_to (tree); |
513 extern struct c_expr default_function_array_conversion (location_t, | 519 extern struct c_expr default_function_array_conversion (location_t, |
597 | 603 |
598 /* In c-decl.c */ | 604 /* In c-decl.c */ |
599 extern void c_finish_incomplete_decl (tree); | 605 extern void c_finish_incomplete_decl (tree); |
600 extern void c_write_global_declarations (void); | 606 extern void c_write_global_declarations (void); |
601 | 607 |
602 /* In order for the format checking to accept the C frontend | 608 /* In c-errors.c */ |
603 diagnostic framework extensions, you must include this file before | 609 extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4); |
604 toplev.h, not after. */ | 610 extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4); |
605 #if GCC_VERSION >= 4001 | |
606 #define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m) | |
607 #else | |
608 #define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m) | |
609 #endif | |
610 | |
611 extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4); | |
612 extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4); | |
613 | |
614 extern bool c_cpp_error (cpp_reader *, int, int, location_t, unsigned int, | |
615 const char *, va_list *) | |
616 ATTRIBUTE_GCC_CDIAG(6,0); | |
617 | 611 |
618 #endif /* ! GCC_C_TREE_H */ | 612 #endif /* ! GCC_C_TREE_H */ |