annotate gcc/c/c-tree.h @ 113:bdf41c9fa0b7

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