annotate gcc/c/c-tree.h @ 158:494b0b89df80 default tip

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