]> gcc.gnu.org Git - gcc.git/blame - gcc/tree.h
bb-reorder.c (reorder_basic_blocks): Update PREV_INSN as well as NEXT_INSN.
[gcc.git] / gcc / tree.h
CommitLineData
8da1b058 1/* Front-end tree definitions for GNU compiler.
06ceef4e
RK
2 Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
3 Free Software Foundation, Inc.
8da1b058
RS
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
e9fa0c7c
RK
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
8da1b058
RS
21
22#include "machmode.h"
9f8f4efe 23#include "version.h"
8da1b058 24
d6b12657
RK
25#ifndef RTX_CODE
26struct rtx_def;
27#endif
28
29/* Codes of tree nodes */
8da1b058
RS
30
31#define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
32
33enum tree_code {
34#include "tree.def"
35
6dc42e49 36 LAST_AND_UNUSED_TREE_CODE /* A convenient way to get a value for
8da1b058
RS
37 NUM_TREE_CODE. */
38};
39
40#undef DEFTREECODE
41
42/* Number of tree codes. */
43#define NUM_TREE_CODES ((int)LAST_AND_UNUSED_TREE_CODE)
44
45/* Indexed by enum tree_code, contains a character which is
46 `<' for a comparison expression, `1', for a unary arithmetic
47 expression, `2' for a binary arithmetic expression, `e' for
48 other types of expressions, `r' for a reference, `c' for a
49 constant, `d' for a decl, `t' for a type, `s' for a statement,
50 and `x' for anything else (TREE_LIST, IDENTIFIER, etc). */
51
0a6969ad
JC
52#define MAX_TREE_CODES 256
53extern char tree_code_type[MAX_TREE_CODES];
54#define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
8da1b058 55
4da05956
MM
56/* Returns non-zero iff CLASS is the tree-code class of an
57 expression. */
58
59#define IS_EXPR_CODE_CLASS(CLASS) \
8830da36 60 (CLASS == '<' || CLASS == '1' || CLASS == '2' || CLASS == 'e')
4da05956 61
8da1b058
RS
62/* Number of argument-words in each kind of tree-node. */
63
0a6969ad 64extern int tree_code_length[MAX_TREE_CODES];
8da1b058
RS
65
66/* Names of tree components. */
67
5f8ded66 68extern const char *tree_code_name[MAX_TREE_CODES];
8da1b058 69\f
9df2c88c
RK
70/* Classify which part of the compiler has defined a given builtin function.
71 Note that we assume below that this is no more than two bits. */
26db82d8
BS
72enum built_in_class
73{
74 NOT_BUILT_IN = 0,
75 BUILT_IN_FRONTEND,
76 BUILT_IN_MD,
77 BUILT_IN_NORMAL
78};
9df2c88c
RK
79
80/* Names for the above. */
fd05eb80 81extern const char *const built_in_class_names[4];
9df2c88c 82
8da1b058
RS
83/* Codes that identify the various built in functions
84 so that expand_call can identify them quickly. */
85
86enum built_in_function
87{
8da1b058
RS
88 BUILT_IN_ALLOCA,
89 BUILT_IN_ABS,
90 BUILT_IN_FABS,
91 BUILT_IN_LABS,
92 BUILT_IN_FFS,
93 BUILT_IN_DIV,
94 BUILT_IN_LDIV,
95 BUILT_IN_FFLOOR,
96 BUILT_IN_FCEIL,
97 BUILT_IN_FMOD,
98 BUILT_IN_FREM,
99 BUILT_IN_MEMCPY,
100 BUILT_IN_MEMCMP,
101 BUILT_IN_MEMSET,
102 BUILT_IN_STRCPY,
103 BUILT_IN_STRCMP,
104 BUILT_IN_STRLEN,
105 BUILT_IN_FSQRT,
a1ee10a4
JVA
106 BUILT_IN_SIN,
107 BUILT_IN_COS,
8da1b058
RS
108 BUILT_IN_GETEXP,
109 BUILT_IN_GETMAN,
110 BUILT_IN_SAVEREGS,
111 BUILT_IN_CLASSIFY_TYPE,
112 BUILT_IN_NEXT_ARG,
113 BUILT_IN_ARGS_INFO,
114 BUILT_IN_CONSTANT_P,
115 BUILT_IN_FRAME_ADDRESS,
116 BUILT_IN_RETURN_ADDRESS,
0844ee7f 117 BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
7f11e158
TW
118 BUILT_IN_APPLY_ARGS,
119 BUILT_IN_APPLY,
120 BUILT_IN_RETURN,
33fb8b5f
RK
121 BUILT_IN_SETJMP,
122 BUILT_IN_LONGJMP,
e0cd0770 123 BUILT_IN_TRAP,
8da1b058 124
1eb8759b
RH
125 /* ISO C99 floating point unordered comparisons. */
126 BUILT_IN_ISGREATER,
127 BUILT_IN_ISGREATEREQUAL,
128 BUILT_IN_ISLESS,
129 BUILT_IN_ISLESSEQUAL,
130 BUILT_IN_ISLESSGREATER,
131 BUILT_IN_ISUNORDERED,
132
0021b564 133 /* Various hooks for the DWARF 2 __throw routine. */
0021b564 134 BUILT_IN_UNWIND_INIT,
71038426 135 BUILT_IN_DWARF_CFA,
0021b564 136 BUILT_IN_DWARF_FP_REGNUM,
d9d5c9de 137 BUILT_IN_INIT_DWARF_REG_SIZES,
0021b564
JM
138 BUILT_IN_FROB_RETURN_ADDR,
139 BUILT_IN_EXTRACT_RETURN_ADDR,
71038426 140 BUILT_IN_EH_RETURN,
0021b564 141
d3707adb
RH
142 BUILT_IN_VARARGS_START,
143 BUILT_IN_STDARG_START,
144 BUILT_IN_VA_END,
145 BUILT_IN_VA_COPY,
146
8da1b058
RS
147 /* C++ extensions */
148 BUILT_IN_NEW,
149 BUILT_IN_VEC_NEW,
150 BUILT_IN_DELETE,
972ded9c
RS
151 BUILT_IN_VEC_DELETE,
152
153 /* Upper bound on non-language-specific builtins. */
154 END_BUILTINS
8da1b058 155};
9df2c88c
RK
156
157/* Names for the above. */
fd05eb80 158extern const char *const built_in_names[(int) END_BUILTINS];
8da1b058
RS
159\f
160/* The definition of tree nodes fills the next several pages. */
161
162/* A tree node can represent a data type, a variable, an expression
163 or a statement. Each node has a TREE_CODE which says what kind of
164 thing it represents. Some common codes are:
165 INTEGER_TYPE -- represents a type of integers.
166 ARRAY_TYPE -- represents a type of pointer.
167 VAR_DECL -- represents a declared variable.
168 INTEGER_CST -- represents a constant integer value.
169 PLUS_EXPR -- represents a sum (an expression).
170
171 As for the contents of a tree node: there are some fields
172 that all nodes share. Each TREE_CODE has various special-purpose
173 fields as well. The fields of a node are never accessed directly,
174 always through accessor macros. */
175
176/* This type is used everywhere to refer to a tree node. */
177
178typedef union tree_node *tree;
179
8da1b058
RS
180/* Every kind of tree node starts with this structure,
181 so all nodes have these fields.
182
42801468
JL
183 See the accessor macros, defined below, for documentation of the fields.
184
185 DO NOT change the layout of tree_common unless absolutely necessary. Some
186 front-ends (namely g++) depend on the internal layout of this tructure.
187 See my_tree_cons in the cp subdir for such uglyness. Ugh. */
8da1b058
RS
188
189struct tree_common
190{
191 union tree_node *chain;
192 union tree_node *type;
193#ifdef ONLY_INT_FIELDS
194 unsigned int code : 8;
195#else
196 enum tree_code code : 8;
197#endif
198
199 unsigned side_effects_flag : 1;
200 unsigned constant_flag : 1;
201 unsigned permanent_flag : 1;
202 unsigned addressable_flag : 1;
203 unsigned volatile_flag : 1;
204 unsigned readonly_flag : 1;
205 unsigned unsigned_flag : 1;
206 unsigned asm_written_flag: 1;
207
208 unsigned used_flag : 1;
12a22e76 209 unsigned nothrow_flag : 1;
8da1b058
RS
210 unsigned static_flag : 1;
211 unsigned public_flag : 1;
212 unsigned private_flag : 1;
213 unsigned protected_flag : 1;
214
215 unsigned lang_flag_0 : 1;
216 unsigned lang_flag_1 : 1;
217 unsigned lang_flag_2 : 1;
218 unsigned lang_flag_3 : 1;
219 unsigned lang_flag_4 : 1;
220 unsigned lang_flag_5 : 1;
221 unsigned lang_flag_6 : 1;
0a25f1f5 222
005537df 223 /* There is room for three more flags. */
8da1b058
RS
224};
225
a5f99f01
RK
226/* The following table lists the uses of each of the above flags and
227 for which types of nodes they are defined. Note that expressions
228 include decls.
229
230 addressable_flag:
231
232 TREE_ADDRESSABLE in
233 VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, LABEL_DECL, ..._TYPE
234 IDENTIFIER_NODE
235
236 static_flag:
237
238 TREE_STATIC in
e5e809f4 239 VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR
a5f99f01
RK
240 TREE_NO_UNUSED_WARNING in
241 CONVERT_EXPR, NOP_EXPR, COMPOUND_EXPR
242 TREE_VIA_VIRTUAL in
243 TREE_LIST or TREE_VEC
244 TREE_CONSTANT_OVERFLOW in
245 INTEGER_CST, REAL_CST, COMPLEX_CST
246 TREE_SYMBOL_REFERENCED in
247 IDENTIFIER_NODE
248
249 public_flag:
250
251 TREE_OVERFLOW in
252 INTEGER_CST, REAL_CST, COMPLEX_CST
253 TREE_PUBLIC in
254 VAR_DECL or FUNCTION_DECL
255 TREE_VIA_PUBLIC in
256 TREE_LIST or TREE_VEC
dadafe54
PB
257 EXPR_WFL_EMIT_LINE_NOTE in
258 EXPR_WITH_FILE_LOCATION
a5f99f01
RK
259
260 private_flag:
261
262 TREE_VIA_PRIVATE in
263 TREE_LIST or TREE_VEC
264 TREE_PRIVATE in
265 ??? unspecified nodes
266
267 protected_flag:
268
269 TREE_VIA_PROTECTED in
270 TREE_LIST
271 TREE_PROTECTED in
272 BLOCK
273 ??? unspecified nodes
274
275 side_effects_flag:
276
277 TREE_SIDE_EFFECTS in
278 all expressions
279
280 volatile_flag:
281
282 TREE_THIS_VOLATILE in
283 all expressions
284 TYPE_VOLATILE in
285 ..._TYPE
286
287 readonly_flag:
288
289 TREE_READONLY in
e5e809f4 290 all expressions
a5f99f01
RK
291 ITERATOR_BOUND_P in
292 VAR_DECL if iterator (C)
293 TYPE_READONLY in
294 ..._TYPE
295
296 constant_flag:
297
298 TREE_CONSTANT in
299 all expressions
300
301 permanent_flag: TREE_PERMANENT in all nodes
302
303 unsigned_flag:
304
305 TREE_UNSIGNED in
306 INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL
a5f99f01
RK
307 DECL_BUILT_IN_NONANSI in
308 FUNCTION_DECL
309 TREE_PARMLIST in
310 TREE_PARMLIST (C++)
e9a25f70
JL
311 SAVE_EXPR_NOPLACEHOLDER in
312 SAVE_EXPR
a5f99f01
RK
313
314 asm_written_flag:
315
316 TREE_ASM_WRITTEN in
317 VAR_DECL, FUNCTION_DECL, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
318 BLOCK
319
320 used_flag:
321
322 TREE_USED in
323 expressions, IDENTIFIER_NODE
324
12a22e76 325 nothrow_flag:
a5f99f01 326
12a22e76
JM
327 TREE_NOTHROW in
328 CALL_EXPR, FUNCTION_DECL
a5f99f01
RK
329
330 */
8da1b058
RS
331/* Define accessors for the fields that all tree nodes have
332 (though some fields are not used for all kinds of nodes). */
333
334/* The tree-code says what kind of node it is.
335 Codes are defined in tree.def. */
336#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
337#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (int) (VALUE))
338
12b195d9 339/* When checking is enabled, errors will be generated if a tree node
8f985ec4 340 is accessed incorrectly. The macros abort with a fatal error. */
f4524c9e 341#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
12b195d9 342
8f985ec4
ZW
343#define TREE_CHECK(t, code) \
344({ const tree __t = t; \
345 if (TREE_CODE(__t) != (code)) \
346 tree_check_failed (__t, code, __FILE__, \
347 __LINE__, __PRETTY_FUNCTION__); \
348 __t; })
349#define TREE_CLASS_CHECK(t, class) \
350({ const tree __t = t; \
351 if (TREE_CODE_CLASS(TREE_CODE(__t)) != (class)) \
352 tree_class_check_failed (__t, class, __FILE__, \
353 __LINE__, __PRETTY_FUNCTION__); \
354 __t; })
355
356/* These checks have to be special cased. */
357#define CST_OR_CONSTRUCTOR_CHECK(t) \
358({ const tree __t = t; \
359 enum tree_code __c = TREE_CODE(__t); \
360 if (__c != CONSTRUCTOR && TREE_CODE_CLASS(__c) != 'c') \
361 tree_check_failed (__t, CONSTRUCTOR, __FILE__, \
362 __LINE__, __PRETTY_FUNCTION__); \
363 __t; })
364#define EXPR_CHECK(t) \
365({ const tree __t = t; \
366 char __c = TREE_CODE_CLASS(TREE_CODE(__t)); \
367 if (__c != 'r' && __c != 's' && __c != '<' \
368 && __c != '1' && __c != '2' && __c != 'e') \
369 tree_class_check_failed(__t, 'e', __FILE__, \
370 __LINE__, __PRETTY_FUNCTION__); \
371 __t; })
372
58782098 373extern void tree_check_failed PARAMS ((const tree, enum tree_code,
8f985ec4
ZW
374 const char *, int, const char *))
375 ATTRIBUTE_NORETURN;
58782098 376extern void tree_class_check_failed PARAMS ((const tree, char,
8f985ec4
ZW
377 const char *, int, const char *))
378 ATTRIBUTE_NORETURN;
379
f4524c9e 380#else /* not ENABLE_TREE_CHECKING, or not gcc */
12b195d9 381
8f985ec4
ZW
382#define TREE_CHECK(t, code) (t)
383#define TREE_CLASS_CHECK(t, code) (t)
384#define CST_OR_CONSTRUCTOR_CHECK(t) (t)
385#define EXPR_CHECK(t) (t)
386
387#endif
388
389#include "tree-check.h"
390
391#define TYPE_CHECK(tree) TREE_CLASS_CHECK (tree, 't')
392#define DECL_CHECK(tree) TREE_CLASS_CHECK (tree, 'd')
393#define CST_CHECK(tree) TREE_CLASS_CHECK (tree, 'c')
12b195d9 394
8da1b058
RS
395/* In all nodes that are expressions, this is the data type of the expression.
396 In POINTER_TYPE nodes, this is the type that the pointer points to.
397 In ARRAY_TYPE nodes, this is the type of the elements. */
398#define TREE_TYPE(NODE) ((NODE)->common.type)
399
400/* Nodes are chained together for many purposes.
401 Types are chained together to record them for being output to the debugger
402 (see the function `chain_type').
403 Decls in the same scope are chained together to record the contents
404 of the scope.
405 Statement nodes for successive statements used to be chained together.
406 Often lists of things are represented by TREE_LIST nodes that
407 are chained together. */
408
409#define TREE_CHAIN(NODE) ((NODE)->common.chain)
410
411/* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs
412 that don't change the machine mode. */
413
414#define STRIP_NOPS(EXP) \
415 while ((TREE_CODE (EXP) == NOP_EXPR \
416 || TREE_CODE (EXP) == CONVERT_EXPR \
417 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
418 && (TYPE_MODE (TREE_TYPE (EXP)) \
419 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
420 (EXP) = TREE_OPERAND (EXP, 0);
0fafb45e 421
14a774a9
RK
422/* Like STRIP_NOPS, but don't let the signedness change either. */
423
424#define STRIP_SIGN_NOPS(EXP) \
425 while ((TREE_CODE (EXP) == NOP_EXPR \
426 || TREE_CODE (EXP) == CONVERT_EXPR \
427 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
428 && (TYPE_MODE (TREE_TYPE (EXP)) \
429 == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
430 && (TREE_UNSIGNED (TREE_TYPE (EXP)) \
431 == TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
432 (EXP) = TREE_OPERAND (EXP, 0);
433
0fafb45e
RS
434/* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */
435
436#define STRIP_TYPE_NOPS(EXP) \
437 while ((TREE_CODE (EXP) == NOP_EXPR \
438 || TREE_CODE (EXP) == CONVERT_EXPR \
439 || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
440 && (TREE_TYPE (EXP) \
441 == TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
442 (EXP) = TREE_OPERAND (EXP, 0);
87291138
RK
443
444/* Nonzero if TYPE represents an integral type. Note that we do not
445 include COMPLEX types here. */
446
447#define INTEGRAL_TYPE_P(TYPE) \
448 (TREE_CODE (TYPE) == INTEGER_TYPE || TREE_CODE (TYPE) == ENUMERAL_TYPE \
449 || TREE_CODE (TYPE) == BOOLEAN_TYPE || TREE_CODE (TYPE) == CHAR_TYPE)
450
451/* Nonzero if TYPE represents a floating-point type, including complex
452 floating-point types. */
453
454#define FLOAT_TYPE_P(TYPE) \
455 (TREE_CODE (TYPE) == REAL_TYPE \
456 || (TREE_CODE (TYPE) == COMPLEX_TYPE \
457 && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE))
947765f9
PB
458
459/* Nonzero if TYPE represents an aggregate (multi-component) type. */
460
461#define AGGREGATE_TYPE_P(TYPE) \
462 (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
463 || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE \
464 || TREE_CODE (TYPE) == SET_TYPE)
9e6cfc43
JM
465
466/* Nonzero if TYPE represents a pointer type. */
467
468#define POINTER_TYPE_P(TYPE) \
469 (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
555f90c5
JM
470
471/* Nonzero if TYPE represents a type. */
472
473#define TYPE_P(TYPE) (TREE_CODE_CLASS (TREE_CODE (TYPE)) == 't')
8da1b058
RS
474\f
475/* Define many boolean fields that all tree nodes have. */
476
477/* In VAR_DECL nodes, nonzero means address of this is needed.
478 So it cannot be in a register.
479 In a FUNCTION_DECL, nonzero means its address is needed.
480 So it must be compiled even if it is an inline function.
481 In CONSTRUCTOR nodes, it means object constructed must be in memory.
482 In LABEL_DECL nodes, it means a goto for this label has been seen
483 from a place outside all binding contours that restore stack levels.
484 In ..._TYPE nodes, it means that objects of this type must
485 be fully addressable. This means that pieces of this
486 object cannot go into register parameters, for example.
487 In IDENTIFIER_NODEs, this means that some extern decl for this name
488 had its address taken. That matters for inline functions. */
489#define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_flag)
490
491/* In a VAR_DECL, nonzero means allocate static storage.
9f86614b 492 In a FUNCTION_DECL, nonzero if function has been defined.
8da1b058
RS
493 In a CONSTRUCTOR, nonzero means allocate static storage. */
494#define TREE_STATIC(NODE) ((NODE)->common.static_flag)
495
248c0f74
JM
496/* In a CONVERT_EXPR, NOP_EXPR or COMPOUND_EXPR, this means the node was
497 made implicitly and should not lead to an "unused value" warning. */
8da1b058
RS
498#define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag)
499
500/* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation
501 chain is via a `virtual' declaration. */
502#define TREE_VIA_VIRTUAL(NODE) ((NODE)->common.static_flag)
503
ae202b56
RK
504/* In an INTEGER_CST, REAL_CST, or COMPLEX_CST, this means there was an
505 overflow in folding. This is distinct from TREE_OVERFLOW because ANSI C
506 requires a diagnostic when overflows occur in constant expressions. */
261450e8
PE
507#define TREE_CONSTANT_OVERFLOW(NODE) ((NODE)->common.static_flag)
508
d3568529
JM
509/* In an IDENTIFIER_NODE, this means that assemble_name was called with
510 this string as an argument. */
511#define TREE_SYMBOL_REFERENCED(NODE) ((NODE)->common.static_flag)
512
ae202b56
RK
513/* In an INTEGER_CST, REAL_CST, of COMPLEX_CST, this means there was an
514 overflow in folding, and no warning has been issued for this subexpression.
261450e8
PE
515 TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW, but not vice versa. */
516#define TREE_OVERFLOW(NODE) ((NODE)->common.public_flag)
517
8da1b058
RS
518/* In a VAR_DECL or FUNCTION_DECL,
519 nonzero means name is to be accessible from outside this module.
858a47b1 520 In an identifier node, nonzero means an external declaration
6dc42e49 521 accessible from outside this module was previously seen
8da1b058
RS
522 for this name in an inner scope. */
523#define TREE_PUBLIC(NODE) ((NODE)->common.public_flag)
524
525/* Nonzero for TREE_LIST or TREE_VEC node means that the path to the
526 base class is via a `public' declaration, which preserves public
527 fields from the base class as public. */
528#define TREE_VIA_PUBLIC(NODE) ((NODE)->common.public_flag)
529
9e5386db
MS
530/* Ditto, for `private' declarations. */
531#define TREE_VIA_PRIVATE(NODE) ((NODE)->common.private_flag)
532
533/* Nonzero for TREE_LIST node means that the path to the
534 base class is via a `protected' declaration, which preserves
535 protected fields from the base class as protected.
536 OVERLOADED. */
026380ff 537#define TREE_VIA_PROTECTED(NODE) ((NODE)->common.protected_flag)
9e5386db 538
8da1b058
RS
539/* In any expression, nonzero means it has side effects or reevaluation
540 of the whole expression could produce a different value.
541 This is set if any subexpression is a function call, a side effect
542 or a reference to a volatile variable.
543 In a ..._DECL, this is set only if the declaration said `volatile'. */
544#define TREE_SIDE_EFFECTS(NODE) ((NODE)->common.side_effects_flag)
545
546/* Nonzero means this expression is volatile in the C sense:
547 its address should be of type `volatile WHATEVER *'.
548 In other words, the declared item is volatile qualified.
549 This is used in _DECL nodes and _REF nodes.
550
551 In a ..._TYPE node, means this type is volatile-qualified.
552 But use TYPE_VOLATILE instead of this macro when the node is a type,
553 because eventually we may make that a different bit.
554
555 If this bit is set in an expression, so is TREE_SIDE_EFFECTS. */
556#define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag)
557
558/* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
559 nonzero means it may not be the lhs of an assignment.
560 In a ..._TYPE node, means this type is const-qualified
561 (but the macro TYPE_READONLY should be used instead of this macro
562 when the node is a type). */
563#define TREE_READONLY(NODE) ((NODE)->common.readonly_flag)
564
565/* Value of expression is constant.
566 Always appears in all ..._CST nodes.
567 May also appear in an arithmetic expression, an ADDR_EXPR or a CONSTRUCTOR
568 if the value is constant. */
569#define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag)
570
571/* Nonzero means permanent node;
572 node will continue to exist for the entire compiler run.
23dfa477
ZW
573 Otherwise it will be recycled at the end of the function.
574 This flag is always zero if garbage collection is in use.
575 Try not to use this. Only set it with TREE_SET_PERMANENT. */
8da1b058 576#define TREE_PERMANENT(NODE) ((NODE)->common.permanent_flag)
23dfa477
ZW
577#define TREE_SET_PERMANENT(NODE) do { \
578 if (!ggc_p && current_obstack == &permanent_obstack) \
579 TREE_PERMANENT(NODE) = 1; \
580} while (0)
8da1b058
RS
581
582/* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type.
583 In FIELD_DECL nodes, means an unsigned bit field.
584 The same bit is used in functions as DECL_BUILT_IN_NONANSI. */
585#define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag)
586
587/* Nonzero in a VAR_DECL means assembler code has been written.
588 Nonzero in a FUNCTION_DECL means that the function has been compiled.
589 This is interesting in an inline function, since it might not need
590 to be compiled separately.
3635a54b 591 Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE
9f86614b
RS
592 if the sdb debugging info for the type has been written.
593 In a BLOCK node, nonzero if reorder_blocks has already seen this block. */
8da1b058
RS
594#define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag)
595
596/* Nonzero in a _DECL if the name is used in its scope.
597 Nonzero in an expr node means inhibit warning if value is unused.
598 In IDENTIFIER_NODEs, this means that some extern decl for this name
599 was used. */
600#define TREE_USED(NODE) ((NODE)->common.used_flag)
601
12a22e76
JM
602/* In a FUNCTION_DECL, nonzero means a call to the function cannot throw
603 an exception. In a CALL_EXPR, nonzero means the call cannot throw. */
604#define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag)
8da1b058 605
9f86614b 606/* Used in classes in C++. */
8da1b058 607#define TREE_PRIVATE(NODE) ((NODE)->common.private_flag)
9f86614b
RS
608/* Used in classes in C++.
609 In a BLOCK node, this is BLOCK_HANDLER_BLOCK. */
8da1b058
RS
610#define TREE_PROTECTED(NODE) ((NODE)->common.protected_flag)
611
9f86614b 612/* These flags are available for each language front end to use internally. */
8da1b058
RS
613#define TREE_LANG_FLAG_0(NODE) ((NODE)->common.lang_flag_0)
614#define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1)
615#define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2)
616#define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3)
617#define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
618#define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5)
619#define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6)
620\f
621/* Define additional fields and accessors for nodes representing constants. */
622
e5d70561
RK
623/* In an INTEGER_CST node. These two together make a 2-word integer.
624 If the data type is signed, the value is sign-extended to 2 words
8da1b058 625 even though not all of them may really be in use.
e5d70561 626 In an unsigned constant shorter than 2 words, the extra bits are 0. */
12b195d9
ML
627#define TREE_INT_CST_LOW(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_low)
628#define TREE_INT_CST_HIGH(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst_high)
8da1b058
RS
629
630#define INT_CST_LT(A, B) \
631(TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B) \
632 || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B) \
05bccae2 633 && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
8da1b058
RS
634
635#define INT_CST_LT_UNSIGNED(A, B) \
e5d70561
RK
636(((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \
637 < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \
638 || (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A) \
05bccae2
RK
639 == (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B)) \
640 && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
8da1b058
RS
641
642struct tree_int_cst
643{
644 char common[sizeof (struct tree_common)];
8e15f736
RK
645 struct rtx_def *rtl; /* acts as link to register transfer language
646 (rtl) info */
05bccae2 647 unsigned HOST_WIDE_INT int_cst_low;
e5d70561 648 HOST_WIDE_INT int_cst_high;
8da1b058
RS
649};
650
651/* In REAL_CST, STRING_CST, COMPLEX_CST nodes, and CONSTRUCTOR nodes,
652 and generally in all kinds of constants that could
653 be given labels (rather than being immediate). */
654
12b195d9 655#define TREE_CST_RTL(NODE) (CST_OR_CONSTRUCTOR_CHECK (NODE)->real_cst.rtl)
8da1b058
RS
656
657/* In a REAL_CST node. */
658/* We can represent a real value as either a `double' or a string.
659 Strings don't allow for any optimization, but they do allow
660 for cross-compilation. */
661
12b195d9 662#define TREE_REAL_CST(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst)
8da1b058
RS
663
664#include "real.h"
665
666struct tree_real_cst
667{
668 char common[sizeof (struct tree_common)];
669 struct rtx_def *rtl; /* acts as link to register transfer language
670 (rtl) info */
671 REAL_VALUE_TYPE real_cst;
672};
673
674/* In a STRING_CST */
12b195d9
ML
675#define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
676#define TREE_STRING_POINTER(NODE) (STRING_CST_CHECK (NODE)->string.pointer)
8da1b058
RS
677
678struct tree_string
679{
680 char common[sizeof (struct tree_common)];
681 struct rtx_def *rtl; /* acts as link to register transfer language
682 (rtl) info */
683 int length;
684 char *pointer;
685};
686
687/* In a COMPLEX_CST node. */
12b195d9
ML
688#define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
689#define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
8da1b058
RS
690
691struct tree_complex
692{
693 char common[sizeof (struct tree_common)];
694 struct rtx_def *rtl; /* acts as link to register transfer language
695 (rtl) info */
696 union tree_node *real;
697 union tree_node *imag;
698};
699\f
700/* Define fields and accessors for some special-purpose tree nodes. */
701
12b195d9
ML
702#define IDENTIFIER_LENGTH(NODE) (IDENTIFIER_NODE_CHECK (NODE)->identifier.length)
703#define IDENTIFIER_POINTER(NODE) (IDENTIFIER_NODE_CHECK (NODE)->identifier.pointer)
8da1b058
RS
704
705struct tree_identifier
706{
707 char common[sizeof (struct tree_common)];
708 int length;
709 char *pointer;
710};
711
712/* In a TREE_LIST node. */
12b195d9
ML
713#define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
714#define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
8da1b058
RS
715
716struct tree_list
717{
718 char common[sizeof (struct tree_common)];
719 union tree_node *purpose;
720 union tree_node *value;
721};
722
723/* In a TREE_VEC node. */
12b195d9
ML
724#define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
725#define TREE_VEC_ELT(NODE,I) (TREE_VEC_CHECK (NODE)->vec.a[I])
52267fcb 726#define TREE_VEC_END(NODE) ((void) TREE_VEC_CHECK (NODE),&((NODE)->vec.a[(NODE)->vec.length]))
8da1b058
RS
727
728struct tree_vec
729{
730 char common[sizeof (struct tree_common)];
731 int length;
732 union tree_node *a[1];
733};
734
735/* Define fields and accessors for some nodes that represent expressions. */
736
737/* In a SAVE_EXPR node. */
738#define SAVE_EXPR_CONTEXT(NODE) TREE_OPERAND(NODE, 1)
12b195d9 739#define SAVE_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[2])
e9a25f70 740#define SAVE_EXPR_NOPLACEHOLDER(NODE) TREE_UNSIGNED (NODE)
d26f8097
MM
741/* Nonzero if the SAVE_EXPRs value should be kept, even if it occurs
742 both in normal code and in a handler. (Normally, in a handler, all
743 SAVE_EXPRs are unsaved, meaning that there values are
744 recalculated.) */
745#define SAVE_EXPR_PERSISTENT_P(NODE) TREE_ASM_WRITTEN (NODE)
8da1b058
RS
746
747/* In a RTL_EXPR node. */
12b195d9
ML
748#define RTL_EXPR_SEQUENCE(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[0])
749#define RTL_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[1])
8da1b058
RS
750
751/* In a CALL_EXPR node. */
12b195d9 752#define CALL_EXPR_RTL(NODE) (*(struct rtx_def **) &EXPR_CHECK (NODE)->exp.operands[2])
8da1b058
RS
753
754/* In a CONSTRUCTOR node. */
755#define CONSTRUCTOR_ELTS(NODE) TREE_OPERAND (NODE, 1)
756
61131fa2 757/* In ordinary expression nodes. */
12b195d9
ML
758#define TREE_OPERAND(NODE, I) (EXPR_CHECK (NODE)->exp.operands[I])
759#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
61131fa2 760
40edd0bd
APB
761/* In a LABELED_BLOCK_EXPR node. */
762#define LABELED_BLOCK_LABEL(NODE) TREE_OPERAND (NODE, 0)
763#define LABELED_BLOCK_BODY(NODE) TREE_OPERAND (NODE, 1)
764
765/* In a EXIT_BLOCK_EXPR node. */
766#define EXIT_BLOCK_LABELED_BLOCK(NODE) TREE_OPERAND (NODE, 0)
767#define EXIT_BLOCK_RETURN(NODE) TREE_OPERAND (NODE, 1)
768
769/* In a LOOP_EXPR node. */
770#define LOOP_EXPR_BODY(NODE) TREE_OPERAND (NODE, 0)
771
dadafe54 772/* In a EXPR_WITH_FILE_LOCATION node. */
bf1e5319 773#define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0)
86fff623
MM
774#define EXPR_WFL_FILENAME(NODE) \
775 (IDENTIFIER_POINTER (EXPR_WFL_FILENAME_NODE ((NODE))))
776#define EXPR_WFL_FILENAME_NODE(NODE) TREE_OPERAND((NODE), 1)
12b195d9
ML
777#define EXPR_WFL_LINENO(NODE) (EXPR_CHECK (NODE)->exp.complexity >> 12)
778#define EXPR_WFL_COLNO(NODE) (EXPR_CHECK (NODE)->exp.complexity & 0xfff)
779#define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity)
bf1e5319
APB
780#define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \
781 (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff))
dadafe54 782#define EXPR_WFL_EMIT_LINE_NOTE(NODE) ((NODE)->common.public_flag)
bf1e5319 783
61131fa2
RS
784struct tree_exp
785{
786 char common[sizeof (struct tree_common)];
787 int complexity;
788 union tree_node *operands[1];
789};
790\f
8da1b058 791/* In a BLOCK node. */
12b195d9 792#define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
12b195d9
ML
793#define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
794#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
8da1b058
RS
795/* Note: when changing this, make sure to find the places
796 that use chainon or nreverse. */
797#define BLOCK_CHAIN(NODE) TREE_CHAIN (NODE)
12b195d9
ML
798#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
799#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
8da1b058
RS
800
801/* Nonzero means that this block is prepared to handle exceptions
802 listed in the BLOCK_VARS slot. */
12b195d9 803#define BLOCK_HANDLER_BLOCK(NODE) (BLOCK_CHECK (NODE)->block.handler_block_flag)
8da1b058 804
18c038b9
MM
805/* An index number for this block. These values are not guaranteed to
806 be unique across functions -- whether or not they are depends on
807 the debugging output format in use. */
808#define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
809
61131fa2 810struct tree_block
8da1b058
RS
811{
812 char common[sizeof (struct tree_common)];
61131fa2
RS
813
814 unsigned handler_block_flag : 1;
815 unsigned abstract_flag : 1;
18c038b9 816 unsigned block_num : 30;
61131fa2
RS
817
818 union tree_node *vars;
61131fa2
RS
819 union tree_node *subblocks;
820 union tree_node *supercontext;
821 union tree_node *abstract_origin;
8da1b058
RS
822};
823\f
824/* Define fields and accessors for nodes representing data types. */
825
826/* See tree.def for documentation of the use of these fields.
827 Look at the documentation of the various ..._TYPE tree codes. */
828
12b195d9
ML
829#define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
830#define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
831#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
832#define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
833#define TYPE_VALUES(NODE) (TYPE_CHECK (NODE)->type.values)
834#define TYPE_DOMAIN(NODE) (TYPE_CHECK (NODE)->type.values)
835#define TYPE_FIELDS(NODE) (TYPE_CHECK (NODE)->type.values)
836#define TYPE_METHODS(NODE) (TYPE_CHECK (NODE)->type.maxval)
837#define TYPE_VFIELD(NODE) (TYPE_CHECK (NODE)->type.minval)
838#define TYPE_ARG_TYPES(NODE) (TYPE_CHECK (NODE)->type.values)
839#define TYPE_METHOD_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
840#define TYPE_OFFSET_BASETYPE(NODE) (TYPE_CHECK (NODE)->type.maxval)
841#define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
842#define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
843#define TYPE_MIN_VALUE(NODE) (TYPE_CHECK (NODE)->type.minval)
844#define TYPE_MAX_VALUE(NODE) (TYPE_CHECK (NODE)->type.maxval)
845#define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
846#define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
847#define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer)
848#define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
849#define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
850#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
12b195d9
ML
851#define TYPE_NONCOPIED_PARTS(NODE) (TYPE_CHECK (NODE)->type.noncopied_parts)
852#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
853#define TYPE_OBSTACK(NODE) (TYPE_CHECK (NODE)->type.obstack)
854#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
8da1b058 855
8ff0c1af
MM
856/* For aggregate types, information about this type, as a base type
857 for itself. Used in a language-dependent way for types that are
858 neither a RECORD_TYPE, QUAL_UNION_TYPE, nor a UNION_TYPE. */
859#define TYPE_BINFO(NODE) (TYPE_CHECK (NODE)->type.binfo)
860
41472af8
MM
861/* The (language-specific) typed-based alias set for this type.
862 Objects whose TYPE_ALIAS_SETs are different cannot alias each
863 other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
864 assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
865 type can alias objects of any type. */
866#define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set)
867
868/* Nonzero iff the typed-based alias set for this type has been
869 calculated. */
870#define TYPE_ALIAS_SET_KNOWN_P(NODE) \
871 (TYPE_CHECK (NODE)->type.alias_set != -1)
872
bad1b4ba
RK
873/* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
874 to this type. */
12b195d9 875#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes)
bad1b4ba 876
869637e6
RS
877/* The alignment necessary for objects of this type.
878 The value is an int, measured in bits. */
12b195d9 879#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align)
869637e6 880
834c6dff
MM
881/* The alignment for NODE, in bytes. */
882#define TYPE_ALIGN_UNIT(NODE) \
883 (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
884
8da1b058
RS
885#define TYPE_STUB_DECL(NODE) (TREE_CHAIN (NODE))
886
3635a54b
RK
887/* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
888 has BLKmode only because it lacks the alignment requirement for
889 its size. */
12b195d9 890#define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
8da1b058 891
fed3cef0
RK
892/* In an INTEGER_TYPE, it means the type represents a size. We use this
893 both for validity checking and to permit optimziations that are unsafe
894 for other types. */
895#define TYPE_IS_SIZETYPE(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
896
8da1b058
RS
897/* Nonzero in a type considered volatile as a whole. */
898#define TYPE_VOLATILE(NODE) ((NODE)->common.volatile_flag)
899
900/* Means this type is const-qualified. */
901#define TYPE_READONLY(NODE) ((NODE)->common.readonly_flag)
902
3932261a
MM
903/* If nonzero, this type is `restrict'-qualified, in the C sense of
904 the term. */
905#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
906
907/* There is a TYPE_QUAL value for each type qualifier. They can be
908 combined by bitwise-or to form the complete set of qualifiers for a
909 type. */
910
911#define TYPE_UNQUALIFIED 0x0
912#define TYPE_QUAL_CONST 0x1
913#define TYPE_QUAL_VOLATILE 0x2
914#define TYPE_QUAL_RESTRICT 0x4
915
916/* The set of type qualifiers for this type. */
917#define TYPE_QUALS(NODE) \
14a774a9
RK
918 ((TYPE_READONLY(NODE) * TYPE_QUAL_CONST) \
919 | (TYPE_VOLATILE(NODE) * TYPE_QUAL_VOLATILE) \
920 | (TYPE_RESTRICT(NODE) * TYPE_QUAL_RESTRICT))
3932261a 921
9f86614b 922/* These flags are available for each language front end to use internally. */
12b195d9
ML
923#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0)
924#define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1)
925#define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2)
926#define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3)
927#define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4)
928#define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5)
929#define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6)
8da1b058 930
74a3fd26
PB
931/* If set in an ARRAY_TYPE, indicates a string type (for languages
932 that distinguish string from array of char).
933 If set in a SET_TYPE, indicates a bitstring type. */
12b195d9 934#define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag)
74a3fd26 935
2fb2b21c
PB
936/* If non-NULL, this is a upper bound of the size (in bytes) of an
937 object of the given ARRAY_TYPE. This allows temporaries to be allocated. */
938#define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) TYPE_MAX_VALUE (ARRAY_TYPE)
939
4ac3d994
JM
940/* Indicates that objects of this type must be initialized by calling a
941 function when they are created. */
12b195d9 942#define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_CHECK (NODE)->type.needs_constructing_flag)
4ac3d994 943
adb23061
RK
944/* Indicates that objects of this type (a UNION_TYPE), should be passed
945 the same way that the first union alternative would be passed. */
12b195d9 946#define TYPE_TRANSPARENT_UNION(NODE) (TYPE_CHECK (NODE)->type.transparent_union_flag)
adb23061 947
956d6950 948/* Indicated that objects of this type should be laid out in as
9e357cd8 949 compact a way as possible. */
12b195d9 950#define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
9e357cd8 951
8da1b058
RS
952struct tree_type
953{
954 char common[sizeof (struct tree_common)];
955 union tree_node *values;
956 union tree_node *size;
ead17059 957 union tree_node *size_unit;
bad1b4ba 958 union tree_node *attributes;
8da1b058
RS
959 unsigned uid;
960
bad1b4ba 961 unsigned char precision;
8da1b058 962#ifdef ONLY_INT_FIELDS
9df2c88c 963 unsigned int mode : 8;
8da1b058
RS
964#else
965 enum machine_mode mode : 8;
966#endif
bad1b4ba 967
74a3fd26 968 unsigned string_flag : 1;
8da1b058 969 unsigned no_force_blk_flag : 1;
4ac3d994 970 unsigned needs_constructing_flag : 1;
adb23061 971 unsigned transparent_union_flag : 1;
9e357cd8 972 unsigned packed_flag : 1;
3932261a
MM
973 unsigned restrict_flag : 1;
974
8da1b058
RS
975 unsigned lang_flag_0 : 1;
976 unsigned lang_flag_1 : 1;
977 unsigned lang_flag_2 : 1;
978 unsigned lang_flag_3 : 1;
979 unsigned lang_flag_4 : 1;
980 unsigned lang_flag_5 : 1;
981 unsigned lang_flag_6 : 1;
3932261a 982 /* room for 3 more bits */
8da1b058 983
69b78d8d 984 unsigned int align;
8da1b058
RS
985 union tree_node *pointer_to;
986 union tree_node *reference_to;
a0665b77 987 union {int address; char *pointer; } symtab;
8da1b058
RS
988 union tree_node *name;
989 union tree_node *minval;
990 union tree_node *maxval;
991 union tree_node *next_variant;
992 union tree_node *main_variant;
993 union tree_node *binfo;
994 union tree_node *noncopied_parts;
995 union tree_node *context;
b20e883e 996 struct obstack *obstack;
41472af8 997 int alias_set;
8da1b058
RS
998 /* Points to a structure whose details depend on the language in use. */
999 struct lang_type *lang_specific;
1000};
1001\f
1002/* Define accessor macros for information about type inheritance
1003 and basetypes.
1004
1005 A "basetype" means a particular usage of a data type for inheritance
1006 in another type. Each such basetype usage has its own "binfo"
1007 object to describe it. The binfo object is a TREE_VEC node.
1008
1009 Inheritance is represented by the binfo nodes allocated for a
1010 given type. For example, given types C and D, such that D is
1011 inherited by C, 3 binfo nodes will be allocated: one for describing
1012 the binfo properties of C, similarly one for D, and one for
1013 describing the binfo properties of D as a base type for C.
1014 Thus, given a pointer to class C, one can get a pointer to the binfo
1015 of D acting as a basetype for C by looking at C's binfo's basetypes. */
1016
1017/* The actual data type node being inherited in this basetype. */
1018#define BINFO_TYPE(NODE) TREE_TYPE (NODE)
1019
1020/* The offset where this basetype appears in its containing type.
1021 BINFO_OFFSET slot holds the offset (in bytes)
1022 from the base of the complete object to the base of the part of the
1023 object that is allocated on behalf of this `type'.
1024 This is always 0 except when there is multiple inheritance. */
1025
1026#define BINFO_OFFSET(NODE) TREE_VEC_ELT ((NODE), 1)
1027#define TYPE_BINFO_OFFSET(NODE) BINFO_OFFSET (TYPE_BINFO (NODE))
7d02bbef 1028#define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
8da1b058
RS
1029
1030/* The virtual function table belonging to this basetype. Virtual
1031 function tables provide a mechanism for run-time method dispatching.
1032 The entries of a virtual function table are language-dependent. */
1033
1034#define BINFO_VTABLE(NODE) TREE_VEC_ELT ((NODE), 2)
1035#define TYPE_BINFO_VTABLE(NODE) BINFO_VTABLE (TYPE_BINFO (NODE))
1036
1037/* The virtual functions in the virtual function table. This is
1038 a TREE_LIST that is used as an initial approximation for building
1039 a virtual function table for this basetype. */
1040#define BINFO_VIRTUALS(NODE) TREE_VEC_ELT ((NODE), 3)
1041#define TYPE_BINFO_VIRTUALS(NODE) BINFO_VIRTUALS (TYPE_BINFO (NODE))
1042
0430641b
MM
1043/* A vector of binfos for the direct basetypes inherited by this
1044 basetype.
8da1b058 1045
0430641b
MM
1046 If this basetype describes type D as inherited in C, and if the
1047 basetypes of D are E and F, then this vector contains binfos for
1048 inheritance of E and F by C.
8da1b058
RS
1049
1050 ??? This could probably be done by just allocating the
1051 base types at the end of this TREE_VEC (instead of using
1052 another TREE_VEC). This would simplify the calculation
1053 of how many basetypes a given type had. */
1054#define BINFO_BASETYPES(NODE) TREE_VEC_ELT ((NODE), 4)
1055#define TYPE_BINFO_BASETYPES(NODE) TREE_VEC_ELT (TYPE_BINFO (NODE), 4)
1056
5e1677bc
MM
1057/* The number of basetypes for NODE. */
1058#define BINFO_N_BASETYPES(NODE) \
1059 (BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (BINFO_BASETYPES (NODE)) : 0)
1060
7d02bbef
JM
1061/* Accessor macro to get to the Nth basetype of this basetype. */
1062#define BINFO_BASETYPE(NODE,N) TREE_VEC_ELT (BINFO_BASETYPES (NODE), (N))
1063#define TYPE_BINFO_BASETYPE(NODE,N) BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (NODE)), (N)))
1064
39ac3e4f
MM
1065/* For a BINFO record describing a virtual base class, i.e., one where
1066 TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
1067 base. The actual contents are language-dependent. Under the old
1068 ABI, the C++ front-end uses a FIELD_DECL whose contents are a
1069 pointer to the virtual base; under the new ABI this field is
1070 instead a INTEGER_CST giving an offset into the vtable where the
1071 offset to the virtual base can be found. */
2cc3ac7a
MS
1072#define BINFO_VPTR_FIELD(NODE) TREE_VEC_ELT ((NODE), 5)
1073
bbc0e641 1074/* The size of a base class subobject of this type. Not all frontends
06ceef4e 1075 currently allocate the space for these fields. */
7d02bbef 1076#define BINFO_SIZE(NODE) TREE_VEC_ELT ((NODE), 6)
06ceef4e 1077#define BINFO_SIZE_UNIT(NODE) TREE_VEC_ELT ((NODE), 7)
7d02bbef 1078#define TYPE_BINFO_SIZE(NODE) BINFO_SIZE (TYPE_BINFO (NODE))
06ceef4e 1079#define TYPE_BINFO_SIZE_UNIT(NODE) BINFO_SIZE_UNIT (TYPE_BINFO (NODE))
8da1b058
RS
1080
1081/* Slot used to build a chain that represents a use of inheritance.
1082 For example, if X is derived from Y, and Y is derived from Z,
1083 then this field can be used to link the binfo node for X to
1084 the binfo node for X's Y to represent the use of inheritance
1085 from X to Y. Similarly, this slot of the binfo node for X's Y
1086 can point to the Z from which Y is inherited (in X's inheritance
1087 hierarchy). In this fashion, one can represent and traverse specific
1088 uses of inheritance using the binfo nodes themselves (instead of
1089 consing new space pointing to binfo nodes).
1090 It is up to the language-dependent front-ends to maintain
1091 this information as necessary. */
1092#define BINFO_INHERITANCE_CHAIN(NODE) TREE_VEC_ELT ((NODE), 0)
1093\f
1094/* Define fields and accessors for nodes representing declared names. */
1095
7766fe8e
JM
1096/* Nonzero if DECL represents a decl. */
1097#define DECL_P(DECL) (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd')
8da1b058
RS
1098/* This is the name of the object as written by the user.
1099 It is an IDENTIFIER_NODE. */
12b195d9 1100#define DECL_NAME(NODE) (DECL_CHECK (NODE)->decl.name)
8da1b058
RS
1101/* This is the name of the object as the assembler will see it
1102 (but before any translations made by ASM_OUTPUT_LABELREF).
1103 Often this is the same as DECL_NAME.
1104 It is an IDENTIFIER_NODE. */
12b195d9 1105#define DECL_ASSEMBLER_NAME(NODE) (DECL_CHECK (NODE)->decl.assembler_name)
868e8789
DE
1106/* Records the section name in a section attribute. Used to pass
1107 the name from decl_attributes to make_function_rtl and make_decl_rtl. */
12b195d9 1108#define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name)
9b800101 1109/* For FIELD_DECLs, this is the
3635a54b
RK
1110 RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is
1111 a member of. For VAR_DECL, PARM_DECL, FUNCTION_DECL, LABEL_DECL,
a082c85a
JM
1112 and CONST_DECL nodes, this points to either the FUNCTION_DECL for the
1113 containing function, the RECORD_TYPE or UNION_TYPE for the containing
1114 type, or NULL_TREE if the given decl has "file scope". */
12b195d9
ML
1115#define DECL_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context)
1116#define DECL_FIELD_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context)
77cf75a8
RK
1117/* In a DECL this is the field where configuration dependent machine
1118 attributes are store */
12b195d9 1119#define DECL_MACHINE_ATTRIBUTES(NODE) (DECL_CHECK (NODE)->decl.machine_attributes)
8da1b058
RS
1120/* In a FIELD_DECL, this is the field position, counting in bits,
1121 of the bit closest to the beginning of the structure. */
12b195d9 1122#define DECL_FIELD_BITPOS(NODE) (DECL_CHECK (NODE)->decl.arguments)
8da1b058 1123/* In a FIELD_DECL, this indicates whether the field was a bit-field and
8e148bef
RS
1124 if so, the type that was originally specified for it.
1125 TREE_TYPE may have been modified (in finish_struct). */
12b195d9 1126#define DECL_BIT_FIELD_TYPE(NODE) (DECL_CHECK (NODE)->decl.result)
8da1b058
RS
1127/* In FUNCTION_DECL, a chain of ..._DECL nodes. */
1128/* VAR_DECL and PARM_DECL reserve the arguments slot
1129 for language-specific uses. */
12b195d9 1130#define DECL_ARGUMENTS(NODE) (DECL_CHECK (NODE)->decl.arguments)
8da1b058 1131/* In FUNCTION_DECL, holds the decl for the return value. */
12b195d9 1132#define DECL_RESULT(NODE) (DECL_CHECK (NODE)->decl.result)
9506a28d 1133/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
12b195d9 1134#define DECL_ORIGINAL_TYPE(NODE) (DECL_CHECK (NODE)->decl.result)
8da1b058 1135/* In PARM_DECL, holds the type as written (perhaps a function or array). */
12b195d9 1136#define DECL_ARG_TYPE_AS_WRITTEN(NODE) (DECL_CHECK (NODE)->decl.result)
8da1b058
RS
1137/* For a FUNCTION_DECL, holds the tree of BINDINGs.
1138 For a VAR_DECL, holds the initial value.
1139 For a PARM_DECL, not used--default
1140 values for parameters are encoded in the type of the function,
1141 not in the PARM_DECL slot. */
12b195d9 1142#define DECL_INITIAL(NODE) (DECL_CHECK (NODE)->decl.initial)
8da1b058
RS
1143/* For a PARM_DECL, records the data type used to pass the argument,
1144 which may be different from the type seen in the program. */
06ceef4e 1145#define DECL_ARG_TYPE(NODE) (DECL_CHECK (NODE)->decl.initial)
3635a54b
RK
1146/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
1147 if nonzero, indicates that the field occupies the type. */
12b195d9 1148#define DECL_QUALIFIER(NODE) (DECL_CHECK (NODE)->decl.initial)
8da1b058 1149/* These two fields describe where in the source code the declaration was. */
12b195d9
ML
1150#define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename)
1151#define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum)
06ceef4e 1152/* Holds the size of the datum, in bits, as a tree expression.
8da1b058 1153 Need not be constant. */
12b195d9 1154#define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size)
06ceef4e
RK
1155/* Likewise for the size in bytes. */
1156#define DECL_SIZE_UNIT(NODE) (DECL_CHECK (NODE)->decl.size_unit)
8da1b058 1157/* Holds the alignment required for the datum. */
9df2c88c 1158#define DECL_ALIGN(NODE) (DECL_CHECK (NODE)->decl.u1.u)
17c73321
RK
1159/* Holds the machine mode corresponding to the declaration of a variable or
1160 field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
1161 FIELD_DECL. */
12b195d9 1162#define DECL_MODE(NODE) (DECL_CHECK (NODE)->decl.mode)
17c73321
RK
1163/* Holds the RTL expression for the value of a variable or function. If
1164 PROMOTED_MODE is defined, the mode of this expression may not be same
1165 as DECL_MODE. In that case, DECL_MODE contains the mode corresponding
1166 to the variable's data type, while the mode
1167 of DECL_RTL is the mode actually used to contain the data. */
12b195d9 1168#define DECL_RTL(NODE) (DECL_CHECK (NODE)->decl.rtl)
0dfa1860
MM
1169/* Holds an INSN_LIST of all of the live ranges in which the variable
1170 has been moved to a possibly different register. */
12b195d9 1171#define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl)
8da1b058
RS
1172/* For PARM_DECL, holds an RTL for the stack slot or register
1173 where the data was actually passed. */
9df2c88c 1174#define DECL_INCOMING_RTL(NODE) (DECL_CHECK (NODE)->decl.u2.r)
8da1b058 1175/* For FUNCTION_DECL, if it is inline, holds the saved insn chain. */
9df2c88c 1176#define DECL_SAVED_INSNS(NODE) (DECL_CHECK (NODE)->decl.u2.f)
66321686
RS
1177/* For FUNCTION_DECL, if it is inline,
1178 holds the size of the stack frame, as an integer. */
9df2c88c 1179#define DECL_FRAME_SIZE(NODE) (DECL_CHECK (NODE)->decl.u1.i)
66321686
RS
1180/* For FUNCTION_DECL, if it is built-in,
1181 this identifies which built-in operation it is. */
9df2c88c 1182#define DECL_FUNCTION_CODE(NODE) (DECL_CHECK (NODE)->decl.u1.f)
8da1b058
RS
1183
1184/* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
1185 Before the struct containing the FUNCTION_DECL is laid out,
1186 DECL_VINDEX may point to a FUNCTION_DECL in a base class which
1187 is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
1188 function. When the class is laid out, this pointer is changed
1189 to an INTEGER_CST node which is suitable for use as an index
1190 into the virtual function table. */
12b195d9 1191#define DECL_VINDEX(NODE) (DECL_CHECK (NODE)->decl.vindex)
8da1b058
RS
1192/* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
1193 which this FIELD_DECL is defined. This information is needed when
1194 writing debugging information about vfield and vbase decls for C++. */
12b195d9 1195#define DECL_FCONTEXT(NODE) (DECL_CHECK (NODE)->decl.vindex)
8da1b058 1196
0e77444b 1197/* Every ..._DECL node gets a unique number. */
12b195d9 1198#define DECL_UID(NODE) (DECL_CHECK (NODE)->decl.uid)
0e77444b 1199
c5caa350
CH
1200/* For any sort of a ..._DECL node, this points to the original (abstract)
1201 decl node which this decl is an instance of, or else it is NULL indicating
4a7d05dc
DE
1202 that this decl is not an instance of some other decl. For example,
1203 in a nested declaration of an inline function, this points back to the
1204 definition. */
12b195d9 1205#define DECL_ABSTRACT_ORIGIN(NODE) (DECL_CHECK (NODE)->decl.abstract_origin)
c5caa350 1206
02e24c7a
MM
1207/* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
1208 origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */
1209#define DECL_ORIGIN(NODE) \
1210 (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : NODE)
1211
c5caa350
CH
1212/* Nonzero for any sort of ..._DECL node means this decl node represents
1213 an inline instance of some original (abstract) decl from an inline function;
3d62d651
ZW
1214 suppress any warnings about shadowing some other variable.
1215 FUNCTION_DECL nodes can also have their abstract origin set to themselves
1216 (see save_for_inline_copying). */
1217#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != (tree) 0 \
1218 && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
8da1b058
RS
1219
1220/* Nonzero if a _DECL means that the name of this decl should be ignored
1221 for symbolic debug purposes. */
12b195d9 1222#define DECL_IGNORED_P(NODE) (DECL_CHECK (NODE)->decl.ignored_flag)
8da1b058 1223
c5caa350
CH
1224/* Nonzero for a given ..._DECL node means that this node represents an
1225 "abstract instance" of the given declaration (e.g. in the original
1226 declaration of an inline function). When generating symbolic debugging
9faa82d8 1227 information, we mustn't try to generate any address information for nodes
c5caa350
CH
1228 marked as "abstract instances" because we don't actually generate
1229 any code or allocate any data space for such instances. */
12b195d9 1230#define DECL_ABSTRACT(NODE) (DECL_CHECK (NODE)->decl.abstract_flag)
c5caa350 1231
3110a56e
RS
1232/* Nonzero if a _DECL means that no warnings should be generated just
1233 because this decl is unused. */
12b195d9 1234#define DECL_IN_SYSTEM_HEADER(NODE) (DECL_CHECK (NODE)->decl.in_system_header_flag)
3110a56e 1235
2c0d84d6
MS
1236/* Nonzero for a given ..._DECL node means that this node should be
1237 put in .common, if possible. If a DECL_INITIAL is given, and it
1238 is not error_mark_node, then the decl cannot be put in .common. */
12b195d9 1239#define DECL_COMMON(NODE) (DECL_CHECK (NODE)->decl.common_flag)
2c0d84d6 1240
3110a56e 1241/* Language-specific decl information. */
12b195d9 1242#define DECL_LANG_SPECIFIC(NODE) (DECL_CHECK (NODE)->decl.lang_specific)
8da1b058
RS
1243
1244/* In a VAR_DECL or FUNCTION_DECL,
1245 nonzero means external reference:
1246 do not allocate storage, and refer to a definition elsewhere. */
12b195d9 1247#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag)
8da1b058 1248
2ce3c6c6
JM
1249/* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
1250 initializatons. */
1251#define DEFAULT_INIT_PRIORITY 65535
1252#define MAX_INIT_PRIORITY 65535
9a6e70c9 1253#define MAX_RESERVED_INIT_PRIORITY 100
2ce3c6c6 1254
60e9e4b7
DE
1255/* In a TYPE_DECL
1256 nonzero means the detail info about this type is not dumped into stabs.
5a783256 1257 Instead it will generate cross reference ('x') of names.
60e9e4b7 1258 This uses the same flag as DECL_EXTERNAL. */
12b195d9 1259#define TYPE_DECL_SUPPRESS_DEBUG(NODE) (DECL_CHECK (NODE)->decl.external_flag)
60e9e4b7
DE
1260
1261
a5f99f01 1262/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
12b195d9 1263#define DECL_REGISTER(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
a5f99f01
RK
1264/* In LABEL_DECL nodes, nonzero means that an error message about
1265 jumping into such a binding contour has been printed for this label. */
12b195d9 1266#define DECL_ERROR_ISSUED(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
5a1c7968 1267/* In a FIELD_DECL, indicates this field should be bit-packed. */
12b195d9 1268#define DECL_PACKED(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
a5f99f01
RK
1269/* In a FUNCTION_DECL with a non-zero DECL_CONTEXT, indicates that a
1270 static chain is not needed. */
12b195d9 1271#define DECL_NO_STATIC_CHAIN(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag)
8da1b058
RS
1272
1273/* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
1274 For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
1275
1276 For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
1277
1278 Also set in some languages for variables, etc., outside the normal
1279 lexical scope, such as class instance variables. */
12b195d9 1280#define DECL_NONLOCAL(NODE) (DECL_CHECK (NODE)->decl.nonlocal_flag)
8da1b058
RS
1281
1282/* Nonzero in a FUNCTION_DECL means this function can be substituted
1283 where it is called. */
12b195d9 1284#define DECL_INLINE(NODE) (DECL_CHECK (NODE)->decl.inline_flag)
8da1b058
RS
1285
1286/* Nonzero in a FUNCTION_DECL means this is a built-in function
1287 that is not specified by ansi C and that users are supposed to be allowed
1288 to redefine for any purpose whatever. */
1289#define DECL_BUILT_IN_NONANSI(NODE) ((NODE)->common.unsigned_flag)
1290
140592a0
AG
1291/* Nonzero in a FUNCTION_DECL means this function should be treated
1292 as if it were a malloc, meaning it returns a pointer that is
1293 not an alias. */
1294#define DECL_IS_MALLOC(NODE) (DECL_CHECK (NODE)->decl.malloc_flag)
1295
8da1b058
RS
1296/* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
1297 specially. */
12b195d9 1298#define DECL_BIT_FIELD(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
8da1b058
RS
1299/* In a LABEL_DECL, nonzero means label was defined inside a binding
1300 contour that restored a stack level and which is now exited. */
12b195d9 1301#define DECL_TOO_LATE(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
26db82d8 1302
12a22e76 1303/* Unused in FUNCTION_DECL. */
26db82d8 1304
b8af45d0
RS
1305/* In a VAR_DECL that's static,
1306 nonzero if the space is in the text section. */
12b195d9 1307#define DECL_IN_TEXT_SECTION(NODE) (DECL_CHECK (NODE)->decl.bit_field_flag)
8da1b058 1308
12a22e76
JM
1309/* In a FUNCTION_DECL, nonzero means a built in function. */
1310#define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
1311/* For a builtin function, identify which part of the compiler defined it. */
1312#define DECL_BUILT_IN_CLASS(NODE) (DECL_CHECK (NODE)->decl.built_in_class)
1313
5a1c7968 1314/* Used in VAR_DECLs to indicate that the variable is a vtable.
2458b9c0
JM
1315 Used in FIELD_DECLs for vtable pointers.
1316 Used in FUNCTION_DECLs to indicate that the function is virtual. */
12b195d9 1317#define DECL_VIRTUAL_P(NODE) (DECL_CHECK (NODE)->decl.virtual_flag)
8da1b058 1318
30801830
JM
1319/* Used to indicate that the linkage status of this DECL is not yet known,
1320 so it should not be output now. */
12b195d9 1321#define DECL_DEFER_OUTPUT(NODE) (DECL_CHECK (NODE)->decl.defer_output)
30801830 1322
adb23061
RK
1323/* Used in PARM_DECLs whose type are unions to indicate that the
1324 argument should be passed in the same way that the first union
1325 alternative would be passed. */
12b195d9 1326#define DECL_TRANSPARENT_UNION(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
adb23061 1327
2c5f4139
JM
1328/* Used in FUNCTION_DECLs to indicate that they should be run automatically
1329 at the beginning or end of execution. */
12b195d9
ML
1330#define DECL_STATIC_CONSTRUCTOR(NODE) (DECL_CHECK (NODE)->decl.static_ctor_flag)
1331#define DECL_STATIC_DESTRUCTOR(NODE) (DECL_CHECK (NODE)->decl.static_dtor_flag)
2c5f4139 1332
3edbc4b9 1333/* Used to indicate that this DECL represents a compiler-generated entity. */
12b195d9 1334#define DECL_ARTIFICIAL(NODE) (DECL_CHECK (NODE)->decl.artificial_flag)
3edbc4b9 1335
daefd78b 1336/* Used to indicate that this DECL has weak linkage. */
12b195d9 1337#define DECL_WEAK(NODE) (DECL_CHECK (NODE)->decl.weak_flag)
daefd78b 1338
c5bd82cb
JM
1339/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
1340 multiple translation units should be merged. */
12b195d9 1341#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
c5bd82cb 1342
59182242
MM
1343/* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
1344 not be put out unless it is needed in this translation unit.
1345 Entities like this are shared across translation units (like weak
1346 entities), but are guaranteed to be generated by any translation
1347 unit that needs them, and therefore need not be put out anywhere
1348 where they are not needed. DECL_COMDAT is just a hint to the
1349 back-end; it is up to front-ends which set this flag to ensure
1350 that there will never be any harm, other than bloat, in putting out
1351 something which is DECL_COMDAT. */
1352#define DECL_COMDAT(NODE) (DECL_CHECK (NODE)->decl.comdat_flag)
1353
07417085
KR
1354/* Used in FUNCTION_DECLs to indicate that function entry and exit should
1355 be instrumented with calls to support routines. */
1356#define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) ((NODE)->decl.no_instrument_function_entry_exit)
1357
c5c76735
JL
1358/* Used in FUNCTION_DECLs to indicate that check-memory-usage should be
1359 disabled in this function. */
7d384cc0
KR
1360#define DECL_NO_CHECK_MEMORY_USAGE(NODE) ((NODE)->decl.no_check_memory_usage)
1361
a157febd
GK
1362/* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
1363 disabled in this function. */
1364#define DECL_NO_LIMIT_STACK(NODE) ((NODE)->decl.no_limit_stack)
1365
8da1b058 1366/* Additional flags for language-specific uses. */
12b195d9
ML
1367#define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0)
1368#define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1)
1369#define DECL_LANG_FLAG_2(NODE) (DECL_CHECK (NODE)->decl.lang_flag_2)
1370#define DECL_LANG_FLAG_3(NODE) (DECL_CHECK (NODE)->decl.lang_flag_3)
1371#define DECL_LANG_FLAG_4(NODE) (DECL_CHECK (NODE)->decl.lang_flag_4)
1372#define DECL_LANG_FLAG_5(NODE) (DECL_CHECK (NODE)->decl.lang_flag_5)
1373#define DECL_LANG_FLAG_6(NODE) (DECL_CHECK (NODE)->decl.lang_flag_6)
1374#define DECL_LANG_FLAG_7(NODE) (DECL_CHECK (NODE)->decl.lang_flag_7)
8da1b058 1375
27da1b4d
MK
1376/* Used to indicate that the pointer to this DECL cannot be treated as
1377 an address constant. */
1378#define DECL_NON_ADDR_CONST_P(NODE) (DECL_CHECK (NODE)->decl.non_addr_const_p)
1379
3932261a
MM
1380/* Used to indicate an alias set for the memory pointed to by this
1381 particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have
1382 pointer (or reference) type. */
1383#define DECL_POINTER_ALIAS_SET(NODE) \
1384 (DECL_CHECK (NODE)->decl.pointer_alias_set)
1385
1386/* Nonzero if an alias set has been assigned to this declaration. */
1387#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
1388 (DECL_POINTER_ALIAS_SET (NODE) != - 1)
1389
8da1b058
RS
1390struct tree_decl
1391{
1392 char common[sizeof (struct tree_common)];
1393 char *filename;
1394 int linenum;
0e77444b 1395 unsigned int uid;
09f532c9 1396 union tree_node *size;
8da1b058
RS
1397#ifdef ONLY_INT_FIELDS
1398 int mode : 8;
1399#else
1400 enum machine_mode mode : 8;
1401#endif
8da1b058
RS
1402
1403 unsigned external_flag : 1;
1404 unsigned nonlocal_flag : 1;
1405 unsigned regdecl_flag : 1;
1406 unsigned inline_flag : 1;
1407 unsigned bit_field_flag : 1;
1408 unsigned virtual_flag : 1;
8da1b058 1409 unsigned ignored_flag : 1;
c5caa350 1410 unsigned abstract_flag : 1;
8da1b058 1411
3110a56e 1412 unsigned in_system_header_flag : 1;
2c0d84d6 1413 unsigned common_flag : 1;
30801830 1414 unsigned defer_output : 1;
adb23061 1415 unsigned transparent_union : 1;
2c5f4139
JM
1416 unsigned static_ctor_flag : 1;
1417 unsigned static_dtor_flag : 1;
3edbc4b9 1418 unsigned artificial_flag : 1;
daefd78b 1419 unsigned weak_flag : 1;
3110a56e 1420
9df2c88c
RK
1421 unsigned non_addr_const_p : 1;
1422 unsigned no_instrument_function_entry_exit : 1;
1423 unsigned no_check_memory_usage : 1;
1424 unsigned comdat_flag : 1;
1425 unsigned malloc_flag : 1;
1426 unsigned no_limit_stack : 1;
1427#ifdef ONLY_INT_FIELDS
1428 unsigned int built_in_class : 2;
1429#else
1430 enum built_in_class built_in_class : 2;
1431#endif
1432
8da1b058
RS
1433 unsigned lang_flag_0 : 1;
1434 unsigned lang_flag_1 : 1;
1435 unsigned lang_flag_2 : 1;
1436 unsigned lang_flag_3 : 1;
1437 unsigned lang_flag_4 : 1;
1438 unsigned lang_flag_5 : 1;
1439 unsigned lang_flag_6 : 1;
1440 unsigned lang_flag_7 : 1;
1441
09f532c9
RK
1442 /* For a FUNCTION_DECL, if inline, this is the size of frame needed.
1443 If built-in, this is the code for which built-in function.
1444 For other kinds of decls, this is DECL_ALIGN. */
1445 union {
9df2c88c 1446 HOST_WIDE_INT i;
09f532c9 1447 unsigned int u;
9df2c88c
RK
1448 enum built_in_function f;
1449 } u1;
09f532c9 1450
06ceef4e 1451 union tree_node *size_unit;
8da1b058
RS
1452 union tree_node *name;
1453 union tree_node *context;
06ceef4e
RK
1454 union tree_node *arguments; /* Also used for DECL_FIELD_BITPOS */
1455 union tree_node *result; /* Also used for DECL_BIT_FIELD_TYPE */
1456 union tree_node *initial; /* Also used for DECL_QUALIFIER */
c5caa350 1457 union tree_node *abstract_origin;
8da1b058 1458 union tree_node *assembler_name;
868e8789 1459 union tree_node *section_name;
77cf75a8 1460 union tree_node *machine_attributes;
9df2c88c 1461 struct rtx_def *rtl; /* RTL representation for object. */
0dfa1860 1462 struct rtx_def *live_range_rtl;
06ceef4e 1463
9df2c88c
RK
1464 /* In FUNCTION_DECL, if it is inline, holds the saved insn chain.
1465 In PARM_DECL, holds an RTL for the stack slot
1466 of register where the data was actually passed.
1467 Used by Chill and Java in LABEL_DECL and by C++ and Java in VAR_DECL. */
77f934bb 1468 union {
49ad7cfa 1469 struct function *f;
77f934bb 1470 struct rtx_def *r;
9df2c88c
RK
1471 union tree_node *t;
1472 int i;
1473 } u2;
1474
8da1b058 1475 union tree_node *vindex;
3932261a 1476 int pointer_alias_set;
8da1b058
RS
1477 /* Points to a structure whose details depend on the language in use. */
1478 struct lang_decl *lang_specific;
1479};
1480\f
1481/* Define the overall contents of a tree node.
1482 It may be any of the structures declared above
1483 for various types of node. */
1484
1485union tree_node
1486{
1487 struct tree_common common;
1488 struct tree_int_cst int_cst;
1489 struct tree_real_cst real_cst;
1490 struct tree_string string;
1491 struct tree_complex complex;
1492 struct tree_identifier identifier;
1493 struct tree_decl decl;
1494 struct tree_type type;
1495 struct tree_list list;
1496 struct tree_vec vec;
1497 struct tree_exp exp;
61131fa2 1498 struct tree_block block;
8da1b058 1499 };
1d2a8985 1500\f
81b3411c
BS
1501/* Standard named or nameless data types of the C compiler. */
1502
1503enum tree_index
1504{
1505 TI_ERROR_MARK,
1506 TI_INTQI_TYPE,
1507 TI_INTHI_TYPE,
1508 TI_INTSI_TYPE,
1509 TI_INTDI_TYPE,
1510 TI_INTTI_TYPE,
1511
1512 TI_UINTQI_TYPE,
1513 TI_UINTHI_TYPE,
1514 TI_UINTSI_TYPE,
1515 TI_UINTDI_TYPE,
1516 TI_UINTTI_TYPE,
1517
1518 TI_CHAR_TYPE,
1519 TI_SIGNED_CHAR_TYPE,
1520 TI_UNSIGNED_CHAR_TYPE,
1521 TI_INTEGER_TYPE,
1522 TI_UNSIGNED_TYPE,
1523 TI_SHORT_INTEGER_TYPE,
1524 TI_SHORT_UNSIGNED_TYPE,
1525 TI_LONG_INTEGER_TYPE,
1526 TI_LONG_UNSIGNED_TYPE,
1527 TI_LONG_LONG_INTEGER_TYPE,
1528 TI_LONG_LONG_UNSIGNED_TYPE,
1529
1530 TI_INTEGER_ZERO,
1531 TI_INTEGER_ONE,
1532 TI_NULL_POINTER,
1533
1534 TI_SIZE_ZERO,
1535 TI_SIZE_ONE,
1536
1537 TI_COMPLEX_INTEGER_TYPE,
1538 TI_COMPLEX_FLOAT_TYPE,
1539 TI_COMPLEX_DOUBLE_TYPE,
1540 TI_COMPLEX_LONG_DOUBLE_TYPE,
1541
1542 TI_FLOAT_TYPE,
1543 TI_DOUBLE_TYPE,
1544 TI_LONG_DOUBLE_TYPE,
1545
1546 TI_VOID_TYPE,
1547 TI_PTR_TYPE,
1548 TI_CONST_PTR_TYPE,
1549 TI_PTRDIFF_TYPE,
1550 TI_VA_LIST_TYPE,
1551
1552 TI_MAX
1553};
1554
1555extern tree global_trees[TI_MAX];
1556
1557#define error_mark_node global_trees[TI_ERROR_MARK]
1558
1559#define intQI_type_node global_trees[TI_INTQI_TYPE]
1560#define intHI_type_node global_trees[TI_INTHI_TYPE]
1561#define intSI_type_node global_trees[TI_INTSI_TYPE]
1562#define intDI_type_node global_trees[TI_INTDI_TYPE]
1563#define intTI_type_node global_trees[TI_INTTI_TYPE]
1564
1565#define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE]
1566#define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE]
1567#define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE]
1568#define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
1569#define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
1570
1571#define char_type_node global_trees[TI_CHAR_TYPE]
1572#define signed_char_type_node global_trees[TI_SIGNED_CHAR_TYPE]
1573#define unsigned_char_type_node global_trees[TI_UNSIGNED_CHAR_TYPE]
1574#define short_integer_type_node global_trees[TI_SHORT_INTEGER_TYPE]
1575#define short_unsigned_type_node global_trees[TI_SHORT_UNSIGNED_TYPE]
1576#define integer_type_node global_trees[TI_INTEGER_TYPE]
1577#define unsigned_type_node global_trees[TI_UNSIGNED_TYPE]
1578#define long_integer_type_node global_trees[TI_LONG_INTEGER_TYPE]
1579#define long_unsigned_type_node global_trees[TI_LONG_UNSIGNED_TYPE]
1580#define long_long_integer_type_node global_trees[TI_LONG_LONG_INTEGER_TYPE]
1581#define long_long_unsigned_type_node global_trees[TI_LONG_LONG_UNSIGNED_TYPE]
1582
1583#define integer_zero_node global_trees[TI_INTEGER_ZERO]
1584#define integer_one_node global_trees[TI_INTEGER_ONE]
1585#define size_zero_node global_trees[TI_SIZE_ZERO]
1586#define size_one_node global_trees[TI_SIZE_ONE]
1587#define null_pointer_node global_trees[TI_NULL_POINTER]
1588
1589#define float_type_node global_trees[TI_FLOAT_TYPE]
1590#define double_type_node global_trees[TI_DOUBLE_TYPE]
1591#define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
1592
1593#define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
1594#define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
1595#define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
1596#define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
1597
1598#define void_type_node global_trees[TI_VOID_TYPE]
fc693822 1599/* The C type `void *'. */
81b3411c 1600#define ptr_type_node global_trees[TI_PTR_TYPE]
fc693822 1601/* The C type `const void *'. */
81b3411c
BS
1602#define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
1603#define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
1604#define va_list_type_node global_trees[TI_VA_LIST_TYPE]
1605\f
f837a861
MM
1606#define NULL_TREE (tree) NULL
1607
e5d70561
RK
1608/* The following functions accept a wide integer argument. Rather than
1609 having to cast on every function call, we use a macro instead, that is
1610 defined here and in rtl.h. */
1611
1612#ifndef exact_log2
a1d061a1
JL
1613#define exact_log2(N) exact_log2_wide ((unsigned HOST_WIDE_INT) (N))
1614#define floor_log2(N) floor_log2_wide ((unsigned HOST_WIDE_INT) (N))
e5d70561 1615#endif
58782098
KG
1616extern int exact_log2_wide PARAMS ((unsigned HOST_WIDE_INT));
1617extern int floor_log2_wide PARAMS ((unsigned HOST_WIDE_INT));
e5d70561 1618
58782098
KG
1619extern char *oballoc PARAMS ((int));
1620extern char *permalloc PARAMS ((int));
1621extern char *savealloc PARAMS ((int));
1622extern char *expralloc PARAMS ((int));
8da1b058
RS
1623
1624/* Lowest level primitive for allocating a node.
1625 The TREE_CODE is the only argument. Contents are initialized
1626 to zero except for a few of the common fields. */
1627
58782098
KG
1628extern tree make_node PARAMS ((enum tree_code));
1629extern tree make_lang_type PARAMS ((enum tree_code));
1630extern tree (*make_lang_type_fn) PARAMS ((enum tree_code));
8da1b058
RS
1631
1632/* Make a copy of a node, with all the same contents except
1633 for TREE_PERMANENT. (The copy is permanent
1634 iff nodes being made now are permanent.) */
1635
58782098 1636extern tree copy_node PARAMS ((tree));
8da1b058
RS
1637
1638/* Make a copy of a chain of TREE_LIST nodes. */
1639
58782098 1640extern tree copy_list PARAMS ((tree));
8da1b058
RS
1641
1642/* Make a TREE_VEC. */
1643
58782098 1644extern tree make_tree_vec PARAMS ((int));
8da1b058
RS
1645
1646/* Return the (unique) IDENTIFIER_NODE node for a given name.
1647 The name is supplied as a char *. */
1648
58782098 1649extern tree get_identifier PARAMS ((const char *));
8da1b058 1650
6b9300aa
RK
1651/* If an identifier with the name TEXT (a null-terminated string) has
1652 previously been referred to, return that node; otherwise return
1653 NULL_TREE. */
1654
58782098 1655extern tree maybe_get_identifier PARAMS ((const char *));
6b9300aa 1656
8da1b058
RS
1657/* Construct various types of nodes. */
1658
e5d70561
RK
1659#define build_int_2(LO,HI) \
1660 build_int_2_wide ((HOST_WIDE_INT) (LO), (HOST_WIDE_INT) (HI))
1661
58782098
KG
1662extern tree build PARAMS ((enum tree_code, tree, ...));
1663extern tree build_nt PARAMS ((enum tree_code, ...));
1664extern tree build_parse_node PARAMS ((enum tree_code, ...));
1665
1666extern tree build_int_2_wide PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT));
1667extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE));
1668extern tree build_real_from_int_cst PARAMS ((tree, tree));
1669extern tree build_complex PARAMS ((tree, tree, tree));
1670extern tree build_string PARAMS ((int, const char *));
1671extern tree build1 PARAMS ((enum tree_code, tree, tree));
1672extern tree build_tree_list PARAMS ((tree, tree));
1673extern tree build_decl_list PARAMS ((tree, tree));
1674extern tree build_expr_list PARAMS ((tree, tree));
1675extern tree build_decl PARAMS ((enum tree_code, tree, tree));
1676extern tree build_block PARAMS ((tree, tree, tree, tree, tree));
1677extern tree build_expr_wfl PARAMS ((tree, const char *, int, int));
8da1b058
RS
1678
1679/* Construct various nodes representing data types. */
1680
58782098
KG
1681extern tree make_signed_type PARAMS ((int));
1682extern tree make_unsigned_type PARAMS ((int));
fed3cef0 1683extern void initialize_sizetypes PARAMS ((void));
58782098
KG
1684extern void set_sizetype PARAMS ((tree));
1685extern tree signed_or_unsigned_type PARAMS ((int, tree));
1686extern void fixup_unsigned_type PARAMS ((tree));
1687extern tree build_pointer_type PARAMS ((tree));
1688extern tree build_reference_type PARAMS ((tree));
1689extern tree build_index_type PARAMS ((tree));
1690extern tree build_index_2_type PARAMS ((tree, tree));
1691extern tree build_array_type PARAMS ((tree, tree));
1692extern tree build_function_type PARAMS ((tree, tree));
1693extern tree build_method_type PARAMS ((tree, tree));
1694extern tree build_offset_type PARAMS ((tree, tree));
1695extern tree build_complex_type PARAMS ((tree));
1696extern tree array_type_nelts PARAMS ((tree));
1697
1698extern tree value_member PARAMS ((tree, tree));
1699extern tree purpose_member PARAMS ((tree, tree));
1700extern tree binfo_member PARAMS ((tree, tree));
05bccae2 1701extern unsigned int attribute_hash_list PARAMS ((tree));
58782098
KG
1702extern int attribute_list_equal PARAMS ((tree, tree));
1703extern int attribute_list_contained PARAMS ((tree, tree));
1704extern int tree_int_cst_equal PARAMS ((tree, tree));
1705extern int tree_int_cst_lt PARAMS ((tree, tree));
665f2503
RK
1706extern int host_integerp PARAMS ((tree, int));
1707extern HOST_WIDE_INT tree_low_cst PARAMS ((tree, int));
a49a6a68 1708extern int tree_int_cst_msb PARAMS ((tree));
58782098
KG
1709extern int tree_int_cst_sgn PARAMS ((tree));
1710extern int index_type_equal PARAMS ((tree, tree));
1711extern tree get_inner_array_type PARAMS ((tree));
12cfc830 1712
f837a861
MM
1713/* From expmed.c. Since rtl.h is included after tree.h, we can't
1714 put the prototype here. Rtl.h does declare the prototype if
1715 tree.h had been included. */
1716
58782098 1717extern tree make_tree PARAMS ((tree, struct rtx_def *));
8da1b058 1718\f
bad1b4ba
RK
1719/* Return a type like TTYPE except that its TYPE_ATTRIBUTES
1720 is ATTRIBUTE.
1721
1722 Such modified types already made are recorded so that duplicates
1723 are not made. */
1724
58782098
KG
1725extern tree build_type_attribute_variant PARAMS ((tree, tree));
1726extern tree build_decl_attribute_variant PARAMS ((tree, tree));
bad1b4ba 1727
58782098
KG
1728extern tree merge_machine_decl_attributes PARAMS ((tree, tree));
1729extern tree merge_machine_type_attributes PARAMS ((tree, tree));
d9525bec
BK
1730
1731/* Split a list of declspecs and attributes into two. */
1732
58782098 1733extern void split_specs_attrs PARAMS ((tree, tree *, tree *));
d9525bec
BK
1734
1735/* Strip attributes from a list of combined specs and attrs. */
1736
58782098 1737extern tree strip_attrs PARAMS ((tree));
d9525bec 1738
9c130398
DE
1739/* Return 1 if an attribute and its arguments are valid for a decl or type. */
1740
58782098 1741extern int valid_machine_attribute PARAMS ((tree, tree, tree, tree));
9c130398
DE
1742
1743/* Given a tree node and a string, return non-zero if the tree node is
1744 a valid attribute name for the string. */
1745
58782098 1746extern int is_attribute_p PARAMS ((const char *, tree));
9c130398
DE
1747
1748/* Given an attribute name and a list of attributes, return the list element
1749 of the attribute or NULL_TREE if not found. */
1750
58782098 1751extern tree lookup_attribute PARAMS ((const char *, tree));
6cb3d314
DE
1752
1753/* Given two attributes lists, return a list of their union. */
1754
58782098 1755extern tree merge_attributes PARAMS ((tree, tree));
9c130398 1756
3932261a
MM
1757/* Given a type node TYPE and a TYPE_QUALIFIER_SET, return a type for
1758 the same kind of data as TYPE describes. Variants point to the
1759 "main variant" (which has no qualifiers set) via TYPE_MAIN_VARIANT,
1760 and it points to a chain of other variants so that duplicate
1761 variants are never made. Only main variants should ever appear as
1762 types of expressions. */
1763
58782098 1764extern tree build_qualified_type PARAMS ((tree, int));
3932261a
MM
1765
1766/* Like build_qualified_type, but only deals with the `const' and
1767 `volatile' qualifiers. This interface is retained for backwards
1768 compatiblity with the various front-ends; new code should use
1769 build_qualified_type instead. */
8da1b058 1770
3932261a
MM
1771#define build_type_variant(TYPE, CONST_P, VOLATILE_P) \
1772 build_qualified_type (TYPE, \
1773 ((CONST_P) ? TYPE_QUAL_CONST : 0) \
1774 | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
8da1b058 1775
43100b14
RS
1776/* Make a copy of a type node. */
1777
58782098 1778extern tree build_type_copy PARAMS ((tree));
43100b14 1779
8da1b058 1780/* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
9328904c
MM
1781 TYPE_ALIGN and TYPE_MODE fields. If called more than once on one
1782 node, does nothing except for the first time. */
8da1b058 1783
58782098 1784extern void layout_type PARAMS ((tree));
8da1b058 1785
9328904c
MM
1786/* These functions allow a front-end to perform a manual layout of a
1787 RECORD_TYPE. (For instance, if the placement of subsequent fields
1788 depends on the placement of fields so far.) Begin by calling
1789 new_record_layout_info. Then, call layout_field for each of the
1790 fields. Then, call finish_record_layout. See layout_type for the
1791 default way in which these functions are used. */
1792
1793struct record_layout_info_s
1794{
1795 /* The RECORD_TYPE that we are laying out. */
1796 tree t;
1797 /* The size of the record so far, in bits. */
1798 unsigned HOST_WIDE_INT const_size;
1799 /* The alignment of the record so far, in bits. */
1800 unsigned int record_align;
1801 /* If the record can have a variable size, then this will be
1802 non-NULL, and the total size will be CONST_SIZE + VAR_SIZE. */
1803 tree var_size;
1804 /* If the record can have a variable size, then this will be the
1805 maximum alignment that we know VAR_SIZE has. */
1806 unsigned int var_align;
1807 /* The static variables (i.e., class variables, as opposed to
1808 instance variables) encountered in T. */
1809 tree pending_statics;
1810 unsigned int unpacked_align;
1811 int packed_maybe_necessary;
1812};
1813
1814typedef struct record_layout_info_s *record_layout_info;
1815
1816extern record_layout_info new_record_layout_info
1817 PARAMS ((tree));
1818extern void layout_field PARAMS ((record_layout_info, tree));
1819extern void finish_record_layout PARAMS ((record_layout_info));
1820
8da1b058
RS
1821/* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
1822 return a canonicalized ..._TYPE node, so that duplicates are not made.
1823 How the hash code is computed is up to the caller, as long as any two
1824 callers that could hash identical-looking type nodes agree. */
1825
05bccae2 1826extern tree type_hash_canon PARAMS ((unsigned int, tree));
8da1b058
RS
1827
1828/* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
1829 calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
1830 fields. Call this only once for any given decl node.
1831
1832 Second argument is the boundary that this field can be assumed to
1833 be starting at (in bits). Zero means it can be assumed aligned
1834 on any boundary that may be needed. */
1835
58782098 1836extern void layout_decl PARAMS ((tree, unsigned));
8da1b058 1837
72c602fc
RK
1838/* Return the mode for data of a given size SIZE and mode class CLASS.
1839 If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
1840 The value is BLKmode if no other mode is found. This is like
1841 mode_for_size, but is passed a tree. */
1842
1843extern enum machine_mode mode_for_size_tree PARAMS ((tree, enum mode_class,
1844 int));
1845
8da1b058
RS
1846/* Return an expr equal to X but certainly not valid as an lvalue. */
1847
58782098
KG
1848extern tree non_lvalue PARAMS ((tree));
1849extern tree pedantic_non_lvalue PARAMS ((tree));
8da1b058 1850
58782098 1851extern tree convert PARAMS ((tree, tree));
729a2125 1852extern unsigned int expr_align PARAMS ((tree));
58782098
KG
1853extern tree size_in_bytes PARAMS ((tree));
1854extern HOST_WIDE_INT int_size_in_bytes PARAMS ((tree));
665f2503
RK
1855extern tree bit_position PARAMS ((tree));
1856extern HOST_WIDE_INT int_bit_position PARAMS ((tree));
fed3cef0
RK
1857
1858/* Define data structures, macros, and functions for handling sizes
1859 and the various types used to represent sizes. */
1860
1861enum size_type_kind
1862{
1863 SIZETYPE, /* Normal representation of sizes in bytes. */
1864 SSIZETYPE, /* Signed representation of sizes in bytes. */
1865 USIZETYPE, /* Unsigned representation of sizes in bytes. */
1866 BITSIZETYPE, /* Normal representation of sizes in bits. */
1867 SBITSIZETYPE, /* Signed representation of sizes in bits. */
1868 UBITSIZETYPE, /* Unsifgned representation of sizes in bits. */
1869 TYPE_KIND_LAST};
1870
1871extern tree sizetype_tab[(int) TYPE_KIND_LAST];
1872
1873#define sizetype sizetype_tab[(int) SIZETYPE]
1874#define bitsizetype sizetype_tab[(int) BITSIZETYPE]
1875#define ssizetype sizetype_tab[(int) SSIZETYPE]
1876#define usizetype sizetype_tab[(int) USIZETYPE]
1877#define sbitsizetype sizetype_tab[(int) SBITSIZETYPE]
1878#define ubitsizetype sizetype_tab[(int) UBITSIZETYPE]
1879
58782098 1880extern tree size_binop PARAMS ((enum tree_code, tree, tree));
fed3cef0
RK
1881extern tree size_diffop PARAMS ((tree, tree));
1882extern tree size_int_wide PARAMS ((HOST_WIDE_INT,
1883 enum size_type_kind));
1884extern tree size_int_type_wide PARAMS ((HOST_WIDE_INT, tree));
06ceef4e 1885
fed3cef0
RK
1886#define size_int_type(L, T) size_int_type_wide ((HOST_WIDE_INT) (L), T)
1887#define size_int(L) size_int_wide ((HOST_WIDE_INT) (L), SIZETYPE)
1888#define ssize_int(L) size_int_wide ((HOST_WIDE_INT) (L), SSIZETYPE)
1889#define bitsize_int(L) size_int_wide ((HOST_WIDE_INT) (L), BITSIZETYPE)
1890#define sbitsize_int(L) size_int_wide ((HOST_WIDE_INT) (L), SBITSIZETYPE)
f8dac6eb 1891
58782098
KG
1892extern tree round_up PARAMS ((tree, int));
1893extern tree get_pending_sizes PARAMS ((void));
1894extern void put_pending_sizes PARAMS ((tree));
8da1b058
RS
1895
1896/* Type for sizes of data-type. */
1897
f8dac6eb
R
1898#define BITS_PER_UNIT_LOG \
1899 ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
1900 + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
1901 + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
1902
8294accf 1903/* If nonzero, an upper limit on alignment of structure fields, in bits. */
729a2125 1904extern unsigned int maximum_field_alignment;
8294accf 1905
abc95ed3 1906/* If non-zero, the alignment of a bitstring or (power-)set value, in bits. */
729a2125 1907extern unsigned int set_alignment;
8294accf 1908
8da1b058
RS
1909/* Concatenate two lists (chains of TREE_LIST nodes) X and Y
1910 by making the last node in X point to Y.
1911 Returns X, except if X is 0 returns Y. */
1912
58782098 1913extern tree chainon PARAMS ((tree, tree));
8da1b058
RS
1914
1915/* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
1916
58782098
KG
1917extern tree tree_cons PARAMS ((tree, tree, tree));
1918extern tree perm_tree_cons PARAMS ((tree, tree, tree));
1919extern tree temp_tree_cons PARAMS ((tree, tree, tree));
1920extern tree saveable_tree_cons PARAMS ((tree, tree, tree));
1921extern tree decl_tree_cons PARAMS ((tree, tree, tree));
1922extern tree expr_tree_cons PARAMS ((tree, tree, tree));
8da1b058
RS
1923
1924/* Return the last tree node in a chain. */
1925
58782098 1926extern tree tree_last PARAMS ((tree));
8da1b058
RS
1927
1928/* Reverse the order of elements in a chain, and return the new head. */
1929
58782098 1930extern tree nreverse PARAMS ((tree));
8da1b058
RS
1931
1932/* Returns the length of a chain of nodes
1933 (number of chain pointers to follow before reaching a null pointer). */
1934
58782098 1935extern int list_length PARAMS ((tree));
8da1b058 1936
c3b247b4
JM
1937/* Returns the number of FIELD_DECLs in a type. */
1938
1939extern int fields_length PARAMS ((tree));
1940
8da1b058
RS
1941/* integer_zerop (tree x) is nonzero if X is an integer constant of value 0 */
1942
58782098 1943extern int integer_zerop PARAMS ((tree));
8da1b058
RS
1944
1945/* integer_onep (tree x) is nonzero if X is an integer constant of value 1 */
1946
58782098 1947extern int integer_onep PARAMS ((tree));
8da1b058
RS
1948
1949/* integer_all_onesp (tree x) is nonzero if X is an integer constant
1950 all of whose significant bits are 1. */
1951
58782098 1952extern int integer_all_onesp PARAMS ((tree));
8da1b058
RS
1953
1954/* integer_pow2p (tree x) is nonzero is X is an integer constant with
1955 exactly one bit 1. */
1956
58782098 1957extern int integer_pow2p PARAMS ((tree));
8da1b058
RS
1958
1959/* staticp (tree x) is nonzero if X is a reference to data allocated
1960 at a fixed address in memory. */
1961
58782098 1962extern int staticp PARAMS ((tree));
8da1b058
RS
1963
1964/* Gets an error if argument X is not an lvalue.
1965 Also returns 1 if X is an lvalue, 0 if not. */
1966
58782098 1967extern int lvalue_or_else PARAMS ((tree, const char *));
8da1b058
RS
1968
1969/* save_expr (EXP) returns an expression equivalent to EXP
1970 but it can be used multiple times within context CTX
1971 and only evaluate EXP once. */
1972
58782098 1973extern tree save_expr PARAMS ((tree));
8da1b058 1974
b7f6588d
JM
1975/* Returns the index of the first non-tree operand for CODE, or the number
1976 of operands if all are trees. */
1977
58782098 1978extern int first_rtl_op PARAMS ((enum tree_code));
b7f6588d 1979
679163cf 1980/* unsave_expr (EXP) returns an expression equivalent to EXP but it
582db8e4 1981 can be used multiple times and will evaluate EXP in its entirety
679163cf
MS
1982 each time. */
1983
58782098 1984extern tree unsave_expr PARAMS ((tree));
679163cf 1985
0a1c58a2
JL
1986/* safe_for_reeval_p (EXP) returns nonzero if it is possible to
1987 expand EXP multiple times. */
1988
1989extern int safe_for_reeval_p PARAMS ((tree));
1990
582db8e4
MM
1991/* Reset EXP in place so that it can be expaned again. Does not
1992 recurse into subtrees. */
1993
58782098 1994extern void unsave_expr_1 PARAMS ((tree));
582db8e4
MM
1995
1996/* Like unsave_expr_1, but recurses into all subtrees. */
679163cf 1997
58782098 1998extern tree unsave_expr_now PARAMS ((tree));
679163cf 1999
582db8e4
MM
2000/* If non-null, these are language-specific helper functions for
2001 unsave_expr_now. If present, LANG_UNSAVE is called before its
2002 argument (an UNSAVE_EXPR) is to be unsaved, and all other
2003 processing in unsave_expr_now is aborted. LANG_UNSAVE_EXPR_NOW is
2004 called from unsave_expr_1 for language-specific tree codes. */
58782098
KG
2005extern void (*lang_unsave) PARAMS ((tree *));
2006extern void (*lang_unsave_expr_now) PARAMS ((tree));
0a818f84 2007
0a1c58a2
JL
2008/* If non-null, a language specific version of safe_for_unsave. */
2009extern int (*lang_safe_for_unsave) PARAMS ((tree));
2010
7380d707
RK
2011/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
2012 or offset that depends on a field within a record.
2013
2014 Note that we only allow such expressions within simple arithmetic
2015 or a COND_EXPR. */
2016
58782098 2017extern int contains_placeholder_p PARAMS ((tree));
7380d707 2018
b7f6588d
JM
2019/* Return 1 if EXP contains any expressions that produce cleanups for an
2020 outer scope to deal with. Used by fold. */
2021
58782098 2022extern int has_cleanups PARAMS ((tree));
b7f6588d 2023
7380d707
RK
2024/* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
2025 return a tree with all occurrences of references to F in a
2026 PLACEHOLDER_EXPR replaced by R. Note that we assume here that EXP
2027 contains only arithmetic expressions. */
2028
58782098 2029extern tree substitute_in_expr PARAMS ((tree, tree, tree));
7380d707 2030
90ca31be
RS
2031/* variable_size (EXP) is like save_expr (EXP) except that it
2032 is for the special case of something that is part of a
2033 variable size for a data type. It makes special arrangements
2034 to compute the value at the right time when the data type
2035 belongs to a function parameter. */
2036
58782098 2037extern tree variable_size PARAMS ((tree));
90ca31be 2038
8da1b058
RS
2039/* stabilize_reference (EXP) returns an reference equivalent to EXP
2040 but it can be used multiple times
2041 and only evaluate the subexpressions once. */
2042
58782098 2043extern tree stabilize_reference PARAMS ((tree));
8da1b058 2044
1c8b10bb
RK
2045/* Subroutine of stabilize_reference; this is called for subtrees of
2046 references. Any expression with side-effects must be put in a SAVE_EXPR
2047 to ensure that it is only evaluated once. */
2048
58782098 2049extern tree stabilize_reference_1 PARAMS ((tree));
1c8b10bb 2050
8da1b058
RS
2051/* Return EXP, stripped of any conversions to wider types
2052 in such a way that the result of converting to type FOR_TYPE
2053 is the same as if EXP were converted to FOR_TYPE.
2054 If FOR_TYPE is 0, it signifies EXP's type. */
2055
58782098 2056extern tree get_unwidened PARAMS ((tree, tree));
8da1b058
RS
2057
2058/* Return OP or a simpler expression for a narrower value
2059 which can be sign-extended or zero-extended to give back OP.
2060 Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
2061 or 0 if the value should be sign-extended. */
2062
58782098 2063extern tree get_narrower PARAMS ((tree, int *));
8da1b058
RS
2064
2065/* Given MODE and UNSIGNEDP, return a suitable type-tree
2066 with that mode.
2067 The definition of this resides in language-specific code
2068 as the repertoire of available types may vary. */
2069
58782098 2070extern tree type_for_mode PARAMS ((enum machine_mode, int));
8da1b058
RS
2071
2072/* Given PRECISION and UNSIGNEDP, return a suitable type-tree
2073 for an integer type with at least that precision.
2074 The definition of this resides in language-specific code
2075 as the repertoire of available types may vary. */
2076
58782098 2077extern tree type_for_size PARAMS ((unsigned, int));
8da1b058
RS
2078
2079/* Given an integer type T, return a type like T but unsigned.
2080 If T is unsigned, the value is T.
2081 The definition of this resides in language-specific code
2082 as the repertoire of available types may vary. */
2083
58782098 2084extern tree unsigned_type PARAMS ((tree));
8da1b058
RS
2085
2086/* Given an integer type T, return a type like T but signed.
2087 If T is signed, the value is T.
2088 The definition of this resides in language-specific code
2089 as the repertoire of available types may vary. */
2090
58782098 2091extern tree signed_type PARAMS ((tree));
8da1b058
RS
2092
2093/* This function must be defined in the language-specific files.
2094 expand_expr calls it to build the cleanup-expression for a TARGET_EXPR.
2095 This is defined in a language-specific file. */
2096
58782098 2097extern tree maybe_build_cleanup PARAMS ((tree));
8da1b058
RS
2098
2099/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
2100 look for nested component-refs or array-refs at constant positions
2101 and find the ultimate containing object, which is returned. */
2102
58782098 2103extern tree get_inner_reference PARAMS ((tree, int *, int *, tree *,
b4523ff4 2104 enum machine_mode *, int *,
729a2125 2105 int *, unsigned int *));
8da1b058 2106
140b60b4
MM
2107/* Given a DECL or TYPE, return the scope in which it was declared, or
2108 NUL_TREE if there is no containing scope. */
2109
58782098 2110extern tree get_containing_scope PARAMS ((tree));
140b60b4 2111
8da1b058
RS
2112/* Return the FUNCTION_DECL which provides this _DECL with its context,
2113 or zero if none. */
58782098 2114extern tree decl_function_context PARAMS ((tree));
8da1b058 2115
3635a54b
RK
2116/* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
2117 this _DECL with its context, or zero if none. */
58782098 2118extern tree decl_type_context PARAMS ((tree));
8da1b058
RS
2119
2120/* Given the FUNCTION_DECL for the current function,
2121 return zero if it is ok for this function to be inline.
2122 Otherwise return a warning message with a single %s
2123 for the function's name. */
2124
58782098 2125extern const char *function_cannot_inline_p PARAMS ((tree));
a3c11cd3
JW
2126
2127/* Return 1 if EXPR is the real constant zero. */
58782098 2128extern int real_zerop PARAMS ((tree));
8da1b058
RS
2129\f
2130/* Declare commonly used variables for tree structure. */
2131
8da1b058
RS
2132/* Points to the name of the input file from which the current input
2133 being parsed originally came (before it went into cpp). */
2134extern char *input_filename;
2135
2136/* Current line number in input file. */
2137extern int lineno;
2138
2139/* Nonzero for -pedantic switch: warn about anything
2140 that standard C forbids. */
2141extern int pedantic;
2142
4812480a
JM
2143/* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
2144 Zero means allow extended lvalues. */
2145
2146extern int pedantic_lvalues;
2147
8da1b058
RS
2148/* Nonzero means can safely call expand_expr now;
2149 otherwise layout_type puts variable sizes onto `pending_sizes' instead. */
2150
2151extern int immediate_size_expand;
2152
2153/* Points to the FUNCTION_DECL of the function whose body we are reading. */
2154
2155extern tree current_function_decl;
2156
00262c8a
ML
2157/* Nonzero means a FUNC_BEGIN label was emitted. */
2158extern tree current_function_func_begin_label;
2159
8da1b058
RS
2160/* Nonzero means all ..._TYPE nodes should be allocated permanently. */
2161
2162extern int all_types_permanent;
2163
a1d7ffe3
JM
2164/* Pointer to function to compute the name to use to print a declaration.
2165 DECL is the declaration in question.
2166 VERBOSITY determines what information will be printed:
2167 0: DECL_NAME, demangled as necessary.
2168 1: and scope information.
2169 2: and any other information that might be interesting, such as function
2170 parameter types in C++. */
2171
58782098 2172extern const char *(*decl_printable_name) PARAMS ((tree, int));
dc437e16
RS
2173
2174/* Pointer to function to finish handling an incomplete decl at the
2175 end of compilation. */
2176
58782098 2177extern void (*incomplete_decl_finalize_hook) PARAMS ((tree));
f425a887 2178
58782098
KG
2179extern char *init_parse PARAMS ((char *));
2180extern void finish_parse PARAMS ((void));
f425a887 2181
26db82d8
BS
2182extern const char * const language_string;
2183
2184/* Declare a predefined function. Return the declaration. This function is
2185 provided by each language frontend. */
58782098 2186extern tree builtin_function PARAMS ((const char *, tree, int,
26db82d8
BS
2187 enum built_in_class,
2188 const char *));
8da1b058 2189\f
143f1945 2190/* In tree.c */
58782098
KG
2191extern char *perm_calloc PARAMS ((int, long));
2192extern tree get_file_function_name PARAMS ((int));
2193extern tree get_file_function_name_long PARAMS ((const char *));
2194extern tree get_set_constructor_bits PARAMS ((tree, char *, int));
2195extern tree get_set_constructor_bytes PARAMS ((tree,
0f41302f 2196 unsigned char *, int));
58782098
KG
2197extern int get_alias_set PARAMS ((tree));
2198extern int new_alias_set PARAMS ((void));
2199extern int (*lang_get_alias_set) PARAMS ((tree));
2200extern tree get_callee_fndecl PARAMS ((tree));
143f1945 2201\f
8da1b058
RS
2202/* In stmt.c */
2203
58782098
KG
2204extern int in_control_zone_p PARAMS ((void));
2205extern void expand_fixups PARAMS ((struct rtx_def *));
2206extern tree expand_start_stmt_expr PARAMS ((void));
2207extern tree expand_end_stmt_expr PARAMS ((tree));
2208extern void expand_expr_stmt PARAMS ((tree));
2209extern int warn_if_unused_value PARAMS ((tree));
2210extern void expand_decl_init PARAMS ((tree));
2211extern void clear_last_expr PARAMS ((void));
2212extern void expand_label PARAMS ((tree));
2213extern void expand_goto PARAMS ((tree));
2214extern void expand_asm PARAMS ((tree));
2215extern void expand_start_cond PARAMS ((tree, int));
2216extern void expand_end_cond PARAMS ((void));
2217extern void expand_start_else PARAMS ((void));
2218extern void expand_start_elseif PARAMS ((tree));
2219extern struct nesting *expand_start_loop PARAMS ((int));
2220extern struct nesting *expand_start_loop_continue_elsewhere PARAMS ((int));
2221extern void expand_loop_continue_here PARAMS ((void));
2222extern void expand_end_loop PARAMS ((void));
2223extern int expand_continue_loop PARAMS ((struct nesting *));
2224extern int expand_exit_loop PARAMS ((struct nesting *));
2225extern int expand_exit_loop_if_false PARAMS ((struct nesting *,
d6b12657 2226 tree));
58782098 2227extern int expand_exit_something PARAMS ((void));
f837a861 2228
58782098
KG
2229extern void expand_null_return PARAMS ((void));
2230extern void expand_return PARAMS ((tree));
2231extern int optimize_tail_recursion PARAMS ((tree, struct rtx_def *));
2232extern void expand_start_bindings_and_block PARAMS ((int, tree));
a97901e6
MM
2233#define expand_start_bindings(flags) \
2234 expand_start_bindings_and_block(flags, NULL_TREE)
58782098
KG
2235extern void expand_end_bindings PARAMS ((tree, int, int));
2236extern void warn_about_unused_variables PARAMS ((tree));
2237extern void start_cleanup_deferral PARAMS ((void));
2238extern void end_cleanup_deferral PARAMS ((void));
deb5e280
JM
2239extern int is_body_block PARAMS ((tree));
2240
58782098
KG
2241extern void mark_block_as_eh_region PARAMS ((void));
2242extern void mark_block_as_not_eh_region PARAMS ((void));
2243extern int is_eh_region PARAMS ((void));
2244extern int conditional_context PARAMS ((void));
2245extern tree last_cleanup_this_contour PARAMS ((void));
2246extern int expand_dhc_cleanup PARAMS ((tree));
2247extern int expand_dcc_cleanup PARAMS ((tree));
2248extern void expand_start_case PARAMS ((int, tree, tree,
dff01034 2249 const char *));
58782098
KG
2250extern void expand_end_case PARAMS ((tree));
2251extern int pushcase PARAMS ((tree,
d6b12657
RK
2252 tree (*) (tree, tree),
2253 tree, tree *));
58782098 2254extern int pushcase_range PARAMS ((tree, tree,
d6b12657
RK
2255 tree (*) (tree, tree),
2256 tree, tree *));
58782098
KG
2257extern void using_eh_for_cleanups PARAMS ((void));
2258extern int stmt_loop_nest_empty PARAMS ((void));
8da1b058
RS
2259
2260/* In fold-const.c */
2261
4b63dccb
RK
2262/* Fold constants as much as possible in an expression.
2263 Returns the simplified expression.
2264 Acts only on the top level of the expression;
2265 if the argument itself cannot be simplified, its
2266 subexpressions are not changed. */
2267
58782098 2268extern tree fold PARAMS ((tree));
4b63dccb 2269
58782098 2270extern int force_fit_type PARAMS ((tree, int));
05bccae2
RK
2271extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2272 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2273 unsigned HOST_WIDE_INT *,
2274 HOST_WIDE_INT *));
2275extern int neg_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2276 unsigned HOST_WIDE_INT *,
2277 HOST_WIDE_INT *));
2278extern int mul_double PARAMS ((unsigned HOST_WIDE_INT,
2279 HOST_WIDE_INT,
2280 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2281 unsigned HOST_WIDE_INT *,
2282 HOST_WIDE_INT *));
2283extern void lshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2284 HOST_WIDE_INT, unsigned int,
2285 unsigned HOST_WIDE_INT *,
2286 HOST_WIDE_INT *, int));
2287extern void rshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2288 HOST_WIDE_INT, unsigned int,
2289 unsigned HOST_WIDE_INT *,
2290 HOST_WIDE_INT *, int));
2291extern void lrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2292 HOST_WIDE_INT, unsigned int,
2293 unsigned HOST_WIDE_INT *,
2294 HOST_WIDE_INT *));
2295extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2296 HOST_WIDE_INT, unsigned int,
2297 unsigned HOST_WIDE_INT *,
2298 HOST_WIDE_INT *));
58782098
KG
2299extern int operand_equal_p PARAMS ((tree, tree, int));
2300extern tree invert_truthvalue PARAMS ((tree));
c530479e
RH
2301
2302/* In builtins.c. Given a type, apply default promotions wrt unnamed
2303 function arguments and return the new type. Return NULL_TREE if no
2304 change. Required by any language that supports variadic arguments. */
2305
58782098 2306extern tree (*lang_type_promotes_to) PARAMS ((tree));
8da1b058 2307\f
956d6950
JL
2308/* Interface of the DWARF2 unwind info support. */
2309
2310/* Decide whether we want to emit frame unwind information for the current
2311 translation unit. */
2312
58782098 2313extern int dwarf2out_do_frame PARAMS ((void));
956d6950
JL
2314
2315/* Generate a new label for the CFI info to refer to. */
2316
58782098 2317extern char *dwarf2out_cfi_label PARAMS ((void));
956d6950
JL
2318
2319/* Entry point to update the canonical frame address (CFA). */
2320
58782098 2321extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long));
956d6950
JL
2322
2323/* Add the CFI for saving a register window. */
2324
58782098 2325extern void dwarf2out_window_save PARAMS ((char *));
956d6950
JL
2326
2327/* Add a CFI to update the running total of the size of arguments pushed
2328 onto the stack. */
2329
58782098 2330extern void dwarf2out_args_size PARAMS ((char *, long));
956d6950
JL
2331
2332/* Entry point for saving a register to the stack. */
2333
58782098 2334extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long));
956d6950
JL
2335
2336/* Entry point for saving the return address in the stack. */
2337
58782098 2338extern void dwarf2out_return_save PARAMS ((char *, long));
956d6950
JL
2339
2340/* Entry point for saving the return address in a register. */
2341
58782098 2342extern void dwarf2out_return_reg PARAMS ((char *, unsigned));
956d6950
JL
2343
2344/* Output a marker (i.e. a label) for the beginning of a function, before
2345 the prologue. */
2346
58782098 2347extern void dwarf2out_begin_prologue PARAMS ((void));
956d6950
JL
2348
2349/* Output a marker (i.e. a label) for the absolute end of the generated
2350 code for a function definition. */
2351
58782098 2352extern void dwarf2out_end_epilogue PARAMS ((void));
956d6950 2353\f
8da1b058
RS
2354/* The language front-end must define these functions. */
2355
b53beeb2 2356/* Function of no arguments for initializing options. */
58782098 2357extern void lang_init_options PARAMS ((void));
b53beeb2 2358
8da1b058 2359/* Function of no arguments for initializing lexical scanning. */
58782098 2360extern void init_lex PARAMS ((void));
8da1b058 2361/* Function of no arguments for initializing the symbol table. */
58782098 2362extern void init_decl_processing PARAMS ((void));
8da1b058
RS
2363
2364/* Functions called with no arguments at the beginning and end or processing
2365 the input source file. */
58782098
KG
2366extern void lang_init PARAMS ((void));
2367extern void lang_finish PARAMS ((void));
8da1b058 2368
9faa82d8 2369/* Function to identify which front-end produced the output file. */
58782098 2370extern const char *lang_identify PARAMS ((void));
c9591059
KG
2371
2372/* Called by report_error_function to print out function name.
2373 * Default may be overridden by language front-ends. */
58782098 2374extern void (*print_error_function) PARAMS ((const char *));
d0d4af87 2375
78b099bd 2376/* Function to replace the DECL_LANG_SPECIFIC field of a DECL with a copy. */
58782098 2377extern void copy_lang_decl PARAMS ((tree));
78b099bd 2378
8da1b058 2379/* Function called with no arguments to parse and compile the input. */
58782098 2380extern int yyparse PARAMS ((void));
8da1b058
RS
2381/* Function called with option as argument
2382 to decode options starting with -f or -W or +.
2383 It should return nonzero if it handles the option. */
58782098 2384extern int lang_decode_option PARAMS ((int, char **));
8da1b058
RS
2385
2386/* Functions for processing symbol declarations. */
2387/* Function to enter a new lexical scope.
2388 Takes one argument: always zero when called from outside the front end. */
58782098 2389extern void pushlevel PARAMS ((int));
8da1b058
RS
2390/* Function to exit a lexical scope. It returns a BINDING for that scope.
2391 Takes three arguments:
2392 KEEP -- nonzero if there were declarations in this scope.
2393 REVERSE -- reverse the order of decls before returning them.
2394 FUNCTIONBODY -- nonzero if this level is the body of a function. */
58782098 2395extern tree poplevel PARAMS ((int, int, int));
69b78d8d 2396/* Set the BLOCK node for the current scope level. */
58782098 2397extern void set_block PARAMS ((tree));
8da1b058
RS
2398/* Function to add a decl to the current scope level.
2399 Takes one argument, a decl to add.
2400 Returns that decl, or, if the same symbol is already declared, may
2401 return a different decl for that name. */
58782098 2402extern tree pushdecl PARAMS ((tree));
8da1b058 2403/* Function to return the chain of decls so far in the current scope level. */
58782098 2404extern tree getdecls PARAMS ((void));
8da1b058 2405/* Function to return the chain of structure tags in the current scope level. */
58782098 2406extern tree gettags PARAMS ((void));
a3c11cd3 2407
58782098 2408extern tree build_range_type PARAMS ((tree, tree, tree));
a3c11cd3
JW
2409
2410/* Call when starting to parse a declaration:
2411 make expressions in the declaration last the length of the function.
2412 Returns an argument that should be passed to resume_momentary later. */
58782098 2413extern int suspend_momentary PARAMS ((void));
a3c11cd3 2414
58782098 2415extern int allocation_temporary_p PARAMS ((void));
a3c11cd3
JW
2416
2417/* Call when finished parsing a declaration:
2418 restore the treatment of node-allocation that was
2419 in effect before the suspension.
2420 YES should be the value previously returned by suspend_momentary. */
58782098 2421extern void resume_momentary PARAMS ((int));
a3c11cd3
JW
2422
2423/* Called after finishing a record, union or enumeral type. */
58782098 2424extern void rest_of_type_compilation PARAMS ((tree, int));
a3c11cd3
JW
2425
2426/* Save the current set of obstacks, but don't change them. */
58782098 2427extern void push_obstacks_nochange PARAMS ((void));
a3c11cd3 2428
58782098 2429extern void permanent_allocation PARAMS ((int));
96bcb120 2430
58782098 2431extern void push_momentary PARAMS ((void));
a3c11cd3 2432
58782098 2433extern void clear_momentary PARAMS ((void));
a3c11cd3 2434
58782098 2435extern void pop_momentary PARAMS ((void));
a3c11cd3 2436
58782098 2437extern void end_temporary_allocation PARAMS ((void));
a3c11cd3
JW
2438
2439/* Pop the obstack selection stack. */
58782098 2440extern void pop_obstacks PARAMS ((void));
92cbe4d2 2441
a1d061a1 2442/* In tree.c */
58782098
KG
2443extern int really_constant_p PARAMS ((tree));
2444extern void push_obstacks PARAMS ((struct obstack *,
a1d061a1 2445 struct obstack *));
58782098
KG
2446extern void pop_momentary_nofree PARAMS ((void));
2447extern void preserve_momentary PARAMS ((void));
2448extern void saveable_allocation PARAMS ((void));
2449extern void temporary_allocation PARAMS ((void));
2450extern void resume_temporary_allocation PARAMS ((void));
2451extern tree get_file_function_name PARAMS ((int));
2452extern void set_identifier_size PARAMS ((int));
2453extern int int_fits_type_p PARAMS ((tree, tree));
2454extern int tree_log2 PARAMS ((tree));
05bccae2 2455extern int tree_floor_log2 PARAMS ((tree));
58782098
KG
2456extern void preserve_initializer PARAMS ((void));
2457extern void preserve_data PARAMS ((void));
2458extern int object_permanent_p PARAMS ((tree));
2459extern int type_precision PARAMS ((tree));
2460extern int simple_cst_equal PARAMS ((tree, tree));
05bccae2 2461extern int compare_tree_int PARAMS ((tree, unsigned int));
58782098
KG
2462extern int type_list_equal PARAMS ((tree, tree));
2463extern int chain_member PARAMS ((tree, tree));
2464extern int chain_member_purpose PARAMS ((tree, tree));
2465extern int chain_member_value PARAMS ((tree, tree));
2466extern tree listify PARAMS ((tree));
05bccae2
RK
2467extern tree type_hash_lookup PARAMS ((unsigned int, tree));
2468extern void type_hash_add PARAMS ((unsigned int, tree));
2469extern unsigned int type_hash_list PARAMS ((tree));
58782098
KG
2470extern int simple_cst_list_equal PARAMS ((tree, tree));
2471extern void debug_obstack PARAMS ((char *));
2472extern void rtl_in_current_obstack PARAMS ((void));
2473extern void rtl_in_saveable_obstack PARAMS ((void));
2474extern void init_tree_codes PARAMS ((void));
2475extern void dump_tree_statistics PARAMS ((void));
2476extern void print_obstack_statistics PARAMS ((const char *,
37b37199 2477 struct obstack *));
a1d061a1 2478#ifdef BUFSIZ
58782098 2479extern void print_obstack_name PARAMS ((char *, FILE *, const char *));
a1d061a1 2480#endif
58782098
KG
2481extern void expand_function_end PARAMS ((char *, int, int));
2482extern void expand_function_start PARAMS ((tree, int));
2483extern int real_onep PARAMS ((tree));
2484extern int real_twop PARAMS ((tree));
2485extern void start_identifier_warnings PARAMS ((void));
2486extern void gcc_obstack_init PARAMS ((struct obstack *));
2487extern void init_obstacks PARAMS ((void));
2488extern void obfree PARAMS ((char *));
2489extern void build_common_tree_nodes PARAMS ((int));
2490extern void build_common_tree_nodes_2 PARAMS ((int));
a1d061a1
JL
2491
2492/* In function.c */
58782098
KG
2493extern void setjmp_protect_args PARAMS ((void));
2494extern void setjmp_protect PARAMS ((tree));
2495extern void expand_main_function PARAMS ((void));
2496extern void mark_varargs PARAMS ((void));
2497extern void init_dummy_function_start PARAMS ((void));
2498extern void expand_dummy_function_end PARAMS ((void));
2499extern void init_function_for_compilation PARAMS ((void));
2500extern void init_function_start PARAMS ((tree, char *, int));
2501extern void assign_parms PARAMS ((tree));
2502extern void put_var_into_stack PARAMS ((tree));
2503extern void uninitialized_vars_warning PARAMS ((tree));
2504extern void setjmp_args_warning PARAMS ((void));
2505extern void mark_all_temps_used PARAMS ((void));
2506extern void init_temp_slots PARAMS ((void));
2507extern void combine_temp_slots PARAMS ((void));
2508extern void free_temp_slots PARAMS ((void));
2509extern void pop_temp_slots PARAMS ((void));
2510extern void push_temp_slots PARAMS ((void));
2511extern void preserve_temp_slots PARAMS ((struct rtx_def *));
05bccae2 2512extern void preserve_rtl_expr_temps PARAMS ((tree));
58782098
KG
2513extern int aggregate_value_p PARAMS ((tree));
2514extern tree reorder_blocks PARAMS ((tree,
a1d061a1 2515 struct rtx_def *));
591ccf92 2516extern void free_temps_for_rtl_expr PARAMS ((tree));
58782098 2517extern void instantiate_virtual_regs PARAMS ((tree, struct rtx_def *));
d1b81779 2518extern void unshare_all_rtl PARAMS ((tree, struct rtx_def *));
58782098
KG
2519extern int max_parm_reg_num PARAMS ((void));
2520extern void push_function_context PARAMS ((void));
2521extern void pop_function_context PARAMS ((void));
2522extern void push_function_context_to PARAMS ((tree));
2523extern void pop_function_context_from PARAMS ((tree));
a1d061a1
JL
2524
2525/* In print-rtl.c */
2526#ifdef BUFSIZ
58782098 2527extern void print_rtl PARAMS ((FILE *, struct rtx_def *));
a1d061a1
JL
2528#endif
2529
2530/* In print-tree.c */
58782098 2531extern void debug_tree PARAMS ((tree));
a1d061a1 2532#ifdef BUFSIZ
58782098
KG
2533extern void print_node PARAMS ((FILE *, const char *, tree, int));
2534extern void print_node_brief PARAMS ((FILE *, const char *, tree, int));
2535extern void indent_to PARAMS ((FILE *, int));
a1d061a1
JL
2536#endif
2537
2538/* In expr.c */
58782098
KG
2539extern void emit_queue PARAMS ((void));
2540extern int apply_args_register_offset PARAMS ((int));
a1d061a1 2541extern struct rtx_def *expand_builtin_return_addr
58782098
KG
2542 PARAMS ((enum built_in_function, int, struct rtx_def *));
2543extern void do_pending_stack_adjust PARAMS ((void));
2544extern struct rtx_def *expand_assignment PARAMS ((tree, tree, int, int));
2545extern struct rtx_def *store_expr PARAMS ((tree, struct rtx_def *,
a1d061a1 2546 int));
58782098 2547extern void check_max_integer_computation_mode PARAMS ((tree));
a1d061a1
JL
2548
2549/* In emit-rtl.c */
591ccf92 2550extern void start_sequence_for_rtl_expr PARAMS ((tree));
3cce094d
KG
2551extern struct rtx_def *emit_line_note_after PARAMS ((const char *, int,
2552 struct rtx_def *));
2553extern struct rtx_def *emit_line_note PARAMS ((const char *, int));
2554extern struct rtx_def *emit_line_note_force PARAMS ((const char *, int));
a1d061a1 2555
3a8c995b 2556/* In calls.c */
58782098 2557extern void special_function_p PARAMS ((tree, int *, int *,
e09d24ff 2558 int *, int *, int *));
3a8c995b 2559
a1d061a1 2560/* In c-typeck.c */
58782098
KG
2561extern int mark_addressable PARAMS ((tree));
2562extern void incomplete_type_error PARAMS ((tree, tree));
a1d061a1
JL
2563
2564/* In c-lang.c */
58782098 2565extern void print_lang_statistics PARAMS ((void));
a1d061a1
JL
2566
2567/* In c-common.c */
58782098 2568extern tree truthvalue_conversion PARAMS ((tree));
58782098 2569extern void split_specs_attrs PARAMS ((tree, tree *, tree *));
a1d061a1
JL
2570
2571/* In c-decl.c */
2572#ifdef BUFSIZ
58782098
KG
2573extern void print_lang_decl PARAMS ((FILE *, tree, int));
2574extern void print_lang_type PARAMS ((FILE *, tree, int));
2575extern void print_lang_identifier PARAMS ((FILE *, tree, int));
a1d061a1 2576#endif
58782098
KG
2577extern int global_bindings_p PARAMS ((void));
2578extern void insert_block PARAMS ((tree));
a1d061a1
JL
2579
2580/* In integrate.c */
58782098
KG
2581extern void save_for_inline_nocopy PARAMS ((tree));
2582extern void save_for_inline_copying PARAMS ((tree));
2583extern void set_decl_abstract_flags PARAMS ((tree, int));
2584extern void output_inline_function PARAMS ((tree));
a1d061a1
JL
2585
2586/* In c-lex.c */
58782098 2587extern void set_yydebug PARAMS ((int));
a1d061a1
JL
2588
2589/* In stor-layout.c */
58782098 2590extern void fixup_signed_type PARAMS ((tree));
a1d061a1
JL
2591
2592/* varasm.c */
58782098
KG
2593extern void make_decl_rtl PARAMS ((tree, const char *, int));
2594extern void make_decl_one_only PARAMS ((tree));
2595extern int supports_one_only PARAMS ((void));
2596extern void variable_section PARAMS ((tree, int));
a1d061a1
JL
2597
2598/* In fold-const.c */
58782098 2599extern int div_and_round_double PARAMS ((enum tree_code, int,
05bccae2
RK
2600 unsigned HOST_WIDE_INT,
2601 HOST_WIDE_INT,
2602 unsigned HOST_WIDE_INT,
2603 HOST_WIDE_INT,
2604 unsigned HOST_WIDE_INT *,
2605 HOST_WIDE_INT *,
2606 unsigned HOST_WIDE_INT *,
2607 HOST_WIDE_INT *));
a1d061a1
JL
2608
2609/* In stmt.c */
58782098
KG
2610extern void emit_nop PARAMS ((void));
2611extern void expand_computed_goto PARAMS ((tree));
2612extern struct rtx_def *label_rtx PARAMS ((tree));
2613extern void expand_asm_operands PARAMS ((tree, tree, tree, tree, int,
a1d061a1 2614 char *, int));
58782098
KG
2615extern int any_pending_cleanups PARAMS ((int));
2616extern void init_stmt PARAMS ((void));
2617extern void init_stmt_for_function PARAMS ((void));
2618extern int drop_through_at_end_p PARAMS ((void));
2619extern void expand_start_target_temps PARAMS ((void));
2620extern void expand_end_target_temps PARAMS ((void));
2621extern void expand_elseif PARAMS ((tree));
2622extern void expand_decl PARAMS ((tree));
2623extern int expand_decl_cleanup PARAMS ((tree, tree));
2624extern void expand_anon_union_decl PARAMS ((tree, tree, tree));
2625extern void move_cleanups_up PARAMS ((void));
2626extern void expand_start_case_dummy PARAMS ((void));
2627extern void expand_end_case_dummy PARAMS ((void));
2628extern tree case_index_expr_type PARAMS ((void));
2629extern HOST_WIDE_INT all_cases_count PARAMS ((tree, int *));
2630extern void check_for_full_enumeration_handling PARAMS ((tree));
2631extern void declare_nonlocal_label PARAMS ((tree));
31ed227b 2632#ifdef BUFSIZ
58782098 2633extern void lang_print_xnode PARAMS ((FILE *, tree, int));
31ed227b
JL
2634#endif
2635
a1d061a1 2636
496651db
MM
2637/* If KIND=='I', return a suitable global initializer (constructor) name.
2638 If KIND=='D', return a suitable global clean-up (destructor) name. */
58782098 2639extern tree get_file_function_name PARAMS ((int));
af4142d5
JM
2640\f
2641/* Interface of the DWARF2 unwind info support. */
2642
2643/* Decide whether we want to emit frame unwind information for the current
2644 translation unit. */
2645
58782098 2646extern int dwarf2out_do_frame PARAMS ((void));
af4142d5
JM
2647
2648/* Generate a new label for the CFI info to refer to. */
2649
58782098 2650extern char *dwarf2out_cfi_label PARAMS ((void));
af4142d5
JM
2651
2652/* Entry point to update the canonical frame address (CFA). */
2653
58782098 2654extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long));
af4142d5
JM
2655
2656/* Add the CFI for saving a register window. */
2657
58782098 2658extern void dwarf2out_window_save PARAMS ((char *));
af4142d5
JM
2659
2660/* Add a CFI to update the running total of the size of arguments pushed
2661 onto the stack. */
2662
58782098 2663extern void dwarf2out_args_size PARAMS ((char *, long));
af4142d5
JM
2664
2665/* Entry point for saving a register to the stack. */
2666
58782098 2667extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long));
af4142d5
JM
2668
2669/* Entry point for saving the return address in the stack. */
2670
58782098 2671extern void dwarf2out_return_save PARAMS ((char *, long));
af4142d5
JM
2672
2673/* Entry point for saving the return address in a register. */
2674
58782098 2675extern void dwarf2out_return_reg PARAMS ((char *, unsigned));
af4142d5
JM
2676
2677/* Output a marker (i.e. a label) for the beginning of a function, before
2678 the prologue. */
2679
58782098 2680extern void dwarf2out_begin_prologue PARAMS ((void));
af4142d5
JM
2681
2682/* Output a marker (i.e. a label) for the absolute end of the generated
2683 code for a function definition. */
2684
58782098 2685extern void dwarf2out_end_epilogue PARAMS ((void));
987009bf
ZW
2686
2687/* Redefine abort to report an internal error w/o coredump, and
2688 reporting the location of the error in the source file. This logic
2689 is duplicated in rtl.h and tree.h because every file that needs the
2690 special abort includes one or both. toplev.h gets too few files,
2691 system.h gets too many. */
2692
58782098 2693extern void fancy_abort PARAMS ((const char *, int, const char *))
987009bf 2694 ATTRIBUTE_NORETURN;
6c9821b7 2695#if (GCC_VERSION >= 2007)
987009bf 2696#define abort() fancy_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
6c9821b7
PDM
2697#else
2698#define abort() fancy_abort (__FILE__, __LINE__, 0)
987009bf 2699#endif
This page took 2.004269 seconds and 5 git commands to generate.