]>
Commit | Line | Data |
---|---|---|
8da1b058 | 1 | /* Front-end tree definitions for GNU compiler. |
91d231cb | 2 | Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
06ceef4e | 3 | Free Software Foundation, Inc. |
8da1b058 | 4 | |
1322177d | 5 | This file is part of GCC. |
8da1b058 | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9 | Software Foundation; either version 2, or (at your option) any later | |
10 | version. | |
8da1b058 | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
8da1b058 RS |
16 | |
17 | You should have received a copy of the GNU General Public License | |
1322177d LB |
18 | along with GCC; see the file COPYING. If not, write to the Free |
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | 02111-1307, USA. */ | |
8da1b058 RS |
21 | |
22 | #include "machmode.h" | |
9f8f4efe | 23 | #include "version.h" |
8da1b058 | 24 | |
d6b12657 | 25 | /* Codes of tree nodes */ |
8da1b058 RS |
26 | |
27 | #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM, | |
28 | ||
29 | enum tree_code { | |
30 | #include "tree.def" | |
31 | ||
6dc42e49 | 32 | LAST_AND_UNUSED_TREE_CODE /* A convenient way to get a value for |
8da1b058 RS |
33 | NUM_TREE_CODE. */ |
34 | }; | |
35 | ||
36 | #undef DEFTREECODE | |
37 | ||
8d5e6e25 RK |
38 | /* Number of language-independent tree codes. */ |
39 | #define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE) | |
8da1b058 RS |
40 | |
41 | /* Indexed by enum tree_code, contains a character which is | |
42 | `<' for a comparison expression, `1', for a unary arithmetic | |
43 | expression, `2' for a binary arithmetic expression, `e' for | |
44 | other types of expressions, `r' for a reference, `c' for a | |
45 | constant, `d' for a decl, `t' for a type, `s' for a statement, | |
46 | and `x' for anything else (TREE_LIST, IDENTIFIER, etc). */ | |
47 | ||
0a6969ad JC |
48 | #define MAX_TREE_CODES 256 |
49 | extern char tree_code_type[MAX_TREE_CODES]; | |
50 | #define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)] | |
8da1b058 | 51 | |
4da05956 MM |
52 | /* Returns non-zero iff CLASS is the tree-code class of an |
53 | expression. */ | |
54 | ||
55 | #define IS_EXPR_CODE_CLASS(CLASS) \ | |
8830da36 | 56 | (CLASS == '<' || CLASS == '1' || CLASS == '2' || CLASS == 'e') |
4da05956 | 57 | |
8da1b058 RS |
58 | /* Number of argument-words in each kind of tree-node. */ |
59 | ||
0a6969ad | 60 | extern int tree_code_length[MAX_TREE_CODES]; |
8d5e6e25 | 61 | #define TREE_CODE_LENGTH(CODE) tree_code_length[(int) (CODE)] |
8da1b058 RS |
62 | |
63 | /* Names of tree components. */ | |
64 | ||
5f8ded66 | 65 | extern const char *tree_code_name[MAX_TREE_CODES]; |
8da1b058 | 66 | \f |
9df2c88c RK |
67 | /* Classify which part of the compiler has defined a given builtin function. |
68 | Note that we assume below that this is no more than two bits. */ | |
26db82d8 BS |
69 | enum built_in_class |
70 | { | |
71 | NOT_BUILT_IN = 0, | |
72 | BUILT_IN_FRONTEND, | |
73 | BUILT_IN_MD, | |
74 | BUILT_IN_NORMAL | |
75 | }; | |
9df2c88c RK |
76 | |
77 | /* Names for the above. */ | |
fd05eb80 | 78 | extern const char *const built_in_class_names[4]; |
9df2c88c | 79 | |
8da1b058 RS |
80 | /* Codes that identify the various built in functions |
81 | so that expand_call can identify them quickly. */ | |
82 | ||
10841285 | 83 | #define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA) ENUM, |
8da1b058 RS |
84 | enum built_in_function |
85 | { | |
cb1072f4 | 86 | #include "builtins.def" |
972ded9c | 87 | |
2ba84f36 | 88 | /* Upper bound on non-language-specific builtins. */ |
972ded9c | 89 | END_BUILTINS |
8da1b058 | 90 | }; |
cb1072f4 | 91 | #undef DEF_BUILTIN |
9df2c88c RK |
92 | |
93 | /* Names for the above. */ | |
fd05eb80 | 94 | extern const char *const built_in_names[(int) END_BUILTINS]; |
3ff5f682 KG |
95 | |
96 | /* An array of _DECL trees for the above. */ | |
2f78c311 | 97 | extern tree built_in_decls[(int) END_BUILTINS]; |
8da1b058 RS |
98 | \f |
99 | /* The definition of tree nodes fills the next several pages. */ | |
100 | ||
101 | /* A tree node can represent a data type, a variable, an expression | |
102 | or a statement. Each node has a TREE_CODE which says what kind of | |
103 | thing it represents. Some common codes are: | |
104 | INTEGER_TYPE -- represents a type of integers. | |
105 | ARRAY_TYPE -- represents a type of pointer. | |
106 | VAR_DECL -- represents a declared variable. | |
107 | INTEGER_CST -- represents a constant integer value. | |
108 | PLUS_EXPR -- represents a sum (an expression). | |
109 | ||
110 | As for the contents of a tree node: there are some fields | |
111 | that all nodes share. Each TREE_CODE has various special-purpose | |
112 | fields as well. The fields of a node are never accessed directly, | |
113 | always through accessor macros. */ | |
114 | ||
8da1b058 RS |
115 | /* Every kind of tree node starts with this structure, |
116 | so all nodes have these fields. | |
117 | ||
76c9d226 | 118 | See the accessor macros, defined below, for documentation of the |
eebedaa5 | 119 | fields. */ |
8da1b058 RS |
120 | |
121 | struct tree_common | |
122 | { | |
2f78c311 ZW |
123 | tree chain; |
124 | tree type; | |
2b1d9dc0 | 125 | void *aux; |
c149cc37 | 126 | ENUM_BITFIELD(tree_code) code : 8; |
8da1b058 RS |
127 | unsigned side_effects_flag : 1; |
128 | unsigned constant_flag : 1; | |
8da1b058 RS |
129 | unsigned addressable_flag : 1; |
130 | unsigned volatile_flag : 1; | |
131 | unsigned readonly_flag : 1; | |
132 | unsigned unsigned_flag : 1; | |
133 | unsigned asm_written_flag: 1; | |
134 | ||
135 | unsigned used_flag : 1; | |
12a22e76 | 136 | unsigned nothrow_flag : 1; |
8da1b058 RS |
137 | unsigned static_flag : 1; |
138 | unsigned public_flag : 1; | |
139 | unsigned private_flag : 1; | |
140 | unsigned protected_flag : 1; | |
a6d7adfd | 141 | unsigned bounded_flag : 1; |
8da1b058 RS |
142 | |
143 | unsigned lang_flag_0 : 1; | |
144 | unsigned lang_flag_1 : 1; | |
145 | unsigned lang_flag_2 : 1; | |
146 | unsigned lang_flag_3 : 1; | |
147 | unsigned lang_flag_4 : 1; | |
148 | unsigned lang_flag_5 : 1; | |
149 | unsigned lang_flag_6 : 1; | |
1f8f4a0b MM |
150 | /* This flag is presently unused. However, language front-ends |
151 | should not make use of this flag; it is reserved for future | |
152 | expansion. */ | |
153 | unsigned dummy : 1; | |
8da1b058 RS |
154 | }; |
155 | ||
a5f99f01 RK |
156 | /* The following table lists the uses of each of the above flags and |
157 | for which types of nodes they are defined. Note that expressions | |
158 | include decls. | |
159 | ||
160 | addressable_flag: | |
161 | ||
162 | TREE_ADDRESSABLE in | |
1febe16b RK |
163 | VAR_DECL, FUNCTION_DECL, FIELD_DECL, CONSTRUCTOR, LABEL_DECL, |
164 | ..._TYPE, IDENTIFIER_NODE | |
a5f99f01 RK |
165 | |
166 | static_flag: | |
167 | ||
168 | TREE_STATIC in | |
e5e809f4 | 169 | VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR |
a5f99f01 RK |
170 | TREE_NO_UNUSED_WARNING in |
171 | CONVERT_EXPR, NOP_EXPR, COMPOUND_EXPR | |
172 | TREE_VIA_VIRTUAL in | |
173 | TREE_LIST or TREE_VEC | |
174 | TREE_CONSTANT_OVERFLOW in | |
175 | INTEGER_CST, REAL_CST, COMPLEX_CST | |
176 | TREE_SYMBOL_REFERENCED in | |
177 | IDENTIFIER_NODE | |
178 | ||
179 | public_flag: | |
180 | ||
181 | TREE_OVERFLOW in | |
182 | INTEGER_CST, REAL_CST, COMPLEX_CST | |
183 | TREE_PUBLIC in | |
4c521bad | 184 | VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE |
a5f99f01 RK |
185 | TREE_VIA_PUBLIC in |
186 | TREE_LIST or TREE_VEC | |
dadafe54 PB |
187 | EXPR_WFL_EMIT_LINE_NOTE in |
188 | EXPR_WITH_FILE_LOCATION | |
a5f99f01 RK |
189 | |
190 | private_flag: | |
191 | ||
192 | TREE_VIA_PRIVATE in | |
193 | TREE_LIST or TREE_VEC | |
194 | TREE_PRIVATE in | |
195 | ??? unspecified nodes | |
196 | ||
197 | protected_flag: | |
198 | ||
199 | TREE_VIA_PROTECTED in | |
200 | TREE_LIST | |
201 | TREE_PROTECTED in | |
202 | BLOCK | |
203 | ??? unspecified nodes | |
204 | ||
205 | side_effects_flag: | |
206 | ||
207 | TREE_SIDE_EFFECTS in | |
208 | all expressions | |
209 | ||
210 | volatile_flag: | |
211 | ||
212 | TREE_THIS_VOLATILE in | |
213 | all expressions | |
214 | TYPE_VOLATILE in | |
215 | ..._TYPE | |
216 | ||
217 | readonly_flag: | |
218 | ||
219 | TREE_READONLY in | |
e5e809f4 | 220 | all expressions |
a5f99f01 RK |
221 | TYPE_READONLY in |
222 | ..._TYPE | |
223 | ||
224 | constant_flag: | |
225 | ||
226 | TREE_CONSTANT in | |
227 | all expressions | |
228 | ||
a5f99f01 RK |
229 | unsigned_flag: |
230 | ||
231 | TREE_UNSIGNED in | |
232 | INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL | |
a5f99f01 RK |
233 | DECL_BUILT_IN_NONANSI in |
234 | FUNCTION_DECL | |
e9a25f70 JL |
235 | SAVE_EXPR_NOPLACEHOLDER in |
236 | SAVE_EXPR | |
a5f99f01 RK |
237 | |
238 | asm_written_flag: | |
239 | ||
240 | TREE_ASM_WRITTEN in | |
241 | VAR_DECL, FUNCTION_DECL, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE | |
242 | BLOCK | |
243 | ||
244 | used_flag: | |
245 | ||
246 | TREE_USED in | |
247 | expressions, IDENTIFIER_NODE | |
248 | ||
12a22e76 | 249 | nothrow_flag: |
a5f99f01 | 250 | |
12a22e76 JM |
251 | TREE_NOTHROW in |
252 | CALL_EXPR, FUNCTION_DECL | |
a5f99f01 | 253 | |
a6d7adfd GM |
254 | bounded_flag: |
255 | ||
256 | TREE_BOUNDED in | |
4c521bad NB |
257 | expressions, VAR_DECL, PARM_DECL, FIELD_DECL, FUNCTION_DECL, |
258 | IDENTIFIER_NODE | |
a6d7adfd GM |
259 | TYPE_BOUNDED in |
260 | ..._TYPE | |
261 | */ | |
262 | ||
8da1b058 RS |
263 | /* Define accessors for the fields that all tree nodes have |
264 | (though some fields are not used for all kinds of nodes). */ | |
265 | ||
266 | /* The tree-code says what kind of node it is. | |
267 | Codes are defined in tree.def. */ | |
268 | #define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code) | |
dbbbbf3b JDA |
269 | #define TREE_SET_CODE(NODE, VALUE) \ |
270 | ((NODE)->common.code = (ENUM_BITFIELD(tree_code)) (VALUE)) | |
8da1b058 | 271 | |
12b195d9 | 272 | /* When checking is enabled, errors will be generated if a tree node |
8f985ec4 | 273 | is accessed incorrectly. The macros abort with a fatal error. */ |
f4524c9e | 274 | #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) |
12b195d9 | 275 | |
8784fdcd | 276 | #define TREE_CHECK(t, code) __extension__ \ |
8f985ec4 ZW |
277 | ({ const tree __t = t; \ |
278 | if (TREE_CODE(__t) != (code)) \ | |
fbfc1192 | 279 | tree_check_failed (__t, code, __FILE__, __LINE__, __FUNCTION__); \ |
8f985ec4 | 280 | __t; }) |
8784fdcd | 281 | #define TREE_CLASS_CHECK(t, class) __extension__ \ |
8f985ec4 ZW |
282 | ({ const tree __t = t; \ |
283 | if (TREE_CODE_CLASS(TREE_CODE(__t)) != (class)) \ | |
fbfc1192 | 284 | tree_class_check_failed (__t, class, __FILE__, __LINE__, __FUNCTION__); \ |
8f985ec4 ZW |
285 | __t; }) |
286 | ||
287 | /* These checks have to be special cased. */ | |
8784fdcd | 288 | #define CST_OR_CONSTRUCTOR_CHECK(t) __extension__ \ |
8f985ec4 ZW |
289 | ({ const tree __t = t; \ |
290 | enum tree_code __c = TREE_CODE(__t); \ | |
291 | if (__c != CONSTRUCTOR && TREE_CODE_CLASS(__c) != 'c') \ | |
fbfc1192 | 292 | tree_check_failed (__t, CONSTRUCTOR, __FILE__, __LINE__, __FUNCTION__); \ |
8f985ec4 | 293 | __t; }) |
8784fdcd | 294 | #define EXPR_CHECK(t) __extension__ \ |
8f985ec4 ZW |
295 | ({ const tree __t = t; \ |
296 | char __c = TREE_CODE_CLASS(TREE_CODE(__t)); \ | |
297 | if (__c != 'r' && __c != 's' && __c != '<' \ | |
298 | && __c != '1' && __c != '2' && __c != 'e') \ | |
fbfc1192 | 299 | tree_class_check_failed(__t, 'e', __FILE__, __LINE__, __FUNCTION__); \ |
8f985ec4 ZW |
300 | __t; }) |
301 | ||
58782098 | 302 | extern void tree_check_failed PARAMS ((const tree, enum tree_code, |
f8a83ee3 | 303 | const char *, int, const char *)) |
8f985ec4 | 304 | ATTRIBUTE_NORETURN; |
f8a83ee3 ZW |
305 | extern void tree_class_check_failed PARAMS ((const tree, int, |
306 | const char *, int, const char *)) | |
8f985ec4 ZW |
307 | ATTRIBUTE_NORETURN; |
308 | ||
f4524c9e | 309 | #else /* not ENABLE_TREE_CHECKING, or not gcc */ |
12b195d9 | 310 | |
8f985ec4 ZW |
311 | #define TREE_CHECK(t, code) (t) |
312 | #define TREE_CLASS_CHECK(t, code) (t) | |
313 | #define CST_OR_CONSTRUCTOR_CHECK(t) (t) | |
314 | #define EXPR_CHECK(t) (t) | |
315 | ||
316 | #endif | |
317 | ||
318 | #include "tree-check.h" | |
319 | ||
320 | #define TYPE_CHECK(tree) TREE_CLASS_CHECK (tree, 't') | |
321 | #define DECL_CHECK(tree) TREE_CLASS_CHECK (tree, 'd') | |
322 | #define CST_CHECK(tree) TREE_CLASS_CHECK (tree, 'c') | |
12b195d9 | 323 | |
8da1b058 RS |
324 | /* In all nodes that are expressions, this is the data type of the expression. |
325 | In POINTER_TYPE nodes, this is the type that the pointer points to. | |
0b4565c9 BS |
326 | In ARRAY_TYPE nodes, this is the type of the elements. |
327 | In VECTOR_TYPE nodes, this is the type of the elements. */ | |
8da1b058 RS |
328 | #define TREE_TYPE(NODE) ((NODE)->common.type) |
329 | ||
1c0cc57e KG |
330 | /* Here is how primitive or already-canonicalized types' hash codes |
331 | are made. */ | |
332 | #define TYPE_HASH(TYPE) ((size_t) (TYPE) & 0777777) | |
333 | ||
8da1b058 RS |
334 | /* Nodes are chained together for many purposes. |
335 | Types are chained together to record them for being output to the debugger | |
336 | (see the function `chain_type'). | |
337 | Decls in the same scope are chained together to record the contents | |
338 | of the scope. | |
339 | Statement nodes for successive statements used to be chained together. | |
340 | Often lists of things are represented by TREE_LIST nodes that | |
341 | are chained together. */ | |
342 | ||
343 | #define TREE_CHAIN(NODE) ((NODE)->common.chain) | |
344 | ||
345 | /* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs | |
346 | that don't change the machine mode. */ | |
347 | ||
9a6bb3f7 | 348 | #define STRIP_NOPS(EXP) \ |
8da1b058 RS |
349 | while ((TREE_CODE (EXP) == NOP_EXPR \ |
350 | || TREE_CODE (EXP) == CONVERT_EXPR \ | |
351 | || TREE_CODE (EXP) == NON_LVALUE_EXPR) \ | |
9a6bb3f7 | 352 | && TREE_OPERAND (EXP, 0) != error_mark_node \ |
8da1b058 RS |
353 | && (TYPE_MODE (TREE_TYPE (EXP)) \ |
354 | == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ | |
355 | (EXP) = TREE_OPERAND (EXP, 0); | |
0fafb45e | 356 | |
14a774a9 RK |
357 | /* Like STRIP_NOPS, but don't let the signedness change either. */ |
358 | ||
359 | #define STRIP_SIGN_NOPS(EXP) \ | |
360 | while ((TREE_CODE (EXP) == NOP_EXPR \ | |
361 | || TREE_CODE (EXP) == CONVERT_EXPR \ | |
362 | || TREE_CODE (EXP) == NON_LVALUE_EXPR) \ | |
9a6bb3f7 | 363 | && TREE_OPERAND (EXP, 0) != error_mark_node \ |
14a774a9 RK |
364 | && (TYPE_MODE (TREE_TYPE (EXP)) \ |
365 | == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))) \ | |
366 | && (TREE_UNSIGNED (TREE_TYPE (EXP)) \ | |
367 | == TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ | |
368 | (EXP) = TREE_OPERAND (EXP, 0); | |
369 | ||
0fafb45e RS |
370 | /* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */ |
371 | ||
372 | #define STRIP_TYPE_NOPS(EXP) \ | |
373 | while ((TREE_CODE (EXP) == NOP_EXPR \ | |
374 | || TREE_CODE (EXP) == CONVERT_EXPR \ | |
375 | || TREE_CODE (EXP) == NON_LVALUE_EXPR) \ | |
9a6bb3f7 | 376 | && TREE_OPERAND (EXP, 0) != error_mark_node \ |
0fafb45e RS |
377 | && (TREE_TYPE (EXP) \ |
378 | == TREE_TYPE (TREE_OPERAND (EXP, 0)))) \ | |
379 | (EXP) = TREE_OPERAND (EXP, 0); | |
87291138 RK |
380 | |
381 | /* Nonzero if TYPE represents an integral type. Note that we do not | |
382 | include COMPLEX types here. */ | |
383 | ||
384 | #define INTEGRAL_TYPE_P(TYPE) \ | |
385 | (TREE_CODE (TYPE) == INTEGER_TYPE || TREE_CODE (TYPE) == ENUMERAL_TYPE \ | |
386 | || TREE_CODE (TYPE) == BOOLEAN_TYPE || TREE_CODE (TYPE) == CHAR_TYPE) | |
387 | ||
388 | /* Nonzero if TYPE represents a floating-point type, including complex | |
389 | floating-point types. */ | |
390 | ||
391 | #define FLOAT_TYPE_P(TYPE) \ | |
392 | (TREE_CODE (TYPE) == REAL_TYPE \ | |
393 | || (TREE_CODE (TYPE) == COMPLEX_TYPE \ | |
394 | && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)) | |
947765f9 | 395 | |
2ba84f36 | 396 | /* Nonzero if TYPE represents an aggregate (multi-component) type. */ |
947765f9 PB |
397 | |
398 | #define AGGREGATE_TYPE_P(TYPE) \ | |
399 | (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \ | |
400 | || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE \ | |
401 | || TREE_CODE (TYPE) == SET_TYPE) | |
9e6cfc43 | 402 | |
a6d7adfd GM |
403 | /* Nonzero if TYPE represents an unbounded pointer or unbounded |
404 | reference type. (It should be renamed to INDIRECT_TYPE_P.) */ | |
9e6cfc43 JM |
405 | |
406 | #define POINTER_TYPE_P(TYPE) \ | |
407 | (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE) | |
555f90c5 | 408 | |
a6d7adfd GM |
409 | /* Nonzero if TYPE represents a bounded pointer or bounded reference type. */ |
410 | ||
411 | #define BOUNDED_INDIRECT_TYPE_P(TYPE) \ | |
412 | (TREE_CODE (TYPE) == RECORD_TYPE && TREE_TYPE (TYPE)) | |
413 | ||
414 | /* Nonzero if TYPE represents a bounded pointer type. */ | |
415 | ||
416 | #define BOUNDED_POINTER_TYPE_P(TYPE) \ | |
417 | (BOUNDED_INDIRECT_TYPE_P (TYPE) \ | |
418 | && TREE_CODE (TYPE_BOUNDED_SUBTYPE (TYPE)) == POINTER_TYPE) | |
419 | ||
420 | /* Nonzero if TYPE represents a bounded reference type. Bounded | |
421 | reference types have two specific uses: (1) When a reference is | |
422 | seated to a variable-length RECORD_TYPE that has an array of | |
423 | indeterminate length as its final field. For all other objects, it | |
424 | is sufficient to check bounds at the time the reference is seated, | |
425 | and assume that all future uses of the reference are safe, since | |
426 | the address of references cannot change. (2) When a reference | |
427 | supertype is seated to an subtype object. The bounds "remember" | |
428 | the true size of the complete object, so that subsequent upcasts of | |
429 | the address of the reference will be checked properly (is such a | |
430 | thing valid C++?). */ | |
431 | ||
432 | #define BOUNDED_REFERENCE_TYPE_P(TYPE) \ | |
433 | (BOUNDED_INDIRECT_TYPE_P (TYPE) \ | |
434 | && TREE_CODE (TYPE_BOUNDED_SUBTYPE (TYPE)) == REFERENCE_TYPE) | |
435 | ||
436 | /* Nonzero if TYPE represents a pointer or reference type, either | |
437 | bounded or unbounded. */ | |
438 | ||
439 | #define MAYBE_BOUNDED_INDIRECT_TYPE_P(TYPE) \ | |
440 | (POINTER_TYPE_P (TYPE) || BOUNDED_INDIRECT_TYPE_P (TYPE)) | |
441 | ||
442 | /* Nonzero if TYPE represents a pointer type, either bounded or unbounded. */ | |
443 | ||
444 | #define MAYBE_BOUNDED_POINTER_TYPE_P(TYPE) \ | |
445 | (TREE_CODE (TYPE) == POINTER_TYPE || BOUNDED_POINTER_TYPE_P (TYPE)) | |
446 | ||
447 | /* Nonzero if TYPE represents a reference type, either bounded or unbounded. */ | |
448 | ||
449 | #define MAYBE_BOUNDED_REFERENCE_TYPE_P(TYPE) \ | |
450 | (TREE_CODE (TYPE) == REFERENCE_TYPE || BOUNDED_REFERENCE_TYPE_P (TYPE)) | |
451 | ||
d0f062fb NS |
452 | /* Nonzero if this type is a complete type. */ |
453 | #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE) | |
454 | ||
71653180 | 455 | /* Nonzero if this type is the (possibly qualified) void type. */ |
e7cd085f | 456 | #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE) |
71653180 | 457 | |
d0f062fb NS |
458 | /* Nonzero if this type is complete or is cv void. */ |
459 | #define COMPLETE_OR_VOID_TYPE_P(NODE) \ | |
71653180 | 460 | (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE)) |
d0f062fb NS |
461 | |
462 | /* Nonzero if this type is complete or is an array with unspecified bound. */ | |
463 | #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \ | |
464 | (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : NODE)) | |
465 | ||
555f90c5 JM |
466 | /* Nonzero if TYPE represents a type. */ |
467 | ||
468 | #define TYPE_P(TYPE) (TREE_CODE_CLASS (TREE_CODE (TYPE)) == 't') | |
8da1b058 RS |
469 | \f |
470 | /* Define many boolean fields that all tree nodes have. */ | |
471 | ||
472 | /* In VAR_DECL nodes, nonzero means address of this is needed. | |
473 | So it cannot be in a register. | |
474 | In a FUNCTION_DECL, nonzero means its address is needed. | |
475 | So it must be compiled even if it is an inline function. | |
1febe16b RK |
476 | In a FIELD_DECL node, it means that the programmer is permitted to |
477 | construct the address of this field. This is used for aliasing | |
478 | purposes: see record_component_aliases. | |
8da1b058 RS |
479 | In CONSTRUCTOR nodes, it means object constructed must be in memory. |
480 | In LABEL_DECL nodes, it means a goto for this label has been seen | |
481 | from a place outside all binding contours that restore stack levels. | |
482 | In ..._TYPE nodes, it means that objects of this type must | |
483 | be fully addressable. This means that pieces of this | |
484 | object cannot go into register parameters, for example. | |
485 | In IDENTIFIER_NODEs, this means that some extern decl for this name | |
486 | had its address taken. That matters for inline functions. */ | |
487 | #define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_flag) | |
488 | ||
489 | /* In a VAR_DECL, nonzero means allocate static storage. | |
9f86614b | 490 | In a FUNCTION_DECL, nonzero if function has been defined. |
8da1b058 RS |
491 | In a CONSTRUCTOR, nonzero means allocate static storage. */ |
492 | #define TREE_STATIC(NODE) ((NODE)->common.static_flag) | |
493 | ||
248c0f74 JM |
494 | /* In a CONVERT_EXPR, NOP_EXPR or COMPOUND_EXPR, this means the node was |
495 | made implicitly and should not lead to an "unused value" warning. */ | |
8da1b058 RS |
496 | #define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag) |
497 | ||
498 | /* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation | |
499 | chain is via a `virtual' declaration. */ | |
500 | #define TREE_VIA_VIRTUAL(NODE) ((NODE)->common.static_flag) | |
501 | ||
ae202b56 RK |
502 | /* In an INTEGER_CST, REAL_CST, or COMPLEX_CST, this means there was an |
503 | overflow in folding. This is distinct from TREE_OVERFLOW because ANSI C | |
504 | requires a diagnostic when overflows occur in constant expressions. */ | |
261450e8 PE |
505 | #define TREE_CONSTANT_OVERFLOW(NODE) ((NODE)->common.static_flag) |
506 | ||
d3568529 JM |
507 | /* In an IDENTIFIER_NODE, this means that assemble_name was called with |
508 | this string as an argument. */ | |
509 | #define TREE_SYMBOL_REFERENCED(NODE) ((NODE)->common.static_flag) | |
510 | ||
ae202b56 RK |
511 | /* In an INTEGER_CST, REAL_CST, of COMPLEX_CST, this means there was an |
512 | overflow in folding, and no warning has been issued for this subexpression. | |
261450e8 PE |
513 | TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW, but not vice versa. */ |
514 | #define TREE_OVERFLOW(NODE) ((NODE)->common.public_flag) | |
515 | ||
8da1b058 RS |
516 | /* In a VAR_DECL or FUNCTION_DECL, |
517 | nonzero means name is to be accessible from outside this module. | |
4c521bad | 518 | In an IDENTIFIER_NODE, nonzero means an external declaration |
6dc42e49 | 519 | accessible from outside this module was previously seen |
8da1b058 RS |
520 | for this name in an inner scope. */ |
521 | #define TREE_PUBLIC(NODE) ((NODE)->common.public_flag) | |
522 | ||
523 | /* Nonzero for TREE_LIST or TREE_VEC node means that the path to the | |
524 | base class is via a `public' declaration, which preserves public | |
525 | fields from the base class as public. */ | |
526 | #define TREE_VIA_PUBLIC(NODE) ((NODE)->common.public_flag) | |
527 | ||
9e5386db MS |
528 | /* Ditto, for `private' declarations. */ |
529 | #define TREE_VIA_PRIVATE(NODE) ((NODE)->common.private_flag) | |
530 | ||
531 | /* Nonzero for TREE_LIST node means that the path to the | |
532 | base class is via a `protected' declaration, which preserves | |
533 | protected fields from the base class as protected. | |
534 | OVERLOADED. */ | |
026380ff | 535 | #define TREE_VIA_PROTECTED(NODE) ((NODE)->common.protected_flag) |
9e5386db | 536 | |
8da1b058 RS |
537 | /* In any expression, nonzero means it has side effects or reevaluation |
538 | of the whole expression could produce a different value. | |
539 | This is set if any subexpression is a function call, a side effect | |
540 | or a reference to a volatile variable. | |
541 | In a ..._DECL, this is set only if the declaration said `volatile'. */ | |
542 | #define TREE_SIDE_EFFECTS(NODE) ((NODE)->common.side_effects_flag) | |
543 | ||
544 | /* Nonzero means this expression is volatile in the C sense: | |
545 | its address should be of type `volatile WHATEVER *'. | |
546 | In other words, the declared item is volatile qualified. | |
547 | This is used in _DECL nodes and _REF nodes. | |
548 | ||
549 | In a ..._TYPE node, means this type is volatile-qualified. | |
550 | But use TYPE_VOLATILE instead of this macro when the node is a type, | |
551 | because eventually we may make that a different bit. | |
552 | ||
553 | If this bit is set in an expression, so is TREE_SIDE_EFFECTS. */ | |
554 | #define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag) | |
555 | ||
556 | /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node, | |
557 | nonzero means it may not be the lhs of an assignment. | |
558 | In a ..._TYPE node, means this type is const-qualified | |
559 | (but the macro TYPE_READONLY should be used instead of this macro | |
560 | when the node is a type). */ | |
561 | #define TREE_READONLY(NODE) ((NODE)->common.readonly_flag) | |
562 | ||
588d3ade AO |
563 | /* Non-zero if NODE is a _DECL with TREE_READONLY set. */ |
564 | #define TREE_READONLY_DECL_P(NODE) \ | |
565 | (TREE_READONLY (NODE) && DECL_P (NODE)) | |
566 | ||
8da1b058 RS |
567 | /* Value of expression is constant. |
568 | Always appears in all ..._CST nodes. | |
569 | May also appear in an arithmetic expression, an ADDR_EXPR or a CONSTRUCTOR | |
570 | if the value is constant. */ | |
571 | #define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag) | |
572 | ||
8da1b058 RS |
573 | /* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type. |
574 | In FIELD_DECL nodes, means an unsigned bit field. | |
575 | The same bit is used in functions as DECL_BUILT_IN_NONANSI. */ | |
576 | #define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag) | |
577 | ||
91ce572a CC |
578 | #define TYPE_TRAP_SIGNED(NODE) (flag_trapv && ! TREE_UNSIGNED (NODE)) |
579 | ||
8da1b058 RS |
580 | /* Nonzero in a VAR_DECL means assembler code has been written. |
581 | Nonzero in a FUNCTION_DECL means that the function has been compiled. | |
582 | This is interesting in an inline function, since it might not need | |
583 | to be compiled separately. | |
3635a54b | 584 | Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE |
9f86614b RS |
585 | if the sdb debugging info for the type has been written. |
586 | In a BLOCK node, nonzero if reorder_blocks has already seen this block. */ | |
8da1b058 RS |
587 | #define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag) |
588 | ||
589 | /* Nonzero in a _DECL if the name is used in its scope. | |
590 | Nonzero in an expr node means inhibit warning if value is unused. | |
591 | In IDENTIFIER_NODEs, this means that some extern decl for this name | |
592 | was used. */ | |
593 | #define TREE_USED(NODE) ((NODE)->common.used_flag) | |
594 | ||
12a22e76 JM |
595 | /* In a FUNCTION_DECL, nonzero means a call to the function cannot throw |
596 | an exception. In a CALL_EXPR, nonzero means the call cannot throw. */ | |
597 | #define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag) | |
c3d32120 RK |
598 | |
599 | /* In a type, nonzero means that all objects of the type are guaranteed by the | |
600 | language or front-end to be properly aligned, so we can indicate that a MEM | |
601 | of this type is aligned at least to the alignment of the type, even if it | |
602 | doesn't appear that it is. We see this, for example, in object-oriented | |
603 | languages where a tag field may show this is an object of a more-aligned | |
604 | variant of the more generic type. */ | |
605 | #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->common.nothrow_flag) | |
8da1b058 | 606 | |
9f86614b | 607 | /* Used in classes in C++. */ |
8da1b058 | 608 | #define TREE_PRIVATE(NODE) ((NODE)->common.private_flag) |
9f86614b RS |
609 | /* Used in classes in C++. |
610 | In a BLOCK node, this is BLOCK_HANDLER_BLOCK. */ | |
8da1b058 RS |
611 | #define TREE_PROTECTED(NODE) ((NODE)->common.protected_flag) |
612 | ||
a6d7adfd GM |
613 | /* In a ..._TYPE node, nonzero means that the type's size and layout, |
614 | (or the size and layout of its arguments and/or return value in the | |
615 | case of a FUNCTION_TYPE or METHOD_TYPE) was changed by the presence | |
616 | of pointer bounds. Use TYPE_BOUNDED instead of this macro when the | |
617 | node is a type, because eventually we may make that a different | |
618 | bit. TYPE_BOUNDED doesn't mean that this type is a bounded indirect | |
619 | type--use BOUNDED_POINTER_TYPE_P, BOUNDED_REFERENCE_TYPE_P, | |
620 | BOUNDED_INDIRECT_TYPE_P to test for that. | |
621 | ||
622 | In a FUNCTION_DECL, nonzero means that the size and layout of one | |
623 | of its arguments and/or return value was changed by the presence of | |
624 | pointer bounds. This value can differ from the value of | |
625 | TYPE_BOUNDED (TREE_TYPE (fundecl)) if the function was implicitly | |
626 | declared, then later called with pointer args, or was declared with | |
627 | a variable argument list and is later called with pointer values in | |
628 | the variable argument list. | |
629 | ||
630 | In a VAR_DECL, PARM_DECL or FIELD_DECL, TREE_BOUNDED matches the value | |
631 | of the decl's type's BOUNDED_POINTER_TYPE_P. | |
632 | ||
633 | In a CONSTRUCTOR or other expression, nonzero means the value is a | |
634 | bounded pointer. It is insufficient to determine the boundedness | |
635 | of an expression EXP with BOUNDED_POINTER_TYPE_P (TREE_TYPE (EXP)), | |
636 | since we allow pointer to be temporarily cast to integer for | |
637 | rounding up to an alignment boudary in a way that preserves the | |
638 | pointer's bounds. | |
639 | ||
640 | In an IDENTIFIER_NODE, nonzero means that the name is prefixed with | |
641 | BP_PREFIX (see varasm.c). This occurs for the DECL_ASSEMBLER_NAME | |
642 | of a function that has bounded pointer(s) for its return type and/or | |
643 | argument type(s). */ | |
644 | ||
645 | #define TREE_BOUNDED(NODE) ((NODE)->common.bounded_flag) | |
646 | ||
9f86614b | 647 | /* These flags are available for each language front end to use internally. */ |
8da1b058 RS |
648 | #define TREE_LANG_FLAG_0(NODE) ((NODE)->common.lang_flag_0) |
649 | #define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1) | |
650 | #define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2) | |
651 | #define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3) | |
652 | #define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4) | |
653 | #define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5) | |
654 | #define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6) | |
655 | \f | |
656 | /* Define additional fields and accessors for nodes representing constants. */ | |
657 | ||
e5d70561 RK |
658 | /* In an INTEGER_CST node. These two together make a 2-word integer. |
659 | If the data type is signed, the value is sign-extended to 2 words | |
8da1b058 | 660 | even though not all of them may really be in use. |
e5d70561 | 661 | In an unsigned constant shorter than 2 words, the extra bits are 0. */ |
2afaa41c GM |
662 | #define TREE_INT_CST(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst) |
663 | #define TREE_INT_CST_LOW(NODE) (TREE_INT_CST (NODE).low) | |
664 | #define TREE_INT_CST_HIGH(NODE) (TREE_INT_CST (NODE).high) | |
8da1b058 RS |
665 | |
666 | #define INT_CST_LT(A, B) \ | |
667 | (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \ | |
668 | || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B) \ | |
05bccae2 | 669 | && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B))) |
8da1b058 RS |
670 | |
671 | #define INT_CST_LT_UNSIGNED(A, B) \ | |
e5d70561 RK |
672 | (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \ |
673 | < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \ | |
674 | || (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \ | |
05bccae2 RK |
675 | == (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \ |
676 | && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B))) | |
8da1b058 RS |
677 | |
678 | struct tree_int_cst | |
679 | { | |
2bf105ab | 680 | struct tree_common common; |
2f78c311 | 681 | rtx rtl; /* acts as link to register transfer language |
8e15f736 | 682 | (rtl) info */ |
2afaa41c GM |
683 | /* A sub-struct is necessary here because the function `const_hash' |
684 | wants to scan both words as a unit and taking the address of the | |
685 | sub-struct yields the properly inclusive bounded pointer. */ | |
686 | struct { | |
687 | unsigned HOST_WIDE_INT low; | |
688 | HOST_WIDE_INT high; | |
689 | } int_cst; | |
8da1b058 RS |
690 | }; |
691 | ||
692 | /* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes, | |
693 | and generally in all kinds of constants that could | |
694 | be given labels (rather than being immediate). */ | |
695 | ||
12b195d9 | 696 | #define TREE_CST_RTL(NODE) (CST_OR_CONSTRUCTOR_CHECK (NODE)->real_cst.rtl) |
8da1b058 RS |
697 | |
698 | /* In a REAL_CST node. */ | |
699 | /* We can represent a real value as either a `double' or a string. | |
700 | Strings don't allow for any optimization, but they do allow | |
701 | for cross-compilation. */ | |
702 | ||
12b195d9 | 703 | #define TREE_REAL_CST(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst) |
8da1b058 RS |
704 | |
705 | #include "real.h" | |
706 | ||
707 | struct tree_real_cst | |
708 | { | |
2bf105ab | 709 | struct tree_common common; |
2f78c311 | 710 | rtx rtl; /* acts as link to register transfer language |
8da1b058 RS |
711 | (rtl) info */ |
712 | REAL_VALUE_TYPE real_cst; | |
713 | }; | |
714 | ||
715 | /* In a STRING_CST */ | |
12b195d9 ML |
716 | #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length) |
717 | #define TREE_STRING_POINTER(NODE) (STRING_CST_CHECK (NODE)->string.pointer) | |
8da1b058 RS |
718 | |
719 | struct tree_string | |
720 | { | |
2bf105ab | 721 | struct tree_common common; |
2f78c311 | 722 | rtx rtl; /* acts as link to register transfer language |
8da1b058 RS |
723 | (rtl) info */ |
724 | int length; | |
520a57c8 | 725 | const char *pointer; |
8da1b058 RS |
726 | }; |
727 | ||
728 | /* In a COMPLEX_CST node. */ | |
12b195d9 ML |
729 | #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real) |
730 | #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag) | |
8da1b058 RS |
731 | |
732 | struct tree_complex | |
733 | { | |
2bf105ab | 734 | struct tree_common common; |
2f78c311 | 735 | rtx rtl; /* acts as link to register transfer language |
8da1b058 | 736 | (rtl) info */ |
2f78c311 ZW |
737 | tree real; |
738 | tree imag; | |
8da1b058 RS |
739 | }; |
740 | \f | |
2a967f3d NB |
741 | #include "hashtable.h" |
742 | ||
8da1b058 RS |
743 | /* Define fields and accessors for some special-purpose tree nodes. */ |
744 | ||
2a967f3d NB |
745 | #define IDENTIFIER_LENGTH(NODE) \ |
746 | (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len) | |
747 | #define IDENTIFIER_POINTER(NODE) \ | |
748 | ((char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str) | |
749 | ||
750 | /* Translate a hash table identifier pointer to a tree_identifier | |
751 | pointer, and vice versa. */ | |
752 | ||
753 | #define HT_IDENT_TO_GCC_IDENT(NODE) \ | |
754 | ((tree) ((char *) (NODE) - sizeof (struct tree_common))) | |
755 | #define GCC_IDENT_TO_HT_IDENT(NODE) \ | |
756 | (&((struct tree_identifier *) (NODE))->id) | |
8da1b058 RS |
757 | |
758 | struct tree_identifier | |
759 | { | |
2bf105ab | 760 | struct tree_common common; |
2a967f3d | 761 | struct ht_identifier id; |
8da1b058 RS |
762 | }; |
763 | ||
764 | /* In a TREE_LIST node. */ | |
12b195d9 ML |
765 | #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose) |
766 | #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value) | |
8da1b058 RS |
767 | |
768 | struct tree_list | |
769 | { | |
2bf105ab | 770 | struct tree_common common; |
2f78c311 ZW |
771 | tree purpose; |
772 | tree value; | |
8da1b058 RS |
773 | }; |
774 | ||
775 | /* In a TREE_VEC node. */ | |
12b195d9 ML |
776 | #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length) |
777 | #define TREE_VEC_ELT(NODE,I) (TREE_VEC_CHECK (NODE)->vec.a[I]) | |
52267fcb | 778 | #define TREE_VEC_END(NODE) ((void) TREE_VEC_CHECK (NODE),&((NODE)->vec.a[(NODE)->vec.length])) |
8da1b058 RS |
779 | |
780 | struct tree_vec | |
781 | { | |
2bf105ab | 782 | struct tree_common common; |
8da1b058 | 783 | int length; |
2f78c311 | 784 | tree a[1]; |
8da1b058 RS |
785 | }; |
786 | ||
787 | /* Define fields and accessors for some nodes that represent expressions. */ | |
788 | ||
789 | /* In a SAVE_EXPR node. */ | |
790 | #define SAVE_EXPR_CONTEXT(NODE) TREE_OPERAND(NODE, 1) | |
2f78c311 | 791 | #define SAVE_EXPR_RTL(NODE) (*(rtx *) &EXPR_CHECK (NODE)->exp.operands[2]) |
e9a25f70 | 792 | #define SAVE_EXPR_NOPLACEHOLDER(NODE) TREE_UNSIGNED (NODE) |
d26f8097 MM |
793 | /* Nonzero if the SAVE_EXPRs value should be kept, even if it occurs |
794 | both in normal code and in a handler. (Normally, in a handler, all | |
795 | SAVE_EXPRs are unsaved, meaning that there values are | |
796 | recalculated.) */ | |
797 | #define SAVE_EXPR_PERSISTENT_P(NODE) TREE_ASM_WRITTEN (NODE) | |
8da1b058 RS |
798 | |
799 | /* In a RTL_EXPR node. */ | |
2f78c311 ZW |
800 | #define RTL_EXPR_SEQUENCE(NODE) (*(rtx *) &EXPR_CHECK (NODE)->exp.operands[0]) |
801 | #define RTL_EXPR_RTL(NODE) (*(rtx *) &EXPR_CHECK (NODE)->exp.operands[1]) | |
8da1b058 | 802 | |
6ad7895a APB |
803 | /* In a WITH_CLEANUP_EXPR node. */ |
804 | #define WITH_CLEANUP_EXPR_RTL(NODE) \ | |
2f78c311 | 805 | (*(rtx *) &EXPR_CHECK (NODE)->exp.operands[2]) |
6ad7895a | 806 | |
8da1b058 RS |
807 | /* In a CONSTRUCTOR node. */ |
808 | #define CONSTRUCTOR_ELTS(NODE) TREE_OPERAND (NODE, 1) | |
809 | ||
61131fa2 | 810 | /* In ordinary expression nodes. */ |
12b195d9 ML |
811 | #define TREE_OPERAND(NODE, I) (EXPR_CHECK (NODE)->exp.operands[I]) |
812 | #define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity) | |
61131fa2 | 813 | |
40edd0bd APB |
814 | /* In a LABELED_BLOCK_EXPR node. */ |
815 | #define LABELED_BLOCK_LABEL(NODE) TREE_OPERAND (NODE, 0) | |
816 | #define LABELED_BLOCK_BODY(NODE) TREE_OPERAND (NODE, 1) | |
817 | ||
818 | /* In a EXIT_BLOCK_EXPR node. */ | |
819 | #define EXIT_BLOCK_LABELED_BLOCK(NODE) TREE_OPERAND (NODE, 0) | |
820 | #define EXIT_BLOCK_RETURN(NODE) TREE_OPERAND (NODE, 1) | |
821 | ||
822 | /* In a LOOP_EXPR node. */ | |
823 | #define LOOP_EXPR_BODY(NODE) TREE_OPERAND (NODE, 0) | |
824 | ||
dadafe54 | 825 | /* In a EXPR_WITH_FILE_LOCATION node. */ |
bf1e5319 | 826 | #define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0) |
86fff623 MM |
827 | #define EXPR_WFL_FILENAME(NODE) \ |
828 | (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE ((NODE)))) | |
829 | #define EXPR_WFL_FILENAME_NODE(NODE) TREE_OPERAND((NODE), 1) | |
12b195d9 ML |
830 | #define EXPR_WFL_LINENO(NODE) (EXPR_CHECK (NODE)->exp.complexity >> 12) |
831 | #define EXPR_WFL_COLNO(NODE) (EXPR_CHECK (NODE)->exp.complexity & 0xfff) | |
832 | #define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity) | |
bf1e5319 APB |
833 | #define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \ |
834 | (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff)) | |
dadafe54 | 835 | #define EXPR_WFL_EMIT_LINE_NOTE(NODE) ((NODE)->common.public_flag) |
bf1e5319 | 836 | |
61131fa2 RS |
837 | struct tree_exp |
838 | { | |
2bf105ab | 839 | struct tree_common common; |
61131fa2 | 840 | int complexity; |
2f78c311 | 841 | tree operands[1]; |
61131fa2 RS |
842 | }; |
843 | \f | |
8da1b058 | 844 | /* In a BLOCK node. */ |
12b195d9 | 845 | #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars) |
12b195d9 ML |
846 | #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks) |
847 | #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext) | |
8da1b058 RS |
848 | /* Note: when changing this, make sure to find the places |
849 | that use chainon or nreverse. */ | |
a901fa64 | 850 | #define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE)) |
12b195d9 ML |
851 | #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin) |
852 | #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag) | |
8da1b058 RS |
853 | |
854 | /* Nonzero means that this block is prepared to handle exceptions | |
855 | listed in the BLOCK_VARS slot. */ | |
12b195d9 | 856 | #define BLOCK_HANDLER_BLOCK(NODE) (BLOCK_CHECK (NODE)->block.handler_block_flag) |
8da1b058 | 857 | |
18c038b9 MM |
858 | /* An index number for this block. These values are not guaranteed to |
859 | be unique across functions -- whether or not they are depends on | |
860 | the debugging output format in use. */ | |
861 | #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num) | |
862 | ||
a20612aa RH |
863 | /* If block reordering splits a lexical block into discontiguous |
864 | address ranges, we'll make a copy of the original block. | |
865 | ||
866 | Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN. | |
867 | In that case, we have one source block that has been replicated | |
868 | (through inlining or unrolling) into many logical blocks, and that | |
869 | these logical blocks have different physical variables in them. | |
870 | ||
871 | In this case, we have one logical block split into several | |
872 | non-contiguous address ranges. Most debug formats can't actually | |
873 | represent this idea directly, so we fake it by creating multiple | |
874 | logical blocks with the same variables in them. However, for those | |
875 | that do support non-contiguous regions, these allow the original | |
876 | logical block to be reconstructed, along with the set of address | |
877 | ranges. | |
878 | ||
879 | One of the logical block fragments is arbitrarily chosen to be | |
880 | the ORIGIN. The other fragments will point to the origin via | |
881 | BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer | |
882 | be null. The list of fragments will be chained through | |
883 | BLOCK_FRAGMENT_CHAIN from the origin. */ | |
884 | ||
885 | #define BLOCK_FRAGMENT_ORIGIN(NODE) \ | |
886 | (BLOCK_CHECK (NODE)->block.fragment_origin) | |
887 | #define BLOCK_FRAGMENT_CHAIN(NODE) \ | |
888 | (BLOCK_CHECK (NODE)->block.fragment_chain) | |
889 | ||
61131fa2 | 890 | struct tree_block |
8da1b058 | 891 | { |
2bf105ab | 892 | struct tree_common common; |
61131fa2 RS |
893 | |
894 | unsigned handler_block_flag : 1; | |
895 | unsigned abstract_flag : 1; | |
a84efb51 | 896 | unsigned block_num : 30; |
61131fa2 | 897 | |
2f78c311 ZW |
898 | tree vars; |
899 | tree subblocks; | |
900 | tree supercontext; | |
901 | tree abstract_origin; | |
902 | tree fragment_origin; | |
903 | tree fragment_chain; | |
8da1b058 RS |
904 | }; |
905 | \f | |
906 | /* Define fields and accessors for nodes representing data types. */ | |
907 | ||
908 | /* See tree.def for documentation of the use of these fields. | |
909 | Look at the documentation of the various ..._TYPE tree codes. */ | |
910 | ||
12b195d9 ML |
911 | #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid) |
912 | #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size) | |
913 | #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit) | |
914 | #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode) | |
915 | #define TYPE_VALUES(NODE) (TYPE_CHECK (NODE)->type.values) | |
916 | #define TYPE_DOMAIN(NODE) (TYPE_CHECK (NODE)->type.values) | |
917 | #define TYPE_FIELDS(NODE) (TYPE_CHECK (NODE)->type.values) | |
918 | #define TYPE_METHODS(NODE) (TYPE_CHECK (NODE)->type.maxval) | |
919 | #define TYPE_VFIELD(NODE) (TYPE_CHECK (NODE)->type.minval) | |
920 | #define TYPE_ARG_TYPES(NODE) (TYPE_CHECK (NODE)->type.values) | |
921 | #define TYPE_METHOD_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval) | |
922 | #define TYPE_OFFSET_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval) | |
923 | #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to) | |
924 | #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to) | |
925 | #define TYPE_MIN_VALUE(NODE) (TYPE_CHECK (NODE)->type.minval) | |
926 | #define TYPE_MAX_VALUE(NODE) (TYPE_CHECK (NODE)->type.maxval) | |
927 | #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision) | |
928 | #define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address) | |
929 | #define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer) | |
930 | #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name) | |
931 | #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant) | |
932 | #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant) | |
12b195d9 | 933 | #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context) |
12b195d9 | 934 | #define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific) |
8da1b058 | 935 | |
4061f623 BS |
936 | /* For a VECTOR_TYPE node, this describes a different type which is emitted |
937 | in the debugging output. We use this to describe a vector as a | |
938 | structure containing an array. */ | |
939 | #define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (TYPE_CHECK (NODE)->type.values) | |
940 | ||
a6d7adfd GM |
941 | /* Indirect types present difficulties because they may be represented |
942 | as either POINTER_TYPE/REFERENCE_TYPE nodes (unbounded) or as | |
943 | RECORD_TYPE nodes (bounded). Bounded and unbounded pointers might | |
944 | be logically equivalent, but physically different. Simple | |
945 | comparison of the main variant only tells if the types are | |
946 | logically equivalent. Use this predicate to compare for physical | |
947 | equivalency. */ | |
948 | ||
949 | /* Types have the same main variant, and have the same boundedness. */ | |
950 | #define TYPE_MAIN_VARIANTS_PHYSICALLY_EQUAL_P(TYPE1, TYPE2) \ | |
951 | (TYPE_MAIN_VARIANT (TYPE1) == TYPE_MAIN_VARIANT (TYPE2) \ | |
952 | && TREE_CODE (TYPE1) == TREE_CODE (TYPE2)) | |
953 | ||
954 | /* Return the type variant that has no qualifiers (i.e., the main variant), | |
955 | except that the boundedness qualifier is preserved. */ | |
956 | #define TYPE_MAIN_PHYSICAL_VARIANT(TYPE) \ | |
957 | (BOUNDED_POINTER_TYPE_P (TYPE) \ | |
958 | ? build_qualified_type (TYPE, TYPE_QUAL_BOUNDED) \ | |
959 | : TYPE_MAIN_VARIANT (TYPE)) | |
960 | ||
8ff0c1af MM |
961 | /* For aggregate types, information about this type, as a base type |
962 | for itself. Used in a language-dependent way for types that are | |
963 | neither a RECORD_TYPE, QUAL_UNION_TYPE, nor a UNION_TYPE. */ | |
964 | #define TYPE_BINFO(NODE) (TYPE_CHECK (NODE)->type.binfo) | |
965 | ||
41472af8 MM |
966 | /* The (language-specific) typed-based alias set for this type. |
967 | Objects whose TYPE_ALIAS_SETs are different cannot alias each | |
968 | other. If the TYPE_ALIAS_SET is -1, no alias set has yet been | |
969 | assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this | |
970 | type can alias objects of any type. */ | |
971 | #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set) | |
972 | ||
973 | /* Nonzero iff the typed-based alias set for this type has been | |
974 | calculated. */ | |
975 | #define TYPE_ALIAS_SET_KNOWN_P(NODE) \ | |
976 | (TYPE_CHECK (NODE)->type.alias_set != -1) | |
977 | ||
bad1b4ba RK |
978 | /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply |
979 | to this type. */ | |
12b195d9 | 980 | #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes) |
bad1b4ba | 981 | |
869637e6 RS |
982 | /* The alignment necessary for objects of this type. |
983 | The value is an int, measured in bits. */ | |
12b195d9 | 984 | #define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align) |
869637e6 | 985 | |
11cf4d18 JJ |
986 | /* 1 if the alignment for this type was requested by "aligned" attribute, |
987 | 0 if it is the default for this type. */ | |
988 | #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->type.user_align) | |
989 | ||
834c6dff MM |
990 | /* The alignment for NODE, in bytes. */ |
991 | #define TYPE_ALIGN_UNIT(NODE) \ | |
992 | (TYPE_ALIGN (NODE) / BITS_PER_UNIT) | |
993 | ||
2b5f2501 RH |
994 | /* If your language allows you to declare types, and you want debug info |
995 | for them, then you need to generate corresponding TYPE_DECL nodes. | |
996 | These "stub" TYPE_DECL nodes have no name, and simply point at the | |
997 | type node. You then set the TYPE_STUB_DECL field of the type node | |
998 | to point back at the TYPE_DECL node. This allows the debug routines | |
999 | to know that the two nodes represent the same type, so that we only | |
2ba84f36 | 1000 | get one debug info record for them. */ |
8da1b058 RS |
1001 | #define TYPE_STUB_DECL(NODE) (TREE_CHAIN (NODE)) |
1002 | ||
3635a54b RK |
1003 | /* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type |
1004 | has BLKmode only because it lacks the alignment requirement for | |
1005 | its size. */ | |
12b195d9 | 1006 | #define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag) |
8da1b058 | 1007 | |
e36308b0 MM |
1008 | /* In an INTEGER_TYPE, it means the type represents a size. We use |
1009 | this both for validity checking and to permit optimizations that | |
1010 | are unsafe for other types. Note that the C `size_t' type should | |
1011 | *not* have this flag set. The `size_t' type is simply a typedef | |
1012 | for an ordinary integer type that happens to be the type of an | |
1013 | expression returned by `sizeof'; `size_t' has no special | |
1014 | properties. Expressions whose type have TYPE_IS_SIZETYPE set are | |
1015 | always actual sizes. */ | |
7393c642 RK |
1016 | #define TYPE_IS_SIZETYPE(NODE) \ |
1017 | (INTEGER_TYPE_CHECK (NODE)->type.no_force_blk_flag) | |
1018 | ||
1019 | /* In a FUNCTION_TYPE, indicates that the function returns with the stack | |
1020 | pointer depressed. */ | |
1021 | #define TYPE_RETURNS_STACK_DEPRESSED(NODE) \ | |
199acebb | 1022 | (FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag) |
fed3cef0 | 1023 | |
8da1b058 | 1024 | /* Nonzero in a type considered volatile as a whole. */ |
50e9f73a | 1025 | #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->common.volatile_flag) |
8da1b058 RS |
1026 | |
1027 | /* Means this type is const-qualified. */ | |
50e9f73a | 1028 | #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->common.readonly_flag) |
8da1b058 | 1029 | |
3932261a MM |
1030 | /* If nonzero, this type is `restrict'-qualified, in the C sense of |
1031 | the term. */ | |
1032 | #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag) | |
1033 | ||
a6d7adfd GM |
1034 | /* If nonzero, this type's size and layout, (or the size and layout of |
1035 | its arguments and/or return value in the case of a FUNCTION_TYPE or | |
1036 | METHOD_TYPE) was changed by the presence of pointer bounds. */ | |
1037 | #define TYPE_BOUNDED(NODE) (TYPE_CHECK (NODE)->common.bounded_flag) | |
1038 | ||
3932261a MM |
1039 | /* There is a TYPE_QUAL value for each type qualifier. They can be |
1040 | combined by bitwise-or to form the complete set of qualifiers for a | |
1041 | type. */ | |
1042 | ||
1043 | #define TYPE_UNQUALIFIED 0x0 | |
1044 | #define TYPE_QUAL_CONST 0x1 | |
1045 | #define TYPE_QUAL_VOLATILE 0x2 | |
1046 | #define TYPE_QUAL_RESTRICT 0x4 | |
a6d7adfd | 1047 | #define TYPE_QUAL_BOUNDED 0x8 |
3932261a MM |
1048 | |
1049 | /* The set of type qualifiers for this type. */ | |
a6d7adfd GM |
1050 | #define TYPE_QUALS(NODE) \ |
1051 | ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \ | |
1052 | | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \ | |
1053 | | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \ | |
1054 | | (BOUNDED_INDIRECT_TYPE_P (NODE) * TYPE_QUAL_BOUNDED)) | |
1055 | ||
1056 | /* The set of qualifiers pertinent to an expression node. */ | |
1057 | #define TREE_EXPR_QUALS(NODE) \ | |
1058 | ((TREE_READONLY (NODE) * TYPE_QUAL_CONST) \ | |
1059 | | (TREE_THIS_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \ | |
1060 | | (TREE_BOUNDED (NODE) * TYPE_QUAL_BOUNDED)) | |
1061 | ||
1062 | /* The set of qualifiers pertinent to a FUNCTION_DECL node. */ | |
1063 | #define TREE_FUNC_QUALS(NODE) \ | |
1064 | ((TREE_READONLY (NODE) * TYPE_QUAL_CONST) \ | |
1065 | | (TREE_THIS_VOLATILE (NODE) * TYPE_QUAL_VOLATILE)) | |
3932261a | 1066 | |
9f86614b | 1067 | /* These flags are available for each language front end to use internally. */ |
12b195d9 ML |
1068 | #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0) |
1069 | #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1) | |
1070 | #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2) | |
1071 | #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3) | |
1072 | #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4) | |
1073 | #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5) | |
1074 | #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6) | |
8da1b058 | 1075 | |
74a3fd26 PB |
1076 | /* If set in an ARRAY_TYPE, indicates a string type (for languages |
1077 | that distinguish string from array of char). | |
2ba84f36 | 1078 | If set in a SET_TYPE, indicates a bitstring type. */ |
12b195d9 | 1079 | #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag) |
74a3fd26 | 1080 | |
4fe9b91c | 1081 | /* If non-NULL, this is an upper bound of the size (in bytes) of an |
2ba84f36 | 1082 | object of the given ARRAY_TYPE. This allows temporaries to be allocated. */ |
2fb2b21c PB |
1083 | #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) TYPE_MAX_VALUE (ARRAY_TYPE) |
1084 | ||
0b4565c9 BS |
1085 | /* For a VECTOR_TYPE, this is the number of sub-parts of the vector. */ |
1086 | #define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) (GET_MODE_NUNITS (TYPE_CHECK (VECTOR_TYPE)->type.mode)) | |
1087 | ||
1088 | /* Indicates that objects of this type must be initialized by calling a | |
4ac3d994 | 1089 | function when they are created. */ |
2bf105ab RK |
1090 | #define TYPE_NEEDS_CONSTRUCTING(NODE) \ |
1091 | (TYPE_CHECK (NODE)->type.needs_constructing_flag) | |
4ac3d994 | 1092 | |
adb23061 RK |
1093 | /* Indicates that objects of this type (a UNION_TYPE), should be passed |
1094 | the same way that the first union alternative would be passed. */ | |
2bf105ab RK |
1095 | #define TYPE_TRANSPARENT_UNION(NODE) \ |
1096 | (UNION_TYPE_CHECK (NODE)->type.transparent_union_flag) | |
1097 | ||
1098 | /* For an ARRAY_TYPE, indicates that it is not permitted to | |
1099 | take the address of a component of the type. */ | |
1100 | #define TYPE_NONALIASED_COMPONENT(NODE) \ | |
1101 | (ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag) | |
adb23061 | 1102 | |
956d6950 | 1103 | /* Indicated that objects of this type should be laid out in as |
9e357cd8 | 1104 | compact a way as possible. */ |
12b195d9 | 1105 | #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag) |
9e357cd8 | 1106 | |
a6d7adfd GM |
1107 | /* A bounded pointer or bounded reference type (collectively called |
1108 | indirect types) is represented as a RECORD_TYPE node containing | |
1109 | three pointer fields whose type is the corresponding unbounded | |
1110 | POINTER_TYPE or REFERENCE_TYPE. A RECORD_TYPE node that represents | |
1111 | a bounded indirect type differs from a normal RECORD_TYPE node in | |
1112 | that its TREE_TYPE is non-NULL and has the pointed-to type just as | |
1113 | a POINTER_TYPE or REFERENCE_TYPE node has. The bounded RECORD_TYPE | |
1114 | nodes are stored on the same type variant chain alongside the | |
1115 | variants of the underlaying indirect types nodes. The main variant | |
1116 | of such chains is always the unbounded type. */ | |
1117 | ||
1118 | /* Access the field decls of a bounded-pointer type. */ | |
1119 | #define TYPE_BOUNDED_VALUE(TYPE) TYPE_FIELDS (TYPE) | |
1120 | #define TYPE_BOUNDED_BASE(TYPE) TREE_CHAIN (TYPE_BOUNDED_VALUE (TYPE)) | |
1121 | #define TYPE_BOUNDED_EXTENT(TYPE) TREE_CHAIN (TYPE_BOUNDED_BASE (TYPE)) | |
1122 | ||
1123 | /* Access the simple-pointer subtype of a bounded-pointer type. */ | |
1124 | #define TYPE_BOUNDED_SUBTYPE(TYPE) TREE_TYPE (TYPE_BOUNDED_VALUE (TYPE)) | |
1125 | ||
1126 | /* Find the unbounded counterpart to a type, or return TYPE if it is | |
1127 | already unbounded. */ | |
1128 | #define TYPE_UNBOUNDED_VARIANT(TYPE) \ | |
1129 | (BOUNDED_POINTER_TYPE_P (TYPE) ? TYPE_BOUNDED_SUBTYPE (TYPE) : (TYPE)) | |
1130 | ||
1131 | /* This field comprises two bits, for values in the range 0..3: | |
1132 | ||
1133 | depth=0 means that type is a scalar, or an aggregate that contains | |
1134 | only depth=0 types, or a function that has only depth=0 types for | |
1135 | its return value and argument types. | |
1136 | ||
1137 | depth=1 means that type is a pointer to a depth=0 type, or an | |
1138 | aggregate that contains only depth=0 and depth=1 types, or a | |
1139 | function that has only depth=0 and depth=1 types for its return | |
1140 | value and argument types. | |
1141 | ||
1142 | The meanings of depth=2 and depth=3 are obvious by induction. | |
1143 | Varargs functions are depth=3. The type `va_list' is depth=3. | |
1144 | ||
1145 | The purpose of measuring pointer depth of a type is to determine | |
1146 | the eligibility of a function for an automatically-generated | |
1147 | bounded-pointer thunk. A depth=0 functions needs no thunk. A | |
1148 | depth=1 function is eligible for an automatic thunk. Functions | |
1149 | with depth 2 or more are too complex to get automatic thunks. | |
1150 | ||
1151 | Function decls also have a pointer_depth field, since we also | |
1152 | consider the actual argument types for functions. */ | |
1153 | ||
1154 | #define TYPE_POINTER_DEPTH(TYPE) (TYPE_CHECK (TYPE)->type.pointer_depth) | |
1155 | ||
1156 | /* In a FUNCTION_TYPE node, this bit stores the value of | |
1157 | default_pointer_boundedness at the time TYPE was created. It is | |
1158 | useful for choosing default boundedness of function arguments for | |
1159 | non-prototype function decls and for varargs/stdarg lists. */ | |
2bf105ab RK |
1160 | #define TYPE_AMBIENT_BOUNDEDNESS(TYPE) \ |
1161 | (FUNCTION_TYPE_CHECK (TYPE)->type.transparent_union_flag) | |
a6d7adfd GM |
1162 | |
1163 | #define MAX_POINTER_DEPTH 2 | |
1164 | #define VA_LIST_POINTER_DEPTH 3 | |
1165 | ||
8da1b058 RS |
1166 | struct tree_type |
1167 | { | |
2bf105ab | 1168 | struct tree_common common; |
2f78c311 ZW |
1169 | tree values; |
1170 | tree size; | |
1171 | tree size_unit; | |
1172 | tree attributes; | |
b3ddc3ab | 1173 | unsigned int uid; |
8da1b058 | 1174 | |
b3ddc3ab | 1175 | unsigned int precision : 9; |
c149cc37 | 1176 | ENUM_BITFIELD(machine_mode) mode : 7; |
bad1b4ba | 1177 | |
74a3fd26 | 1178 | unsigned string_flag : 1; |
8da1b058 | 1179 | unsigned no_force_blk_flag : 1; |
4ac3d994 | 1180 | unsigned needs_constructing_flag : 1; |
adb23061 | 1181 | unsigned transparent_union_flag : 1; |
9e357cd8 | 1182 | unsigned packed_flag : 1; |
3932261a | 1183 | unsigned restrict_flag : 1; |
a6d7adfd | 1184 | unsigned pointer_depth : 2; |
3932261a | 1185 | |
8da1b058 RS |
1186 | unsigned lang_flag_0 : 1; |
1187 | unsigned lang_flag_1 : 1; | |
1188 | unsigned lang_flag_2 : 1; | |
1189 | unsigned lang_flag_3 : 1; | |
1190 | unsigned lang_flag_4 : 1; | |
1191 | unsigned lang_flag_5 : 1; | |
1192 | unsigned lang_flag_6 : 1; | |
11cf4d18 | 1193 | unsigned user_align : 1; |
8da1b058 | 1194 | |
69b78d8d | 1195 | unsigned int align; |
2f78c311 ZW |
1196 | tree pointer_to; |
1197 | tree reference_to; | |
a0665b77 | 1198 | union {int address; char *pointer; } symtab; |
2f78c311 ZW |
1199 | tree name; |
1200 | tree minval; | |
1201 | tree maxval; | |
1202 | tree next_variant; | |
1203 | tree main_variant; | |
1204 | tree binfo; | |
2f78c311 | 1205 | tree context; |
3bdf5ad1 | 1206 | HOST_WIDE_INT alias_set; |
8da1b058 RS |
1207 | /* Points to a structure whose details depend on the language in use. */ |
1208 | struct lang_type *lang_specific; | |
1209 | }; | |
1210 | \f | |
1211 | /* Define accessor macros for information about type inheritance | |
1212 | and basetypes. | |
1213 | ||
1214 | A "basetype" means a particular usage of a data type for inheritance | |
1215 | in another type. Each such basetype usage has its own "binfo" | |
1216 | object to describe it. The binfo object is a TREE_VEC node. | |
1217 | ||
1218 | Inheritance is represented by the binfo nodes allocated for a | |
1219 | given type. For example, given types C and D, such that D is | |
1220 | inherited by C, 3 binfo nodes will be allocated: one for describing | |
1221 | the binfo properties of C, similarly one for D, and one for | |
1222 | describing the binfo properties of D as a base type for C. | |
1223 | Thus, given a pointer to class C, one can get a pointer to the binfo | |
1224 | of D acting as a basetype for C by looking at C's binfo's basetypes. */ | |
1225 | ||
1226 | /* The actual data type node being inherited in this basetype. */ | |
1227 | #define BINFO_TYPE(NODE) TREE_TYPE (NODE) | |
1228 | ||
1229 | /* The offset where this basetype appears in its containing type. | |
1230 | BINFO_OFFSET slot holds the offset (in bytes) | |
1231 | from the base of the complete object to the base of the part of the | |
1232 | object that is allocated on behalf of this `type'. | |
1233 | This is always 0 except when there is multiple inheritance. */ | |
1234 | ||
1235 | #define BINFO_OFFSET(NODE) TREE_VEC_ELT ((NODE), 1) | |
1236 | #define TYPE_BINFO_OFFSET(NODE) BINFO_OFFSET (TYPE_BINFO (NODE)) | |
7d02bbef | 1237 | #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE))) |
8da1b058 RS |
1238 | |
1239 | /* The virtual function table belonging to this basetype. Virtual | |
1240 | function tables provide a mechanism for run-time method dispatching. | |
1241 | The entries of a virtual function table are language-dependent. */ | |
1242 | ||
1243 | #define BINFO_VTABLE(NODE) TREE_VEC_ELT ((NODE), 2) | |
1244 | #define TYPE_BINFO_VTABLE(NODE) BINFO_VTABLE (TYPE_BINFO (NODE)) | |
1245 | ||
1246 | /* The virtual functions in the virtual function table. This is | |
1247 | a TREE_LIST that is used as an initial approximation for building | |
1248 | a virtual function table for this basetype. */ | |
1249 | #define BINFO_VIRTUALS(NODE) TREE_VEC_ELT ((NODE), 3) | |
1250 | #define TYPE_BINFO_VIRTUALS(NODE) BINFO_VIRTUALS (TYPE_BINFO (NODE)) | |
1251 | ||
0430641b MM |
1252 | /* A vector of binfos for the direct basetypes inherited by this |
1253 | basetype. | |
8da1b058 | 1254 | |
0430641b MM |
1255 | If this basetype describes type D as inherited in C, and if the |
1256 | basetypes of D are E and F, then this vector contains binfos for | |
1257 | inheritance of E and F by C. | |
8da1b058 RS |
1258 | |
1259 | ??? This could probably be done by just allocating the | |
1260 | base types at the end of this TREE_VEC (instead of using | |
1261 | another TREE_VEC). This would simplify the calculation | |
1262 | of how many basetypes a given type had. */ | |
1263 | #define BINFO_BASETYPES(NODE) TREE_VEC_ELT ((NODE), 4) | |
1264 | #define TYPE_BINFO_BASETYPES(NODE) TREE_VEC_ELT (TYPE_BINFO (NODE), 4) | |
1265 | ||
5e1677bc MM |
1266 | /* The number of basetypes for NODE. */ |
1267 | #define BINFO_N_BASETYPES(NODE) \ | |
1268 | (BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (BINFO_BASETYPES (NODE)) : 0) | |
1269 | ||
7d02bbef JM |
1270 | /* Accessor macro to get to the Nth basetype of this basetype. */ |
1271 | #define BINFO_BASETYPE(NODE,N) TREE_VEC_ELT (BINFO_BASETYPES (NODE), (N)) | |
1272 | #define TYPE_BINFO_BASETYPE(NODE,N) BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (NODE)), (N))) | |
1273 | ||
39ac3e4f MM |
1274 | /* For a BINFO record describing a virtual base class, i.e., one where |
1275 | TREE_VIA_VIRTUAL is set, this field assists in locating the virtual | |
1276 | base. The actual contents are language-dependent. Under the old | |
1277 | ABI, the C++ front-end uses a FIELD_DECL whose contents are a | |
1278 | pointer to the virtual base; under the new ABI this field is | |
1279 | instead a INTEGER_CST giving an offset into the vtable where the | |
1280 | offset to the virtual base can be found. */ | |
2cc3ac7a MS |
1281 | #define BINFO_VPTR_FIELD(NODE) TREE_VEC_ELT ((NODE), 5) |
1282 | ||
bbc0e641 | 1283 | /* The size of a base class subobject of this type. Not all frontends |
06ceef4e | 1284 | currently allocate the space for these fields. */ |
7d02bbef | 1285 | #define BINFO_SIZE(NODE) TREE_VEC_ELT ((NODE), 6) |
06ceef4e | 1286 | #define BINFO_SIZE_UNIT(NODE) TREE_VEC_ELT ((NODE), 7) |
7d02bbef | 1287 | #define TYPE_BINFO_SIZE(NODE) BINFO_SIZE (TYPE_BINFO (NODE)) |
06ceef4e | 1288 | #define TYPE_BINFO_SIZE_UNIT(NODE) BINFO_SIZE_UNIT (TYPE_BINFO (NODE)) |
8da1b058 RS |
1289 | |
1290 | /* Slot used to build a chain that represents a use of inheritance. | |
1291 | For example, if X is derived from Y, and Y is derived from Z, | |
1292 | then this field can be used to link the binfo node for X to | |
1293 | the binfo node for X's Y to represent the use of inheritance | |
1294 | from X to Y. Similarly, this slot of the binfo node for X's Y | |
1295 | can point to the Z from which Y is inherited (in X's inheritance | |
1296 | hierarchy). In this fashion, one can represent and traverse specific | |
1297 | uses of inheritance using the binfo nodes themselves (instead of | |
1298 | consing new space pointing to binfo nodes). | |
1299 | It is up to the language-dependent front-ends to maintain | |
1300 | this information as necessary. */ | |
1301 | #define BINFO_INHERITANCE_CHAIN(NODE) TREE_VEC_ELT ((NODE), 0) | |
1302 | \f | |
1303 | /* Define fields and accessors for nodes representing declared names. */ | |
1304 | ||
7766fe8e JM |
1305 | /* Nonzero if DECL represents a decl. */ |
1306 | #define DECL_P(DECL) (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd') | |
8da1b058 RS |
1307 | /* This is the name of the object as written by the user. |
1308 | It is an IDENTIFIER_NODE. */ | |
12b195d9 | 1309 | #define DECL_NAME(NODE) (DECL_CHECK (NODE)->decl.name) |
92643fea MM |
1310 | /* The name of the object as the assembler will see it (but before any |
1311 | translations made by ASM_OUTPUT_LABELREF). Often this is the same | |
1312 | as DECL_NAME. It is an IDENTIFIER_NODE. */ | |
1313 | #define DECL_ASSEMBLER_NAME(NODE) \ | |
1314 | ((DECL_ASSEMBLER_NAME_SET_P (NODE) \ | |
1315 | ? (void) 0 \ | |
1316 | : (*lang_set_decl_assembler_name) (NODE)), \ | |
1317 | DECL_CHECK (NODE)->decl.assembler_name) | |
1318 | /* Returns non-zero if the DECL_ASSEMBLER_NAME for NODE has been | |
1319 | set. If zero, the NODE might still have a DECL_ASSEMBLER_NAME -- | |
1320 | it just hasn't been set yet. */ | |
1321 | #define DECL_ASSEMBLER_NAME_SET_P(NODE) \ | |
1322 | (DECL_CHECK (NODE)->decl.assembler_name != NULL_TREE) | |
1323 | /* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */ | |
1324 | #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \ | |
1325 | (DECL_CHECK (NODE)->decl.assembler_name = (NAME)) | |
1326 | /* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if | |
1327 | DECL1's DECL_ASSEMBLER_NAME has not yet been set, using this macro | |
1328 | will not cause the DECL_ASSEMBLER_NAME of either DECL to be set. | |
1329 | In other words, the semantics of using this macro, are different | |
1330 | than saying: | |
1331 | ||
1332 | SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1)) | |
1333 | ||
1334 | which will try to set the DECL_ASSEMBLER_NAME for DECL1. */ | |
1335 | #define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \ | |
1336 | (DECL_ASSEMBLER_NAME_SET_P (DECL1) \ | |
1337 | ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \ | |
1338 | DECL_ASSEMBLER_NAME (DECL1)) \ | |
1339 | : (void) 0) | |
1340 | ||
868e8789 DE |
1341 | /* Records the section name in a section attribute. Used to pass |
1342 | the name from decl_attributes to make_function_rtl and make_decl_rtl. */ | |
12b195d9 | 1343 | #define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name) |
9b800101 | 1344 | /* For FIELD_DECLs, this is the |
3635a54b RK |
1345 | RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is |
1346 | a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL, | |
a082c85a JM |
1347 | and CONST_DECL nodes, this points to either the FUNCTION_DECL for the |
1348 | containing function, the RECORD_TYPE or UNION_TYPE for the containing | |
1349 | type, or NULL_TREE if the given decl has "file scope". */ | |
12b195d9 | 1350 | #define DECL_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context) |
770ae6cc | 1351 | #define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl.context) |
91d231cb JM |
1352 | /* In a DECL this is the field where attributes are stored. */ |
1353 | #define DECL_ATTRIBUTES(NODE) (DECL_CHECK (NODE)->decl.attributes) | |
770ae6cc RK |
1354 | /* In a FIELD_DECL, this is the field position, counting in bytes, of the |
1355 | byte containing the bit closest to the beginning of the structure. */ | |
1356 | #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->decl.arguments) | |
1357 | /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the | |
1358 | field from DECL_FIELD_OFFSET. */ | |
1359 | #define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->decl.u2.t) | |
8da1b058 | 1360 | /* In a FIELD_DECL, this indicates whether the field was a bit-field and |
8e148bef RS |
1361 | if so, the type that was originally specified for it. |
1362 | TREE_TYPE may have been modified (in finish_struct). */ | |
770ae6cc | 1363 | #define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->decl.result) |
8da1b058 RS |
1364 | /* In FUNCTION_DECL, a chain of ..._DECL nodes. */ |
1365 | /* VAR_DECL and PARM_DECL reserve the arguments slot | |
1366 | for language-specific uses. */ | |
12b195d9 | 1367 | #define DECL_ARGUMENTS(NODE) (DECL_CHECK (NODE)->decl.arguments) |
17aec3eb RK |
1368 | /* This field is used to reference anything in decl.result and is meant only |
1369 | for use by the garbage collector. */ | |
1370 | #define DECL_RESULT_FLD(NODE) (DECL_CHECK (NODE)->decl.result) | |
8da1b058 | 1371 | /* In FUNCTION_DECL, holds the decl for the return value. */ |
770ae6cc | 1372 | #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.result) |
9506a28d | 1373 | /* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */ |
770ae6cc | 1374 | #define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl.result) |
8da1b058 | 1375 | /* In PARM_DECL, holds the type as written (perhaps a function or array). */ |
770ae6cc | 1376 | #define DECL_ARG_TYPE_AS_WRITTEN(NODE) (PARM_DECL_CHECK (NODE)->decl.result) |
8da1b058 RS |
1377 | /* For a FUNCTION_DECL, holds the tree of BINDINGs. |
1378 | For a VAR_DECL, holds the initial value. | |
1379 | For a PARM_DECL, not used--default | |
1380 | values for parameters are encoded in the type of the function, | |
1381 | not in the PARM_DECL slot. */ | |
12b195d9 | 1382 | #define DECL_INITIAL(NODE) (DECL_CHECK (NODE)->decl.initial) |
8da1b058 RS |
1383 | /* For a PARM_DECL, records the data type used to pass the argument, |
1384 | which may be different from the type seen in the program. */ | |
770ae6cc | 1385 | #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl.initial) |
3635a54b RK |
1386 | /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which |
1387 | if nonzero, indicates that the field occupies the type. */ | |
770ae6cc | 1388 | #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->decl.initial) |
daa8df65 MM |
1389 | /* These two fields describe where in the source code the declaration |
1390 | was. If the declaration appears in several places (as for a C | |
1391 | function that is declared first and then defined later), this | |
1392 | information should refer to the definition. */ | |
12b195d9 ML |
1393 | #define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename) |
1394 | #define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum) | |
06ceef4e | 1395 | /* Holds the size of the datum, in bits, as a tree expression. |
8da1b058 | 1396 | Need not be constant. */ |
12b195d9 | 1397 | #define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size) |
06ceef4e RK |
1398 | /* Likewise for the size in bytes. */ |
1399 | #define DECL_SIZE_UNIT(NODE) (DECL_CHECK (NODE)->decl.size_unit) | |
971774bb | 1400 | /* Holds the alignment required for the datum, in bits. */ |
770ae6cc | 1401 | #define DECL_ALIGN(NODE) (DECL_CHECK (NODE)->decl.u1.a.align) |
971774bb MM |
1402 | /* The alignment of NODE, in bytes. */ |
1403 | #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT) | |
2f5c7f45 GK |
1404 | /* For FIELD_DECLs, off_align holds the number of low-order bits of |
1405 | DECL_FIELD_OFFSET which are known to be always zero. | |
1406 | DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET | |
1407 | has. */ | |
1408 | #define DECL_OFFSET_ALIGN(NODE) \ | |
1409 | (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align) | |
1410 | /* Specify that DECL_ALIGN(NODE) is a multiple of X. */ | |
1411 | #define SET_DECL_OFFSET_ALIGN(NODE, X) \ | |
1412 | (FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align = exact_log2 ((X) & -(X))) | |
11cf4d18 JJ |
1413 | /* 1 if the alignment for this type was requested by "aligned" attribute, |
1414 | 0 if it is the default for this type. */ | |
1415 | #define DECL_USER_ALIGN(NODE) (DECL_CHECK (NODE)->decl.user_align) | |
17c73321 RK |
1416 | /* Holds the machine mode corresponding to the declaration of a variable or |
1417 | field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a | |
1418 | FIELD_DECL. */ | |
12b195d9 | 1419 | #define DECL_MODE(NODE) (DECL_CHECK (NODE)->decl.mode) |
17c73321 RK |
1420 | /* Holds the RTL expression for the value of a variable or function. If |
1421 | PROMOTED_MODE is defined, the mode of this expression may not be same | |
1422 | as DECL_MODE. In that case, DECL_MODE contains the mode corresponding | |
1423 | to the variable's data type, while the mode | |
19e7881c MM |
1424 | of DECL_RTL is the mode actually used to contain the data. |
1425 | ||
1426 | This value can be evaluated lazily for functions, variables with | |
1427 | static storage duration, and labels. */ | |
1428 | #define DECL_RTL(NODE) \ | |
1429 | (DECL_CHECK (NODE)->decl.rtl \ | |
1430 | ? (NODE)->decl.rtl \ | |
1431 | : (make_decl_rtl (NODE, NULL), (NODE)->decl.rtl)) | |
1432 | /* Set the DECL_RTL for NODE to RTL. */ | |
1433 | #define SET_DECL_RTL(NODE, RTL) \ | |
1434 | (DECL_CHECK (NODE)->decl.rtl = (RTL)) | |
1435 | /* Returns non-zero if the DECL_RTL for NODE has already been set. */ | |
1436 | #define DECL_RTL_SET_P(NODE) \ | |
1437 | (DECL_CHECK (NODE)->decl.rtl != NULL) | |
1438 | /* Copy the RTL from NODE1 to NODE2. If the RTL was not set for | |
1439 | NODE1, it will not be set for NODE2; this is a lazy copy. */ | |
1440 | #define COPY_DECL_RTL(NODE1, NODE2) \ | |
1441 | (DECL_CHECK (NODE2)->decl.rtl = DECL_CHECK (NODE1)->decl.rtl) | |
1442 | /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */ | |
1443 | #define DECL_RTL_IF_SET(NODE) \ | |
1444 | (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL) | |
0dfa1860 MM |
1445 | /* Holds an INSN_LIST of all of the live ranges in which the variable |
1446 | has been moved to a possibly different register. */ | |
12b195d9 | 1447 | #define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl) |
8da1b058 RS |
1448 | /* For PARM_DECL, holds an RTL for the stack slot or register |
1449 | where the data was actually passed. */ | |
770ae6cc | 1450 | #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r) |
8da1b058 | 1451 | /* For FUNCTION_DECL, if it is inline, holds the saved insn chain. */ |
770ae6cc | 1452 | #define DECL_SAVED_INSNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f) |
66321686 RS |
1453 | /* For FUNCTION_DECL, if it is built-in, |
1454 | this identifies which built-in operation it is. */ | |
770ae6cc | 1455 | #define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u1.f) |
8da1b058 RS |
1456 | |
1457 | /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways. | |
1458 | Before the struct containing the FUNCTION_DECL is laid out, | |
1459 | DECL_VINDEX may point to a FUNCTION_DECL in a base class which | |
1460 | is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual | |
1461 | function. When the class is laid out, this pointer is changed | |
1462 | to an INTEGER_CST node which is suitable for use as an index | |
1463 | into the virtual function table. */ | |
12b195d9 | 1464 | #define DECL_VINDEX(NODE) (DECL_CHECK (NODE)->decl.vindex) |
8da1b058 RS |
1465 | /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in |
1466 | which this FIELD_DECL is defined. This information is needed when | |
1467 | writing debugging information about vfield and vbase decls for C++. */ | |
770ae6cc | 1468 | #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl.vindex) |
8da1b058 | 1469 | |
0e77444b | 1470 | /* Every ..._DECL node gets a unique number. */ |
12b195d9 | 1471 | #define DECL_UID(NODE) (DECL_CHECK (NODE)->decl.uid) |
0e77444b | 1472 | |
c5caa350 CH |
1473 | /* For any sort of a ..._DECL node, this points to the original (abstract) |
1474 | decl node which this decl is an instance of, or else it is NULL indicating | |
4a7d05dc DE |
1475 | that this decl is not an instance of some other decl. For example, |
1476 | in a nested declaration of an inline function, this points back to the | |
1477 | definition. */ | |
12b195d9 | 1478 | #define DECL_ABSTRACT_ORIGIN(NODE) (DECL_CHECK (NODE)->decl.abstract_origin) |
c5caa350 | 1479 | |
02e24c7a MM |
1480 | /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract |
1481 | origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */ | |
1482 | #define DECL_ORIGIN(NODE) \ | |
1483 | (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : NODE) | |
1484 | ||
f93dacbd RK |
1485 | /* Nonzero for any sort of ..._DECL node means this decl node represents an |
1486 | inline instance of some original (abstract) decl from an inline function; | |
1487 | suppress any warnings about shadowing some other variable. FUNCTION_DECL | |
2ba84f36 | 1488 | nodes can also have their abstract origin set to themselves. */ |
3d62d651 ZW |
1489 | #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0 \ |
1490 | && DECL_ABSTRACT_ORIGIN (NODE) != (NODE)) | |
8da1b058 RS |
1491 | |
1492 | /* Nonzero if a _DECL means that the name of this decl should be ignored | |
1493 | for symbolic debug purposes. */ | |
12b195d9 | 1494 | #define DECL_IGNORED_P(NODE) (DECL_CHECK (NODE)->decl.ignored_flag) |
8da1b058 | 1495 | |
c5caa350 CH |
1496 | /* Nonzero for a given ..._DECL node means that this node represents an |
1497 | "abstract instance" of the given declaration (e.g. in the original | |
1498 | declaration of an inline function). When generating symbolic debugging | |
9faa82d8 | 1499 | information, we mustn't try to generate any address information for nodes |
c5caa350 CH |
1500 | marked as "abstract instances" because we don't actually generate |
1501 | any code or allocate any data space for such instances. */ | |
12b195d9 | 1502 | #define DECL_ABSTRACT(NODE) (DECL_CHECK (NODE)->decl.abstract_flag) |
c5caa350 | 1503 | |
3110a56e RS |
1504 | /* Nonzero if a _DECL means that no warnings should be generated just |
1505 | because this decl is unused. */ | |
12b195d9 | 1506 | #define DECL_IN_SYSTEM_HEADER(NODE) (DECL_CHECK (NODE)->decl.in_system_header_flag) |
3110a56e | 1507 | |
2c0d84d6 MS |
1508 | /* Nonzero for a given ..._DECL node means that this node should be |
1509 | put in .common, if possible. If a DECL_INITIAL is given, and it | |
1510 | is not error_mark_node, then the decl cannot be put in .common. */ | |
12b195d9 | 1511 | #define DECL_COMMON(NODE) (DECL_CHECK (NODE)->decl.common_flag) |
2c0d84d6 | 1512 | |
3110a56e | 1513 | /* Language-specific decl information. */ |
12b195d9 | 1514 | #define DECL_LANG_SPECIFIC(NODE) (DECL_CHECK (NODE)->decl.lang_specific) |
8da1b058 RS |
1515 | |
1516 | /* In a VAR_DECL or FUNCTION_DECL, | |
1517 | nonzero means external reference: | |
1518 | do not allocate storage, and refer to a definition elsewhere. */ | |
12b195d9 | 1519 | #define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag) |
8da1b058 | 1520 | |
2ce3c6c6 | 1521 | /* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority |
2ba84f36 | 1522 | initializatons. */ |
2ce3c6c6 JM |
1523 | #define DEFAULT_INIT_PRIORITY 65535 |
1524 | #define MAX_INIT_PRIORITY 65535 | |
9a6e70c9 | 1525 | #define MAX_RESERVED_INIT_PRIORITY 100 |
2ce3c6c6 | 1526 | |
60e9e4b7 DE |
1527 | /* In a TYPE_DECL |
1528 | nonzero means the detail info about this type is not dumped into stabs. | |
5a783256 | 1529 | Instead it will generate cross reference ('x') of names. |
2ba84f36 | 1530 | This uses the same flag as DECL_EXTERNAL. */ |
770ae6cc RK |
1531 | #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \ |
1532 | (TYPE_DECL_CHECK (NODE)->decl.external_flag) | |
60e9e4b7 | 1533 | |
a5f99f01 | 1534 | /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */ |
12b195d9 | 1535 | #define DECL_REGISTER(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag) |
a5f99f01 RK |
1536 | /* In LABEL_DECL nodes, nonzero means that an error message about |
1537 | jumping into such a binding contour has been printed for this label. */ | |
770ae6cc | 1538 | #define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl.regdecl_flag) |
5a1c7968 | 1539 | /* In a FIELD_DECL, indicates this field should be bit-packed. */ |
770ae6cc | 1540 | #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->decl.regdecl_flag) |
a5f99f01 RK |
1541 | /* In a FUNCTION_DECL with a non-zero DECL_CONTEXT, indicates that a |
1542 | static chain is not needed. */ | |
770ae6cc RK |
1543 | #define DECL_NO_STATIC_CHAIN(NODE) \ |
1544 | (FUNCTION_DECL_CHECK (NODE)->decl.regdecl_flag) | |
8da1b058 RS |
1545 | |
1546 | /* Nonzero in a ..._DECL means this variable is ref'd from a nested function. | |
1547 | For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes. | |
1548 | ||
1549 | For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted. | |
1550 | ||
1551 | Also set in some languages for variables, etc., outside the normal | |
1552 | lexical scope, such as class instance variables. */ | |
12b195d9 | 1553 | #define DECL_NONLOCAL(NODE) (DECL_CHECK (NODE)->decl.nonlocal_flag) |
8da1b058 RS |
1554 | |
1555 | /* Nonzero in a FUNCTION_DECL means this function can be substituted | |
1556 | where it is called. */ | |
770ae6cc | 1557 | #define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inline_flag) |
8da1b058 | 1558 | |
5daf7c0a JM |
1559 | /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ |
1560 | #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable) | |
1561 | ||
588d3ade AO |
1562 | /* In a FUNCTION_DECL, the saved representation of the body of the |
1563 | entire function. Usually a COMPOUND_STMT, but in C++ this may also | |
1564 | be a RETURN_INIT, CTOR_INITIALIZER, or TRY_BLOCK. */ | |
1565 | #define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.saved_tree) | |
1566 | ||
684d9f3b | 1567 | /* List of FUNCTION_DECLs inlined into this function's body. */ |
588d3ade AO |
1568 | #define DECL_INLINED_FNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inlined_fns) |
1569 | ||
8da1b058 RS |
1570 | /* Nonzero in a FUNCTION_DECL means this is a built-in function |
1571 | that is not specified by ansi C and that users are supposed to be allowed | |
1572 | to redefine for any purpose whatever. */ | |
770ae6cc RK |
1573 | #define DECL_BUILT_IN_NONANSI(NODE) \ |
1574 | (FUNCTION_DECL_CHECK (NODE)->common.unsigned_flag) | |
8da1b058 | 1575 | |
140592a0 AG |
1576 | /* Nonzero in a FUNCTION_DECL means this function should be treated |
1577 | as if it were a malloc, meaning it returns a pointer that is | |
1578 | not an alias. */ | |
770ae6cc | 1579 | #define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.malloc_flag) |
140592a0 | 1580 | |
2a8f6b90 JH |
1581 | /* Nonzero in a FUNCTION_DECL means this function should be treated |
1582 | as "pure" function (like const function, but may read global memory). */ | |
1583 | #define DECL_IS_PURE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.pure_flag) | |
1584 | ||
8da1b058 RS |
1585 | /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed |
1586 | specially. */ | |
770ae6cc | 1587 | #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl.bit_field_flag) |
8da1b058 RS |
1588 | /* In a LABEL_DECL, nonzero means label was defined inside a binding |
1589 | contour that restored a stack level and which is now exited. */ | |
770ae6cc | 1590 | #define DECL_TOO_LATE(NODE) (LABEL_DECL_CHECK (NODE)->decl.bit_field_flag) |
26db82d8 | 1591 | |
12a22e76 | 1592 | /* Unused in FUNCTION_DECL. */ |
26db82d8 | 1593 | |
b8af45d0 RS |
1594 | /* In a VAR_DECL that's static, |
1595 | nonzero if the space is in the text section. */ | |
770ae6cc | 1596 | #define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl.bit_field_flag) |
8da1b058 | 1597 | |
12a22e76 JM |
1598 | /* In a FUNCTION_DECL, nonzero means a built in function. */ |
1599 | #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN) | |
1600 | /* For a builtin function, identify which part of the compiler defined it. */ | |
770ae6cc RK |
1601 | #define DECL_BUILT_IN_CLASS(NODE) \ |
1602 | (FUNCTION_DECL_CHECK (NODE)->decl.built_in_class) | |
12a22e76 | 1603 | |
5a1c7968 | 1604 | /* Used in VAR_DECLs to indicate that the variable is a vtable. |
2458b9c0 JM |
1605 | Used in FIELD_DECLs for vtable pointers. |
1606 | Used in FUNCTION_DECLs to indicate that the function is virtual. */ | |
12b195d9 | 1607 | #define DECL_VIRTUAL_P(NODE) (DECL_CHECK (NODE)->decl.virtual_flag) |
8da1b058 | 1608 | |
30801830 JM |
1609 | /* Used to indicate that the linkage status of this DECL is not yet known, |
1610 | so it should not be output now. */ | |
12b195d9 | 1611 | #define DECL_DEFER_OUTPUT(NODE) (DECL_CHECK (NODE)->decl.defer_output) |
30801830 | 1612 | |
adb23061 RK |
1613 | /* Used in PARM_DECLs whose type are unions to indicate that the |
1614 | argument should be passed in the same way that the first union | |
1615 | alternative would be passed. */ | |
770ae6cc RK |
1616 | #define DECL_TRANSPARENT_UNION(NODE) \ |
1617 | (PARM_DECL_CHECK (NODE)->decl.transparent_union) | |
adb23061 | 1618 | |
2c5f4139 JM |
1619 | /* Used in FUNCTION_DECLs to indicate that they should be run automatically |
1620 | at the beginning or end of execution. */ | |
770ae6cc RK |
1621 | #define DECL_STATIC_CONSTRUCTOR(NODE) \ |
1622 | (FUNCTION_DECL_CHECK (NODE)->decl.static_ctor_flag) | |
1623 | ||
1624 | #define DECL_STATIC_DESTRUCTOR(NODE) \ | |
1625 | (FUNCTION_DECL_CHECK (NODE)->decl.static_dtor_flag) | |
2c5f4139 | 1626 | |
3edbc4b9 | 1627 | /* Used to indicate that this DECL represents a compiler-generated entity. */ |
12b195d9 | 1628 | #define DECL_ARTIFICIAL(NODE) (DECL_CHECK (NODE)->decl.artificial_flag) |
3edbc4b9 | 1629 | |
daefd78b | 1630 | /* Used to indicate that this DECL has weak linkage. */ |
12b195d9 | 1631 | #define DECL_WEAK(NODE) (DECL_CHECK (NODE)->decl.weak_flag) |
daefd78b | 1632 | |
c5bd82cb JM |
1633 | /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in |
1634 | multiple translation units should be merged. */ | |
12b195d9 | 1635 | #define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union) |
c5bd82cb | 1636 | |
59182242 MM |
1637 | /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need |
1638 | not be put out unless it is needed in this translation unit. | |
1639 | Entities like this are shared across translation units (like weak | |
1640 | entities), but are guaranteed to be generated by any translation | |
1641 | unit that needs them, and therefore need not be put out anywhere | |
1642 | where they are not needed. DECL_COMDAT is just a hint to the | |
1643 | back-end; it is up to front-ends which set this flag to ensure | |
1644 | that there will never be any harm, other than bloat, in putting out | |
1645 | something which is DECL_COMDAT. */ | |
1646 | #define DECL_COMDAT(NODE) (DECL_CHECK (NODE)->decl.comdat_flag) | |
1647 | ||
07417085 KR |
1648 | /* Used in FUNCTION_DECLs to indicate that function entry and exit should |
1649 | be instrumented with calls to support routines. */ | |
770ae6cc RK |
1650 | #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \ |
1651 | (FUNCTION_DECL_CHECK (NODE)->decl.no_instrument_function_entry_exit) | |
07417085 | 1652 | |
c5c76735 JL |
1653 | /* Used in FUNCTION_DECLs to indicate that check-memory-usage should be |
1654 | disabled in this function. */ | |
770ae6cc RK |
1655 | #define DECL_NO_CHECK_MEMORY_USAGE(NODE) \ |
1656 | (FUNCTION_DECL_CHECK (NODE)->decl.no_check_memory_usage) | |
7d384cc0 | 1657 | |
a157febd GK |
1658 | /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be |
1659 | disabled in this function. */ | |
770ae6cc RK |
1660 | #define DECL_NO_LIMIT_STACK(NODE) \ |
1661 | (FUNCTION_DECL_CHECK (NODE)->decl.no_limit_stack) | |
a157febd | 1662 | |
8da1b058 | 1663 | /* Additional flags for language-specific uses. */ |
12b195d9 ML |
1664 | #define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0) |
1665 | #define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1) | |
1666 | #define DECL_LANG_FLAG_2(NODE) (DECL_CHECK (NODE)->decl.lang_flag_2) | |
1667 | #define DECL_LANG_FLAG_3(NODE) (DECL_CHECK (NODE)->decl.lang_flag_3) | |
1668 | #define DECL_LANG_FLAG_4(NODE) (DECL_CHECK (NODE)->decl.lang_flag_4) | |
1669 | #define DECL_LANG_FLAG_5(NODE) (DECL_CHECK (NODE)->decl.lang_flag_5) | |
1670 | #define DECL_LANG_FLAG_6(NODE) (DECL_CHECK (NODE)->decl.lang_flag_6) | |
1671 | #define DECL_LANG_FLAG_7(NODE) (DECL_CHECK (NODE)->decl.lang_flag_7) | |
8da1b058 | 1672 | |
27da1b4d MK |
1673 | /* Used to indicate that the pointer to this DECL cannot be treated as |
1674 | an address constant. */ | |
1675 | #define DECL_NON_ADDR_CONST_P(NODE) (DECL_CHECK (NODE)->decl.non_addr_const_p) | |
1676 | ||
2bf105ab RK |
1677 | /* Used in a FIELD_DECL to indicate that we cannot form the address of |
1678 | this component. */ | |
1679 | #define DECL_NONADDRESSABLE_P(NODE) \ | |
1680 | (FIELD_DECL_CHECK (NODE)->decl.non_addressable) | |
1681 | ||
3932261a MM |
1682 | /* Used to indicate an alias set for the memory pointed to by this |
1683 | particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have | |
1684 | pointer (or reference) type. */ | |
1685 | #define DECL_POINTER_ALIAS_SET(NODE) \ | |
1686 | (DECL_CHECK (NODE)->decl.pointer_alias_set) | |
1687 | ||
1688 | /* Nonzero if an alias set has been assigned to this declaration. */ | |
1689 | #define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \ | |
1690 | (DECL_POINTER_ALIAS_SET (NODE) != - 1) | |
1691 | ||
a6d7adfd GM |
1692 | /* The pointer_depth field comprises two bits for values in the range |
1693 | 0..3. The value is normally equal to TYPE_POINTER_DEPTH of decl's | |
1694 | type node, but for functions it migth be greater. For example, | |
1695 | this can happen when the function is declared to accept a parameter | |
1696 | of type void* (depth=1), but is actually called with an argument of | |
1697 | type foo** (depth=2). The function type will get the formal | |
1698 | parameter's depth, but the function decl will get the actual | |
1699 | argument's depth. */ | |
1700 | #define DECL_POINTER_DEPTH(DECL) (DECL_CHECK (DECL)->decl.pointer_depth) | |
1701 | ||
eb3ae3e1 ZW |
1702 | struct function; |
1703 | ||
8da1b058 RS |
1704 | struct tree_decl |
1705 | { | |
2bf105ab | 1706 | struct tree_common common; |
3b304f5b | 1707 | const char *filename; |
8da1b058 | 1708 | int linenum; |
0e77444b | 1709 | unsigned int uid; |
2f78c311 | 1710 | tree size; |
e60a8c26 | 1711 | ENUM_BITFIELD(machine_mode) mode : 8; |
8da1b058 RS |
1712 | |
1713 | unsigned external_flag : 1; | |
1714 | unsigned nonlocal_flag : 1; | |
1715 | unsigned regdecl_flag : 1; | |
1716 | unsigned inline_flag : 1; | |
1717 | unsigned bit_field_flag : 1; | |
1718 | unsigned virtual_flag : 1; | |
8da1b058 | 1719 | unsigned ignored_flag : 1; |
c5caa350 | 1720 | unsigned abstract_flag : 1; |
8da1b058 | 1721 | |
3110a56e | 1722 | unsigned in_system_header_flag : 1; |
2c0d84d6 | 1723 | unsigned common_flag : 1; |
30801830 | 1724 | unsigned defer_output : 1; |
adb23061 | 1725 | unsigned transparent_union : 1; |
2c5f4139 JM |
1726 | unsigned static_ctor_flag : 1; |
1727 | unsigned static_dtor_flag : 1; | |
3edbc4b9 | 1728 | unsigned artificial_flag : 1; |
daefd78b | 1729 | unsigned weak_flag : 1; |
3110a56e | 1730 | |
9df2c88c RK |
1731 | unsigned non_addr_const_p : 1; |
1732 | unsigned no_instrument_function_entry_exit : 1; | |
1733 | unsigned no_check_memory_usage : 1; | |
1734 | unsigned comdat_flag : 1; | |
1735 | unsigned malloc_flag : 1; | |
1736 | unsigned no_limit_stack : 1; | |
c149cc37 | 1737 | ENUM_BITFIELD(built_in_class) built_in_class : 2; |
2bf105ab RK |
1738 | |
1739 | unsigned pure_flag : 1; | |
a6d7adfd | 1740 | unsigned pointer_depth : 2; |
2bf105ab | 1741 | unsigned non_addressable : 1; |
11cf4d18 | 1742 | unsigned user_align : 1; |
5daf7c0a JM |
1743 | unsigned uninlinable : 1; |
1744 | /* Two unused bits. */ | |
9df2c88c | 1745 | |
8da1b058 RS |
1746 | unsigned lang_flag_0 : 1; |
1747 | unsigned lang_flag_1 : 1; | |
1748 | unsigned lang_flag_2 : 1; | |
1749 | unsigned lang_flag_3 : 1; | |
1750 | unsigned lang_flag_4 : 1; | |
1751 | unsigned lang_flag_5 : 1; | |
1752 | unsigned lang_flag_6 : 1; | |
1753 | unsigned lang_flag_7 : 1; | |
1754 | ||
09f532c9 | 1755 | union { |
b850de4f MM |
1756 | /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is |
1757 | DECL_FUNCTION_CODE. */ | |
9df2c88c | 1758 | enum built_in_function f; |
b850de4f MM |
1759 | /* In a FUNCITON_DECL for which DECL_BUILT_IN does not hold, this |
1760 | is used by language-dependent code. */ | |
1761 | HOST_WIDE_INT i; | |
1762 | /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for | |
1763 | FUNCTION_DECLs). */ | |
770ae6cc | 1764 | struct {unsigned int align : 24; unsigned int off_align : 8;} a; |
9df2c88c | 1765 | } u1; |
09f532c9 | 1766 | |
2f78c311 ZW |
1767 | tree size_unit; |
1768 | tree name; | |
1769 | tree context; | |
1770 | tree arguments; /* Also used for DECL_FIELD_OFFSET */ | |
1771 | tree result; /* Also used for DECL_BIT_FIELD_TYPE */ | |
1772 | tree initial; /* Also used for DECL_QUALIFIER */ | |
1773 | tree abstract_origin; | |
1774 | tree assembler_name; | |
1775 | tree section_name; | |
91d231cb | 1776 | tree attributes; |
2f78c311 ZW |
1777 | rtx rtl; /* RTL representation for object. */ |
1778 | rtx live_range_rtl; | |
06ceef4e | 1779 | |
9df2c88c | 1780 | /* In FUNCTION_DECL, if it is inline, holds the saved insn chain. |
770ae6cc | 1781 | In FIELD_DECL, is DECL_FIELD_BIT_OFFSET. |
9df2c88c RK |
1782 | In PARM_DECL, holds an RTL for the stack slot |
1783 | of register where the data was actually passed. | |
1784 | Used by Chill and Java in LABEL_DECL and by C++ and Java in VAR_DECL. */ | |
77f934bb | 1785 | union { |
49ad7cfa | 1786 | struct function *f; |
2f78c311 ZW |
1787 | rtx r; |
1788 | tree t; | |
9df2c88c RK |
1789 | int i; |
1790 | } u2; | |
1791 | ||
588d3ade AO |
1792 | /* In a FUNCTION_DECL, this is DECL_SAVED_TREE. */ |
1793 | tree saved_tree; | |
1794 | ||
1795 | /* In a FUNCTION_DECL, these are function data which is to be kept | |
1796 | as long as FUNCTION_DECL is kept. */ | |
1797 | tree inlined_fns; | |
1798 | ||
2f78c311 | 1799 | tree vindex; |
3bdf5ad1 | 1800 | HOST_WIDE_INT pointer_alias_set; |
8da1b058 RS |
1801 | /* Points to a structure whose details depend on the language in use. */ |
1802 | struct lang_decl *lang_specific; | |
1803 | }; | |
1804 | \f | |
1805 | /* Define the overall contents of a tree node. | |
1806 | It may be any of the structures declared above | |
1807 | for various types of node. */ | |
1808 | ||
1809 | union tree_node | |
1810 | { | |
1811 | struct tree_common common; | |
1812 | struct tree_int_cst int_cst; | |
1813 | struct tree_real_cst real_cst; | |
1814 | struct tree_string string; | |
1815 | struct tree_complex complex; | |
1816 | struct tree_identifier identifier; | |
1817 | struct tree_decl decl; | |
1818 | struct tree_type type; | |
1819 | struct tree_list list; | |
1820 | struct tree_vec vec; | |
1821 | struct tree_exp exp; | |
61131fa2 | 1822 | struct tree_block block; |
8da1b058 | 1823 | }; |
1d2a8985 | 1824 | \f |
81b3411c BS |
1825 | /* Standard named or nameless data types of the C compiler. */ |
1826 | ||
1827 | enum tree_index | |
1828 | { | |
1829 | TI_ERROR_MARK, | |
1830 | TI_INTQI_TYPE, | |
1831 | TI_INTHI_TYPE, | |
1832 | TI_INTSI_TYPE, | |
1833 | TI_INTDI_TYPE, | |
1834 | TI_INTTI_TYPE, | |
1835 | ||
1836 | TI_UINTQI_TYPE, | |
1837 | TI_UINTHI_TYPE, | |
1838 | TI_UINTSI_TYPE, | |
1839 | TI_UINTDI_TYPE, | |
1840 | TI_UINTTI_TYPE, | |
1841 | ||
81b3411c BS |
1842 | TI_INTEGER_ZERO, |
1843 | TI_INTEGER_ONE, | |
f2d1f0ba | 1844 | TI_INTEGER_MINUS_ONE, |
81b3411c BS |
1845 | TI_NULL_POINTER, |
1846 | ||
1847 | TI_SIZE_ZERO, | |
1848 | TI_SIZE_ONE, | |
770ae6cc RK |
1849 | |
1850 | TI_BITSIZE_ZERO, | |
1851 | TI_BITSIZE_ONE, | |
1852 | TI_BITSIZE_UNIT, | |
1853 | ||
81b3411c BS |
1854 | TI_COMPLEX_INTEGER_TYPE, |
1855 | TI_COMPLEX_FLOAT_TYPE, | |
1856 | TI_COMPLEX_DOUBLE_TYPE, | |
1857 | TI_COMPLEX_LONG_DOUBLE_TYPE, | |
1858 | ||
1859 | TI_FLOAT_TYPE, | |
1860 | TI_DOUBLE_TYPE, | |
1861 | TI_LONG_DOUBLE_TYPE, | |
1862 | ||
1863 | TI_VOID_TYPE, | |
1864 | TI_PTR_TYPE, | |
1865 | TI_CONST_PTR_TYPE, | |
1866 | TI_PTRDIFF_TYPE, | |
1867 | TI_VA_LIST_TYPE, | |
1868 | ||
cbd5937a MM |
1869 | TI_VOID_LIST_NODE, |
1870 | ||
4061f623 BS |
1871 | TI_V4SF_TYPE, |
1872 | TI_V4SI_TYPE, | |
b63781e9 | 1873 | TI_V8HI_TYPE, |
4061f623 BS |
1874 | TI_V8QI_TYPE, |
1875 | TI_V4HI_TYPE, | |
1876 | TI_V2SI_TYPE, | |
47f339cf | 1877 | TI_V2SF_TYPE, |
b63781e9 | 1878 | TI_V16QI_TYPE, |
4061f623 | 1879 | |
5b47282c GM |
1880 | TI_MAIN_IDENTIFIER, |
1881 | ||
81b3411c BS |
1882 | TI_MAX |
1883 | }; | |
1884 | ||
1885 | extern tree global_trees[TI_MAX]; | |
1886 | ||
1887 | #define error_mark_node global_trees[TI_ERROR_MARK] | |
1888 | ||
1889 | #define intQI_type_node global_trees[TI_INTQI_TYPE] | |
1890 | #define intHI_type_node global_trees[TI_INTHI_TYPE] | |
1891 | #define intSI_type_node global_trees[TI_INTSI_TYPE] | |
1892 | #define intDI_type_node global_trees[TI_INTDI_TYPE] | |
1893 | #define intTI_type_node global_trees[TI_INTTI_TYPE] | |
1894 | ||
1895 | #define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE] | |
1896 | #define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE] | |
1897 | #define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE] | |
1898 | #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE] | |
1899 | #define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE] | |
1900 | ||
81b3411c BS |
1901 | #define integer_zero_node global_trees[TI_INTEGER_ZERO] |
1902 | #define integer_one_node global_trees[TI_INTEGER_ONE] | |
f2d1f0ba | 1903 | #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE] |
81b3411c BS |
1904 | #define size_zero_node global_trees[TI_SIZE_ZERO] |
1905 | #define size_one_node global_trees[TI_SIZE_ONE] | |
770ae6cc RK |
1906 | #define bitsize_zero_node global_trees[TI_BITSIZE_ZERO] |
1907 | #define bitsize_one_node global_trees[TI_BITSIZE_ONE] | |
1908 | #define bitsize_unit_node global_trees[TI_BITSIZE_UNIT] | |
1909 | ||
81b3411c BS |
1910 | #define null_pointer_node global_trees[TI_NULL_POINTER] |
1911 | ||
1912 | #define float_type_node global_trees[TI_FLOAT_TYPE] | |
1913 | #define double_type_node global_trees[TI_DOUBLE_TYPE] | |
1914 | #define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE] | |
1915 | ||
1916 | #define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE] | |
1917 | #define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE] | |
1918 | #define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE] | |
1919 | #define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE] | |
1920 | ||
1921 | #define void_type_node global_trees[TI_VOID_TYPE] | |
fc693822 | 1922 | /* The C type `void *'. */ |
81b3411c | 1923 | #define ptr_type_node global_trees[TI_PTR_TYPE] |
fc693822 | 1924 | /* The C type `const void *'. */ |
81b3411c BS |
1925 | #define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE] |
1926 | #define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE] | |
1927 | #define va_list_type_node global_trees[TI_VA_LIST_TYPE] | |
7145ef21 | 1928 | |
cbd5937a MM |
1929 | /* The node that should be placed at the end of a parameter list to |
1930 | indicate that the function does not take a variable number of | |
1931 | arguments. The TREE_VALUE will be void_type_node and there will be | |
1932 | no TREE_CHAIN. Language-independent code should not assume | |
1933 | anything else about this node. */ | |
1934 | #define void_list_node global_trees[TI_VOID_LIST_NODE] | |
1935 | ||
5b47282c GM |
1936 | #define main_identifier_node global_trees[TI_MAIN_IDENTIFIER] |
1937 | #define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node) | |
1938 | ||
b63781e9 | 1939 | #define V16QI_type_node global_trees[TI_V16QI_TYPE] |
4061f623 BS |
1940 | #define V4SF_type_node global_trees[TI_V4SF_TYPE] |
1941 | #define V4SI_type_node global_trees[TI_V4SI_TYPE] | |
1942 | #define V8QI_type_node global_trees[TI_V8QI_TYPE] | |
b63781e9 | 1943 | #define V8HI_type_node global_trees[TI_V8HI_TYPE] |
4061f623 BS |
1944 | #define V4HI_type_node global_trees[TI_V4HI_TYPE] |
1945 | #define V2SI_type_node global_trees[TI_V2SI_TYPE] | |
47f339cf | 1946 | #define V2SF_type_node global_trees[TI_V2SF_TYPE] |
4061f623 | 1947 | |
7145ef21 MM |
1948 | /* An enumeration of the standard C integer types. These must be |
1949 | ordered so that shorter types appear before longer ones. */ | |
1950 | enum integer_type_kind | |
1951 | { | |
1952 | itk_char, | |
1953 | itk_signed_char, | |
1954 | itk_unsigned_char, | |
1955 | itk_short, | |
1956 | itk_unsigned_short, | |
1957 | itk_int, | |
1958 | itk_unsigned_int, | |
1959 | itk_long, | |
1960 | itk_unsigned_long, | |
1961 | itk_long_long, | |
1962 | itk_unsigned_long_long, | |
1963 | itk_none | |
1964 | }; | |
1965 | ||
1966 | typedef enum integer_type_kind integer_type_kind; | |
1967 | ||
1968 | /* The standard C integer types. Use integer_type_kind to index into | |
1969 | this array. */ | |
1970 | extern tree integer_types[itk_none]; | |
1971 | ||
1972 | #define char_type_node integer_types[itk_char] | |
1973 | #define signed_char_type_node integer_types[itk_signed_char] | |
1974 | #define unsigned_char_type_node integer_types[itk_unsigned_char] | |
1975 | #define short_integer_type_node integer_types[itk_short] | |
1976 | #define short_unsigned_type_node integer_types[itk_unsigned_short] | |
1977 | #define integer_type_node integer_types[itk_int] | |
1978 | #define unsigned_type_node integer_types[itk_unsigned_int] | |
1979 | #define long_integer_type_node integer_types[itk_long] | |
1980 | #define long_unsigned_type_node integer_types[itk_unsigned_long] | |
1981 | #define long_long_integer_type_node integer_types[itk_long_long] | |
1982 | #define long_long_unsigned_type_node integer_types[itk_unsigned_long_long] | |
1983 | ||
81b3411c | 1984 | \f |
f837a861 MM |
1985 | #define NULL_TREE (tree) NULL |
1986 | ||
520a57c8 ZW |
1987 | /* Approximate positive square root of a host double. This is for |
1988 | statistical reports, not code generation. */ | |
1989 | extern double approx_sqrt PARAMS ((double)); | |
1990 | ||
58782098 | 1991 | extern char *permalloc PARAMS ((int)); |
58782098 | 1992 | extern char *expralloc PARAMS ((int)); |
8da1b058 | 1993 | |
c5620996 GK |
1994 | /* Compute the number of bytes occupied by 'node'. This routine only |
1995 | looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */ | |
1996 | ||
1997 | extern size_t tree_size PARAMS ((tree)); | |
1998 | ||
8da1b058 RS |
1999 | /* Lowest level primitive for allocating a node. |
2000 | The TREE_CODE is the only argument. Contents are initialized | |
2001 | to zero except for a few of the common fields. */ | |
2002 | ||
58782098 KG |
2003 | extern tree make_node PARAMS ((enum tree_code)); |
2004 | extern tree make_lang_type PARAMS ((enum tree_code)); | |
2005 | extern tree (*make_lang_type_fn) PARAMS ((enum tree_code)); | |
8da1b058 RS |
2006 | |
2007 | /* Make a copy of a node, with all the same contents except | |
2008 | for TREE_PERMANENT. (The copy is permanent | |
2009 | iff nodes being made now are permanent.) */ | |
2010 | ||
58782098 | 2011 | extern tree copy_node PARAMS ((tree)); |
8da1b058 RS |
2012 | |
2013 | /* Make a copy of a chain of TREE_LIST nodes. */ | |
2014 | ||
58782098 | 2015 | extern tree copy_list PARAMS ((tree)); |
8da1b058 RS |
2016 | |
2017 | /* Make a TREE_VEC. */ | |
2018 | ||
58782098 | 2019 | extern tree make_tree_vec PARAMS ((int)); |
8da1b058 RS |
2020 | |
2021 | /* Return the (unique) IDENTIFIER_NODE node for a given name. | |
2022 | The name is supplied as a char *. */ | |
2023 | ||
58782098 | 2024 | extern tree get_identifier PARAMS ((const char *)); |
8da1b058 | 2025 | |
4bad9e39 APB |
2026 | /* Identical to get_identifier, except that the length is assumed |
2027 | known. */ | |
2028 | ||
2029 | extern tree get_identifier_with_length PARAMS ((const char *, unsigned int)); | |
2030 | ||
6b9300aa RK |
2031 | /* If an identifier with the name TEXT (a null-terminated string) has |
2032 | previously been referred to, return that node; otherwise return | |
2033 | NULL_TREE. */ | |
2034 | ||
58782098 | 2035 | extern tree maybe_get_identifier PARAMS ((const char *)); |
6b9300aa | 2036 | |
8da1b058 RS |
2037 | /* Construct various types of nodes. */ |
2038 | ||
e5d70561 | 2039 | #define build_int_2(LO,HI) \ |
f9e158c3 | 2040 | build_int_2_wide ((unsigned HOST_WIDE_INT) (LO), (HOST_WIDE_INT) (HI)) |
e5d70561 | 2041 | |
58782098 KG |
2042 | extern tree build PARAMS ((enum tree_code, tree, ...)); |
2043 | extern tree build_nt PARAMS ((enum tree_code, ...)); | |
58782098 | 2044 | |
f9e158c3 | 2045 | extern tree build_int_2_wide PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT)); |
58782098 KG |
2046 | extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE)); |
2047 | extern tree build_real_from_int_cst PARAMS ((tree, tree)); | |
2048 | extern tree build_complex PARAMS ((tree, tree, tree)); | |
2049 | extern tree build_string PARAMS ((int, const char *)); | |
2050 | extern tree build1 PARAMS ((enum tree_code, tree, tree)); | |
2051 | extern tree build_tree_list PARAMS ((tree, tree)); | |
58782098 KG |
2052 | extern tree build_decl PARAMS ((enum tree_code, tree, tree)); |
2053 | extern tree build_block PARAMS ((tree, tree, tree, tree, tree)); | |
2054 | extern tree build_expr_wfl PARAMS ((tree, const char *, int, int)); | |
8da1b058 RS |
2055 | |
2056 | /* Construct various nodes representing data types. */ | |
2057 | ||
58782098 KG |
2058 | extern tree make_signed_type PARAMS ((int)); |
2059 | extern tree make_unsigned_type PARAMS ((int)); | |
fed3cef0 | 2060 | extern void initialize_sizetypes PARAMS ((void)); |
58782098 KG |
2061 | extern void set_sizetype PARAMS ((tree)); |
2062 | extern tree signed_or_unsigned_type PARAMS ((int, tree)); | |
2063 | extern void fixup_unsigned_type PARAMS ((tree)); | |
2064 | extern tree build_pointer_type PARAMS ((tree)); | |
2065 | extern tree build_reference_type PARAMS ((tree)); | |
12e1243e | 2066 | extern tree build_type_no_quals PARAMS ((tree)); |
58782098 KG |
2067 | extern tree build_index_type PARAMS ((tree)); |
2068 | extern tree build_index_2_type PARAMS ((tree, tree)); | |
2069 | extern tree build_array_type PARAMS ((tree, tree)); | |
2070 | extern tree build_function_type PARAMS ((tree, tree)); | |
2071 | extern tree build_method_type PARAMS ((tree, tree)); | |
2072 | extern tree build_offset_type PARAMS ((tree, tree)); | |
2073 | extern tree build_complex_type PARAMS ((tree)); | |
2074 | extern tree array_type_nelts PARAMS ((tree)); | |
2075 | ||
2076 | extern tree value_member PARAMS ((tree, tree)); | |
2077 | extern tree purpose_member PARAMS ((tree, tree)); | |
2078 | extern tree binfo_member PARAMS ((tree, tree)); | |
05bccae2 | 2079 | extern unsigned int attribute_hash_list PARAMS ((tree)); |
58782098 KG |
2080 | extern int attribute_list_equal PARAMS ((tree, tree)); |
2081 | extern int attribute_list_contained PARAMS ((tree, tree)); | |
2082 | extern int tree_int_cst_equal PARAMS ((tree, tree)); | |
2083 | extern int tree_int_cst_lt PARAMS ((tree, tree)); | |
56cb9733 | 2084 | extern int tree_int_cst_compare PARAMS ((tree, tree)); |
665f2503 RK |
2085 | extern int host_integerp PARAMS ((tree, int)); |
2086 | extern HOST_WIDE_INT tree_low_cst PARAMS ((tree, int)); | |
a49a6a68 | 2087 | extern int tree_int_cst_msb PARAMS ((tree)); |
58782098 | 2088 | extern int tree_int_cst_sgn PARAMS ((tree)); |
a36556a8 | 2089 | extern int tree_expr_nonnegative_p PARAMS ((tree)); |
2f78c311 | 2090 | extern int rtl_expr_nonnegative_p PARAMS ((rtx)); |
58782098 KG |
2091 | extern int index_type_equal PARAMS ((tree, tree)); |
2092 | extern tree get_inner_array_type PARAMS ((tree)); | |
12cfc830 | 2093 | |
f837a861 MM |
2094 | /* From expmed.c. Since rtl.h is included after tree.h, we can't |
2095 | put the prototype here. Rtl.h does declare the prototype if | |
2096 | tree.h had been included. */ | |
2097 | ||
2f78c311 | 2098 | extern tree make_tree PARAMS ((tree, rtx)); |
8da1b058 | 2099 | \f |
bad1b4ba RK |
2100 | /* Return a type like TTYPE except that its TYPE_ATTRIBUTES |
2101 | is ATTRIBUTE. | |
2102 | ||
2103 | Such modified types already made are recorded so that duplicates | |
2ba84f36 | 2104 | are not made. */ |
bad1b4ba | 2105 | |
58782098 KG |
2106 | extern tree build_type_attribute_variant PARAMS ((tree, tree)); |
2107 | extern tree build_decl_attribute_variant PARAMS ((tree, tree)); | |
bad1b4ba | 2108 | |
91d231cb JM |
2109 | /* Structure describing an attribute and a function to handle it. */ |
2110 | struct attribute_spec | |
2111 | { | |
2112 | /* The name of the attribute (without any leading or trailing __), | |
2113 | or NULL to mark the end of a table of attributes. */ | |
8b60264b | 2114 | const char *const name; |
91d231cb | 2115 | /* The minimum length of the list of arguments of the attribute. */ |
8b60264b | 2116 | const int min_length; |
91d231cb JM |
2117 | /* The maximum length of the list of arguments of the attribute |
2118 | (-1 for no maximum). */ | |
8b60264b | 2119 | const int max_length; |
91d231cb JM |
2120 | /* Whether this attribute requires a DECL. If it does, it will be passed |
2121 | from types of DECLs, function return types and array element types to | |
2122 | the DECLs, function types and array types respectively; but when | |
2123 | applied to a type in any other circumstances, it will be ignored with | |
2124 | a warning. (If greater control is desired for a given attribute, | |
2125 | this should be false, and the flags argument to the handler may be | |
2126 | used to gain greater control in that case.) */ | |
8b60264b | 2127 | const bool decl_required; |
91d231cb JM |
2128 | /* Whether this attribute requires a type. If it does, it will be passed |
2129 | from a DECL to the type of that DECL. */ | |
8b60264b | 2130 | const bool type_required; |
91d231cb JM |
2131 | /* Whether this attribute requires a function (or method) type. If it does, |
2132 | it will be passed from a function pointer type to the target type, | |
2133 | and from a function return type (which is not itself a function | |
2134 | pointer type) to the function type. */ | |
8b60264b | 2135 | const bool function_type_required; |
91d231cb JM |
2136 | /* Function to handle this attribute. NODE points to the node to which |
2137 | the attribute is to be applied. If a DECL, it should be modified in | |
2138 | place; if a TYPE, a copy should be created. NAME is the name of the | |
2139 | attribute (possibly with leading or trailing __). ARGS is the TREE_LIST | |
2140 | of the arguments (which may be NULL). FLAGS gives further information | |
2141 | about the context of the attribute. Afterwards, the attributes will | |
2142 | be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate, | |
2143 | unless *NO_ADD_ATTRS is set to true (which should be done on error, | |
2144 | as well as in any other cases when the attributes should not be added | |
2145 | to the DECL or TYPE). Depending on FLAGS, any attributes to be | |
2146 | applied to another type or DECL later may be returned; | |
2147 | otherwise the return value should be NULL_TREE. This pointer may be | |
2148 | NULL if no special handling is required beyond the checks implied | |
2149 | by the rest of this structure. */ | |
8b60264b KG |
2150 | tree (*const handler) PARAMS ((tree *node, tree name, tree args, |
2151 | int flags, bool *no_add_attrs)); | |
91d231cb JM |
2152 | }; |
2153 | ||
2154 | extern const struct attribute_spec default_target_attribute_table[]; | |
2155 | ||
2156 | /* Flags that may be passed in the third argument of decl_attributes, and | |
2157 | to handler functions for attributes. */ | |
2158 | enum attribute_flags | |
2159 | { | |
2160 | /* The type passed in is the type of a DECL, and any attributes that | |
2161 | should be passed in again to be applied to the DECL rather than the | |
2162 | type should be returned. */ | |
2163 | ATTR_FLAG_DECL_NEXT = 1, | |
2164 | /* The type passed in is a function return type, and any attributes that | |
2165 | should be passed in again to be applied to the function type rather | |
2166 | than the return type should be returned. */ | |
2167 | ATTR_FLAG_FUNCTION_NEXT = 2, | |
2168 | /* The type passed in is an array element type, and any attributes that | |
2169 | should be passed in again to be applied to the array type rather | |
2170 | than the element type should be returned. */ | |
2171 | ATTR_FLAG_ARRAY_NEXT = 4, | |
2172 | /* The type passed in is a structure, union or enumeration type being | |
2173 | created, and should be modified in place. */ | |
6431177a JM |
2174 | ATTR_FLAG_TYPE_IN_PLACE = 8, |
2175 | /* The attributes are being applied by default to a library function whose | |
2176 | name indicates known behavior, and should be silently ignored if they | |
2177 | are not in fact compatible with the function type. */ | |
2178 | ATTR_FLAG_BUILT_IN = 16 | |
91d231cb JM |
2179 | }; |
2180 | ||
501990bb NB |
2181 | /* Default versions of target-overridable functions. */ |
2182 | ||
672a6f42 NB |
2183 | extern tree merge_decl_attributes PARAMS ((tree, tree)); |
2184 | extern tree merge_type_attributes PARAMS ((tree, tree)); | |
8d8e52be JM |
2185 | extern int default_comp_type_attributes PARAMS ((tree, tree)); |
2186 | extern void default_set_default_type_attributes PARAMS ((tree)); | |
12a68f1f | 2187 | extern void default_insert_attributes PARAMS ((tree, tree *)); |
91d231cb | 2188 | extern bool default_function_attribute_inlinable_p PARAMS ((tree)); |
d9525bec BK |
2189 | |
2190 | /* Split a list of declspecs and attributes into two. */ | |
2191 | ||
58782098 | 2192 | extern void split_specs_attrs PARAMS ((tree, tree *, tree *)); |
d9525bec BK |
2193 | |
2194 | /* Strip attributes from a list of combined specs and attrs. */ | |
2195 | ||
58782098 | 2196 | extern tree strip_attrs PARAMS ((tree)); |
d9525bec | 2197 | |
9c130398 DE |
2198 | /* Return 1 if an attribute and its arguments are valid for a decl or type. */ |
2199 | ||
58782098 | 2200 | extern int valid_machine_attribute PARAMS ((tree, tree, tree, tree)); |
9c130398 DE |
2201 | |
2202 | /* Given a tree node and a string, return non-zero if the tree node is | |
2203 | a valid attribute name for the string. */ | |
2204 | ||
58782098 | 2205 | extern int is_attribute_p PARAMS ((const char *, tree)); |
9c130398 DE |
2206 | |
2207 | /* Given an attribute name and a list of attributes, return the list element | |
2208 | of the attribute or NULL_TREE if not found. */ | |
2209 | ||
58782098 | 2210 | extern tree lookup_attribute PARAMS ((const char *, tree)); |
6cb3d314 DE |
2211 | |
2212 | /* Given two attributes lists, return a list of their union. */ | |
2213 | ||
58782098 | 2214 | extern tree merge_attributes PARAMS ((tree, tree)); |
9c130398 | 2215 | |
672a6f42 NB |
2216 | #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES |
2217 | /* Given two Windows decl attributes lists, possibly including | |
2218 | dllimport, return a list of their union . */ | |
2219 | extern tree merge_dllimport_decl_attributes PARAMS ((tree, tree)); | |
2220 | #endif | |
2221 | ||
5101b304 MM |
2222 | /* Return a version of the TYPE, qualified as indicated by the |
2223 | TYPE_QUALS, if one exists. If no qualified version exists yet, | |
2224 | return NULL_TREE. */ | |
2225 | ||
2226 | extern tree get_qualified_type PARAMS ((tree, int)); | |
2227 | ||
2228 | /* Like get_qualified_type, but creates the type if it does not | |
2229 | exist. This function never returns NULL_TREE. */ | |
3932261a | 2230 | |
58782098 | 2231 | extern tree build_qualified_type PARAMS ((tree, int)); |
3932261a MM |
2232 | |
2233 | /* Like build_qualified_type, but only deals with the `const' and | |
2234 | `volatile' qualifiers. This interface is retained for backwards | |
2235 | compatiblity with the various front-ends; new code should use | |
2236 | build_qualified_type instead. */ | |
8da1b058 | 2237 | |
3932261a MM |
2238 | #define build_type_variant(TYPE, CONST_P, VOLATILE_P) \ |
2239 | build_qualified_type (TYPE, \ | |
2240 | ((CONST_P) ? TYPE_QUAL_CONST : 0) \ | |
2241 | | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0)) | |
8da1b058 | 2242 | |
43100b14 RS |
2243 | /* Make a copy of a type node. */ |
2244 | ||
58782098 | 2245 | extern tree build_type_copy PARAMS ((tree)); |
43100b14 | 2246 | |
8da1b058 | 2247 | /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT, |
9328904c MM |
2248 | TYPE_ALIGN and TYPE_MODE fields. If called more than once on one |
2249 | node, does nothing except for the first time. */ | |
8da1b058 | 2250 | |
58782098 | 2251 | extern void layout_type PARAMS ((tree)); |
8da1b058 | 2252 | |
9328904c MM |
2253 | /* These functions allow a front-end to perform a manual layout of a |
2254 | RECORD_TYPE. (For instance, if the placement of subsequent fields | |
2255 | depends on the placement of fields so far.) Begin by calling | |
770ae6cc | 2256 | start_record_layout. Then, call place_field for each of the |
9328904c MM |
2257 | fields. Then, call finish_record_layout. See layout_type for the |
2258 | default way in which these functions are used. */ | |
2259 | ||
defd0dea | 2260 | typedef struct record_layout_info_s |
9328904c MM |
2261 | { |
2262 | /* The RECORD_TYPE that we are laying out. */ | |
2263 | tree t; | |
770ae6cc RK |
2264 | /* The offset into the record so far, in bytes, not including bits in |
2265 | BITPOS. */ | |
2266 | tree offset; | |
2267 | /* The last known alignment of SIZE. */ | |
2268 | unsigned int offset_align; | |
2269 | /* The bit position within the last OFFSET_ALIGN bits, in bits. */ | |
2270 | tree bitpos; | |
9328904c MM |
2271 | /* The alignment of the record so far, in bits. */ |
2272 | unsigned int record_align; | |
770ae6cc RK |
2273 | /* The alignment of the record so far, not including padding, in bits. */ |
2274 | unsigned int unpacked_align; | |
e0cea8d9 RK |
2275 | /* The alignment of the record so far, allowing for the record to be |
2276 | padded only at the end, in bits. */ | |
2277 | unsigned int unpadded_align; | |
9328904c MM |
2278 | /* The static variables (i.e., class variables, as opposed to |
2279 | instance variables) encountered in T. */ | |
2280 | tree pending_statics; | |
9328904c | 2281 | int packed_maybe_necessary; |
770ae6cc | 2282 | } *record_layout_info; |
9328904c | 2283 | |
e0cea8d9 RK |
2284 | extern void set_lang_adjust_rli PARAMS ((void (*) PARAMS |
2285 | ((record_layout_info)))); | |
770ae6cc | 2286 | extern record_layout_info start_record_layout PARAMS ((tree)); |
f2704b9f RK |
2287 | extern tree bit_from_pos PARAMS ((tree, tree)); |
2288 | extern tree byte_from_pos PARAMS ((tree, tree)); | |
2289 | extern void pos_from_byte PARAMS ((tree *, tree *, unsigned int, | |
2290 | tree)); | |
2291 | extern void pos_from_bit PARAMS ((tree *, tree *, unsigned int, | |
2292 | tree)); | |
2293 | extern void normalize_offset PARAMS ((tree *, tree *, | |
2294 | unsigned int)); | |
770ae6cc RK |
2295 | extern tree rli_size_unit_so_far PARAMS ((record_layout_info)); |
2296 | extern tree rli_size_so_far PARAMS ((record_layout_info)); | |
2297 | extern void normalize_rli PARAMS ((record_layout_info)); | |
2298 | extern void place_field PARAMS ((record_layout_info, tree)); | |
65e14bf5 | 2299 | extern void compute_record_mode PARAMS ((tree)); |
770ae6cc | 2300 | extern void finish_record_layout PARAMS ((record_layout_info)); |
9328904c | 2301 | |
8da1b058 RS |
2302 | /* Given a hashcode and a ..._TYPE node (for which the hashcode was made), |
2303 | return a canonicalized ..._TYPE node, so that duplicates are not made. | |
2304 | How the hash code is computed is up to the caller, as long as any two | |
2305 | callers that could hash identical-looking type nodes agree. */ | |
2306 | ||
05bccae2 | 2307 | extern tree type_hash_canon PARAMS ((unsigned int, tree)); |
8da1b058 RS |
2308 | |
2309 | /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node, | |
2310 | calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE | |
2311 | fields. Call this only once for any given decl node. | |
2312 | ||
2313 | Second argument is the boundary that this field can be assumed to | |
2314 | be starting at (in bits). Zero means it can be assumed aligned | |
2315 | on any boundary that may be needed. */ | |
2316 | ||
58782098 | 2317 | extern void layout_decl PARAMS ((tree, unsigned)); |
8da1b058 | 2318 | |
72c602fc RK |
2319 | /* Return the mode for data of a given size SIZE and mode class CLASS. |
2320 | If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE. | |
2321 | The value is BLKmode if no other mode is found. This is like | |
2322 | mode_for_size, but is passed a tree. */ | |
2323 | ||
2324 | extern enum machine_mode mode_for_size_tree PARAMS ((tree, enum mode_class, | |
2325 | int)); | |
2326 | ||
8da1b058 RS |
2327 | /* Return an expr equal to X but certainly not valid as an lvalue. */ |
2328 | ||
58782098 KG |
2329 | extern tree non_lvalue PARAMS ((tree)); |
2330 | extern tree pedantic_non_lvalue PARAMS ((tree)); | |
8da1b058 | 2331 | |
58782098 | 2332 | extern tree convert PARAMS ((tree, tree)); |
729a2125 | 2333 | extern unsigned int expr_align PARAMS ((tree)); |
58782098 KG |
2334 | extern tree size_in_bytes PARAMS ((tree)); |
2335 | extern HOST_WIDE_INT int_size_in_bytes PARAMS ((tree)); | |
665f2503 RK |
2336 | extern tree bit_position PARAMS ((tree)); |
2337 | extern HOST_WIDE_INT int_bit_position PARAMS ((tree)); | |
770ae6cc RK |
2338 | extern tree byte_position PARAMS ((tree)); |
2339 | extern HOST_WIDE_INT int_byte_position PARAMS ((tree)); | |
fed3cef0 RK |
2340 | |
2341 | /* Define data structures, macros, and functions for handling sizes | |
2342 | and the various types used to represent sizes. */ | |
2343 | ||
2344 | enum size_type_kind | |
2345 | { | |
2ba84f36 KH |
2346 | SIZETYPE, /* Normal representation of sizes in bytes. */ |
2347 | SSIZETYPE, /* Signed representation of sizes in bytes. */ | |
fed3cef0 RK |
2348 | USIZETYPE, /* Unsigned representation of sizes in bytes. */ |
2349 | BITSIZETYPE, /* Normal representation of sizes in bits. */ | |
2350 | SBITSIZETYPE, /* Signed representation of sizes in bits. */ | |
2351 | UBITSIZETYPE, /* Unsifgned representation of sizes in bits. */ | |
2352 | TYPE_KIND_LAST}; | |
2353 | ||
2354 | extern tree sizetype_tab[(int) TYPE_KIND_LAST]; | |
2355 | ||
2356 | #define sizetype sizetype_tab[(int) SIZETYPE] | |
2357 | #define bitsizetype sizetype_tab[(int) BITSIZETYPE] | |
2358 | #define ssizetype sizetype_tab[(int) SSIZETYPE] | |
2359 | #define usizetype sizetype_tab[(int) USIZETYPE] | |
2360 | #define sbitsizetype sizetype_tab[(int) SBITSIZETYPE] | |
2361 | #define ubitsizetype sizetype_tab[(int) UBITSIZETYPE] | |
2362 | ||
58782098 | 2363 | extern tree size_binop PARAMS ((enum tree_code, tree, tree)); |
fed3cef0 RK |
2364 | extern tree size_diffop PARAMS ((tree, tree)); |
2365 | extern tree size_int_wide PARAMS ((HOST_WIDE_INT, | |
2366 | enum size_type_kind)); | |
2367 | extern tree size_int_type_wide PARAMS ((HOST_WIDE_INT, tree)); | |
06ceef4e | 2368 | |
fed3cef0 RK |
2369 | #define size_int_type(L, T) size_int_type_wide ((HOST_WIDE_INT) (L), T) |
2370 | #define size_int(L) size_int_wide ((HOST_WIDE_INT) (L), SIZETYPE) | |
2371 | #define ssize_int(L) size_int_wide ((HOST_WIDE_INT) (L), SSIZETYPE) | |
2372 | #define bitsize_int(L) size_int_wide ((HOST_WIDE_INT) (L), BITSIZETYPE) | |
2373 | #define sbitsize_int(L) size_int_wide ((HOST_WIDE_INT) (L), SBITSIZETYPE) | |
f8dac6eb | 2374 | |
58782098 | 2375 | extern tree round_up PARAMS ((tree, int)); |
36244024 | 2376 | extern tree round_down PARAMS ((tree, int)); |
58782098 | 2377 | extern tree get_pending_sizes PARAMS ((void)); |
fe375cf1 JJ |
2378 | extern int is_pending_size PARAMS ((tree)); |
2379 | extern void put_pending_size PARAMS ((tree)); | |
58782098 | 2380 | extern void put_pending_sizes PARAMS ((tree)); |
8da1b058 RS |
2381 | |
2382 | /* Type for sizes of data-type. */ | |
2383 | ||
f8dac6eb R |
2384 | #define BITS_PER_UNIT_LOG \ |
2385 | ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \ | |
2386 | + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \ | |
2387 | + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256)) | |
2388 | ||
2ba84f36 | 2389 | /* If nonzero, an upper limit on alignment of structure fields, in bits. */ |
729a2125 | 2390 | extern unsigned int maximum_field_alignment; |
8294accf | 2391 | |
2ba84f36 | 2392 | /* If non-zero, the alignment of a bitstring or (power-)set value, in bits. */ |
729a2125 | 2393 | extern unsigned int set_alignment; |
8294accf | 2394 | |
8da1b058 RS |
2395 | /* Concatenate two lists (chains of TREE_LIST nodes) X and Y |
2396 | by making the last node in X point to Y. | |
2397 | Returns X, except if X is 0 returns Y. */ | |
2398 | ||
58782098 | 2399 | extern tree chainon PARAMS ((tree, tree)); |
8da1b058 RS |
2400 | |
2401 | /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */ | |
2402 | ||
58782098 | 2403 | extern tree tree_cons PARAMS ((tree, tree, tree)); |
8da1b058 RS |
2404 | |
2405 | /* Return the last tree node in a chain. */ | |
2406 | ||
58782098 | 2407 | extern tree tree_last PARAMS ((tree)); |
8da1b058 RS |
2408 | |
2409 | /* Reverse the order of elements in a chain, and return the new head. */ | |
2410 | ||
58782098 | 2411 | extern tree nreverse PARAMS ((tree)); |
8da1b058 RS |
2412 | |
2413 | /* Returns the length of a chain of nodes | |
2414 | (number of chain pointers to follow before reaching a null pointer). */ | |
2415 | ||
58782098 | 2416 | extern int list_length PARAMS ((tree)); |
8da1b058 | 2417 | |
c3b247b4 JM |
2418 | /* Returns the number of FIELD_DECLs in a type. */ |
2419 | ||
2420 | extern int fields_length PARAMS ((tree)); | |
2421 | ||
8da1b058 RS |
2422 | /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */ |
2423 | ||
58782098 | 2424 | extern int integer_zerop PARAMS ((tree)); |
8da1b058 RS |
2425 | |
2426 | /* integer_onep (tree x) is nonzero if X is an integer constant of value 1 */ | |
2427 | ||
58782098 | 2428 | extern int integer_onep PARAMS ((tree)); |
8da1b058 RS |
2429 | |
2430 | /* integer_all_onesp (tree x) is nonzero if X is an integer constant | |
2431 | all of whose significant bits are 1. */ | |
2432 | ||
58782098 | 2433 | extern int integer_all_onesp PARAMS ((tree)); |
8da1b058 RS |
2434 | |
2435 | /* integer_pow2p (tree x) is nonzero is X is an integer constant with | |
2436 | exactly one bit 1. */ | |
2437 | ||
58782098 | 2438 | extern int integer_pow2p PARAMS ((tree)); |
8da1b058 RS |
2439 | |
2440 | /* staticp (tree x) is nonzero if X is a reference to data allocated | |
2441 | at a fixed address in memory. */ | |
2442 | ||
58782098 | 2443 | extern int staticp PARAMS ((tree)); |
8da1b058 RS |
2444 | |
2445 | /* Gets an error if argument X is not an lvalue. | |
2446 | Also returns 1 if X is an lvalue, 0 if not. */ | |
2447 | ||
58782098 | 2448 | extern int lvalue_or_else PARAMS ((tree, const char *)); |
8da1b058 RS |
2449 | |
2450 | /* save_expr (EXP) returns an expression equivalent to EXP | |
2451 | but it can be used multiple times within context CTX | |
2452 | and only evaluate EXP once. */ | |
2453 | ||
58782098 | 2454 | extern tree save_expr PARAMS ((tree)); |
8da1b058 | 2455 | |
b7f6588d JM |
2456 | /* Returns the index of the first non-tree operand for CODE, or the number |
2457 | of operands if all are trees. */ | |
2458 | ||
58782098 | 2459 | extern int first_rtl_op PARAMS ((enum tree_code)); |
b7f6588d | 2460 | |
679163cf | 2461 | /* unsave_expr (EXP) returns an expression equivalent to EXP but it |
582db8e4 | 2462 | can be used multiple times and will evaluate EXP in its entirety |
679163cf MS |
2463 | each time. */ |
2464 | ||
58782098 | 2465 | extern tree unsave_expr PARAMS ((tree)); |
679163cf | 2466 | |
582db8e4 MM |
2467 | /* Reset EXP in place so that it can be expaned again. Does not |
2468 | recurse into subtrees. */ | |
2469 | ||
58782098 | 2470 | extern void unsave_expr_1 PARAMS ((tree)); |
582db8e4 MM |
2471 | |
2472 | /* Like unsave_expr_1, but recurses into all subtrees. */ | |
679163cf | 2473 | |
58782098 | 2474 | extern tree unsave_expr_now PARAMS ((tree)); |
679163cf | 2475 | |
582db8e4 MM |
2476 | /* If non-null, these are language-specific helper functions for |
2477 | unsave_expr_now. If present, LANG_UNSAVE is called before its | |
2478 | argument (an UNSAVE_EXPR) is to be unsaved, and all other | |
2479 | processing in unsave_expr_now is aborted. LANG_UNSAVE_EXPR_NOW is | |
2480 | called from unsave_expr_1 for language-specific tree codes. */ | |
58782098 KG |
2481 | extern void (*lang_unsave) PARAMS ((tree *)); |
2482 | extern void (*lang_unsave_expr_now) PARAMS ((tree)); | |
0a818f84 | 2483 | |
194c7c45 RH |
2484 | /* Return 0 if it is safe to evaluate EXPR multiple times, |
2485 | return 1 if it is safe if EXPR is unsaved afterward, or | |
2486 | return 2 if it is completely unsafe. */ | |
3fe30ff6 RH |
2487 | extern int unsafe_for_reeval PARAMS ((tree)); |
2488 | ||
2489 | /* If non-null, these are language-specific helper functions for | |
2490 | unsafe_for_reeval. Return negative to not handle some tree. */ | |
2491 | extern int (*lang_unsafe_for_reeval) PARAMS ((tree)); | |
8c57aea6 | 2492 | |
7380d707 RK |
2493 | /* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size |
2494 | or offset that depends on a field within a record. | |
2495 | ||
2496 | Note that we only allow such expressions within simple arithmetic | |
2497 | or a COND_EXPR. */ | |
2498 | ||
58782098 | 2499 | extern int contains_placeholder_p PARAMS ((tree)); |
7380d707 | 2500 | |
b7f6588d JM |
2501 | /* Return 1 if EXP contains any expressions that produce cleanups for an |
2502 | outer scope to deal with. Used by fold. */ | |
2503 | ||
58782098 | 2504 | extern int has_cleanups PARAMS ((tree)); |
b7f6588d | 2505 | |
7380d707 RK |
2506 | /* Given a tree EXP, a FIELD_DECL F, and a replacement value R, |
2507 | return a tree with all occurrences of references to F in a | |
2508 | PLACEHOLDER_EXPR replaced by R. Note that we assume here that EXP | |
2509 | contains only arithmetic expressions. */ | |
2510 | ||
58782098 | 2511 | extern tree substitute_in_expr PARAMS ((tree, tree, tree)); |
7380d707 | 2512 | |
90ca31be RS |
2513 | /* variable_size (EXP) is like save_expr (EXP) except that it |
2514 | is for the special case of something that is part of a | |
2515 | variable size for a data type. It makes special arrangements | |
2516 | to compute the value at the right time when the data type | |
2517 | belongs to a function parameter. */ | |
2518 | ||
58782098 | 2519 | extern tree variable_size PARAMS ((tree)); |
90ca31be | 2520 | |
8da1b058 RS |
2521 | /* stabilize_reference (EXP) returns an reference equivalent to EXP |
2522 | but it can be used multiple times | |
2523 | and only evaluate the subexpressions once. */ | |
2524 | ||
58782098 | 2525 | extern tree stabilize_reference PARAMS ((tree)); |
8da1b058 | 2526 | |
1c8b10bb RK |
2527 | /* Subroutine of stabilize_reference; this is called for subtrees of |
2528 | references. Any expression with side-effects must be put in a SAVE_EXPR | |
2529 | to ensure that it is only evaluated once. */ | |
2530 | ||
58782098 | 2531 | extern tree stabilize_reference_1 PARAMS ((tree)); |
1c8b10bb | 2532 | |
8da1b058 RS |
2533 | /* Return EXP, stripped of any conversions to wider types |
2534 | in such a way that the result of converting to type FOR_TYPE | |
2535 | is the same as if EXP were converted to FOR_TYPE. | |
2536 | If FOR_TYPE is 0, it signifies EXP's type. */ | |
2537 | ||
58782098 | 2538 | extern tree get_unwidened PARAMS ((tree, tree)); |
8da1b058 RS |
2539 | |
2540 | /* Return OP or a simpler expression for a narrower value | |
2541 | which can be sign-extended or zero-extended to give back OP. | |
2542 | Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended | |
2543 | or 0 if the value should be sign-extended. */ | |
2544 | ||
58782098 | 2545 | extern tree get_narrower PARAMS ((tree, int *)); |
8da1b058 RS |
2546 | |
2547 | /* Given MODE and UNSIGNEDP, return a suitable type-tree | |
2548 | with that mode. | |
2549 | The definition of this resides in language-specific code | |
2550 | as the repertoire of available types may vary. */ | |
2551 | ||
58782098 | 2552 | extern tree type_for_mode PARAMS ((enum machine_mode, int)); |
8da1b058 RS |
2553 | |
2554 | /* Given PRECISION and UNSIGNEDP, return a suitable type-tree | |
2555 | for an integer type with at least that precision. | |
2556 | The definition of this resides in language-specific code | |
2557 | as the repertoire of available types may vary. */ | |
2558 | ||
58782098 | 2559 | extern tree type_for_size PARAMS ((unsigned, int)); |
8da1b058 RS |
2560 | |
2561 | /* Given an integer type T, return a type like T but unsigned. | |
2562 | If T is unsigned, the value is T. | |
2563 | The definition of this resides in language-specific code | |
2564 | as the repertoire of available types may vary. */ | |
2565 | ||
58782098 | 2566 | extern tree unsigned_type PARAMS ((tree)); |
8da1b058 RS |
2567 | |
2568 | /* Given an integer type T, return a type like T but signed. | |
2569 | If T is signed, the value is T. | |
2570 | The definition of this resides in language-specific code | |
2571 | as the repertoire of available types may vary. */ | |
2572 | ||
58782098 | 2573 | extern tree signed_type PARAMS ((tree)); |
8da1b058 RS |
2574 | |
2575 | /* This function must be defined in the language-specific files. | |
2576 | expand_expr calls it to build the cleanup-expression for a TARGET_EXPR. | |
2577 | This is defined in a language-specific file. */ | |
2578 | ||
58782098 | 2579 | extern tree maybe_build_cleanup PARAMS ((tree)); |
8da1b058 RS |
2580 | |
2581 | /* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF, | |
2582 | look for nested component-refs or array-refs at constant positions | |
2583 | and find the ultimate containing object, which is returned. */ | |
2584 | ||
770ae6cc RK |
2585 | extern tree get_inner_reference PARAMS ((tree, HOST_WIDE_INT *, |
2586 | HOST_WIDE_INT *, tree *, | |
2587 | enum machine_mode *, int *, | |
a06ef755 | 2588 | int *)); |
8da1b058 | 2589 | |
ed239f5a RK |
2590 | /* Return 1 if T is an expression that get_inner_reference handles. */ |
2591 | ||
2592 | extern int handled_component_p PARAMS ((tree)); | |
2593 | ||
140b60b4 MM |
2594 | /* Given a DECL or TYPE, return the scope in which it was declared, or |
2595 | NUL_TREE if there is no containing scope. */ | |
2596 | ||
58782098 | 2597 | extern tree get_containing_scope PARAMS ((tree)); |
140b60b4 | 2598 | |
8da1b058 RS |
2599 | /* Return the FUNCTION_DECL which provides this _DECL with its context, |
2600 | or zero if none. */ | |
58782098 | 2601 | extern tree decl_function_context PARAMS ((tree)); |
8da1b058 | 2602 | |
3635a54b RK |
2603 | /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides |
2604 | this _DECL with its context, or zero if none. */ | |
58782098 | 2605 | extern tree decl_type_context PARAMS ((tree)); |
8da1b058 RS |
2606 | |
2607 | /* Given the FUNCTION_DECL for the current function, | |
2608 | return zero if it is ok for this function to be inline. | |
2609 | Otherwise return a warning message with a single %s | |
2610 | for the function's name. */ | |
2611 | ||
58782098 | 2612 | extern const char *function_cannot_inline_p PARAMS ((tree)); |
a3c11cd3 JW |
2613 | |
2614 | /* Return 1 if EXPR is the real constant zero. */ | |
58782098 | 2615 | extern int real_zerop PARAMS ((tree)); |
8da1b058 RS |
2616 | \f |
2617 | /* Declare commonly used variables for tree structure. */ | |
2618 | ||
8da1b058 RS |
2619 | /* Points to the name of the input file from which the current input |
2620 | being parsed originally came (before it went into cpp). */ | |
3b304f5b | 2621 | extern const char *input_filename; |
8da1b058 RS |
2622 | |
2623 | /* Current line number in input file. */ | |
2624 | extern int lineno; | |
2625 | ||
4812480a JM |
2626 | /* Nonzero means lvalues are limited to those valid in pedantic ANSI C. |
2627 | Zero means allow extended lvalues. */ | |
2628 | ||
2629 | extern int pedantic_lvalues; | |
2630 | ||
8da1b058 RS |
2631 | /* Nonzero means can safely call expand_expr now; |
2632 | otherwise layout_type puts variable sizes onto `pending_sizes' instead. */ | |
2633 | ||
2634 | extern int immediate_size_expand; | |
2635 | ||
2ba84f36 | 2636 | /* Points to the FUNCTION_DECL of the function whose body we are reading. */ |
8da1b058 RS |
2637 | |
2638 | extern tree current_function_decl; | |
2639 | ||
00262c8a ML |
2640 | /* Nonzero means a FUNC_BEGIN label was emitted. */ |
2641 | extern tree current_function_func_begin_label; | |
2642 | ||
8da1b058 RS |
2643 | /* Nonzero means all ..._TYPE nodes should be allocated permanently. */ |
2644 | ||
2645 | extern int all_types_permanent; | |
2646 | ||
a1d7ffe3 JM |
2647 | /* Pointer to function to compute the name to use to print a declaration. |
2648 | DECL is the declaration in question. | |
2649 | VERBOSITY determines what information will be printed: | |
2650 | 0: DECL_NAME, demangled as necessary. | |
2651 | 1: and scope information. | |
2652 | 2: and any other information that might be interesting, such as function | |
2653 | parameter types in C++. */ | |
2654 | ||
58782098 | 2655 | extern const char *(*decl_printable_name) PARAMS ((tree, int)); |
dc437e16 RS |
2656 | |
2657 | /* Pointer to function to finish handling an incomplete decl at the | |
2658 | end of compilation. */ | |
2659 | ||
58782098 | 2660 | extern void (*incomplete_decl_finalize_hook) PARAMS ((tree)); |
f425a887 | 2661 | |
26db82d8 BS |
2662 | /* Declare a predefined function. Return the declaration. This function is |
2663 | provided by each language frontend. */ | |
58782098 | 2664 | extern tree builtin_function PARAMS ((const char *, tree, int, |
26db82d8 BS |
2665 | enum built_in_class, |
2666 | const char *)); | |
8da1b058 | 2667 | \f |
143f1945 | 2668 | /* In tree.c */ |
58782098 | 2669 | extern char *perm_calloc PARAMS ((int, long)); |
881c6935 | 2670 | extern void clean_symbol_name PARAMS ((char *)); |
58782098 KG |
2671 | extern tree get_file_function_name_long PARAMS ((const char *)); |
2672 | extern tree get_set_constructor_bits PARAMS ((tree, char *, int)); | |
2673 | extern tree get_set_constructor_bytes PARAMS ((tree, | |
0f41302f | 2674 | unsigned char *, int)); |
58782098 | 2675 | extern tree get_callee_fndecl PARAMS ((tree)); |
92643fea | 2676 | extern void set_decl_assembler_name PARAMS ((tree)); |
f5d6a24c | 2677 | extern int type_num_arguments PARAMS ((tree)); |
143f1945 | 2678 | \f |
8da1b058 RS |
2679 | /* In stmt.c */ |
2680 | ||
58782098 | 2681 | extern int in_control_zone_p PARAMS ((void)); |
2f78c311 | 2682 | extern void expand_fixups PARAMS ((rtx)); |
58782098 KG |
2683 | extern tree expand_start_stmt_expr PARAMS ((void)); |
2684 | extern tree expand_end_stmt_expr PARAMS ((tree)); | |
2685 | extern void expand_expr_stmt PARAMS ((tree)); | |
2686 | extern int warn_if_unused_value PARAMS ((tree)); | |
2687 | extern void expand_decl_init PARAMS ((tree)); | |
2688 | extern void clear_last_expr PARAMS ((void)); | |
2689 | extern void expand_label PARAMS ((tree)); | |
2690 | extern void expand_goto PARAMS ((tree)); | |
2691 | extern void expand_asm PARAMS ((tree)); | |
2692 | extern void expand_start_cond PARAMS ((tree, int)); | |
2693 | extern void expand_end_cond PARAMS ((void)); | |
2694 | extern void expand_start_else PARAMS ((void)); | |
2695 | extern void expand_start_elseif PARAMS ((tree)); | |
2696 | extern struct nesting *expand_start_loop PARAMS ((int)); | |
2697 | extern struct nesting *expand_start_loop_continue_elsewhere PARAMS ((int)); | |
f0de0c5d | 2698 | extern struct nesting *expand_start_null_loop PARAMS ((void)); |
58782098 KG |
2699 | extern void expand_loop_continue_here PARAMS ((void)); |
2700 | extern void expand_end_loop PARAMS ((void)); | |
f0de0c5d | 2701 | extern void expand_end_null_loop PARAMS ((void)); |
58782098 KG |
2702 | extern int expand_continue_loop PARAMS ((struct nesting *)); |
2703 | extern int expand_exit_loop PARAMS ((struct nesting *)); | |
2704 | extern int expand_exit_loop_if_false PARAMS ((struct nesting *, | |
d6b12657 | 2705 | tree)); |
58782098 | 2706 | extern int expand_exit_something PARAMS ((void)); |
f837a861 | 2707 | |
58782098 | 2708 | extern void expand_return PARAMS ((tree)); |
2f78c311 | 2709 | extern int optimize_tail_recursion PARAMS ((tree, rtx)); |
58782098 | 2710 | extern void expand_start_bindings_and_block PARAMS ((int, tree)); |
a97901e6 MM |
2711 | #define expand_start_bindings(flags) \ |
2712 | expand_start_bindings_and_block(flags, NULL_TREE) | |
58782098 KG |
2713 | extern void expand_end_bindings PARAMS ((tree, int, int)); |
2714 | extern void warn_about_unused_variables PARAMS ((tree)); | |
2715 | extern void start_cleanup_deferral PARAMS ((void)); | |
2716 | extern void end_cleanup_deferral PARAMS ((void)); | |
deb5e280 JM |
2717 | extern int is_body_block PARAMS ((tree)); |
2718 | ||
58782098 | 2719 | extern int conditional_context PARAMS ((void)); |
91088ddb | 2720 | extern struct nesting * current_nesting_level PARAMS ((void)); |
58782098 | 2721 | extern tree last_cleanup_this_contour PARAMS ((void)); |
58782098 | 2722 | extern void expand_start_case PARAMS ((int, tree, tree, |
dff01034 | 2723 | const char *)); |
58782098 | 2724 | extern void expand_end_case PARAMS ((tree)); |
56cb9733 MM |
2725 | extern int add_case_node PARAMS ((tree, tree, |
2726 | tree, tree *)); | |
58782098 | 2727 | extern int pushcase PARAMS ((tree, |
d6b12657 RK |
2728 | tree (*) (tree, tree), |
2729 | tree, tree *)); | |
58782098 | 2730 | extern int pushcase_range PARAMS ((tree, tree, |
d6b12657 RK |
2731 | tree (*) (tree, tree), |
2732 | tree, tree *)); | |
58782098 KG |
2733 | extern void using_eh_for_cleanups PARAMS ((void)); |
2734 | extern int stmt_loop_nest_empty PARAMS ((void)); | |
8da1b058 RS |
2735 | |
2736 | /* In fold-const.c */ | |
2737 | ||
4b63dccb RK |
2738 | /* Fold constants as much as possible in an expression. |
2739 | Returns the simplified expression. | |
2740 | Acts only on the top level of the expression; | |
2741 | if the argument itself cannot be simplified, its | |
2742 | subexpressions are not changed. */ | |
2743 | ||
58782098 | 2744 | extern tree fold PARAMS ((tree)); |
4b63dccb | 2745 | |
58782098 | 2746 | extern int force_fit_type PARAMS ((tree, int)); |
05bccae2 RK |
2747 | extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, |
2748 | unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2749 | unsigned HOST_WIDE_INT *, | |
2750 | HOST_WIDE_INT *)); | |
2751 | extern int neg_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2752 | unsigned HOST_WIDE_INT *, | |
2753 | HOST_WIDE_INT *)); | |
2754 | extern int mul_double PARAMS ((unsigned HOST_WIDE_INT, | |
2755 | HOST_WIDE_INT, | |
2756 | unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2757 | unsigned HOST_WIDE_INT *, | |
2758 | HOST_WIDE_INT *)); | |
2759 | extern void lshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2760 | HOST_WIDE_INT, unsigned int, | |
2761 | unsigned HOST_WIDE_INT *, | |
2762 | HOST_WIDE_INT *, int)); | |
2763 | extern void rshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2764 | HOST_WIDE_INT, unsigned int, | |
2765 | unsigned HOST_WIDE_INT *, | |
2766 | HOST_WIDE_INT *, int)); | |
2767 | extern void lrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2768 | HOST_WIDE_INT, unsigned int, | |
2769 | unsigned HOST_WIDE_INT *, | |
2770 | HOST_WIDE_INT *)); | |
2771 | extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, | |
2772 | HOST_WIDE_INT, unsigned int, | |
2773 | unsigned HOST_WIDE_INT *, | |
2774 | HOST_WIDE_INT *)); | |
58782098 KG |
2775 | extern int operand_equal_p PARAMS ((tree, tree, int)); |
2776 | extern tree invert_truthvalue PARAMS ((tree)); | |
c530479e RH |
2777 | |
2778 | /* In builtins.c. Given a type, apply default promotions wrt unnamed | |
2779 | function arguments and return the new type. Return NULL_TREE if no | |
2780 | change. Required by any language that supports variadic arguments. */ | |
2781 | ||
58782098 | 2782 | extern tree (*lang_type_promotes_to) PARAMS ((tree)); |
94e9dc13 | 2783 | extern tree fold_builtin PARAMS ((tree)); |
8da1b058 RS |
2784 | \f |
2785 | /* The language front-end must define these functions. */ | |
2786 | ||
78b099bd | 2787 | /* Function to replace the DECL_LANG_SPECIFIC field of a DECL with a copy. */ |
58782098 | 2788 | extern void copy_lang_decl PARAMS ((tree)); |
78b099bd | 2789 | |
8da1b058 | 2790 | /* Function called with no arguments to parse and compile the input. */ |
58782098 | 2791 | extern int yyparse PARAMS ((void)); |
8da1b058 RS |
2792 | /* Functions for processing symbol declarations. */ |
2793 | /* Function to enter a new lexical scope. | |
2794 | Takes one argument: always zero when called from outside the front end. */ | |
58782098 | 2795 | extern void pushlevel PARAMS ((int)); |
8da1b058 RS |
2796 | /* Function to exit a lexical scope. It returns a BINDING for that scope. |
2797 | Takes three arguments: | |
2798 | KEEP -- nonzero if there were declarations in this scope. | |
2799 | REVERSE -- reverse the order of decls before returning them. | |
2800 | FUNCTIONBODY -- nonzero if this level is the body of a function. */ | |
58782098 | 2801 | extern tree poplevel PARAMS ((int, int, int)); |
69b78d8d | 2802 | /* Set the BLOCK node for the current scope level. */ |
58782098 | 2803 | extern void set_block PARAMS ((tree)); |
8da1b058 RS |
2804 | /* Function to add a decl to the current scope level. |
2805 | Takes one argument, a decl to add. | |
2806 | Returns that decl, or, if the same symbol is already declared, may | |
2807 | return a different decl for that name. */ | |
58782098 | 2808 | extern tree pushdecl PARAMS ((tree)); |
8da1b058 | 2809 | /* Function to return the chain of decls so far in the current scope level. */ |
58782098 | 2810 | extern tree getdecls PARAMS ((void)); |
8da1b058 | 2811 | /* Function to return the chain of structure tags in the current scope level. */ |
58782098 | 2812 | extern tree gettags PARAMS ((void)); |
a3c11cd3 | 2813 | |
58782098 | 2814 | extern tree build_range_type PARAMS ((tree, tree, tree)); |
a3c11cd3 | 2815 | |
a0c33338 | 2816 | /* In alias.c */ |
bebe2280 RB |
2817 | extern void record_component_aliases PARAMS ((tree)); |
2818 | extern HOST_WIDE_INT get_alias_set PARAMS ((tree)); | |
1da68f56 RK |
2819 | extern int alias_sets_conflict_p PARAMS ((HOST_WIDE_INT, |
2820 | HOST_WIDE_INT)); | |
2821 | extern int readonly_fields_p PARAMS ((tree)); | |
2822 | extern int objects_must_conflict_p PARAMS ((tree, tree)); | |
bebe2280 | 2823 | |
92643fea MM |
2824 | /* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of thing |
2825 | that the assembler should talk about, set DECL_ASSEMBLER_NAME to an | |
2826 | appropriate IDENTIFIER_NODE. Otherwise, set it to the | |
2827 | ERROR_MARK_NODE to ensure that the assembler does not talk about | |
2828 | it. */ | |
2829 | extern void (*lang_set_decl_assembler_name) PARAMS ((tree)); | |
2830 | ||
7584b89f RE |
2831 | struct obstack; |
2832 | ||
a1d061a1 | 2833 | /* In tree.c */ |
58782098 | 2834 | extern int really_constant_p PARAMS ((tree)); |
58782098 KG |
2835 | extern int int_fits_type_p PARAMS ((tree, tree)); |
2836 | extern int tree_log2 PARAMS ((tree)); | |
05bccae2 | 2837 | extern int tree_floor_log2 PARAMS ((tree)); |
58782098 KG |
2838 | extern void preserve_data PARAMS ((void)); |
2839 | extern int object_permanent_p PARAMS ((tree)); | |
2840 | extern int type_precision PARAMS ((tree)); | |
2841 | extern int simple_cst_equal PARAMS ((tree, tree)); | |
05bccae2 | 2842 | extern int compare_tree_int PARAMS ((tree, unsigned int)); |
58782098 KG |
2843 | extern int type_list_equal PARAMS ((tree, tree)); |
2844 | extern int chain_member PARAMS ((tree, tree)); | |
2845 | extern int chain_member_purpose PARAMS ((tree, tree)); | |
2846 | extern int chain_member_value PARAMS ((tree, tree)); | |
2847 | extern tree listify PARAMS ((tree)); | |
05bccae2 RK |
2848 | extern tree type_hash_lookup PARAMS ((unsigned int, tree)); |
2849 | extern void type_hash_add PARAMS ((unsigned int, tree)); | |
2850 | extern unsigned int type_hash_list PARAMS ((tree)); | |
58782098 | 2851 | extern int simple_cst_list_equal PARAMS ((tree, tree)); |
58782098 KG |
2852 | extern void dump_tree_statistics PARAMS ((void)); |
2853 | extern void print_obstack_statistics PARAMS ((const char *, | |
37b37199 | 2854 | struct obstack *)); |
a1d061a1 | 2855 | #ifdef BUFSIZ |
a0c33338 RK |
2856 | extern void print_obstack_name PARAMS ((char *, FILE *, |
2857 | const char *)); | |
a1d061a1 | 2858 | #endif |
3b304f5b | 2859 | extern void expand_function_end PARAMS ((const char *, int, int)); |
58782098 | 2860 | extern void expand_function_start PARAMS ((tree, int)); |
1f731749 | 2861 | extern void expand_pending_sizes PARAMS ((tree)); |
a0c33338 | 2862 | |
58782098 KG |
2863 | extern int real_onep PARAMS ((tree)); |
2864 | extern int real_twop PARAMS ((tree)); | |
58782098 KG |
2865 | extern void gcc_obstack_init PARAMS ((struct obstack *)); |
2866 | extern void init_obstacks PARAMS ((void)); | |
58782098 KG |
2867 | extern void build_common_tree_nodes PARAMS ((int)); |
2868 | extern void build_common_tree_nodes_2 PARAMS ((int)); | |
9ccb25d5 | 2869 | extern void mark_tree_hashtable PARAMS ((void *)); |
a1d061a1 JL |
2870 | |
2871 | /* In function.c */ | |
58782098 KG |
2872 | extern void setjmp_protect_args PARAMS ((void)); |
2873 | extern void setjmp_protect PARAMS ((tree)); | |
2874 | extern void expand_main_function PARAMS ((void)); | |
2875 | extern void mark_varargs PARAMS ((void)); | |
2876 | extern void init_dummy_function_start PARAMS ((void)); | |
2877 | extern void expand_dummy_function_end PARAMS ((void)); | |
2878 | extern void init_function_for_compilation PARAMS ((void)); | |
36244024 | 2879 | extern void init_function_start PARAMS ((tree, const char *, int)); |
58782098 KG |
2880 | extern void assign_parms PARAMS ((tree)); |
2881 | extern void put_var_into_stack PARAMS ((tree)); | |
13eb1f7f | 2882 | extern void flush_addressof PARAMS ((tree)); |
58782098 KG |
2883 | extern void uninitialized_vars_warning PARAMS ((tree)); |
2884 | extern void setjmp_args_warning PARAMS ((void)); | |
2885 | extern void mark_all_temps_used PARAMS ((void)); | |
2886 | extern void init_temp_slots PARAMS ((void)); | |
2887 | extern void combine_temp_slots PARAMS ((void)); | |
2888 | extern void free_temp_slots PARAMS ((void)); | |
2889 | extern void pop_temp_slots PARAMS ((void)); | |
2890 | extern void push_temp_slots PARAMS ((void)); | |
2f78c311 | 2891 | extern void preserve_temp_slots PARAMS ((rtx)); |
05bccae2 | 2892 | extern void preserve_rtl_expr_temps PARAMS ((tree)); |
58782098 | 2893 | extern int aggregate_value_p PARAMS ((tree)); |
591ccf92 | 2894 | extern void free_temps_for_rtl_expr PARAMS ((tree)); |
2f78c311 ZW |
2895 | extern void instantiate_virtual_regs PARAMS ((tree, rtx)); |
2896 | extern void unshare_all_rtl PARAMS ((tree, rtx)); | |
58782098 KG |
2897 | extern int max_parm_reg_num PARAMS ((void)); |
2898 | extern void push_function_context PARAMS ((void)); | |
2899 | extern void pop_function_context PARAMS ((void)); | |
2900 | extern void push_function_context_to PARAMS ((tree)); | |
2901 | extern void pop_function_context_from PARAMS ((tree)); | |
eb3ae3e1 | 2902 | extern void ggc_mark_struct_function PARAMS ((struct function *)); |
a1d061a1 JL |
2903 | |
2904 | /* In print-rtl.c */ | |
2905 | #ifdef BUFSIZ | |
2f78c311 | 2906 | extern void print_rtl PARAMS ((FILE *, rtx)); |
a1d061a1 JL |
2907 | #endif |
2908 | ||
2909 | /* In print-tree.c */ | |
58782098 | 2910 | extern void debug_tree PARAMS ((tree)); |
a1d061a1 | 2911 | #ifdef BUFSIZ |
a0c33338 RK |
2912 | extern void print_node PARAMS ((FILE *, const char *, tree, |
2913 | int)); | |
2914 | extern void print_node_brief PARAMS ((FILE *, const char *, tree, | |
2915 | int)); | |
58782098 | 2916 | extern void indent_to PARAMS ((FILE *, int)); |
a1d061a1 JL |
2917 | #endif |
2918 | ||
2919 | /* In expr.c */ | |
58782098 | 2920 | extern int apply_args_register_offset PARAMS ((int)); |
2f78c311 ZW |
2921 | extern rtx expand_builtin_return_addr |
2922 | PARAMS ((enum built_in_function, int, rtx)); | |
58782098 | 2923 | extern void check_max_integer_computation_mode PARAMS ((tree)); |
a1d061a1 JL |
2924 | |
2925 | /* In emit-rtl.c */ | |
591ccf92 | 2926 | extern void start_sequence_for_rtl_expr PARAMS ((tree)); |
2f78c311 | 2927 | extern rtx emit_line_note PARAMS ((const char *, int)); |
a1d061a1 | 2928 | |
3a8c995b | 2929 | /* In calls.c */ |
f2d33f13 | 2930 | |
f2d33f13 | 2931 | extern int setjmp_call_p PARAMS ((tree)); |
3a8c995b | 2932 | |
bb9f8221 | 2933 | /* In attribs.c. */ |
0c96e965 RK |
2934 | |
2935 | /* Process the attributes listed in ATTRIBUTES and install them in *NODE, | |
2936 | which is either a DECL (including a TYPE_DECL) or a TYPE. If a DECL, | |
2937 | it should be modified in place; if a TYPE, a copy should be created | |
2938 | unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS. FLAGS gives further | |
2939 | information, in the form of a bitwise OR of flags in enum attribute_flags | |
2940 | from tree.h. Depending on these flags, some attributes may be | |
2941 | returned to be applied at a later stage (for example, to apply | |
2942 | a decl attribute to the declaration rather than to its type). */ | |
bb9f8221 RK |
2943 | extern tree decl_attributes PARAMS ((tree *, tree, int)); |
2944 | ||
6431177a JM |
2945 | /* The following function must be provided by front ends |
2946 | using attribs.c. */ | |
2947 | ||
2948 | /* Possibly apply default attributes to a function (represented by | |
2949 | a FUNCTION_DECL). */ | |
2950 | extern void insert_default_attributes PARAMS ((tree)); | |
2951 | ||
0c96e965 RK |
2952 | /* Table of machine-independent attributes for checking formats, if used. */ |
2953 | extern const struct attribute_spec *format_attribute_table; | |
2954 | ||
2955 | /* Table of machine-independent attributes for a particular language. */ | |
2956 | extern const struct attribute_spec *lang_attribute_table; | |
2957 | ||
2958 | /* Flag saying whether common language attributes are to be supported. */ | |
2959 | extern int lang_attribute_common; | |
2960 | ||
a0c33338 RK |
2961 | /* In front end. */ |
2962 | ||
58782098 KG |
2963 | extern int mark_addressable PARAMS ((tree)); |
2964 | extern void incomplete_type_error PARAMS ((tree, tree)); | |
58782098 | 2965 | extern tree truthvalue_conversion PARAMS ((tree)); |
58782098 KG |
2966 | extern int global_bindings_p PARAMS ((void)); |
2967 | extern void insert_block PARAMS ((tree)); | |
a1d061a1 JL |
2968 | |
2969 | /* In integrate.c */ | |
f93dacbd | 2970 | extern void save_for_inline PARAMS ((tree)); |
58782098 KG |
2971 | extern void set_decl_abstract_flags PARAMS ((tree, int)); |
2972 | extern void output_inline_function PARAMS ((tree)); | |
1cfdcc15 | 2973 | extern void set_decl_origin_self PARAMS ((tree)); |
a1d061a1 | 2974 | |
a1d061a1 | 2975 | /* In stor-layout.c */ |
58782098 | 2976 | extern void fixup_signed_type PARAMS ((tree)); |
b5d6a2ff | 2977 | extern void internal_reference_types PARAMS ((void)); |
a1d061a1 JL |
2978 | |
2979 | /* varasm.c */ | |
6c418184 | 2980 | extern void make_decl_rtl PARAMS ((tree, const char *)); |
58782098 KG |
2981 | extern void make_decl_one_only PARAMS ((tree)); |
2982 | extern int supports_one_only PARAMS ((void)); | |
2983 | extern void variable_section PARAMS ((tree, int)); | |
a1d061a1 JL |
2984 | |
2985 | /* In fold-const.c */ | |
58782098 | 2986 | extern int div_and_round_double PARAMS ((enum tree_code, int, |
05bccae2 RK |
2987 | unsigned HOST_WIDE_INT, |
2988 | HOST_WIDE_INT, | |
2989 | unsigned HOST_WIDE_INT, | |
2990 | HOST_WIDE_INT, | |
2991 | unsigned HOST_WIDE_INT *, | |
2992 | HOST_WIDE_INT *, | |
2993 | unsigned HOST_WIDE_INT *, | |
2994 | HOST_WIDE_INT *)); | |
a1d061a1 JL |
2995 | |
2996 | /* In stmt.c */ | |
58782098 KG |
2997 | extern void emit_nop PARAMS ((void)); |
2998 | extern void expand_computed_goto PARAMS ((tree)); | |
40b18c0a MM |
2999 | extern bool parse_output_constraint PARAMS ((const char **, |
3000 | int, int, int, | |
3001 | bool *, bool *, bool *)); | |
58782098 | 3002 | extern void expand_asm_operands PARAMS ((tree, tree, tree, tree, int, |
3b304f5b | 3003 | const char *, int)); |
58782098 KG |
3004 | extern int any_pending_cleanups PARAMS ((int)); |
3005 | extern void init_stmt PARAMS ((void)); | |
3006 | extern void init_stmt_for_function PARAMS ((void)); | |
3007 | extern int drop_through_at_end_p PARAMS ((void)); | |
3008 | extern void expand_start_target_temps PARAMS ((void)); | |
3009 | extern void expand_end_target_temps PARAMS ((void)); | |
3010 | extern void expand_elseif PARAMS ((tree)); | |
7393c642 | 3011 | extern void save_stack_pointer PARAMS ((void)); |
58782098 KG |
3012 | extern void expand_decl PARAMS ((tree)); |
3013 | extern int expand_decl_cleanup PARAMS ((tree, tree)); | |
3014 | extern void expand_anon_union_decl PARAMS ((tree, tree, tree)); | |
3015 | extern void move_cleanups_up PARAMS ((void)); | |
3016 | extern void expand_start_case_dummy PARAMS ((void)); | |
3017 | extern void expand_end_case_dummy PARAMS ((void)); | |
3018 | extern tree case_index_expr_type PARAMS ((void)); | |
3019 | extern HOST_WIDE_INT all_cases_count PARAMS ((tree, int *)); | |
3020 | extern void check_for_full_enumeration_handling PARAMS ((tree)); | |
3021 | extern void declare_nonlocal_label PARAMS ((tree)); | |
a1d061a1 | 3022 | |
496651db MM |
3023 | /* If KIND=='I', return a suitable global initializer (constructor) name. |
3024 | If KIND=='D', return a suitable global clean-up (destructor) name. */ | |
58782098 | 3025 | extern tree get_file_function_name PARAMS ((int)); |
af4142d5 JM |
3026 | \f |
3027 | /* Interface of the DWARF2 unwind info support. */ | |
3028 | ||
af4142d5 JM |
3029 | /* Generate a new label for the CFI info to refer to. */ |
3030 | ||
58782098 | 3031 | extern char *dwarf2out_cfi_label PARAMS ((void)); |
af4142d5 JM |
3032 | |
3033 | /* Entry point to update the canonical frame address (CFA). */ | |
3034 | ||
d3e3972c | 3035 | extern void dwarf2out_def_cfa PARAMS ((const char *, unsigned, long)); |
af4142d5 JM |
3036 | |
3037 | /* Add the CFI for saving a register window. */ | |
3038 | ||
d3e3972c | 3039 | extern void dwarf2out_window_save PARAMS ((const char *)); |
af4142d5 JM |
3040 | |
3041 | /* Add a CFI to update the running total of the size of arguments pushed | |
3042 | onto the stack. */ | |
3043 | ||
d3e3972c | 3044 | extern void dwarf2out_args_size PARAMS ((const char *, long)); |
af4142d5 JM |
3045 | |
3046 | /* Entry point for saving a register to the stack. */ | |
3047 | ||
d3e3972c | 3048 | extern void dwarf2out_reg_save PARAMS ((const char *, unsigned, long)); |
af4142d5 JM |
3049 | |
3050 | /* Entry point for saving the return address in the stack. */ | |
3051 | ||
d3e3972c | 3052 | extern void dwarf2out_return_save PARAMS ((const char *, long)); |
af4142d5 JM |
3053 | |
3054 | /* Entry point for saving the return address in a register. */ | |
3055 | ||
d3e3972c | 3056 | extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); |
af4142d5 | 3057 | |
588d3ade AO |
3058 | /* The type of a function that walks over tree structure. */ |
3059 | ||
3060 | typedef tree (*walk_tree_fn) PARAMS ((tree *, int *, void *)); | |
3061 | ||
89d684bb BM |
3062 | /* In tree-dump.c */ |
3063 | ||
3064 | /* Different tree dump places. When you add new tree dump places, | |
3065 | extend the DUMP_FILES array in tree-dump.c */ | |
3066 | enum tree_dump_index | |
3067 | { | |
3068 | TDI_all, /* dump the whole translation unit */ | |
3069 | TDI_class, /* dump class hierarchy */ | |
3070 | TDI_original, /* dump each function before optimizing it */ | |
3071 | TDI_optimized, /* dump each function after optimizing it */ | |
3072 | TDI_inlined, /* dump each function after inlining | |
3073 | within it. */ | |
3074 | TDI_end | |
3075 | }; | |
3076 | ||
3077 | /* Bit masks to control tree dumping. Not all values are applicable to | |
3078 | all tree dumps. Add new ones at the end. When you define new | |
3079 | values, extend the DUMP_OPTIONS array in tree-dump.c */ | |
3080 | #define TDF_ADDRESS (1 << 0) /* dump node addresses */ | |
3081 | #define TDF_SLIM (1 << 1) /* don't go wild following links */ | |
3082 | ||
3083 | typedef struct dump_info *dump_info_p; | |
3084 | ||
3085 | extern int dump_flag PARAMS ((dump_info_p, int, tree)); | |
3086 | extern int dump_enabled_p PARAMS ((enum tree_dump_index)); | |
3087 | extern FILE *dump_begin PARAMS ((enum tree_dump_index, int *)); | |
3088 | extern void dump_end PARAMS ((enum tree_dump_index, FILE *)); | |
3089 | extern void dump_node PARAMS ((tree, int, FILE *)); | |
3090 | extern int dump_switch_p PARAMS ((const char *)); | |
3091 | extern const char *dump_flag_name PARAMS ((enum tree_dump_index)); | |
3092 | ||
9a6bb3f7 | 3093 | \f |
987009bf ZW |
3094 | /* Redefine abort to report an internal error w/o coredump, and |
3095 | reporting the location of the error in the source file. This logic | |
3096 | is duplicated in rtl.h and tree.h because every file that needs the | |
3097 | special abort includes one or both. toplev.h gets too few files, | |
3098 | system.h gets too many. */ | |
3099 | ||
58782098 | 3100 | extern void fancy_abort PARAMS ((const char *, int, const char *)) |
987009bf | 3101 | ATTRIBUTE_NORETURN; |
fbfc1192 | 3102 | #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) |