xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/c/c-tree.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 /* Definitions for C parsing and type checking.
2    Copyright (C) 1987-2019 Free Software Foundation, Inc.
3 
4 This file is part of GCC.
5 
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10 
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3.  If not see
18 <http://www.gnu.org/licenses/>.  */
19 
20 #ifndef GCC_C_TREE_H
21 #define GCC_C_TREE_H
22 
23 #include "c-family/c-common.h"
24 #include "diagnostic.h"
25 
26 /* struct lang_identifier is private to c-decl.c, but langhooks.c needs to
27    know how big it is.  This is sanity-checked in c-decl.c.  */
28 #define C_SIZEOF_STRUCT_LANG_IDENTIFIER \
29   (sizeof (struct c_common_identifier) + 3 * sizeof (void *))
30 
31 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only.  */
32 #define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE)
33 
34 /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile.  */
35 #define C_TYPE_FIELDS_VOLATILE(TYPE) TREE_LANG_FLAG_2 (TYPE)
36 
37 /* In a RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE
38    nonzero if the definition of the type has already started.  */
39 #define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
40 
41 /* In an incomplete RECORD_TYPE or UNION_TYPE, a list of variable
42    declarations whose type would be completed by completing that type.  */
43 #define C_TYPE_INCOMPLETE_VARS(TYPE) TYPE_VFIELD (TYPE)
44 
45 /* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
46    keyword.  C_RID_CODE (node) is then the RID_* value of the keyword.  */
47 #define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID)
48 
49 /* Record whether a type or decl was written with nonconstant size.
50    Note that TYPE_SIZE may have simplified to a constant.  */
51 #define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE)
52 #define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE)
53 
54 /* Record whether a type is defined inside a struct or union type.
55    This is used for -Wc++-compat. */
56 #define C_TYPE_DEFINED_IN_STRUCT(TYPE) TYPE_LANG_FLAG_2 (TYPE)
57 
58 /* Record whether an "incomplete type" error was given for the type.  */
59 #define C_TYPE_ERROR_REPORTED(TYPE) TYPE_LANG_FLAG_3 (TYPE)
60 
61 /* Record whether a typedef for type `int' was actually `signed int'.  */
62 #define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
63 
64 /* For a FUNCTION_DECL, nonzero if it was defined without an explicit
65    return type.  */
66 #define C_FUNCTION_IMPLICIT_INT(EXP) DECL_LANG_FLAG_1 (EXP)
67 
68 /* For a FUNCTION_DECL, nonzero if it was an implicit declaration.  */
69 #define C_DECL_IMPLICIT(EXP) DECL_LANG_FLAG_2 (EXP)
70 
71 /* For a PARM_DECL, nonzero if it was declared as an array.  */
72 #define C_ARRAY_PARAMETER(NODE) DECL_LANG_FLAG_0 (NODE)
73 
74 /* For FUNCTION_DECLs, evaluates true if the decl is built-in but has
75    been declared.  */
76 #define C_DECL_DECLARED_BUILTIN(EXP)		\
77   DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP))
78 
79 /* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a
80    built-in prototype and does not have a non-built-in prototype.  */
81 #define C_DECL_BUILTIN_PROTOTYPE(EXP)		\
82   DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP))
83 
84 /* Record whether a decl was declared register.  This is strictly a
85    front-end flag, whereas DECL_REGISTER is used for code generation;
86    they may differ for structures with volatile fields.  */
87 #define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4 (EXP)
88 
89 /* Record whether a decl was used in an expression anywhere except an
90    unevaluated operand of sizeof / typeof / alignof.  This is only
91    used for functions declared static but not defined, though outside
92    sizeof and typeof it is set for other function decls as well.  */
93 #define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (EXP))
94 
95 /* Record whether a variable has been declared threadprivate by
96    #pragma omp threadprivate.  */
97 #define C_DECL_THREADPRIVATE_P(DECL) DECL_LANG_FLAG_3 (VAR_DECL_CHECK (DECL))
98 
99 /* Set on VAR_DECLs for compound literals.  */
100 #define C_DECL_COMPOUND_LITERAL_P(DECL) \
101   DECL_LANG_FLAG_5 (VAR_DECL_CHECK (DECL))
102 
103 /* Nonzero for a decl which either doesn't exist or isn't a prototype.
104    N.B. Could be simplified if all built-in decls had complete prototypes
105    (but this is presently difficult because some of them need FILE*).  */
106 #define C_DECL_ISNT_PROTOTYPE(EXP)			\
107        (EXP == 0					\
108 	|| (!prototype_p (TREE_TYPE (EXP))	\
109 	    && !fndecl_built_in_p (EXP)))
110 
111 /* For FUNCTION_TYPE, a hidden list of types of arguments.  The same as
112    TYPE_ARG_TYPES for functions with prototypes, but created for functions
113    without prototypes.  */
114 #define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_LANG_SLOT_1 (NODE)
115 
116 /* For a CONSTRUCTOR, whether some initializer contains a
117    subexpression meaning it is not a constant expression.  */
118 #define CONSTRUCTOR_NON_CONST(EXPR) TREE_LANG_FLAG_1 (CONSTRUCTOR_CHECK (EXPR))
119 
120 /* For a SAVE_EXPR, nonzero if the operand of the SAVE_EXPR has already
121    been folded.  */
122 #define SAVE_EXPR_FOLDED_P(EXP)	TREE_LANG_FLAG_1 (SAVE_EXPR_CHECK (EXP))
123 
124 /* Record parser information about an expression that is irrelevant
125    for code generation alongside a tree representing its value.  */
126 struct c_expr
127 {
128   /* The value of the expression.  */
129   tree value;
130   /* Record the original unary/binary operator of an expression, which may
131      have been changed by fold, STRING_CST for unparenthesized string
132      constants, C_MAYBE_CONST_EXPR for __builtin_constant_p calls
133      (even if parenthesized), for subexpressions, and for non-constant
134      initializers, or ERROR_MARK for other expressions (including
135      parenthesized expressions).  */
136   enum tree_code original_code;
137   /* If not NULL, the original type of an expression.  This will
138      differ from the type of the value field for an enum constant.
139      The type of an enum constant is a plain integer type, but this
140      field will be the enum type.  */
141   tree original_type;
142 
143   /* The source range of this expression.  This is redundant
144      for node values that have locations, but not all node kinds
145      have locations (e.g. constants, and references to params, locals,
146      etc), so we stash a copy here.  */
147   source_range src_range;
148 
149   /* Access to the first and last locations within the source spelling
150      of this expression.  */
151   location_t get_start () const { return src_range.m_start; }
152   location_t get_finish () const { return src_range.m_finish; }
153 
154   location_t get_location () const
155   {
156     if (EXPR_HAS_LOCATION (value))
157       return EXPR_LOCATION (value);
158     else
159       return make_location (get_start (), get_start (), get_finish ());
160   }
161 
162   /* Set the value to error_mark_node whilst ensuring that src_range
163      is initialized.  */
164   void set_error ()
165   {
166     value = error_mark_node;
167     src_range.m_start = UNKNOWN_LOCATION;
168     src_range.m_finish = UNKNOWN_LOCATION;
169   }
170 };
171 
172 /* Type alias for struct c_expr. This allows to use the structure
173    inside the VEC types.  */
174 typedef struct c_expr c_expr_t;
175 
176 /* A kind of type specifier.  Note that this information is currently
177    only used to distinguish tag definitions, tag references and typeof
178    uses.  */
179 enum c_typespec_kind {
180   /* No typespec.  This appears only in struct c_declspec.  */
181   ctsk_none,
182   /* A reserved keyword type specifier.  */
183   ctsk_resword,
184   /* A reference to a tag, previously declared, such as "struct foo".
185      This includes where the previous declaration was as a different
186      kind of tag, in which case this is only valid if shadowing that
187      tag in an inner scope.  */
188   ctsk_tagref,
189   /* A reference to a tag, not previously declared in a visible
190      scope.  */
191   ctsk_tagfirstref,
192   /* A definition of a tag such as "struct foo { int a; }".  */
193   ctsk_tagdef,
194   /* A typedef name.  */
195   ctsk_typedef,
196   /* An ObjC-specific kind of type specifier.  */
197   ctsk_objc,
198   /* A typeof specifier, or _Atomic ( type-name ).  */
199   ctsk_typeof
200 };
201 
202 /* A type specifier: this structure is created in the parser and
203    passed to declspecs_add_type only.  */
204 struct c_typespec {
205   /* What kind of type specifier this is.  */
206   enum c_typespec_kind kind;
207   /* Whether the expression has operands suitable for use in constant
208      expressions.  */
209   bool expr_const_operands;
210   /* The specifier itself.  */
211   tree spec;
212   /* An expression to be evaluated before the type specifier, in the
213      case of typeof specifiers, or NULL otherwise or if no such
214      expression is required for a particular typeof specifier.  In
215      particular, when typeof is applied to an expression of variably
216      modified type, that expression must be evaluated in order to
217      determine array sizes that form part of the type, but the
218      expression itself (as opposed to the array sizes) forms no part
219      of the type and so needs to be recorded separately.  */
220   tree expr;
221 };
222 
223 /* A storage class specifier.  */
224 enum c_storage_class {
225   csc_none,
226   csc_auto,
227   csc_extern,
228   csc_register,
229   csc_static,
230   csc_typedef
231 };
232 
233 /* A type specifier keyword "void", "_Bool", "char", "int", "float",
234    "double", "_Decimal32", "_Decimal64", "_Decimal128", "_Fract", "_Accum",
235    or none of these.  */
236 enum c_typespec_keyword {
237   cts_none,
238   cts_void,
239   cts_bool,
240   cts_char,
241   cts_int,
242   cts_float,
243   cts_int_n,
244   cts_double,
245   cts_dfloat32,
246   cts_dfloat64,
247   cts_dfloat128,
248   cts_floatn_nx,
249   cts_fract,
250   cts_accum,
251   cts_auto_type
252 };
253 
254 /* This enum lists all the possible declarator specifiers, storage
255    class or attribute that a user can write.  There is at least one
256    enumerator per possible declarator specifier in the struct
257    c_declspecs below.
258 
259    It is used to index the array of declspec locations in struct
260    c_declspecs.  */
261 enum c_declspec_word {
262   cdw_typespec /* A catch-all for a typespec.  */,
263   cdw_storage_class  /* A catch-all for a storage class */,
264   cdw_attributes,
265   cdw_typedef,
266   cdw_explicit_signed,
267   cdw_deprecated,
268   cdw_default_int,
269   cdw_long,
270   cdw_long_long,
271   cdw_short,
272   cdw_signed,
273   cdw_unsigned,
274   cdw_complex,
275   cdw_inline,
276   cdw_noreturn,
277   cdw_thread,
278   cdw_const,
279   cdw_volatile,
280   cdw_restrict,
281   cdw_atomic,
282   cdw_saturating,
283   cdw_alignas,
284   cdw_address_space,
285   cdw_gimple,
286   cdw_rtl,
287   cdw_number_of_elements /* This one must always be the last
288 			    enumerator.  */
289 };
290 
291 enum c_declspec_il {
292   cdil_none,
293   cdil_gimple,		/* __GIMPLE  */
294   cdil_gimple_cfg,	/* __GIMPLE(cfg)  */
295   cdil_gimple_ssa,	/* __GIMPLE(ssa)  */
296   cdil_rtl		/* __RTL  */
297 };
298 
299 /* A sequence of declaration specifiers in C.  When a new declaration
300    specifier is added, please update the enum c_declspec_word above
301    accordingly.  */
302 struct c_declspecs {
303   location_t locations[cdw_number_of_elements];
304   /* The type specified, if a single type specifier such as a struct,
305      union or enum specifier, typedef name or typeof specifies the
306      whole type, or NULL_TREE if none or a keyword such as "void" or
307      "char" is used.  Does not include qualifiers.  */
308   tree type;
309   /* Any expression to be evaluated before the type, from a typeof
310      specifier.  */
311   tree expr;
312   /* The attributes from a typedef decl.  */
313   tree decl_attr;
314   /* When parsing, the attributes.  Outside the parser, this will be
315      NULL; attributes (possibly from multiple lists) will be passed
316      separately.  */
317   tree attrs;
318   /* The pass to start compiling a __GIMPLE or __RTL function with.  */
319   char *gimple_or_rtl_pass;
320   /* The base-2 log of the greatest alignment required by an _Alignas
321      specifier, in bytes, or -1 if no such specifiers with nonzero
322      alignment.  */
323   int align_log;
324   /* For the __intN declspec, this stores the index into the int_n_* arrays.  */
325   int int_n_idx;
326   /* For the _FloatN and _FloatNx declspec, this stores the index into
327      the floatn_nx_types array.  */
328   int floatn_nx_idx;
329   /* The storage class specifier, or csc_none if none.  */
330   enum c_storage_class storage_class;
331   /* Any type specifier keyword used such as "int", not reflecting
332      modifiers such as "short", or cts_none if none.  */
333   ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8;
334   /* The kind of type specifier if one has been seen, ctsk_none
335      otherwise.  */
336   ENUM_BITFIELD (c_typespec_kind) typespec_kind : 3;
337   ENUM_BITFIELD (c_declspec_il) declspec_il : 3;
338   /* Whether any expressions in typeof specifiers may appear in
339      constant expressions.  */
340   BOOL_BITFIELD expr_const_operands : 1;
341   /* Whether any declaration specifiers have been seen at all.  */
342   BOOL_BITFIELD declspecs_seen_p : 1;
343   /* Whether something other than a storage class specifier or
344      attribute has been seen.  This is used to warn for the
345      obsolescent usage of storage class specifiers other than at the
346      start of the list.  (Doing this properly would require function
347      specifiers to be handled separately from storage class
348      specifiers.)  */
349   BOOL_BITFIELD non_sc_seen_p : 1;
350   /* Whether the type is specified by a typedef or typeof name.  */
351   BOOL_BITFIELD typedef_p : 1;
352   /* Whether the type is explicitly "signed" or specified by a typedef
353      whose type is explicitly "signed".  */
354   BOOL_BITFIELD explicit_signed_p : 1;
355   /* Whether the specifiers include a deprecated typedef.  */
356   BOOL_BITFIELD deprecated_p : 1;
357   /* Whether the type defaulted to "int" because there were no type
358      specifiers.  */
359   BOOL_BITFIELD default_int_p : 1;
360   /* Whether "long" was specified.  */
361   BOOL_BITFIELD long_p : 1;
362   /* Whether "long" was specified more than once.  */
363   BOOL_BITFIELD long_long_p : 1;
364   /* Whether "short" was specified.  */
365   BOOL_BITFIELD short_p : 1;
366   /* Whether "signed" was specified.  */
367   BOOL_BITFIELD signed_p : 1;
368   /* Whether "unsigned" was specified.  */
369   BOOL_BITFIELD unsigned_p : 1;
370   /* Whether "complex" was specified.  */
371   BOOL_BITFIELD complex_p : 1;
372   /* Whether "inline" was specified.  */
373   BOOL_BITFIELD inline_p : 1;
374   /* Whether "_Noreturn" was speciied.  */
375   BOOL_BITFIELD noreturn_p : 1;
376   /* Whether "__thread" or "_Thread_local" was specified.  */
377   BOOL_BITFIELD thread_p : 1;
378   /* Whether "__thread" rather than "_Thread_local" was specified.  */
379   BOOL_BITFIELD thread_gnu_p : 1;
380   /* Whether "const" was specified.  */
381   BOOL_BITFIELD const_p : 1;
382   /* Whether "volatile" was specified.  */
383   BOOL_BITFIELD volatile_p : 1;
384   /* Whether "restrict" was specified.  */
385   BOOL_BITFIELD restrict_p : 1;
386   /* Whether "_Atomic" was specified.  */
387   BOOL_BITFIELD atomic_p : 1;
388   /* Whether "_Sat" was specified.  */
389   BOOL_BITFIELD saturating_p : 1;
390   /* Whether any alignment specifier (even with zero alignment) was
391      specified.  */
392   BOOL_BITFIELD alignas_p : 1;
393   /* The address space that the declaration belongs to.  */
394   addr_space_t address_space;
395 };
396 
397 /* The various kinds of declarators in C.  */
398 enum c_declarator_kind {
399   /* An identifier.  */
400   cdk_id,
401   /* A function.  */
402   cdk_function,
403   /* An array.  */
404   cdk_array,
405   /* A pointer.  */
406   cdk_pointer,
407   /* Parenthesized declarator with nested attributes.  */
408   cdk_attrs
409 };
410 
411 struct c_arg_tag {
412   /* The argument name.  */
413   tree id;
414   /* The type of the argument.  */
415   tree type;
416 };
417 
418 
419 /* Information about the parameters in a function declarator.  */
420 struct c_arg_info {
421   /* A list of parameter decls.  */
422   tree parms;
423   /* A list of structure, union and enum tags defined.  */
424   vec<c_arg_tag, va_gc> *tags;
425   /* A list of argument types to go in the FUNCTION_TYPE.  */
426   tree types;
427   /* A list of non-parameter decls (notably enumeration constants)
428      defined with the parameters.  */
429   tree others;
430   /* A compound expression of VLA sizes from the parameters, or NULL.
431      In a function definition, these are used to ensure that
432      side-effects in sizes of arrays converted to pointers (such as a
433      parameter int i[n++]) take place; otherwise, they are
434      ignored.  */
435   tree pending_sizes;
436   /* True when these arguments had [*].  */
437   BOOL_BITFIELD had_vla_unspec : 1;
438 };
439 
440 /* A declarator.  */
441 struct c_declarator {
442   /* The kind of declarator.  */
443   enum c_declarator_kind kind;
444   location_t id_loc; /* Currently only set for cdk_id, cdk_array. */
445   /* Except for cdk_id, the contained declarator.  For cdk_id, NULL.  */
446   struct c_declarator *declarator;
447   union {
448     /* For identifiers, an IDENTIFIER_NODE or NULL_TREE if an abstract
449        declarator.  */
450     tree id;
451     /* For functions.  */
452     struct c_arg_info *arg_info;
453     /* For arrays.  */
454     struct {
455       /* The array dimension, or NULL for [] and [*].  */
456       tree dimen;
457       /* The qualifiers inside [].  */
458       int quals;
459       /* The attributes (currently ignored) inside [].  */
460       tree attrs;
461       /* Whether [static] was used.  */
462       BOOL_BITFIELD static_p : 1;
463       /* Whether [*] was used.  */
464       BOOL_BITFIELD vla_unspec_p : 1;
465     } array;
466     /* For pointers, the qualifiers on the pointer type.  */
467     int pointer_quals;
468     /* For attributes.  */
469     tree attrs;
470   } u;
471 };
472 
473 /* A type name.  */
474 struct c_type_name {
475   /* The declaration specifiers.  */
476   struct c_declspecs *specs;
477   /* The declarator.  */
478   struct c_declarator *declarator;
479 };
480 
481 /* A parameter.  */
482 struct c_parm {
483   /* The declaration specifiers, minus any prefix attributes.  */
484   struct c_declspecs *specs;
485   /* The attributes.  */
486   tree attrs;
487   /* The declarator.  */
488   struct c_declarator *declarator;
489   /* The location of the parameter.  */
490   location_t loc;
491 };
492 
493 /* Used when parsing an enum.  Initialized by start_enum.  */
494 struct c_enum_contents
495 {
496   /* While defining an enum type, this is 1 plus the last enumerator
497      constant value.  */
498   tree enum_next_value;
499 
500   /* Nonzero means that there was overflow computing enum_next_value.  */
501   int enum_overflow;
502 };
503 
504 /* A type of reference to a static identifier in an inline
505    function.  */
506 enum c_inline_static_type {
507   /* Identifier with internal linkage used in function that may be an
508      inline definition (i.e., file-scope static).  */
509   csi_internal,
510   /* Modifiable object with static storage duration defined in
511      function that may be an inline definition (i.e., local
512      static).  */
513   csi_modifiable
514 };
515 
516 
517 /* in c-parser.c */
518 extern void c_parse_init (void);
519 extern bool c_keyword_starts_typename (enum rid keyword);
520 
521 /* in c-aux-info.c */
522 extern void gen_aux_info_record (tree, int, int, int);
523 
524 /* in c-decl.c */
525 struct c_spot_bindings;
526 struct c_struct_parse_info;
527 extern struct obstack parser_obstack;
528 extern tree c_break_label;
529 extern tree c_cont_label;
530 
531 extern bool global_bindings_p (void);
532 extern tree pushdecl (tree);
533 extern void push_scope (void);
534 extern tree pop_scope (void);
535 extern void c_bindings_start_stmt_expr (struct c_spot_bindings *);
536 extern void c_bindings_end_stmt_expr (struct c_spot_bindings *);
537 
538 extern void record_inline_static (location_t, tree, tree,
539 				  enum c_inline_static_type);
540 extern void c_init_decl_processing (void);
541 extern void c_print_identifier (FILE *, tree, int);
542 extern int quals_from_declspecs (const struct c_declspecs *);
543 extern struct c_declarator *build_array_declarator (location_t, tree,
544     						    struct c_declspecs *,
545 						    bool, bool);
546 extern tree build_enumerator (location_t, location_t, struct c_enum_contents *,
547 			      tree, tree);
548 extern tree check_for_loop_decls (location_t, bool);
549 extern void mark_forward_parm_decls (void);
550 extern void declare_parm_level (void);
551 extern void undeclared_variable (location_t, tree);
552 extern tree lookup_label_for_goto (location_t, tree);
553 extern tree declare_label (tree);
554 extern tree define_label (location_t, tree);
555 extern struct c_spot_bindings *c_get_switch_bindings (void);
556 extern void c_release_switch_bindings (struct c_spot_bindings *);
557 extern bool c_check_switch_jump_warnings (struct c_spot_bindings *,
558 					  location_t, location_t);
559 extern void finish_decl (tree, location_t, tree, tree, tree);
560 extern tree finish_enum (tree, tree, tree);
561 extern void finish_function (void);
562 extern tree finish_struct (location_t, tree, tree, tree,
563 			   struct c_struct_parse_info *);
564 extern struct c_arg_info *build_arg_info (void);
565 extern struct c_arg_info *get_parm_info (bool, tree);
566 extern tree grokfield (location_t, struct c_declarator *,
567 		       struct c_declspecs *, tree, tree *);
568 extern tree groktypename (struct c_type_name *, tree *, bool *);
569 extern tree grokparm (const struct c_parm *, tree *);
570 extern tree implicitly_declare (location_t, tree);
571 extern void keep_next_level (void);
572 extern void pending_xref_error (void);
573 extern void c_push_function_context (void);
574 extern void c_pop_function_context (void);
575 extern void push_parm_decl (const struct c_parm *, tree *);
576 extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
577 							struct c_declarator *);
578 extern tree c_builtin_function (tree);
579 extern tree c_builtin_function_ext_scope (tree);
580 extern void shadow_tag (const struct c_declspecs *);
581 extern void shadow_tag_warned (const struct c_declspecs *, int);
582 extern tree start_enum (location_t, struct c_enum_contents *, tree);
583 extern bool start_function (struct c_declspecs *, struct c_declarator *, tree);
584 extern tree start_decl (struct c_declarator *, struct c_declspecs *, bool,
585 			tree);
586 extern tree start_struct (location_t, enum tree_code, tree,
587 			  struct c_struct_parse_info **);
588 extern void store_parm_decls (void);
589 extern void store_parm_decls_from (struct c_arg_info *);
590 extern void temp_store_parm_decls (tree, tree);
591 extern void temp_pop_parm_decls (void);
592 extern tree xref_tag (enum tree_code, tree);
593 extern struct c_typespec parser_xref_tag (location_t, enum tree_code, tree);
594 extern struct c_parm *build_c_parm (struct c_declspecs *, tree,
595 				    struct c_declarator *, location_t);
596 extern struct c_declarator *build_attrs_declarator (tree,
597 						    struct c_declarator *);
598 extern struct c_declarator *build_function_declarator (struct c_arg_info *,
599 						       struct c_declarator *);
600 extern struct c_declarator *build_id_declarator (tree);
601 extern struct c_declarator *make_pointer_declarator (struct c_declspecs *,
602 						     struct c_declarator *);
603 extern struct c_declspecs *build_null_declspecs (void);
604 extern struct c_declspecs *declspecs_add_qual (location_t,
605 					       struct c_declspecs *, tree);
606 extern struct c_declspecs *declspecs_add_type (location_t,
607 					       struct c_declspecs *,
608 					       struct c_typespec);
609 extern struct c_declspecs *declspecs_add_scspec (location_t,
610 						 struct c_declspecs *, tree);
611 extern struct c_declspecs *declspecs_add_attrs (location_t,
612 						struct c_declspecs *, tree);
613 extern struct c_declspecs *declspecs_add_addrspace (location_t,
614 						    struct c_declspecs *,
615 						    addr_space_t);
616 extern struct c_declspecs *declspecs_add_alignas (location_t,
617 						  struct c_declspecs *, tree);
618 extern struct c_declspecs *finish_declspecs (struct c_declspecs *);
619 
620 /* in c-objc-common.c */
621 extern bool c_objc_common_init (void);
622 extern bool c_missing_noreturn_ok_p (tree);
623 extern bool c_warn_unused_global_decl (const_tree);
624 extern void c_initialize_diagnostics (diagnostic_context *);
625 extern bool c_vla_unspec_p (tree x, tree fn);
626 extern alias_set_type c_get_alias_set (tree);
627 
628 /* in c-typeck.c */
629 extern int in_alignof;
630 extern int in_sizeof;
631 extern int in_typeof;
632 
633 extern tree c_last_sizeof_arg;
634 extern location_t c_last_sizeof_loc;
635 
636 extern struct c_switch *c_switch_stack;
637 
638 extern tree c_objc_common_truthvalue_conversion (location_t, tree);
639 extern tree require_complete_type (location_t, tree);
640 extern bool same_translation_unit_p (const_tree, const_tree);
641 extern int comptypes (tree, tree);
642 extern int comptypes_check_different_types (tree, tree, bool *);
643 extern bool c_vla_type_p (const_tree);
644 extern bool c_mark_addressable (tree, bool = false);
645 extern void c_incomplete_type_error (location_t, const_tree, const_tree);
646 extern tree c_type_promotes_to (tree);
647 extern struct c_expr default_function_array_conversion (location_t,
648 							struct c_expr);
649 extern struct c_expr default_function_array_read_conversion (location_t,
650 							     struct c_expr);
651 extern struct c_expr convert_lvalue_to_rvalue (location_t, struct c_expr,
652 					       bool, bool);
653 extern tree decl_constant_value_1 (tree, bool);
654 extern void mark_exp_read (tree);
655 extern tree composite_type (tree, tree);
656 extern tree build_component_ref (location_t, tree, tree, location_t);
657 extern tree build_array_ref (location_t, tree, tree);
658 extern tree build_external_ref (location_t, tree, bool, tree *);
659 extern void pop_maybe_used (bool);
660 extern struct c_expr c_expr_sizeof_expr (location_t, struct c_expr);
661 extern struct c_expr c_expr_sizeof_type (location_t, struct c_type_name *);
662 extern struct c_expr parser_build_unary_op (location_t, enum tree_code,
663     					    struct c_expr);
664 extern struct c_expr parser_build_binary_op (location_t,
665     					     enum tree_code, struct c_expr,
666 					     struct c_expr);
667 extern tree build_conditional_expr (location_t, tree, bool, tree, tree,
668 				    location_t, tree, tree, location_t);
669 extern tree build_compound_expr (location_t, tree, tree);
670 extern tree c_cast_expr (location_t, struct c_type_name *, tree);
671 extern tree build_c_cast (location_t, tree, tree);
672 extern void store_init_value (location_t, tree, tree, tree);
673 extern void maybe_warn_string_init (location_t, tree, struct c_expr);
674 extern void start_init (tree, tree, int, rich_location *);
675 extern void finish_init (void);
676 extern void really_start_incremental_init (tree);
677 extern void finish_implicit_inits (location_t, struct obstack *);
678 extern void push_init_level (location_t, int, struct obstack *);
679 extern struct c_expr pop_init_level (location_t, int, struct obstack *,
680 				     location_t);
681 extern void set_init_index (location_t, tree, tree, struct obstack *);
682 extern void set_init_label (location_t, tree, location_t, struct obstack *);
683 extern void process_init_element (location_t, struct c_expr, bool,
684 				  struct obstack *);
685 extern tree build_compound_literal (location_t, tree, tree, bool,
686 				    unsigned int);
687 extern void check_compound_literal_type (location_t, struct c_type_name *);
688 extern tree c_start_case (location_t, location_t, tree, bool);
689 extern void c_finish_case (tree, tree);
690 extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool,
691 			    bool);
692 extern tree build_asm_stmt (bool, tree);
693 extern int c_types_compatible_p (tree, tree);
694 extern tree c_begin_compound_stmt (bool);
695 extern tree c_end_compound_stmt (location_t, tree, bool);
696 extern void c_finish_if_stmt (location_t, tree, tree, tree);
697 extern void c_finish_loop (location_t, location_t, tree, location_t, tree,
698 			   tree, tree, tree, bool);
699 extern tree c_begin_stmt_expr (void);
700 extern tree c_finish_stmt_expr (location_t, tree);
701 extern tree c_process_expr_stmt (location_t, tree);
702 extern tree c_finish_expr_stmt (location_t, tree);
703 extern tree c_finish_return (location_t, tree, tree);
704 extern tree c_finish_bc_stmt (location_t, tree *, bool);
705 extern tree c_finish_goto_label (location_t, tree);
706 extern tree c_finish_goto_ptr (location_t, tree);
707 extern tree c_expr_to_decl (tree, bool *, bool *);
708 extern tree c_finish_omp_construct (location_t, enum tree_code, tree, tree);
709 extern tree c_finish_oacc_data (location_t, tree, tree);
710 extern tree c_finish_oacc_host_data (location_t, tree, tree);
711 extern tree c_begin_omp_parallel (void);
712 extern tree c_finish_omp_parallel (location_t, tree, tree);
713 extern tree c_begin_omp_task (void);
714 extern tree c_finish_omp_task (location_t, tree, tree);
715 extern void c_finish_omp_cancel (location_t, tree);
716 extern void c_finish_omp_cancellation_point (location_t, tree);
717 extern tree c_finish_omp_clauses (tree, enum c_omp_region_type);
718 extern tree c_build_va_arg (location_t, tree, location_t, tree);
719 extern tree c_finish_transaction (location_t, tree, int);
720 extern bool c_tree_equal (tree, tree);
721 extern tree c_build_function_call_vec (location_t, vec<location_t>, tree,
722 				       vec<tree, va_gc> *, vec<tree, va_gc> *);
723 extern tree c_omp_clause_copy_ctor (tree, tree, tree);
724 
725 /* Set to 0 at beginning of a function definition, set to 1 if
726    a return statement that specifies a return value is seen.  */
727 
728 extern int current_function_returns_value;
729 
730 /* Set to 0 at beginning of a function definition, set to 1 if
731    a return statement with no argument is seen.  */
732 
733 extern int current_function_returns_null;
734 
735 /* Set to 0 at beginning of a function definition, set to 1 if
736    a call to a noreturn function is seen.  */
737 
738 extern int current_function_returns_abnormally;
739 
740 /* In c-decl.c */
741 
742 /* Tell the binding oracle what kind of binding we are looking for.  */
743 
744 enum c_oracle_request
745 {
746   C_ORACLE_SYMBOL,
747   C_ORACLE_TAG,
748   C_ORACLE_LABEL
749 };
750 
751 /* If this is non-NULL, then it is a "binding oracle" which can lazily
752    create bindings when needed by the C compiler.  The oracle is told
753    the name and type of the binding to create.  It can call pushdecl
754    or the like to ensure the binding is visible; or do nothing,
755    leaving the binding untouched.  c-decl.c takes note of when the
756    oracle has been called and will not call it again if it fails to
757    create a given binding.  */
758 
759 typedef void c_binding_oracle_function (enum c_oracle_request, tree identifier);
760 
761 extern c_binding_oracle_function *c_binding_oracle;
762 
763 extern void c_finish_incomplete_decl (tree);
764 extern tree c_omp_reduction_id (enum tree_code, tree);
765 extern tree c_omp_reduction_decl (tree);
766 extern tree c_omp_reduction_lookup (tree, tree);
767 extern tree c_check_omp_declare_reduction_r (tree *, int *, void *);
768 extern void c_pushtag (location_t, tree, tree);
769 extern void c_bind (location_t, tree, bool);
770 extern bool tag_exists_p (enum tree_code, tree);
771 
772 /* In c-errors.c */
773 extern bool pedwarn_c90 (location_t, int opt, const char *, ...)
774     ATTRIBUTE_GCC_DIAG(3,4);
775 extern bool pedwarn_c99 (location_t, int opt, const char *, ...)
776     ATTRIBUTE_GCC_DIAG(3,4);
777 extern bool pedwarn_c11 (location_t, int opt, const char *, ...)
778     ATTRIBUTE_GCC_DIAG(3,4);
779 
780 extern void
781 set_c_expr_source_range (c_expr *expr,
782 			 location_t start, location_t finish);
783 
784 extern void
785 set_c_expr_source_range (c_expr *expr,
786 			 source_range src_range);
787 
788 /* In c-fold.c */
789 extern vec<tree> incomplete_record_decls;
790 
791 #if CHECKING_P
792 namespace selftest {
793   extern void run_c_tests (void);
794 } // namespace selftest
795 #endif /* #if CHECKING_P */
796 
797 
798 #endif /* ! GCC_C_TREE_H */
799