]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/gcc/tree.h
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / gcc / tree.h
1 /* Front-end tree definitions for GNU compiler.
2    Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3    2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA.  */
21
22 #ifndef GCC_TREE_H
23 #define GCC_TREE_H
24
25 #include <sys/param.h>
26 #ifndef __PAST_END
27 # define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
28 #endif
29
30 #include "hashtab.h"
31 #include "machmode.h"
32 #include "input.h"
33 #include "statistics.h"
34 #include "vec.h"
35
36 /* Codes of tree nodes */
37
38 #define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
39
40 enum tree_code {
41 #include "tree.def"
42
43   LAST_AND_UNUSED_TREE_CODE     /* A convenient way to get a value for
44                                    NUM_TREE_CODES.  */
45 };
46
47 #undef DEFTREECODE
48
49 extern unsigned char tree_contains_struct[256][64];
50 #define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
51
52 /* Number of language-independent tree codes.  */
53 #define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE)
54
55 /* Tree code classes.  */
56
57 /* Each tree_code has an associated code class represented by a
58    TREE_CODE_CLASS.  */
59
60 enum tree_code_class {
61   tcc_exceptional, /* An exceptional code (fits no category).  */
62   tcc_constant,    /* A constant.  */
63   /* Order of tcc_type and tcc_declaration is important.  */
64   tcc_type,        /* A type object code.  */
65   tcc_declaration, /* A declaration (also serving as variable refs).  */
66   tcc_reference,   /* A reference to storage.  */
67   tcc_comparison,  /* A comparison expression.  */
68   tcc_unary,       /* A unary arithmetic expression.  */
69   tcc_binary,      /* A binary arithmetic expression.  */
70   tcc_statement,   /* A statement expression, which have side effects
71                       but usually no interesting value.  */
72   tcc_expression   /* Any other expression.  */
73 };
74
75 /* Each tree code class has an associated string representation.
76    These must correspond to the tree_code_class entries.  */
77
78 extern const char *const tree_code_class_strings[];
79
80 /* Returns the string representing CLASS.  */
81
82 #define TREE_CODE_CLASS_STRING(CLASS)\
83         tree_code_class_strings[(int) (CLASS)]
84
85 #define MAX_TREE_CODES 256
86 extern const enum tree_code_class tree_code_type[];
87 #define TREE_CODE_CLASS(CODE)   tree_code_type[(int) (CODE)]
88
89 /* Nonzero if CODE represents an exceptional code.  */
90
91 #define EXCEPTIONAL_CLASS_P(CODE)\
92         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_exceptional)
93
94 /* Nonzero if CODE represents a constant.  */
95
96 #define CONSTANT_CLASS_P(CODE)\
97         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_constant)
98
99 /* Nonzero if CODE represents a type.  */
100
101 #define TYPE_P(CODE)\
102         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_type)
103
104 /* Nonzero if CODE represents a declaration.  */
105
106 #define DECL_P(CODE)\
107         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration)
108
109 /* Nonzero if CODE represents a memory tag.  */
110
111 #define MTAG_P(CODE) \
112   (TREE_CODE (CODE) == STRUCT_FIELD_TAG         \
113    || TREE_CODE (CODE) == NAME_MEMORY_TAG       \
114    || TREE_CODE (CODE) == SYMBOL_MEMORY_TAG)
115
116
117 /* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL.  */
118
119 #define VAR_OR_FUNCTION_DECL_P(DECL)\
120   (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL)
121
122 /* Nonzero if CODE represents a INDIRECT_REF.  Keep these checks in
123    ascending code order.  */
124
125 #define INDIRECT_REF_P(CODE)\
126   (TREE_CODE (CODE) == INDIRECT_REF \
127    || TREE_CODE (CODE) == ALIGN_INDIRECT_REF \
128    || TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF)
129
130 /* Nonzero if CODE represents a reference.  */
131
132 #define REFERENCE_CLASS_P(CODE)\
133         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_reference)
134
135 /* Nonzero if CODE represents a comparison.  */
136
137 #define COMPARISON_CLASS_P(CODE)\
138         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_comparison)
139
140 /* Nonzero if CODE represents a unary arithmetic expression.  */
141
142 #define UNARY_CLASS_P(CODE)\
143         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_unary)
144
145 /* Nonzero if CODE represents a binary arithmetic expression.  */
146
147 #define BINARY_CLASS_P(CODE)\
148         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_binary)
149
150 /* Nonzero if CODE represents a statement expression.  */
151
152 #define STATEMENT_CLASS_P(CODE)\
153         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_statement)
154
155 /* Nonzero if CODE represents any other expression.  */
156
157 #define EXPRESSION_CLASS_P(CODE)\
158         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_expression)
159
160 /* Returns nonzero iff CODE represents a type or declaration.  */
161
162 #define IS_TYPE_OR_DECL_P(CODE)\
163         (TYPE_P (CODE) || DECL_P (CODE))
164
165 /* Returns nonzero iff CLASS is the tree-code class of an
166    expression.  */
167
168 #define IS_EXPR_CODE_CLASS(CLASS)\
169         ((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
170
171 /* Returns nonzero iff NODE is an expression of some kind.  */
172
173 #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
174
175 /* Returns nonzero iff NODE is an OpenMP directive.  */
176
177 #define OMP_DIRECTIVE_P(NODE)                           \
178     (TREE_CODE (NODE) == OMP_PARALLEL                   \
179      || TREE_CODE (NODE) == OMP_FOR                     \
180      || TREE_CODE (NODE) == OMP_SECTIONS                \
181      || TREE_CODE (NODE) == OMP_SINGLE                  \
182      || TREE_CODE (NODE) == OMP_SECTION                 \
183      || TREE_CODE (NODE) == OMP_MASTER                  \
184      || TREE_CODE (NODE) == OMP_ORDERED                 \
185      || TREE_CODE (NODE) == OMP_CRITICAL                \
186      || TREE_CODE (NODE) == OMP_RETURN                  \
187      || TREE_CODE (NODE) == OMP_CONTINUE)
188
189 /* Number of argument-words in each kind of tree-node.  */
190
191 extern const unsigned char tree_code_length[];
192 #define TREE_CODE_LENGTH(CODE)  tree_code_length[(int) (CODE)]
193
194 /* Names of tree components.  */
195
196 extern const char *const tree_code_name[];
197
198 /* A vectors of trees.  */
199 DEF_VEC_P(tree);
200 DEF_VEC_ALLOC_P(tree,gc);
201 DEF_VEC_ALLOC_P(tree,heap);
202
203 \f
204 /* Classify which part of the compiler has defined a given builtin function.
205    Note that we assume below that this is no more than two bits.  */
206 enum built_in_class
207 {
208   NOT_BUILT_IN = 0,
209   BUILT_IN_FRONTEND,
210   BUILT_IN_MD,
211   BUILT_IN_NORMAL
212 };
213
214 /* Names for the above.  */
215 extern const char *const built_in_class_names[4];
216
217 /* Codes that identify the various built in functions
218    so that expand_call can identify them quickly.  */
219
220 #define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
221 enum built_in_function
222 {
223 #include "builtins.def"
224
225   /* Complex division routines in libgcc.  These are done via builtins
226      because emit_library_call_value can't handle complex values.  */
227   BUILT_IN_COMPLEX_MUL_MIN,
228   BUILT_IN_COMPLEX_MUL_MAX
229     = BUILT_IN_COMPLEX_MUL_MIN
230       + MAX_MODE_COMPLEX_FLOAT
231       - MIN_MODE_COMPLEX_FLOAT,
232
233   BUILT_IN_COMPLEX_DIV_MIN,
234   BUILT_IN_COMPLEX_DIV_MAX
235     = BUILT_IN_COMPLEX_DIV_MIN
236       + MAX_MODE_COMPLEX_FLOAT
237       - MIN_MODE_COMPLEX_FLOAT,
238
239   /* Upper bound on non-language-specific builtins.  */
240   END_BUILTINS
241 };
242 #undef DEF_BUILTIN
243
244 /* Names for the above.  */
245 extern const char * built_in_names[(int) END_BUILTINS];
246
247 /* Helper macros for math builtins.  */
248
249 #define BUILTIN_EXP10_P(FN) \
250  ((FN) == BUILT_IN_EXP10 || (FN) == BUILT_IN_EXP10F || (FN) == BUILT_IN_EXP10L \
251   || (FN) == BUILT_IN_POW10 || (FN) == BUILT_IN_POW10F || (FN) == BUILT_IN_POW10L)
252
253 #define BUILTIN_EXPONENT_P(FN) (BUILTIN_EXP10_P (FN) \
254   || (FN) == BUILT_IN_EXP || (FN) == BUILT_IN_EXPF || (FN) == BUILT_IN_EXPL \
255   || (FN) == BUILT_IN_EXP2 || (FN) == BUILT_IN_EXP2F || (FN) == BUILT_IN_EXP2L)
256
257 #define BUILTIN_SQRT_P(FN) \
258  ((FN) == BUILT_IN_SQRT || (FN) == BUILT_IN_SQRTF || (FN) == BUILT_IN_SQRTL)
259
260 #define BUILTIN_CBRT_P(FN) \
261  ((FN) == BUILT_IN_CBRT || (FN) == BUILT_IN_CBRTF || (FN) == BUILT_IN_CBRTL)
262
263 #define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
264
265 #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
266 #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL
267
268 /* An array of _DECL trees for the above.  */
269 extern GTY(()) tree built_in_decls[(int) END_BUILTINS];
270 extern GTY(()) tree implicit_built_in_decls[(int) END_BUILTINS];
271 \f
272 /* In an OMP_CLAUSE node.  */
273
274 /* Number of operands and names for each clause.  */
275 extern unsigned const char omp_clause_num_ops[];
276 extern const char * const omp_clause_code_name[];
277
278 /* Clause codes.  Do not reorder, as this is used to index into the tables
279    omp_clause_num_ops and omp_clause_code_name.  */
280 enum omp_clause_code
281 {
282   /* Clause zero is special-cased inside the parser
283      (c_parser_omp_variable_list).  */
284   OMP_CLAUSE_ERROR = 0,
285
286   /* OpenMP clause: private (variable_list).  */
287   OMP_CLAUSE_PRIVATE,
288
289   /* OpenMP clause: shared (variable_list).  */
290   OMP_CLAUSE_SHARED,
291
292   /* OpenMP clause: firstprivate (variable_list).  */
293   OMP_CLAUSE_FIRSTPRIVATE,
294
295   /* OpenMP clause: lastprivate (variable_list).  */
296   OMP_CLAUSE_LASTPRIVATE,
297
298   /* OpenMP clause: reduction (operator:variable_list).
299      OMP_CLAUSE_REDUCTION_CODE: The tree_code of the operator.
300      Operand 1: OMP_CLAUSE_REDUCTION_INIT: Stmt-list to initialize the var.
301      Operand 2: OMP_CLAUSE_REDUCTION_MERGE: Stmt-list to merge private var
302                 into the shared one.
303      Operand 3: OMP_CLAUSE_REDUCTION_PLACEHOLDER: A dummy VAR_DECL
304                 placeholder used in OMP_CLAUSE_REDUCTION_MERGE.  */
305   OMP_CLAUSE_REDUCTION,
306
307   /* OpenMP clause: copyin (variable_list).  */
308   OMP_CLAUSE_COPYIN,
309
310   /* OpenMP clause: copyprivate (variable_list).  */
311   OMP_CLAUSE_COPYPRIVATE,
312
313   /* OpenMP clause: if (scalar-expression).  */
314   OMP_CLAUSE_IF,
315
316   /* OpenMP clause: num_threads (integer-expression).  */
317   OMP_CLAUSE_NUM_THREADS,
318
319   /* OpenMP clause: schedule.  */
320   OMP_CLAUSE_SCHEDULE,
321
322   /* OpenMP clause: nowait.  */
323   OMP_CLAUSE_NOWAIT,
324
325   /* OpenMP clause: ordered.  */
326   OMP_CLAUSE_ORDERED,
327
328   /* OpenMP clause: default.  */
329   OMP_CLAUSE_DEFAULT
330 };
331 \f
332 /* The definition of tree nodes fills the next several pages.  */
333
334 /* A tree node can represent a data type, a variable, an expression
335    or a statement.  Each node has a TREE_CODE which says what kind of
336    thing it represents.  Some common codes are:
337    INTEGER_TYPE -- represents a type of integers.
338    ARRAY_TYPE -- represents a type of pointer.
339    VAR_DECL -- represents a declared variable.
340    INTEGER_CST -- represents a constant integer value.
341    PLUS_EXPR -- represents a sum (an expression).
342
343    As for the contents of a tree node: there are some fields
344    that all nodes share.  Each TREE_CODE has various special-purpose
345    fields as well.  The fields of a node are never accessed directly,
346    always through accessor macros.  */
347
348 /* Every kind of tree node starts with this structure,
349    so all nodes have these fields.
350
351    See the accessor macros, defined below, for documentation of the
352    fields.  */
353 union tree_ann_d;
354
355 struct tree_common GTY(())
356 {
357   tree chain;
358   tree type;
359   union tree_ann_d *ann;
360
361   ENUM_BITFIELD(tree_code) code : 8;
362
363   unsigned side_effects_flag : 1;
364   unsigned constant_flag : 1;
365   unsigned addressable_flag : 1;
366   unsigned volatile_flag : 1;
367   unsigned readonly_flag : 1;
368   unsigned unsigned_flag : 1;
369   unsigned asm_written_flag: 1;
370   unsigned nowarning_flag : 1;
371
372   unsigned used_flag : 1;
373   unsigned nothrow_flag : 1;
374   unsigned static_flag : 1;
375   unsigned public_flag : 1;
376   unsigned private_flag : 1;
377   unsigned protected_flag : 1;
378   unsigned deprecated_flag : 1;
379   unsigned invariant_flag : 1;
380
381   unsigned lang_flag_0 : 1;
382   unsigned lang_flag_1 : 1;
383   unsigned lang_flag_2 : 1;
384   unsigned lang_flag_3 : 1;
385   unsigned lang_flag_4 : 1;
386   unsigned lang_flag_5 : 1;
387   unsigned lang_flag_6 : 1;
388   unsigned visited : 1;
389   /* APPLE LOCAL "unavailable" attribute (Radar 2809697) --ilr */
390   unsigned unavailable_flag : 1;
391 };
392
393 /* The following table lists the uses of each of the above flags and
394    for which types of nodes they are defined.  Note that expressions
395    include decls.
396
397    addressable_flag:
398
399        TREE_ADDRESSABLE in
400            VAR_DECL, FUNCTION_DECL, FIELD_DECL, CONSTRUCTOR, LABEL_DECL,
401            ..._TYPE, IDENTIFIER_NODE.
402            In a STMT_EXPR, it means we want the result of the enclosed
403            expression.
404        CALL_EXPR_TAILCALL in CALL_EXPR
405        CASE_LOW_SEEN in CASE_LABEL_EXPR
406
407    static_flag:
408
409        TREE_STATIC in
410            VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR
411        BINFO_VIRTUAL_P in
412            TREE_BINFO
413        TREE_CONSTANT_OVERFLOW in
414            INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
415        TREE_SYMBOL_REFERENCED in
416            IDENTIFIER_NODE
417        CLEANUP_EH_ONLY in
418            TARGET_EXPR, WITH_CLEANUP_EXPR
419        ASM_INPUT_P in
420            ASM_EXPR
421        EH_FILTER_MUST_NOT_THROW in EH_FILTER_EXPR
422        TYPE_REF_CAN_ALIAS_ALL in
423            POINTER_TYPE, REFERENCE_TYPE
424        CASE_HIGH_SEEN in CASE_LABEL_EXPR
425
426    public_flag:
427
428        TREE_OVERFLOW in
429            INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
430        TREE_PUBLIC in
431            VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE
432        ASM_VOLATILE_P in
433            ASM_EXPR
434        TYPE_CACHED_VALUES_P in
435           ..._TYPE
436        SAVE_EXPR_RESOLVED_P in
437           SAVE_EXPR
438        OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE in
439           OMP_CLAUSE_LASTPRIVATE
440        OMP_CLAUSE_PRIVATE_DEBUG in
441           OMP_CLAUSE_PRIVATE
442
443    private_flag:
444
445        TREE_PRIVATE in
446            ..._DECL
447        CALL_EXPR_RETURN_SLOT_OPT in
448            CALL_EXPR
449        DECL_BY_REFERENCE in
450            PARM_DECL, RESULT_DECL
451        OMP_RETURN_NOWAIT in
452            OMP_RETURN
453        OMP_SECTION_LAST in
454            OMP_SECTION
455        OMP_PARALLEL_COMBINED in
456            OMP_PARALLEL
457
458    protected_flag:
459
460        TREE_PROTECTED in
461            BLOCK
462            ..._DECL
463        CALL_FROM_THUNK_P in
464            CALL_EXPR
465
466    side_effects_flag:
467
468        TREE_SIDE_EFFECTS in
469            all expressions
470            all decls
471            all constants
472
473        FORCED_LABEL in
474            LABEL_DECL
475
476    volatile_flag:
477
478        TREE_THIS_VOLATILE in
479            all expressions
480        TYPE_VOLATILE in
481            ..._TYPE
482
483    readonly_flag:
484
485        TREE_READONLY in
486            all expressions
487        TYPE_READONLY in
488            ..._TYPE
489
490    constant_flag:
491
492        TREE_CONSTANT in
493            all expressions
494            all decls
495            all constants
496        TYPE_SIZES_GIMPLIFIED
497            ..._TYPE
498
499    unsigned_flag:
500
501        TYPE_UNSIGNED in
502            all types
503        DECL_UNSIGNED in
504            all decls
505        BIT_FIELD_REF_UNSIGNED in
506            BIT_FIELD_REF
507
508    asm_written_flag:
509
510        TREE_ASM_WRITTEN in
511            VAR_DECL, FUNCTION_DECL, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
512            BLOCK, SSA_NAME
513
514    used_flag:
515
516        TREE_USED in
517            expressions, IDENTIFIER_NODE
518
519    nothrow_flag:
520
521        TREE_NOTHROW in
522            CALL_EXPR, FUNCTION_DECL
523
524        TYPE_ALIGN_OK in
525            ..._TYPE
526
527        TREE_THIS_NOTRAP in
528           (ALIGN/MISALIGNED_)INDIRECT_REF, ARRAY_REF, ARRAY_RANGE_REF
529
530    deprecated_flag:
531
532         TREE_DEPRECATED in
533            ..._DECL
534
535         IDENTIFIER_TRANSPARENT_ALIAS in
536            IDENTIFIER_NODE
537
538    APPLE LOCAL begin "unavailable" attribute (Radar 2809697)
539    unavailable_flag:
540
541         TREE_UNAVAILABLE in
542            ..._DECL
543    APPLE LOCAL end "unavailable" attribute (Radar 2809697)
544
545    visited:
546
547         Used in tree traversals to mark visited nodes.
548
549    invariant_flag:
550
551         TREE_INVARIANT in
552             all expressions.
553
554    nowarning_flag:
555
556        TREE_NO_WARNING in
557            ... any expr or decl node
558 */
559 #undef DEFTREESTRUCT
560 #define DEFTREESTRUCT(ENUM, NAME) ENUM,
561 enum tree_node_structure_enum {
562 #include "treestruct.def"
563   LAST_TS_ENUM
564 };
565 #undef DEFTREESTRUCT
566
567 /* Define accessors for the fields that all tree nodes have
568    (though some fields are not used for all kinds of nodes).  */
569
570 /* The tree-code says what kind of node it is.
571    Codes are defined in tree.def.  */
572 #define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
573 #define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
574
575 /* When checking is enabled, errors will be generated if a tree node
576    is accessed incorrectly. The macros die with a fatal error.  */
577 #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
578
579 #define TREE_CHECK(T, CODE) __extension__                               \
580 ({  const tree __t = (T);                                               \
581     if (TREE_CODE (__t) != (CODE))                                      \
582       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
583                          (CODE), 0);                                    \
584     __t; })
585
586 #define TREE_NOT_CHECK(T, CODE) __extension__                           \
587 ({  const tree __t = (T);                                               \
588     if (TREE_CODE (__t) == (CODE))                                      \
589       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,     \
590                              (CODE), 0);                                \
591     __t; })
592
593 #define TREE_CHECK2(T, CODE1, CODE2) __extension__                      \
594 ({  const tree __t = (T);                                               \
595     if (TREE_CODE (__t) != (CODE1)                                      \
596         && TREE_CODE (__t) != (CODE2))                                  \
597       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
598                          (CODE1), (CODE2), 0);                          \
599     __t; })
600
601 #define TREE_NOT_CHECK2(T, CODE1, CODE2) __extension__                  \
602 ({  const tree __t = (T);                                               \
603     if (TREE_CODE (__t) == (CODE1)                                      \
604         || TREE_CODE (__t) == (CODE2))                                  \
605       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,     \
606                              (CODE1), (CODE2), 0);                      \
607     __t; })
608
609 #define TREE_CHECK3(T, CODE1, CODE2, CODE3) __extension__               \
610 ({  const tree __t = (T);                                               \
611     if (TREE_CODE (__t) != (CODE1)                                      \
612         && TREE_CODE (__t) != (CODE2)                                   \
613         && TREE_CODE (__t) != (CODE3))                                  \
614       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
615                              (CODE1), (CODE2), (CODE3), 0);             \
616     __t; })
617
618 #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) __extension__           \
619 ({  const tree __t = (T);                                               \
620     if (TREE_CODE (__t) == (CODE1)                                      \
621         || TREE_CODE (__t) == (CODE2)                                   \
622         || TREE_CODE (__t) == (CODE3))                                  \
623       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,     \
624                              (CODE1), (CODE2), (CODE3), 0);             \
625     __t; })
626
627 #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__        \
628 ({  const tree __t = (T);                                               \
629     if (TREE_CODE (__t) != (CODE1)                                      \
630         && TREE_CODE (__t) != (CODE2)                                   \
631         && TREE_CODE (__t) != (CODE3)                                   \
632         && TREE_CODE (__t) != (CODE4))                                  \
633       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
634                              (CODE1), (CODE2), (CODE3), (CODE4), 0);    \
635     __t; })
636
637 #define NON_TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__    \
638 ({  const tree __t = (T);                                               \
639     if (TREE_CODE (__t) == (CODE1)                                      \
640         || TREE_CODE (__t) == (CODE2)                                   \
641         || TREE_CODE (__t) == (CODE3)                                   \
642         || TREE_CODE (__t) == (CODE4))                                  \
643       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,     \
644                              (CODE1), (CODE2), (CODE3), (CODE4), 0);    \
645     __t; })
646
647 #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__ \
648 ({  const tree __t = (T);                                               \
649     if (TREE_CODE (__t) != (CODE1)                                      \
650         && TREE_CODE (__t) != (CODE2)                                   \
651         && TREE_CODE (__t) != (CODE3)                                   \
652         && TREE_CODE (__t) != (CODE4)                                   \
653         && TREE_CODE (__t) != (CODE5))                                  \
654       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
655                              (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
656     __t; })
657
658 #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__ \
659 ({  const tree __t = (T);                                               \
660     if (TREE_CODE (__t) == (CODE1)                                      \
661         || TREE_CODE (__t) == (CODE2)                                   \
662         || TREE_CODE (__t) == (CODE3)                                   \
663         || TREE_CODE (__t) == (CODE4)                                   \
664         || TREE_CODE (__t) == (CODE5))                                  \
665       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,     \
666                              (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
667     __t; })
668
669 #define CONTAINS_STRUCT_CHECK(T, STRUCT) __extension__                  \
670 ({  const tree __t = (T);                                               \
671   if (tree_contains_struct[TREE_CODE(__t)][(STRUCT)] != 1)              \
672       tree_contains_struct_check_failed (__t, (STRUCT), __FILE__, __LINE__,     \
673                                __FUNCTION__);                           \
674     __t; })
675
676 #define TREE_CLASS_CHECK(T, CLASS) __extension__                        \
677 ({  const tree __t = (T);                                               \
678     if (TREE_CODE_CLASS (TREE_CODE(__t)) != (CLASS))                    \
679       tree_class_check_failed (__t, (CLASS), __FILE__, __LINE__,        \
680                                __FUNCTION__);                           \
681     __t; })
682
683 #define TREE_RANGE_CHECK(T, CODE1, CODE2) __extension__                 \
684 ({  const tree __t = (T);                                               \
685     if (TREE_CODE (__t) < (CODE1) || TREE_CODE (__t) > (CODE2))         \
686       tree_range_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,   \
687                                (CODE1), (CODE2));                       \
688     __t; })
689
690 #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) __extension__                 \
691 ({  const tree __t = (T);                                               \
692     if (TREE_CODE (__t) != OMP_CLAUSE)                                  \
693       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
694                          OMP_CLAUSE, 0);                                \
695     if (__t->omp_clause.code != (CODE))                                 \
696       omp_clause_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,   \
697                                (CODE));                                 \
698     __t; })
699
700 #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) __extension__           \
701 ({  const tree __t = (T);                                               \
702     if (TREE_CODE (__t) != OMP_CLAUSE)                                  \
703       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
704                          OMP_CLAUSE, 0);                                \
705     if ((int) __t->omp_clause.code < (int) (CODE1)                      \
706         || (int) __t->omp_clause.code > (int) (CODE2))                  \
707       omp_clause_range_check_failed (__t, __FILE__, __LINE__,           \
708                                      __FUNCTION__, (CODE1), (CODE2));   \
709     __t; })
710
711 /* These checks have to be special cased.  */
712 #define EXPR_CHECK(T) __extension__                                     \
713 ({  const tree __t = (T);                                               \
714     char const __c = TREE_CODE_CLASS (TREE_CODE (__t));                 \
715     if (!IS_EXPR_CODE_CLASS (__c))                                      \
716       tree_class_check_failed (__t, tcc_expression, __FILE__, __LINE__, \
717                                __FUNCTION__);                           \
718     __t; })
719
720 /* These checks have to be special cased.  */
721 #define NON_TYPE_CHECK(T) __extension__                                 \
722 ({  const tree __t = (T);                                               \
723     if (TYPE_P (__t))                                                   \
724       tree_not_class_check_failed (__t, tcc_type, __FILE__, __LINE__,   \
725                                    __FUNCTION__);                       \
726     __t; })
727
728 #define TREE_VEC_ELT_CHECK(T, I) __extension__                          \
729 (*({const tree __t = (T);                                               \
730     const int __i = (I);                                                \
731     if (TREE_CODE (__t) != TREE_VEC)                                    \
732       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
733                          TREE_VEC, 0);                                  \
734     if (__i < 0 || __i >= __t->vec.length)                              \
735       tree_vec_elt_check_failed (__i, __t->vec.length,                  \
736                                  __FILE__, __LINE__, __FUNCTION__);     \
737     &__t->vec.a[__i]; }))
738
739 #define PHI_NODE_ELT_CHECK(t, i) __extension__                          \
740 (*({const tree __t = t;                                                 \
741     const int __i = (i);                                                \
742     if (TREE_CODE (__t) != PHI_NODE)                                    \
743       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
744                          PHI_NODE, 0);                                  \
745     if (__i < 0 || __i >= __t->phi.capacity)                            \
746       phi_node_elt_check_failed (__i, __t->phi.num_args,                \
747                                  __FILE__, __LINE__, __FUNCTION__);     \
748     &__t->phi.a[__i]; }))
749
750 #define OMP_CLAUSE_ELT_CHECK(t, i) __extension__                        \
751 (*({const tree __t = t;                                                 \
752     const int __i = (i);                                                \
753     if (TREE_CODE (__t) != OMP_CLAUSE)                                  \
754       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,         \
755                          OMP_CLAUSE, 0);                                \
756     if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])    \
757       omp_clause_operand_check_failed (__i, __t, __FILE__, __LINE__,    \
758                                        __FUNCTION__);                   \
759     &__t->omp_clause.ops[__i]; }))
760
761 /* Special checks for TREE_OPERANDs.  */
762 #define TREE_OPERAND_CHECK(T, I) __extension__                          \
763 (*({const tree __t = EXPR_CHECK (T);                                    \
764     const int __i = (I);                                                \
765     if (__i < 0 || __i >= TREE_CODE_LENGTH (TREE_CODE (__t)))           \
766       tree_operand_check_failed (__i, TREE_CODE (__t),                  \
767                                  __FILE__, __LINE__, __FUNCTION__);     \
768     &__t->exp.operands[__i]; }))
769
770 #define TREE_OPERAND_CHECK_CODE(T, CODE, I) __extension__               \
771 (*({const tree __t = (T);                                               \
772     const int __i = (I);                                                \
773     if (TREE_CODE (__t) != CODE)                                        \
774       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0);\
775     if (__i < 0 || __i >= TREE_CODE_LENGTH (CODE))                      \
776       tree_operand_check_failed (__i, (CODE),                           \
777                                  __FILE__, __LINE__, __FUNCTION__);     \
778     &__t->exp.operands[__i]; }))
779
780 #define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__                \
781 (*(rtx *)                                                               \
782  ({const tree __t = (T);                                                \
783     const int __i = (I);                                                \
784     if (TREE_CODE (__t) != (CODE))                                      \
785       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0); \
786     if (__i < 0 || __i >= TREE_CODE_LENGTH ((CODE)))                    \
787       tree_operand_check_failed (__i, (CODE),                           \
788                                  __FILE__, __LINE__, __FUNCTION__);     \
789     &__t->exp.operands[__i]; }))
790
791 extern void tree_contains_struct_check_failed (const tree,
792                                                const enum tree_node_structure_enum,
793                                                const char *, int, const char *)
794   ATTRIBUTE_NORETURN;
795
796 extern void tree_check_failed (const tree, const char *, int, const char *,
797                                ...) ATTRIBUTE_NORETURN;
798 extern void tree_not_check_failed (const tree, const char *, int, const char *,
799                                    ...) ATTRIBUTE_NORETURN;
800 extern void tree_class_check_failed (const tree, const enum tree_code_class,
801                                      const char *, int, const char *)
802     ATTRIBUTE_NORETURN;
803 extern void tree_range_check_failed (const tree, const char *, int,
804                                      const char *, enum tree_code,
805                                      enum tree_code);
806 extern void tree_not_class_check_failed (const tree,
807                                          const enum tree_code_class,
808                                          const char *, int, const char *)
809     ATTRIBUTE_NORETURN;
810 extern void tree_vec_elt_check_failed (int, int, const char *,
811                                        int, const char *)
812     ATTRIBUTE_NORETURN;
813 extern void phi_node_elt_check_failed (int, int, const char *,
814                                        int, const char *)
815     ATTRIBUTE_NORETURN;
816 extern void tree_operand_check_failed (int, enum tree_code,
817                                        const char *, int, const char *)
818     ATTRIBUTE_NORETURN;
819 extern void omp_clause_check_failed (const tree, const char *, int,
820                                      const char *, enum omp_clause_code)
821     ATTRIBUTE_NORETURN;
822 extern void omp_clause_operand_check_failed (int, tree, const char *,
823                                              int, const char *)
824     ATTRIBUTE_NORETURN;
825 extern void omp_clause_range_check_failed (const tree, const char *, int,
826                                const char *, enum omp_clause_code,
827                                enum omp_clause_code)
828     ATTRIBUTE_NORETURN;
829
830 #else /* not ENABLE_TREE_CHECKING, or not gcc */
831
832 #define CONTAINS_STRUCT_CHECK(T, ENUM)          (T)
833 #define TREE_CHECK(T, CODE)                     (T)
834 #define TREE_NOT_CHECK(T, CODE)                 (T)
835 #define TREE_CHECK2(T, CODE1, CODE2)            (T)
836 #define TREE_NOT_CHECK2(T, CODE1, CODE2)        (T)
837 #define TREE_CHECK3(T, CODE1, CODE2, CODE3)     (T)
838 #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) (T)
839 #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
840 #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
841 #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
842 #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
843 #define TREE_CLASS_CHECK(T, CODE)               (T)
844 #define TREE_RANGE_CHECK(T, CODE1, CODE2)       (T)
845 #define EXPR_CHECK(T)                           (T)
846 #define NON_TYPE_CHECK(T)                       (T)
847 #define TREE_VEC_ELT_CHECK(T, I)                __PAST_END((T)->vec.a, I)
848 #define TREE_OPERAND_CHECK(T, I)                __PAST_END((T)->exp.operands, I)
849 #define TREE_OPERAND_CHECK_CODE(T, CODE, I)     __PAST_END((T)->exp.operands, I)
850 #define TREE_RTL_OPERAND_CHECK(T, CODE, I)  (*(rtx *) &((T)->exp.operands[I]))
851 #define PHI_NODE_ELT_CHECK(T, i)        ((T)->phi.a[i])
852 #define OMP_CLAUSE_ELT_CHECK(T, i)              __PAST_END((T)->omp_clause.ops, i)
853 #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
854 #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE)       (T)
855
856 #endif
857
858 #define TREE_BLOCK(NODE)                (EXPR_CHECK (NODE)->exp.block)
859
860 #include "tree-check.h"
861
862 #define TYPE_CHECK(T)           TREE_CLASS_CHECK (T, tcc_type)
863 #define DECL_MINIMAL_CHECK(T)   CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
864 #define TREE_MEMORY_TAG_CHECK(T)       CONTAINS_STRUCT_CHECK (T, TS_MEMORY_TAG)
865 #define DECL_COMMON_CHECK(T)    CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
866 #define DECL_WRTL_CHECK(T)      CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
867 #define DECL_WITH_VIS_CHECK(T)  CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
868 #define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON)
869 #define CST_CHECK(T)            TREE_CLASS_CHECK (T, tcc_constant)
870 #define STMT_CHECK(T)           TREE_CLASS_CHECK (T, tcc_statement)
871 #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
872 /* APPLE LOCAL blocks 5862465 */
873 #define PTR_OR_REF_CHECK(T)     TREE_CHECK3 (T, POINTER_TYPE, REFERENCE_TYPE, BLOCK_POINTER_TYPE)
874
875 #define RECORD_OR_UNION_CHECK(T)        \
876   TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
877 #define NOT_RECORD_OR_UNION_CHECK(T) \
878   TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
879
880 #define NUMERICAL_TYPE_CHECK(T)                                 \
881   TREE_CHECK4 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE)
882
883 /* In all nodes that are expressions, this is the data type of the expression.
884    In POINTER_TYPE nodes, this is the type that the pointer points to.
885    In ARRAY_TYPE nodes, this is the type of the elements.
886    In VECTOR_TYPE nodes, this is the type of the elements.  */
887 #define TREE_TYPE(NODE) ((NODE)->common.type)
888
889 /* Here is how primitive or already-canonicalized types' hash codes
890    are made.  */
891 #define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
892
893 /* A simple hash function for an arbitrary tree node.  This must not be
894    used in hash tables which are saved to a PCH.  */
895 #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
896
897 /* Nodes are chained together for many purposes.
898    Types are chained together to record them for being output to the debugger
899    (see the function `chain_type').
900    Decls in the same scope are chained together to record the contents
901    of the scope.
902    Statement nodes for successive statements used to be chained together.
903    Often lists of things are represented by TREE_LIST nodes that
904    are chained together.  */
905
906 #define TREE_CHAIN(NODE) ((NODE)->common.chain)
907
908 /* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs
909    that don't change the machine mode.  */
910
911 #define STRIP_NOPS(EXP)                                         \
912   while ((TREE_CODE (EXP) == NOP_EXPR                           \
913           || TREE_CODE (EXP) == CONVERT_EXPR                    \
914           || TREE_CODE (EXP) == NON_LVALUE_EXPR)                \
915          && TREE_OPERAND (EXP, 0) != error_mark_node            \
916          && (TYPE_MODE (TREE_TYPE (EXP))                        \
917              == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
918     (EXP) = TREE_OPERAND (EXP, 0)
919
920 /* Like STRIP_NOPS, but don't let the signedness change either.  */
921
922 #define STRIP_SIGN_NOPS(EXP) \
923   while ((TREE_CODE (EXP) == NOP_EXPR                           \
924           || TREE_CODE (EXP) == CONVERT_EXPR                    \
925           || TREE_CODE (EXP) == NON_LVALUE_EXPR)                \
926          && TREE_OPERAND (EXP, 0) != error_mark_node            \
927          && (TYPE_MODE (TREE_TYPE (EXP))                        \
928              == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))  \
929          && (TYPE_UNSIGNED (TREE_TYPE (EXP))                    \
930              == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
931     (EXP) = TREE_OPERAND (EXP, 0)
932
933 /* Like STRIP_NOPS, but don't alter the TREE_TYPE either.  */
934
935 #define STRIP_TYPE_NOPS(EXP) \
936   while ((TREE_CODE (EXP) == NOP_EXPR                           \
937           || TREE_CODE (EXP) == CONVERT_EXPR                    \
938           || TREE_CODE (EXP) == NON_LVALUE_EXPR)                \
939          && TREE_OPERAND (EXP, 0) != error_mark_node            \
940          && (TREE_TYPE (EXP)                                    \
941              == TREE_TYPE (TREE_OPERAND (EXP, 0))))             \
942     (EXP) = TREE_OPERAND (EXP, 0)
943
944 /* Remove unnecessary type conversions according to
945    tree_ssa_useless_type_conversion.  */
946
947 #define STRIP_USELESS_TYPE_CONVERSION(EXP)                              \
948       while (tree_ssa_useless_type_conversion (EXP))                    \
949         EXP = TREE_OPERAND (EXP, 0)
950
951 /* Nonzero if TYPE represents an integral type.  Note that we do not
952    include COMPLEX types here.  Keep these checks in ascending code
953    order.  */
954
955 #define INTEGRAL_TYPE_P(TYPE)  \
956   (TREE_CODE (TYPE) == ENUMERAL_TYPE  \
957    || TREE_CODE (TYPE) == BOOLEAN_TYPE \
958    || TREE_CODE (TYPE) == INTEGER_TYPE)
959
960 /* Nonzero if TYPE represents a scalar floating-point type.  */
961
962 #define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
963
964 /* Nonzero if TYPE represents a complex floating-point type.  */
965
966 #define COMPLEX_FLOAT_TYPE_P(TYPE)      \
967   (TREE_CODE (TYPE) == COMPLEX_TYPE     \
968    && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
969
970 /* Nonzero if TYPE represents a vector floating-point type.  */
971
972 #define VECTOR_FLOAT_TYPE_P(TYPE)       \
973   (TREE_CODE (TYPE) == VECTOR_TYPE      \
974    && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
975
976 /* Nonzero if TYPE represents a floating-point type, including complex
977    and vector floating-point types.  The vector and complex check does
978    not use the previous two macros to enable early folding.  */
979
980 #define FLOAT_TYPE_P(TYPE)                      \
981   (SCALAR_FLOAT_TYPE_P (TYPE)                   \
982    || ((TREE_CODE (TYPE) == COMPLEX_TYPE        \
983         || TREE_CODE (TYPE) == VECTOR_TYPE)     \
984        && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE))))
985
986 /* Nonzero if TYPE represents a decimal floating-point type.  */
987 #define DECIMAL_FLOAT_TYPE_P(TYPE)              \
988   (SCALAR_FLOAT_TYPE_P (TYPE)                   \
989    && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TYPE)))
990
991 /* Nonzero if TYPE represents an aggregate (multi-component) type.
992    Keep these checks in ascending code order.  */
993
994 #define AGGREGATE_TYPE_P(TYPE) \
995   (TREE_CODE (TYPE) == ARRAY_TYPE || TREE_CODE (TYPE) == RECORD_TYPE \
996    || TREE_CODE (TYPE) == UNION_TYPE || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
997
998 /* Nonzero if TYPE represents a pointer or reference type.
999    (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
1000    ascending code order.  */
1001
1002 /* APPLE LOCAL begin blocks 5862465 */
1003 #define POINTER_TYPE_P(TYPE) \
1004   (TREE_CODE (TYPE) == POINTER_TYPE \
1005    || TREE_CODE (TYPE) == REFERENCE_TYPE \
1006    || TREE_CODE (TYPE) == BLOCK_POINTER_TYPE)
1007 /* APPLE LOCAL end blocks 5862465 */
1008
1009 /* Nonzero if this type is a complete type.  */
1010 #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
1011
1012 /* Nonzero if this type is the (possibly qualified) void type.  */
1013 #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
1014
1015 /* Nonzero if this type is complete or is cv void.  */
1016 #define COMPLETE_OR_VOID_TYPE_P(NODE) \
1017   (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE))
1018
1019 /* Nonzero if this type is complete or is an array with unspecified bound.  */
1020 #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \
1021   (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : (NODE)))
1022
1023 \f
1024 /* Define many boolean fields that all tree nodes have.  */
1025
1026 /* In VAR_DECL nodes, nonzero means address of this is needed.
1027    So it cannot be in a register.
1028    In a FUNCTION_DECL, nonzero means its address is needed.
1029    So it must be compiled even if it is an inline function.
1030    In a FIELD_DECL node, it means that the programmer is permitted to
1031    construct the address of this field.  This is used for aliasing
1032    purposes: see record_component_aliases.
1033    In CONSTRUCTOR nodes, it means object constructed must be in memory.
1034    In LABEL_DECL nodes, it means a goto for this label has been seen
1035    from a place outside all binding contours that restore stack levels.
1036    In ..._TYPE nodes, it means that objects of this type must
1037    be fully addressable.  This means that pieces of this
1038    object cannot go into register parameters, for example.
1039    In IDENTIFIER_NODEs, this means that some extern decl for this name
1040    had its address taken.  That matters for inline functions.  */
1041 #define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_flag)
1042
1043 /* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
1044    exit of a function.  Calls for which this is true are candidates for tail
1045    call optimizations.  */
1046 #define CALL_EXPR_TAILCALL(NODE) (CALL_EXPR_CHECK(NODE)->common.addressable_flag)
1047
1048 /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
1049    CASE_LOW operand has been processed.  */
1050 #define CASE_LOW_SEEN(NODE) \
1051   (CASE_LABEL_EXPR_CHECK (NODE)->common.addressable_flag)
1052
1053 /* In a VAR_DECL, nonzero means allocate static storage.
1054    In a FUNCTION_DECL, nonzero if function has been defined.
1055    In a CONSTRUCTOR, nonzero means allocate static storage.
1056
1057    ??? This is also used in lots of other nodes in unclear ways which
1058    should be cleaned up some day.  */
1059 #define TREE_STATIC(NODE) ((NODE)->common.static_flag)
1060
1061 /* In a TARGET_EXPR, WITH_CLEANUP_EXPR, means that the pertinent cleanup
1062    should only be executed if an exception is thrown, not on normal exit
1063    of its scope.  */
1064 #define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
1065
1066 /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
1067    CASE_HIGH operand has been processed.  */
1068 #define CASE_HIGH_SEEN(NODE) \
1069   (CASE_LABEL_EXPR_CHECK (NODE)->common.static_flag)
1070
1071 /* In an expr node (usually a conversion) this means the node was made
1072    implicitly and should not lead to any sort of warning.  In a decl node,
1073    warnings concerning the decl should be suppressed.  This is used at
1074    least for used-before-set warnings, and it set after one warning is
1075    emitted.  */
1076 #define TREE_NO_WARNING(NODE) ((NODE)->common.nowarning_flag)
1077
1078 /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST this means
1079    there was an overflow in folding.  This is distinct from
1080    TREE_OVERFLOW because ANSI C requires a diagnostic when overflows
1081    occur in constant expressions.  */
1082 #define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->common.static_flag)
1083
1084 /* In an IDENTIFIER_NODE, this means that assemble_name was called with
1085    this string as an argument.  */
1086 #define TREE_SYMBOL_REFERENCED(NODE) \
1087   (IDENTIFIER_NODE_CHECK (NODE)->common.static_flag)
1088
1089 /* Nonzero in a pointer or reference type means the data pointed to
1090    by this type can alias anything.  */
1091 #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
1092   (PTR_OR_REF_CHECK (NODE)->common.static_flag)
1093
1094 /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
1095    there was an overflow in folding, and no warning has been issued
1096    for this subexpression.  TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
1097    but not vice versa.  */
1098
1099 #define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.public_flag)
1100
1101 /* TREE_OVERFLOW can only be true for EXPR of CONSTANT_CLASS_P. */
1102
1103 #define TREE_OVERFLOW_P(EXPR) \
1104   (CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
1105
1106 /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
1107    nonzero means name is to be accessible from outside this module.
1108    In an IDENTIFIER_NODE, nonzero means an external declaration
1109    accessible from outside this module was previously seen
1110    for this name in an inner scope.  */
1111 #define TREE_PUBLIC(NODE) ((NODE)->common.public_flag)
1112
1113 /* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
1114    of cached values, or is something else.  */
1115 #define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->common.public_flag)
1116
1117 /* In a SAVE_EXPR, indicates that the original expression has already
1118    been substituted with a VAR_DECL that contains the value.  */
1119 #define SAVE_EXPR_RESOLVED_P(NODE) \
1120   (TREE_CHECK (NODE, SAVE_EXPR)->common.public_flag)
1121
1122 /* In any expression, decl, or constant, nonzero means it has side effects or
1123    reevaluation of the whole expression could produce a different value.
1124    This is set if any subexpression is a function call, a side effect or a
1125    reference to a volatile variable.  In a ..._DECL, this is set only if the
1126    declaration said `volatile'.  This will never be set for a constant.  */
1127 #define TREE_SIDE_EFFECTS(NODE) \
1128   (NON_TYPE_CHECK (NODE)->common.side_effects_flag)
1129
1130 /* In a LABEL_DECL, nonzero means this label had its address taken
1131    and therefore can never be deleted and is a jump target for
1132    computed gotos.  */
1133 #define FORCED_LABEL(NODE) ((NODE)->common.side_effects_flag)
1134
1135 /* Nonzero means this expression is volatile in the C sense:
1136    its address should be of type `volatile WHATEVER *'.
1137    In other words, the declared item is volatile qualified.
1138    This is used in _DECL nodes and _REF nodes.
1139    On a FUNCTION_DECL node, this means the function does not
1140    return normally.  This is the same effect as setting
1141    the attribute noreturn on the function in C.
1142
1143    In a ..._TYPE node, means this type is volatile-qualified.
1144    But use TYPE_VOLATILE instead of this macro when the node is a type,
1145    because eventually we may make that a different bit.
1146
1147    If this bit is set in an expression, so is TREE_SIDE_EFFECTS.  */
1148 #define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag)
1149
1150 /* Nonzero means this node will not trap.  In an INDIRECT_REF, means
1151    accessing the memory pointed to won't generate a trap.  However,
1152    this only applies to an object when used appropriately: it doesn't
1153    mean that writing a READONLY mem won't trap. Similarly for
1154    ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF.
1155
1156    In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
1157    (or slice of the array) always belongs to the range of the array.
1158    I.e. that the access will not trap, provided that the access to
1159    the base to the array will not trap.  */
1160 #define TREE_THIS_NOTRAP(NODE) ((NODE)->common.nothrow_flag)
1161
1162 /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
1163    nonzero means it may not be the lhs of an assignment.  */
1164 #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->common.readonly_flag)
1165
1166 /* Nonzero if NODE is a _DECL with TREE_READONLY set.  */
1167 #define TREE_READONLY_DECL_P(NODE)\
1168         (DECL_P (NODE) && TREE_READONLY (NODE))
1169
1170 /* Value of expression is constant.  Always on in all ..._CST nodes.  May
1171    also appear in an expression or decl where the value is constant.  */
1172 #define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->common.constant_flag)
1173
1174 /* Nonzero if NODE, a type, has had its sizes gimplified.  */
1175 #define TYPE_SIZES_GIMPLIFIED(NODE) (TYPE_CHECK (NODE)->common.constant_flag)
1176
1177 /* In a decl (most significantly a FIELD_DECL), means an unsigned field.  */
1178 #define DECL_UNSIGNED(NODE) (DECL_COMMON_CHECK (NODE)->common.unsigned_flag)
1179
1180 /* In a BIT_FIELD_REF, means the bitfield is to be interpreted as unsigned.  */
1181 #define BIT_FIELD_REF_UNSIGNED(NODE) \
1182   (BIT_FIELD_REF_CHECK (NODE)->common.unsigned_flag)
1183
1184 /* In integral and pointer types, means an unsigned type.  */
1185 #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)
1186
1187 /* Nonzero in a VAR_DECL means assembler code has been written.
1188    Nonzero in a FUNCTION_DECL means that the function has been compiled.
1189    This is interesting in an inline function, since it might not need
1190    to be compiled separately.
1191    Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE
1192    if the sdb debugging info for the type has been written.
1193    In a BLOCK node, nonzero if reorder_blocks has already seen this block.
1194    In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
1195    PHI node.  */
1196 #define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag)
1197
1198 /* Nonzero in a _DECL if the name is used in its scope.
1199    Nonzero in an expr node means inhibit warning if value is unused.
1200    In IDENTIFIER_NODEs, this means that some extern decl for this name
1201    was used.
1202    In a BLOCK, this means that the block contains variables that are used.  */
1203 #define TREE_USED(NODE) ((NODE)->common.used_flag)
1204
1205 /* In a FUNCTION_DECL, nonzero means a call to the function cannot throw
1206    an exception.  In a CALL_EXPR, nonzero means the call cannot throw.  */
1207 #define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag)
1208
1209 /* In a CALL_EXPR, means that it's safe to use the target of the call
1210    expansion as the return slot for a call that returns in memory.  */
1211 #define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->common.private_flag)
1212
1213 /* In a RESULT_DECL or PARM_DECL, means that it is passed by invisible
1214    reference (and the TREE_TYPE is a pointer to the true type).  */
1215 #define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->common.private_flag)
1216
1217 /* In a CALL_EXPR, means that the call is the jump from a thunk to the
1218    thunked-to function.  */
1219 #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->common.protected_flag)
1220
1221 /* In a type, nonzero means that all objects of the type are guaranteed by the
1222    language or front-end to be properly aligned, so we can indicate that a MEM
1223    of this type is aligned at least to the alignment of the type, even if it
1224    doesn't appear that it is.  We see this, for example, in object-oriented
1225    languages where a tag field may show this is an object of a more-aligned
1226    variant of the more generic type.
1227
1228    In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
1229    freelist.  */
1230 #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->common.nothrow_flag)
1231
1232 /* Used in classes in C++.  */
1233 #define TREE_PRIVATE(NODE) ((NODE)->common.private_flag)
1234 /* Used in classes in C++.
1235    In a BLOCK node, this is BLOCK_HANDLER_BLOCK.  */
1236 #define TREE_PROTECTED(NODE) ((NODE)->common.protected_flag)
1237
1238 /* Nonzero in a _DECL if the use of the name is defined as a
1239    deprecated feature by __attribute__((deprecated)).  */
1240 #define TREE_DEPRECATED(NODE) \
1241   ((NODE)->common.deprecated_flag)
1242
1243 /* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) */
1244 /* Nonzero in a IDENTIFIER_NODE if the use of the name is defined as a
1245    unavailable feature by __attribute__((unavailable)).  */
1246 #define TREE_UNAVAILABLE(NODE) ((NODE)->common.unavailable_flag)
1247 /* APPLE LOCAL end "unavailable" attribute (Radar 2809697) */
1248
1249 /* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
1250    uses are to be substituted for uses of the TREE_CHAINed identifier.  */
1251 #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
1252   (IDENTIFIER_NODE_CHECK (NODE)->common.deprecated_flag)
1253
1254 /* Value of expression is function invariant.  A strict subset of
1255    TREE_CONSTANT, such an expression is constant over any one function
1256    invocation, though not across different invocations.  May appear in
1257    any expression node.  */
1258 #define TREE_INVARIANT(NODE) ((NODE)->common.invariant_flag)
1259
1260 /* These flags are available for each language front end to use internally.  */
1261 #define TREE_LANG_FLAG_0(NODE) ((NODE)->common.lang_flag_0)
1262 #define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1)
1263 #define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2)
1264 #define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3)
1265 #define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
1266 #define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5)
1267 #define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6)
1268 \f
1269 /* Define additional fields and accessors for nodes representing constants.  */
1270
1271 /* In an INTEGER_CST node.  These two together make a 2-word integer.
1272    If the data type is signed, the value is sign-extended to 2 words
1273    even though not all of them may really be in use.
1274    In an unsigned constant shorter than 2 words, the extra bits are 0.  */
1275 #define TREE_INT_CST(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst)
1276 #define TREE_INT_CST_LOW(NODE) (TREE_INT_CST (NODE).low)
1277 #define TREE_INT_CST_HIGH(NODE) (TREE_INT_CST (NODE).high)
1278
1279 #define INT_CST_LT(A, B)                                \
1280   (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B)        \
1281    || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B)   \
1282        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
1283
1284 #define INT_CST_LT_UNSIGNED(A, B)                               \
1285   (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A)              \
1286     < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))           \
1287    || (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A)          \
1288         == (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))      \
1289        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
1290
1291 struct tree_int_cst GTY(())
1292 {
1293   struct tree_common common;
1294   double_int int_cst;
1295 };
1296
1297 /* In a REAL_CST node.  struct real_value is an opaque entity, with
1298    manipulators defined in real.h.  We don't want tree.h depending on
1299    real.h and transitively on tm.h.  */
1300 struct real_value;
1301
1302 #define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
1303 #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
1304
1305 struct tree_real_cst GTY(())
1306 {
1307   struct tree_common common;
1308   struct real_value * real_cst_ptr;
1309 };
1310
1311 /* In a STRING_CST */
1312 #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
1313 #define TREE_STRING_POINTER(NODE) \
1314   ((const char *)(STRING_CST_CHECK (NODE)->string.str))
1315
1316 struct tree_string GTY(())
1317 {
1318   struct tree_common common;
1319   int length;
1320   char str[1];
1321 };
1322
1323 /* In a COMPLEX_CST node.  */
1324 #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
1325 #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
1326
1327 struct tree_complex GTY(())
1328 {
1329   struct tree_common common;
1330   tree real;
1331   tree imag;
1332 };
1333
1334 /* In a VECTOR_CST node.  */
1335 #define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elements)
1336
1337 struct tree_vector GTY(())
1338 {
1339   struct tree_common common;
1340   tree elements;
1341 };
1342 \f
1343 #include "symtab.h"
1344
1345 /* Define fields and accessors for some special-purpose tree nodes.  */
1346
1347 #define IDENTIFIER_LENGTH(NODE) \
1348   (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len)
1349 #define IDENTIFIER_POINTER(NODE) \
1350   ((const char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str)
1351 #define IDENTIFIER_HASH_VALUE(NODE) \
1352   (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.hash_value)
1353
1354 /* Translate a hash table identifier pointer to a tree_identifier
1355    pointer, and vice versa.  */
1356
1357 #define HT_IDENT_TO_GCC_IDENT(NODE) \
1358   ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
1359 #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
1360
1361 struct tree_identifier GTY(())
1362 {
1363   struct tree_common common;
1364   struct ht_identifier id;
1365 };
1366
1367 /* In a TREE_LIST node.  */
1368 #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
1369 #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
1370
1371 struct tree_list GTY(())
1372 {
1373   struct tree_common common;
1374   tree purpose;
1375   tree value;
1376 };
1377
1378 /* In a TREE_VEC node.  */
1379 #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
1380 #define TREE_VEC_END(NODE) \
1381   ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->vec.length]))
1382
1383 #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
1384
1385 struct tree_vec GTY(())
1386 {
1387   struct tree_common common;
1388   int length;
1389   tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%h)"))) a[1];
1390 };
1391
1392 /* In a CONSTRUCTOR node.  */
1393 #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
1394
1395 /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
1396    value of each element (stored within VAL). IX must be a scratch variable
1397    of unsigned integer type.  */
1398 #define FOR_EACH_CONSTRUCTOR_VALUE(V, IX, VAL) \
1399   for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
1400                ? false \
1401                : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
1402                true); \
1403        (IX)++)
1404
1405 /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding both
1406    the value of each element (stored within VAL) and its index (stored
1407    within INDEX). IX must be a scratch variable of unsigned integer type.  */
1408 #define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
1409   for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
1410                ? false \
1411                : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
1412                   (INDEX = VEC_index (constructor_elt, V, IX)->index), \
1413                true); \
1414        (IX)++)
1415
1416 /* Append a new constructor element to V, with the specified INDEX and VAL.  */
1417 #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
1418   do { \
1419     constructor_elt *_ce___ = VEC_safe_push (constructor_elt, gc, V, NULL); \
1420     _ce___->index = INDEX; \
1421     _ce___->value = VALUE; \
1422   } while (0)
1423
1424 /* A single element of a CONSTRUCTOR. VALUE holds the actual value of the
1425    element. INDEX can optionally design the position of VALUE: in arrays,
1426    it is the index where VALUE has to be placed; in structures, it is the
1427    FIELD_DECL of the member.  */
1428 typedef struct constructor_elt_d GTY(())
1429 {
1430   tree index;
1431   tree value;
1432 } constructor_elt;
1433
1434 DEF_VEC_O(constructor_elt);
1435 DEF_VEC_ALLOC_O(constructor_elt,gc);
1436
1437 struct tree_constructor GTY(())
1438 {
1439   struct tree_common common;
1440   VEC(constructor_elt,gc) *elts;
1441 };
1442
1443 /* Define fields and accessors for some nodes that represent expressions.  */
1444
1445 /* Nonzero if NODE is an empty statement (NOP_EXPR <0>).  */
1446 #define IS_EMPTY_STMT(NODE)     (TREE_CODE (NODE) == NOP_EXPR \
1447                                  && VOID_TYPE_P (TREE_TYPE (NODE)) \
1448                                  && integer_zerop (TREE_OPERAND (NODE, 0)))
1449
1450 /* In ordinary expression nodes.  */
1451 #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
1452 #define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
1453
1454 /* In a LOOP_EXPR node.  */
1455 #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
1456
1457 #ifdef USE_MAPPED_LOCATION
1458 /* The source location of this expression.  Non-tree_exp nodes such as
1459    decls and constants can be shared among multiple locations, so
1460    return nothing.  */
1461 #define EXPR_LOCATION(NODE)                                     \
1462   (EXPR_P (NODE) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
1463 #define SET_EXPR_LOCATION(NODE, FROM) \
1464   (EXPR_CHECK (NODE)->exp.locus = (FROM))
1465 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
1466 /* EXPR_LOCUS and SET_EXPR_LOCUS are deprecated.  */
1467 #define EXPR_LOCUS(NODE)                                        \
1468   (EXPR_P (NODE) ? &(NODE)->exp.locus : (location_t *)NULL)
1469 #define SET_EXPR_LOCUS(NODE, FROM) \
1470   do { source_location *loc_tmp = FROM; \
1471        EXPR_CHECK (NODE)->exp.locus \
1472        = loc_tmp == NULL ? UNKNOWN_LOCATION : *loc_tmp; } while (0)
1473 #define EXPR_FILENAME(NODE) \
1474   LOCATION_FILE (EXPR_CHECK (NODE)->exp.locus)
1475 #define EXPR_LINENO(NODE) \
1476   LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
1477 #else
1478 /* The source location of this expression.  Non-tree_exp nodes such as
1479    decls and constants can be shared among multiple locations, so
1480    return nothing.  */
1481 #define EXPR_LOCUS(NODE)                                        \
1482   (EXPR_P (NODE) ? (NODE)->exp.locus : (location_t *)NULL)
1483 #define SET_EXPR_LOCUS(NODE, FROM) \
1484   (EXPR_CHECK (NODE)->exp.locus = (FROM))
1485 #define SET_EXPR_LOCATION(NODE, FROM) annotate_with_locus (NODE, FROM)
1486 #define EXPR_FILENAME(NODE) \
1487   (EXPR_CHECK (NODE)->exp.locus->file)
1488 #define EXPR_LINENO(NODE) \
1489   (EXPR_CHECK (NODE)->exp.locus->line)
1490 #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCUS (NODE) != NULL)
1491 #define EXPR_LOCATION(NODE) \
1492   (EXPR_HAS_LOCATION(NODE) ? *(NODE)->exp.locus : UNKNOWN_LOCATION)
1493 #endif
1494
1495 /* In a TARGET_EXPR node.  */
1496 #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
1497 #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 1)
1498 #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 2)
1499
1500 /* DECL_EXPR accessor. This gives access to the DECL associated with
1501    the given declaration statement.  */
1502 #define DECL_EXPR_DECL(NODE)    TREE_OPERAND (DECL_EXPR_CHECK (NODE), 0)
1503
1504 #define EXIT_EXPR_COND(NODE)         TREE_OPERAND (EXIT_EXPR_CHECK (NODE), 0)
1505
1506 /* SWITCH_EXPR accessors. These give access to the condition, body and
1507    original condition type (before any compiler conversions)
1508    of the switch statement, respectively.  */
1509 #define SWITCH_COND(NODE)       TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 0)
1510 #define SWITCH_BODY(NODE)       TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 1)
1511 #define SWITCH_LABELS(NODE)     TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 2)
1512
1513 /* CASE_LABEL_EXPR accessors. These give access to the high and low values
1514    of a case label, respectively.  */
1515 #define CASE_LOW(NODE)                  TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
1516 #define CASE_HIGH(NODE)                 TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
1517 #define CASE_LABEL(NODE)                TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
1518
1519 /* The operands of a TARGET_MEM_REF.  */
1520 #define TMR_SYMBOL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
1521 #define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
1522 #define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
1523 #define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
1524 #define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
1525 #define TMR_ORIGINAL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 5))
1526 #define TMR_TAG(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 6))
1527
1528 /* The operands of a BIND_EXPR.  */
1529 #define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
1530 #define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
1531 #define BIND_EXPR_BLOCK(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 2))
1532
1533 /* GOTO_EXPR accessor. This gives access to the label associated with
1534    a goto statement.  */
1535 #define GOTO_DESTINATION(NODE)  TREE_OPERAND ((NODE), 0)
1536
1537 /* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the
1538    instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and
1539    ASM_CLOBBERS represent the outputs, inputs, and clobbers for the
1540    statement.  */
1541 #define ASM_STRING(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 0)
1542 #define ASM_OUTPUTS(NODE)       TREE_OPERAND (ASM_EXPR_CHECK (NODE), 1)
1543 #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
1544 #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
1545 /* Nonzero if we want to create an ASM_INPUT instead of an
1546    ASM_OPERAND with no operands.  */
1547 #define ASM_INPUT_P(NODE) (TREE_STATIC (NODE))
1548 #define ASM_VOLATILE_P(NODE) (TREE_PUBLIC (NODE))
1549
1550 /* COND_EXPR accessors.  */
1551 #define COND_EXPR_COND(NODE)    (TREE_OPERAND (COND_EXPR_CHECK (NODE), 0))
1552 #define COND_EXPR_THEN(NODE)    (TREE_OPERAND (COND_EXPR_CHECK (NODE), 1))
1553 #define COND_EXPR_ELSE(NODE)    (TREE_OPERAND (COND_EXPR_CHECK (NODE), 2))
1554
1555 /* LABEL_EXPR accessor. This gives access to the label associated with
1556    the given label expression.  */
1557 #define LABEL_EXPR_LABEL(NODE)  TREE_OPERAND (LABEL_EXPR_CHECK (NODE), 0)
1558
1559 /* VDEF_EXPR accessors are specified in tree-flow.h, along with the other
1560    accessors for SSA operands.  */
1561
1562 /* CATCH_EXPR accessors.  */
1563 #define CATCH_TYPES(NODE)       TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
1564 #define CATCH_BODY(NODE)        TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
1565
1566 /* EH_FILTER_EXPR accessors.  */
1567 #define EH_FILTER_TYPES(NODE)   TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 0)
1568 #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1)
1569 #define EH_FILTER_MUST_NOT_THROW(NODE) TREE_STATIC (EH_FILTER_EXPR_CHECK (NODE))
1570
1571 /* OBJ_TYPE_REF accessors.  */
1572 #define OBJ_TYPE_REF_EXPR(NODE)   TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0)
1573 #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1)
1574 #define OBJ_TYPE_REF_TOKEN(NODE)  TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 2)
1575
1576 /* ASSERT_EXPR accessors.  */
1577 #define ASSERT_EXPR_VAR(NODE)   TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 0)
1578 #define ASSERT_EXPR_COND(NODE)  TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 1)
1579
1580 /* OpenMP directive and clause accessors.  */
1581
1582 #define OMP_BODY(NODE) \
1583   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_CRITICAL), 0)
1584 #define OMP_CLAUSES(NODE) \
1585   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_SINGLE), 1)
1586
1587 #define OMP_PARALLEL_BODY(NODE)    TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
1588 #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
1589 #define OMP_PARALLEL_FN(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 2)
1590 #define OMP_PARALLEL_DATA_ARG(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 3)
1591
1592 #define OMP_FOR_BODY(NODE)         TREE_OPERAND (OMP_FOR_CHECK (NODE), 0)
1593 #define OMP_FOR_CLAUSES(NODE)      TREE_OPERAND (OMP_FOR_CHECK (NODE), 1)
1594 #define OMP_FOR_INIT(NODE)         TREE_OPERAND (OMP_FOR_CHECK (NODE), 2)
1595 #define OMP_FOR_COND(NODE)         TREE_OPERAND (OMP_FOR_CHECK (NODE), 3)
1596 #define OMP_FOR_INCR(NODE)         TREE_OPERAND (OMP_FOR_CHECK (NODE), 4)
1597 #define OMP_FOR_PRE_BODY(NODE)     TREE_OPERAND (OMP_FOR_CHECK (NODE), 5)
1598
1599 #define OMP_SECTIONS_BODY(NODE)    TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
1600 #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
1601
1602 #define OMP_SECTION_BODY(NODE)     TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
1603
1604 #define OMP_SINGLE_BODY(NODE)      TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 0)
1605 #define OMP_SINGLE_CLAUSES(NODE)   TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 1)
1606
1607 #define OMP_MASTER_BODY(NODE)      TREE_OPERAND (OMP_MASTER_CHECK (NODE), 0)
1608
1609 #define OMP_ORDERED_BODY(NODE)     TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 0)
1610
1611 #define OMP_CRITICAL_BODY(NODE)    TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 0)
1612 #define OMP_CRITICAL_NAME(NODE)    TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 1)
1613
1614 #define OMP_CLAUSE_CHAIN(NODE)     TREE_CHAIN (OMP_CLAUSE_CHECK (NODE))
1615 #define OMP_CLAUSE_DECL(NODE)                                           \
1616   OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE),  \
1617                                               OMP_CLAUSE_PRIVATE,       \
1618                                               OMP_CLAUSE_COPYPRIVATE), 0)
1619
1620 /* True on an OMP_SECTION statement that was the last lexical member.
1621    This status is meaningful in the implementation of lastprivate.  */
1622 #define OMP_SECTION_LAST(NODE) \
1623   TREE_PRIVATE (OMP_SECTION_CHECK (NODE))
1624
1625 /* True on an OMP_RETURN statement if the return does not require a
1626    thread synchronization via some sort of barrier.  The exact barrier
1627    that would otherwise be emitted is dependent on the OMP statement
1628    with which this return is associated.  */
1629 #define OMP_RETURN_NOWAIT(NODE) \
1630   TREE_PRIVATE (OMP_RETURN_CHECK (NODE))
1631
1632 /* True on an OMP_PARALLEL statement if it represents an explicit
1633    combined parallel work-sharing constructs.  */
1634 #define OMP_PARALLEL_COMBINED(NODE) \
1635   TREE_PRIVATE (OMP_PARALLEL_CHECK (NODE))
1636
1637 /* True on a PRIVATE clause if its decl is kept around for debugging
1638    information only and its DECL_VALUE_EXPR is supposed to point
1639    to what it has been remapped to.  */
1640 #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
1641   TREE_PUBLIC (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
1642
1643 /* True on a LASTPRIVATE clause if a FIRSTPRIVATE clause for the same
1644    decl is present in the chain.  */
1645 #define OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE(NODE) \
1646   TREE_PUBLIC (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE))
1647
1648 #define OMP_CLAUSE_IF_EXPR(NODE) \
1649   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
1650 #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \
1651   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0)
1652 #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \
1653   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE), 0)
1654
1655 #define OMP_CLAUSE_REDUCTION_CODE(NODE) \
1656   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION)->omp_clause.subcode.reduction_code)
1657 #define OMP_CLAUSE_REDUCTION_INIT(NODE) \
1658   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
1659 #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
1660   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
1661 #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
1662   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
1663
1664 enum omp_clause_schedule_kind
1665 {
1666   OMP_CLAUSE_SCHEDULE_STATIC,
1667   OMP_CLAUSE_SCHEDULE_DYNAMIC,
1668   OMP_CLAUSE_SCHEDULE_GUIDED,
1669   OMP_CLAUSE_SCHEDULE_RUNTIME
1670 };
1671
1672 #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
1673   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
1674
1675 enum omp_clause_default_kind
1676 {
1677   OMP_CLAUSE_DEFAULT_UNSPECIFIED,
1678   OMP_CLAUSE_DEFAULT_SHARED,
1679   OMP_CLAUSE_DEFAULT_NONE,
1680   OMP_CLAUSE_DEFAULT_PRIVATE
1681 };
1682
1683 #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
1684   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
1685
1686 struct tree_exp GTY(())
1687 {
1688   struct tree_common common;
1689   source_locus locus;
1690   int complexity;
1691   tree block;
1692   tree GTY ((special ("tree_exp"),
1693              desc ("TREE_CODE ((tree) &%0)")))
1694     operands[1];
1695 };
1696 \f
1697 /* SSA_NAME accessors.  */
1698
1699 /* Returns the variable being referenced.  Once released, this is the
1700    only field that can be relied upon.  */
1701 #define SSA_NAME_VAR(NODE)      SSA_NAME_CHECK (NODE)->ssa_name.var
1702
1703 /* Returns the statement which defines this reference.   Note that
1704    we use the same field when chaining SSA_NAME nodes together on
1705    the SSA_NAME freelist.  */
1706 #define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->common.chain
1707
1708 /* Returns the SSA version number of this SSA name.  Note that in
1709    tree SSA, version numbers are not per variable and may be recycled.  */
1710 #define SSA_NAME_VERSION(NODE)  SSA_NAME_CHECK (NODE)->ssa_name.version
1711
1712 /* Nonzero if this SSA name occurs in an abnormal PHI.  SSA_NAMES are
1713    never output, so we can safely use the ASM_WRITTEN_FLAG for this
1714    status bit.  */
1715 #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
1716     SSA_NAME_CHECK (NODE)->common.asm_written_flag
1717
1718 /* Nonzero if this SSA_NAME expression is currently on the free list of
1719    SSA_NAMES.  Using NOTHROW_FLAG seems reasonably safe since throwing
1720    has no meaning for an SSA_NAME.  */
1721 #define SSA_NAME_IN_FREE_LIST(NODE) \
1722     SSA_NAME_CHECK (NODE)->common.nothrow_flag
1723
1724 /* Attributes for SSA_NAMEs for pointer-type variables.  */
1725 #define SSA_NAME_PTR_INFO(N) \
1726     SSA_NAME_CHECK (N)->ssa_name.ptr_info
1727
1728 /* Get the value of this SSA_NAME, if available.  */
1729 #define SSA_NAME_VALUE(N) \
1730    SSA_NAME_CHECK (N)->ssa_name.value_handle
1731
1732 #ifndef _TREE_FLOW_H
1733 struct ptr_info_def;
1734 #endif
1735
1736
1737
1738 /* Immediate use linking structure.  This structure is used for maintaining
1739    a doubly linked list of uses of an SSA_NAME.  */
1740 typedef struct ssa_use_operand_d GTY(())
1741 {
1742   struct ssa_use_operand_d* GTY((skip(""))) prev;
1743   struct ssa_use_operand_d* GTY((skip(""))) next;
1744   tree GTY((skip(""))) stmt;
1745   tree *GTY((skip(""))) use;
1746 } ssa_use_operand_t;
1747
1748 /* Return the immediate_use information for an SSA_NAME. */
1749 #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
1750
1751 struct tree_ssa_name GTY(())
1752 {
1753   struct tree_common common;
1754
1755   /* _DECL wrapped by this SSA name.  */
1756   tree var;
1757
1758   /* SSA version number.  */
1759   unsigned int version;
1760
1761   /* Pointer attributes used for alias analysis.  */
1762   struct ptr_info_def *ptr_info;
1763
1764   /* Value for SSA name used by various passes.
1765
1766      Right now only invariants are allowed to persist beyond a pass in
1767      this field; in the future we will allow VALUE_HANDLEs to persist
1768      as well.  */
1769   tree value_handle;
1770
1771   /* Immediate uses list for this SSA_NAME.  */
1772   struct ssa_use_operand_d imm_uses;
1773 };
1774 \f
1775 /* In a PHI_NODE node.  */
1776
1777 /* These 2 macros should be considered off limits for use by developers.  If
1778    you wish to access the use or def fields of a PHI_NODE in the SSA
1779    optimizers, use the accessor macros found in tree-ssa-operands.h.
1780    These two macros are to be used only by those accessor macros, and other
1781    select places where we *absolutely* must take the address of the tree.  */
1782
1783 #define PHI_RESULT_TREE(NODE)           PHI_NODE_CHECK (NODE)->phi.result
1784 #define PHI_ARG_DEF_TREE(NODE, I)       PHI_NODE_ELT_CHECK (NODE, I).def
1785
1786 /* PHI_NODEs for each basic block are chained together in a single linked
1787    list.  The head of the list is linked from the block annotation, and
1788    the link to the next PHI is in PHI_CHAIN.  */
1789 #define PHI_CHAIN(NODE)         TREE_CHAIN (PHI_NODE_CHECK (NODE))
1790
1791 #define PHI_NUM_ARGS(NODE)              PHI_NODE_CHECK (NODE)->phi.num_args
1792 #define PHI_ARG_CAPACITY(NODE)          PHI_NODE_CHECK (NODE)->phi.capacity
1793 #define PHI_ARG_ELT(NODE, I)            PHI_NODE_ELT_CHECK (NODE, I)
1794 #define PHI_ARG_EDGE(NODE, I)           (EDGE_PRED (PHI_BB ((NODE)), (I)))
1795 #define PHI_BB(NODE)                    PHI_NODE_CHECK (NODE)->phi.bb
1796 #define PHI_ARG_IMM_USE_NODE(NODE, I)   PHI_NODE_ELT_CHECK (NODE, I).imm_use
1797
1798 struct phi_arg_d GTY(())
1799 {
1800   /* imm_use MUST be the first element in struct because we do some
1801      pointer arithmetic with it.  See phi_arg_index_from_use.  */
1802   struct ssa_use_operand_d imm_use;
1803   tree def;
1804 };
1805
1806 struct tree_phi_node GTY(())
1807 {
1808   struct tree_common common;
1809   tree result;
1810   int num_args;
1811   int capacity;
1812
1813   /* Basic block to that the phi node belongs.  */
1814   struct basic_block_def *bb;
1815
1816   /* Arguments of the PHI node.  These are maintained in the same
1817      order as predecessor edge vector BB->PREDS.  */
1818   struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1];
1819 };
1820 \f
1821 #define OMP_CLAUSE_CODE(NODE)                                   \
1822         (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
1823
1824 #define OMP_CLAUSE_SET_CODE(NODE, CODE)                         \
1825         ((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
1826
1827 #define OMP_CLAUSE_CODE(NODE)                                   \
1828         (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
1829
1830 #define OMP_CLAUSE_OPERAND(NODE, I)                             \
1831         OMP_CLAUSE_ELT_CHECK (NODE, I)
1832
1833 struct tree_omp_clause GTY(())
1834 {
1835   struct tree_common common;
1836   enum omp_clause_code code;
1837   union omp_clause_subcode {
1838     enum omp_clause_default_kind  default_kind;
1839     enum omp_clause_schedule_kind schedule_kind;
1840     enum tree_code                reduction_code;
1841   } GTY ((skip)) subcode;
1842   tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
1843 };
1844 \f
1845
1846 struct varray_head_tag;
1847
1848 /* In a BLOCK node.  */
1849 #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
1850 #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
1851 #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
1852 /* Note: when changing this, make sure to find the places
1853    that use chainon or nreverse.  */
1854 #define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE))
1855 #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
1856 #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
1857
1858 /* Nonzero means that this block is prepared to handle exceptions
1859    listed in the BLOCK_VARS slot.  */
1860 #define BLOCK_HANDLER_BLOCK(NODE) \
1861   (BLOCK_CHECK (NODE)->block.handler_block_flag)
1862
1863 /* An index number for this block.  These values are not guaranteed to
1864    be unique across functions -- whether or not they are depends on
1865    the debugging output format in use.  */
1866 #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
1867
1868 /* If block reordering splits a lexical block into discontiguous
1869    address ranges, we'll make a copy of the original block.
1870
1871    Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN.
1872    In that case, we have one source block that has been replicated
1873    (through inlining or unrolling) into many logical blocks, and that
1874    these logical blocks have different physical variables in them.
1875
1876    In this case, we have one logical block split into several
1877    non-contiguous address ranges.  Most debug formats can't actually
1878    represent this idea directly, so we fake it by creating multiple
1879    logical blocks with the same variables in them.  However, for those
1880    that do support non-contiguous regions, these allow the original
1881    logical block to be reconstructed, along with the set of address
1882    ranges.
1883
1884    One of the logical block fragments is arbitrarily chosen to be
1885    the ORIGIN.  The other fragments will point to the origin via
1886    BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer
1887    be null.  The list of fragments will be chained through
1888    BLOCK_FRAGMENT_CHAIN from the origin.  */
1889
1890 #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
1891 #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
1892
1893 /* For an inlined function, this gives the location where it was called
1894    from.  This is only set in the top level block, which corresponds to the
1895    inlined function scope.  This is used in the debug output routines.  */
1896
1897 #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
1898
1899 struct tree_block GTY(())
1900 {
1901   struct tree_common common;
1902
1903   unsigned handler_block_flag : 1;
1904   unsigned abstract_flag : 1;
1905   unsigned block_num : 30;
1906
1907   tree vars;
1908   tree subblocks;
1909   tree supercontext;
1910   tree abstract_origin;
1911   tree fragment_origin;
1912   tree fragment_chain;
1913   location_t locus;
1914 };
1915 \f
1916 /* Define fields and accessors for nodes representing data types.  */
1917
1918 /* See tree.def for documentation of the use of these fields.
1919    Look at the documentation of the various ..._TYPE tree codes.
1920
1921    Note that the type.values, type.minval, and type.maxval fields are
1922    overloaded and used for different macros in different kinds of types.
1923    Each macro must check to ensure the tree node is of the proper kind of
1924    type.  Note also that some of the front-ends also overload these fields,
1925    so they must be checked as well.  */
1926
1927 #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
1928 #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
1929 #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
1930 #define TYPE_MODE(NODE) (TYPE_CHECK (NODE)->type.mode)
1931 #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
1932 #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
1933 #define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
1934 #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
1935 #define TYPE_ORIG_SIZE_TYPE(NODE)                       \
1936   (INTEGER_TYPE_CHECK (NODE)->type.values               \
1937   ? TREE_TYPE ((NODE)->type.values) : NULL_TREE)
1938 #define TYPE_METHODS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.maxval)
1939 #define TYPE_VFIELD(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.minval)
1940 #define TYPE_ARG_TYPES(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.values)
1941 #define TYPE_METHOD_BASETYPE(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.maxval)
1942 #define TYPE_OFFSET_BASETYPE(NODE) (OFFSET_TYPE_CHECK (NODE)->type.maxval)
1943 #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
1944 #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
1945 #define TYPE_NEXT_PTR_TO(NODE) (POINTER_TYPE_CHECK (NODE)->type.minval)
1946 #define TYPE_NEXT_REF_TO(NODE) (REFERENCE_TYPE_CHECK (NODE)->type.minval)
1947 #define TYPE_MIN_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.minval)
1948 #define TYPE_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval)
1949 #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
1950 #define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
1951 #define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer)
1952 #define TYPE_SYMTAB_DIE(NODE) (TYPE_CHECK (NODE)->type.symtab.die)
1953 #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
1954 #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
1955 #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
1956 #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
1957 #define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
1958
1959 /* For a VECTOR_TYPE node, this describes a different type which is emitted
1960    in the debugging output.  We use this to describe a vector as a
1961    structure containing an array.  */
1962 #define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (VECTOR_TYPE_CHECK (NODE)->type.values)
1963
1964 /* For record and union types, information about this type, as a base type
1965    for itself.  */
1966 #define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK(NODE)->type.binfo)
1967
1968 /* For non record and union types, used in a language-dependent way.  */
1969 #define TYPE_LANG_SLOT_1(NODE) (NOT_RECORD_OR_UNION_CHECK(NODE)->type.binfo)
1970
1971 /* The (language-specific) typed-based alias set for this type.
1972    Objects whose TYPE_ALIAS_SETs are different cannot alias each
1973    other.  If the TYPE_ALIAS_SET is -1, no alias set has yet been
1974    assigned to this type.  If the TYPE_ALIAS_SET is 0, objects of this
1975    type can alias objects of any type.  */
1976 #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set)
1977
1978 /* Nonzero iff the typed-based alias set for this type has been
1979    calculated.  */
1980 #define TYPE_ALIAS_SET_KNOWN_P(NODE) (TYPE_CHECK (NODE)->type.alias_set != -1)
1981
1982 /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
1983    to this type.  */
1984 #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes)
1985
1986 /* The alignment necessary for objects of this type.
1987    The value is an int, measured in bits.  */
1988 #define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align)
1989
1990 /* 1 if the alignment for this type was requested by "aligned" attribute,
1991    0 if it is the default for this type.  */
1992 #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->type.user_align)
1993
1994 /* The alignment for NODE, in bytes.  */
1995 #define TYPE_ALIGN_UNIT(NODE) (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
1996
1997 /* If your language allows you to declare types, and you want debug info
1998    for them, then you need to generate corresponding TYPE_DECL nodes.
1999    These "stub" TYPE_DECL nodes have no name, and simply point at the
2000    type node.  You then set the TYPE_STUB_DECL field of the type node
2001    to point back at the TYPE_DECL node.  This allows the debug routines
2002    to know that the two nodes represent the same type, so that we only
2003    get one debug info record for them.  */
2004 #define TYPE_STUB_DECL(NODE) TREE_CHAIN (NODE)
2005
2006 /* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
2007    has BLKmode only because it lacks the alignment requirement for
2008    its size.  */
2009 #define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
2010
2011 /* In an INTEGER_TYPE, it means the type represents a size.  We use
2012    this both for validity checking and to permit optimizations that
2013    are unsafe for other types.  Note that the C `size_t' type should
2014    *not* have this flag set.  The `size_t' type is simply a typedef
2015    for an ordinary integer type that happens to be the type of an
2016    expression returned by `sizeof'; `size_t' has no special
2017    properties.  Expressions whose type have TYPE_IS_SIZETYPE set are
2018    always actual sizes.  */
2019 #define TYPE_IS_SIZETYPE(NODE) \
2020   (INTEGER_TYPE_CHECK (NODE)->type.no_force_blk_flag)
2021
2022 /* In a FUNCTION_TYPE, indicates that the function returns with the stack
2023    pointer depressed.  */
2024 #define TYPE_RETURNS_STACK_DEPRESSED(NODE) \
2025   (FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag)
2026
2027 /* Nonzero in a type considered volatile as a whole.  */
2028 #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->common.volatile_flag)
2029
2030 /* Means this type is const-qualified.  */
2031 #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->common.readonly_flag)
2032
2033 /* If nonzero, this type is `restrict'-qualified, in the C sense of
2034    the term.  */
2035 #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
2036
2037 /* There is a TYPE_QUAL value for each type qualifier.  They can be
2038    combined by bitwise-or to form the complete set of qualifiers for a
2039    type.  */
2040
2041 #define TYPE_UNQUALIFIED   0x0
2042 #define TYPE_QUAL_CONST    0x1
2043 #define TYPE_QUAL_VOLATILE 0x2
2044 #define TYPE_QUAL_RESTRICT 0x4
2045
2046 /* The set of type qualifiers for this type.  */
2047 #define TYPE_QUALS(NODE)                                        \
2048   ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST)                     \
2049    | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE)                \
2050    | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
2051
2052 /* These flags are available for each language front end to use internally.  */
2053 #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0)
2054 #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1)
2055 #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2)
2056 #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3)
2057 #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4)
2058 #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5)
2059 #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6)
2060
2061 /* Used to keep track of visited nodes in tree traversals.  This is set to
2062    0 by copy_node and make_node.  */
2063 #define TREE_VISITED(NODE) ((NODE)->common.visited)
2064
2065 /* If set in an ARRAY_TYPE, indicates a string type (for languages
2066    that distinguish string from array of char).
2067    If set in a INTEGER_TYPE, indicates a character type.  */
2068 #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag)
2069
2070 /* If non-NULL, this is an upper bound of the size (in bytes) of an
2071    object of the given ARRAY_TYPE.  This allows temporaries to be
2072    allocated.  */
2073 #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
2074   (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type.maxval)
2075
2076 /* For a VECTOR_TYPE, this is the number of sub-parts of the vector.  */
2077 #define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
2078   (((unsigned HOST_WIDE_INT) 1) \
2079    << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision)
2080
2081 /* Set precision to n when we have 2^n sub-parts of the vector.  */
2082 #define SET_TYPE_VECTOR_SUBPARTS(VECTOR_TYPE, X) \
2083   (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision = exact_log2 (X))
2084
2085 /* Indicates that objects of this type must be initialized by calling a
2086    function when they are created.  */
2087 #define TYPE_NEEDS_CONSTRUCTING(NODE) \
2088   (TYPE_CHECK (NODE)->type.needs_constructing_flag)
2089
2090 /* Indicates that objects of this type (a UNION_TYPE), should be passed
2091    the same way that the first union alternative would be passed.  */
2092 #define TYPE_TRANSPARENT_UNION(NODE)  \
2093   (UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
2094
2095 /* For an ARRAY_TYPE, indicates that it is not permitted to
2096    take the address of a component of the type.  */
2097 #define TYPE_NONALIASED_COMPONENT(NODE) \
2098   (ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
2099
2100 /* Indicated that objects of this type should be laid out in as
2101    compact a way as possible.  */
2102 #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->type.packed_flag)
2103
2104 /* Used by type_contains_placeholder_p to avoid recomputation.
2105    Values are: 0 (unknown), 1 (false), 2 (true).  Never access
2106    this field directly.  */
2107 #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
2108   (TYPE_CHECK (NODE)->type.contains_placeholder_bits)
2109
2110 /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to blocks  */
2111 /* Indicates that the struct type is a block struct, rather than
2112    a 'normal' struct, i.e. one of its fields is a function that can
2113    be called.  This uses the existing bit-field lang_flag_2 in the
2114    struct tree_type, rather than creating a new bit field, as 
2115    lang_flag_2 is currently unused and we don't want to increase the 
2116    size of trees if we can avoid it.  */
2117 #define TYPE_BLOCK_IMPL_STRUCT(NODE) \
2118 (TYPE_CHECK (NODE)->type.lang_flag_2)
2119 /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks  */
2120
2121 struct die_struct;
2122
2123 struct tree_type GTY(())
2124 {
2125   struct tree_common common;
2126   tree values;
2127   tree size;
2128   tree size_unit;
2129   tree attributes;
2130   unsigned int uid;
2131
2132   unsigned int precision : 9;
2133   ENUM_BITFIELD(machine_mode) mode : 7;
2134
2135   unsigned string_flag : 1;
2136   unsigned no_force_blk_flag : 1;
2137   unsigned needs_constructing_flag : 1;
2138   unsigned transparent_union_flag : 1;
2139   unsigned packed_flag : 1;
2140   unsigned restrict_flag : 1;
2141   unsigned contains_placeholder_bits : 2;
2142
2143   unsigned lang_flag_0 : 1;
2144   unsigned lang_flag_1 : 1;
2145   /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks  */
2146   /* Since it is currently completely unused, and in the interest of
2147      not making trees any bigger than they already are, lang_flag_2
2148      in the tree_type struct will be used to indicate that a struct is a 
2149      block struct.  The macro used for these purposes is 
2150      TYPE_BLOCK_IMPL_STRUCT, rather than TYPE_LANG_FLAG_2, in order to make 
2151      its uses in the code more clear.  */
2152   /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks  */
2153   unsigned lang_flag_2 : 1;
2154   unsigned lang_flag_3 : 1;
2155   unsigned lang_flag_4 : 1;
2156   unsigned lang_flag_5 : 1;
2157   unsigned lang_flag_6 : 1;
2158   unsigned user_align : 1;
2159
2160   unsigned int align;
2161   tree pointer_to;
2162   tree reference_to;
2163   union tree_type_symtab {
2164     int GTY ((tag ("0"))) address;
2165     char * GTY ((tag ("1"))) pointer;
2166     struct die_struct * GTY ((tag ("2"))) die;
2167   } GTY ((desc ("debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"),
2168           descbits ("2"))) symtab;
2169   tree name;
2170   tree minval;
2171   tree maxval;
2172   tree next_variant;
2173   tree main_variant;
2174   tree binfo;
2175   tree context;
2176   HOST_WIDE_INT alias_set;
2177   /* Points to a structure whose details depend on the language in use.  */
2178   struct lang_type *lang_specific;
2179 };
2180 \f
2181 /* Define accessor macros for information about type inheritance
2182    and basetypes.
2183
2184    A "basetype" means a particular usage of a data type for inheritance
2185    in another type.  Each such basetype usage has its own "binfo"
2186    object to describe it.  The binfo object is a TREE_VEC node.
2187
2188    Inheritance is represented by the binfo nodes allocated for a
2189    given type.  For example, given types C and D, such that D is
2190    inherited by C, 3 binfo nodes will be allocated: one for describing
2191    the binfo properties of C, similarly one for D, and one for
2192    describing the binfo properties of D as a base type for C.
2193    Thus, given a pointer to class C, one can get a pointer to the binfo
2194    of D acting as a basetype for C by looking at C's binfo's basetypes.  */
2195
2196 /* BINFO specific flags.  */
2197
2198 /* Nonzero means that the derivation chain is via a `virtual' declaration.  */
2199 #define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->common.static_flag)
2200
2201 /* Flags for language dependent use.  */
2202 #define BINFO_MARKED(NODE) TREE_LANG_FLAG_0(TREE_BINFO_CHECK(NODE))
2203 #define BINFO_FLAG_1(NODE) TREE_LANG_FLAG_1(TREE_BINFO_CHECK(NODE))
2204 #define BINFO_FLAG_2(NODE) TREE_LANG_FLAG_2(TREE_BINFO_CHECK(NODE))
2205 #define BINFO_FLAG_3(NODE) TREE_LANG_FLAG_3(TREE_BINFO_CHECK(NODE))
2206 #define BINFO_FLAG_4(NODE) TREE_LANG_FLAG_4(TREE_BINFO_CHECK(NODE))
2207 #define BINFO_FLAG_5(NODE) TREE_LANG_FLAG_5(TREE_BINFO_CHECK(NODE))
2208 #define BINFO_FLAG_6(NODE) TREE_LANG_FLAG_6(TREE_BINFO_CHECK(NODE))
2209
2210 /* The actual data type node being inherited in this basetype.  */
2211 #define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK(NODE))
2212
2213 /* The offset where this basetype appears in its containing type.
2214    BINFO_OFFSET slot holds the offset (in bytes)
2215    from the base of the complete object to the base of the part of the
2216    object that is allocated on behalf of this `type'.
2217    This is always 0 except when there is multiple inheritance.  */
2218
2219 #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK(NODE)->binfo.offset)
2220 #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
2221
2222 /* The virtual function table belonging to this basetype.  Virtual
2223    function tables provide a mechanism for run-time method dispatching.
2224    The entries of a virtual function table are language-dependent.  */
2225
2226 #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtable)
2227
2228 /* The virtual functions in the virtual function table.  This is
2229    a TREE_LIST that is used as an initial approximation for building
2230    a virtual function table for this basetype.  */
2231 #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK(NODE)->binfo.virtuals)
2232
2233 /* A vector of binfos for the direct basetypes inherited by this
2234    basetype.
2235
2236    If this basetype describes type D as inherited in C, and if the
2237    basetypes of D are E and F, then this vector contains binfos for
2238    inheritance of E and F by C.  */
2239 #define BINFO_BASE_BINFOS(NODE) (&TREE_BINFO_CHECK(NODE)->binfo.base_binfos)
2240
2241 /* The number of basetypes for NODE.  */
2242 #define BINFO_N_BASE_BINFOS(NODE) (VEC_length (tree, BINFO_BASE_BINFOS (NODE)))
2243
2244 /* Accessor macro to get to the Nth base binfo of this binfo.  */
2245 #define BINFO_BASE_BINFO(NODE,N) \
2246  (VEC_index (tree, BINFO_BASE_BINFOS (NODE), (N)))
2247 #define BINFO_BASE_ITERATE(NODE,N,B) \
2248  (VEC_iterate (tree, BINFO_BASE_BINFOS (NODE), (N), (B)))
2249 #define BINFO_BASE_APPEND(NODE,T) \
2250  (VEC_quick_push (tree, BINFO_BASE_BINFOS (NODE), (T)))
2251
2252 /* For a BINFO record describing a virtual base class, i.e., one where
2253    TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
2254    base.  The actual contents are language-dependent.  In the C++
2255    front-end this field is an INTEGER_CST giving an offset into the
2256    vtable where the offset to the virtual base can be found.  */
2257 #define BINFO_VPTR_FIELD(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vptr_field)
2258
2259 /* Indicates the accesses this binfo has to its bases. The values are
2260    access_public_node, access_protected_node or access_private_node.
2261    If this array is not present, public access is implied.  */
2262 #define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses)
2263
2264 #define BINFO_BASE_ACCESS(NODE,N) \
2265   VEC_index (tree, BINFO_BASE_ACCESSES (NODE), (N))
2266 #define BINFO_BASE_ACCESS_APPEND(NODE,T) \
2267   VEC_quick_push (tree, BINFO_BASE_ACCESSES (NODE), (T))
2268
2269 /* The index in the VTT where this subobject's sub-VTT can be found.
2270    NULL_TREE if there is no sub-VTT.  */
2271 #define BINFO_SUBVTT_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_subvtt)
2272
2273 /* The index in the VTT where the vptr for this subobject can be
2274    found.  NULL_TREE if there is no secondary vptr in the VTT.  */
2275 #define BINFO_VPTR_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_vptr)
2276
2277 /* The BINFO_INHERITANCE_CHAIN points at the binfo for the base
2278    inheriting this base for non-virtual bases. For virtual bases it
2279    points either to the binfo for which this is a primary binfo, or to
2280    the binfo of the most derived type.  */
2281 #define BINFO_INHERITANCE_CHAIN(NODE) \
2282         (TREE_BINFO_CHECK(NODE)->binfo.inheritance)
2283
2284 struct tree_binfo GTY (())
2285 {
2286   struct tree_common common;
2287
2288   tree offset;
2289   tree vtable;
2290   tree virtuals;
2291   tree vptr_field;
2292   VEC(tree,gc) *base_accesses;
2293   tree inheritance;
2294
2295   tree vtt_subvtt;
2296   tree vtt_vptr;
2297
2298   VEC(tree,none) base_binfos;
2299 };
2300
2301 \f
2302 /* Define fields and accessors for nodes representing declared names.  */
2303
2304 /* Nonzero if DECL represents a variable for the SSA passes.  */
2305 #define SSA_VAR_P(DECL)                                                 \
2306         (TREE_CODE (DECL) == VAR_DECL                                   \
2307          || TREE_CODE (DECL) == PARM_DECL                               \
2308          || TREE_CODE (DECL) == RESULT_DECL                             \
2309          || MTAG_P (DECL)                                               \
2310          || (TREE_CODE (DECL) == SSA_NAME                               \
2311              && (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL            \
2312                  || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL        \
2313                  || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL      \
2314                  || MTAG_P (SSA_NAME_VAR (DECL)))))
2315
2316
2317
2318
2319 /* Enumerate visibility settings.  */
2320 #ifndef SYMBOL_VISIBILITY_DEFINED
2321 #define SYMBOL_VISIBILITY_DEFINED
2322 enum symbol_visibility
2323 {
2324   VISIBILITY_DEFAULT,
2325   VISIBILITY_PROTECTED,
2326   VISIBILITY_HIDDEN,
2327   VISIBILITY_INTERNAL
2328 };
2329 #endif
2330
2331 struct function;
2332
2333
2334 /* This is the name of the object as written by the user.
2335    It is an IDENTIFIER_NODE.  */
2336 #define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name)
2337
2338 /* Every ..._DECL node gets a unique number.  */
2339 #define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
2340
2341 /* These two fields describe where in the source code the declaration
2342    was.  If the declaration appears in several places (as for a C
2343    function that is declared first and then defined later), this
2344    information should refer to the definition.  */
2345 #define DECL_SOURCE_LOCATION(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
2346 #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
2347 #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
2348 #ifdef USE_MAPPED_LOCATION
2349 #define DECL_IS_BUILTIN(DECL) \
2350   (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
2351 #else
2352 #define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0)
2353 #endif
2354
2355 /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
2356     QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,
2357     PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this
2358     points to either the FUNCTION_DECL for the containing function,
2359     the RECORD_TYPE or UNION_TYPE for the containing type, or
2360     NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
2361     scope".  */
2362 #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
2363 #define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
2364 struct tree_decl_minimal GTY(())
2365 {
2366   struct tree_common common;
2367   location_t locus;
2368   unsigned int uid;
2369   tree name;
2370   tree context;
2371 };
2372
2373 /* When computing aliasing information, we represent the memory pointed-to
2374    by pointers with artificial variables called "memory tags" (MT).  There
2375    are two kinds of tags, namely symbol and name:
2376
2377    Symbol tags (SMT) are used in flow-insensitive alias analysis, they
2378    represent all the pointed-to locations and variables pointed-to by
2379    the same pointer symbol.  Usually, this set is computed using
2380    type-based analysis (i.e., alias set classes), but this may not
2381    always be the case.
2382
2383    Name tags (NMT) are used in flow-sensitive points-to alias
2384    analysis, they represent the variables and memory locations
2385    pointed-to by a specific SSA_NAME pointer.
2386
2387    In general, given a pointer P with a symbol tag SMT, the alias set
2388    of SMT should be the union of all the alias sets of the NMTs of
2389    every SSA_NAME for P.  */
2390 struct tree_memory_tag GTY(())
2391 {
2392   struct tree_decl_minimal common;
2393   unsigned int is_global:1;
2394   unsigned int is_used_alone:1;
2395   unsigned int old_used_alone:1;
2396 };
2397
2398 #define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
2399
2400 /* This flag is true if a SMT is used as the V_MAY_DEF or VUSE operand
2401    directly, because the access had all of the SMT's aliases pruned
2402    from it.  */
2403 #define SMT_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.is_used_alone)
2404
2405 /* This flag is used to temporarily store the old value of the used alone
2406    flag when updating so we know whether to mark the symbol for
2407    renaming.  */
2408 #define SMT_OLD_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.old_used_alone)
2409
2410 struct tree_struct_field_tag GTY(())
2411 {
2412   struct tree_memory_tag common;
2413
2414   /* Parent variable.  */
2415   tree parent_var;
2416
2417   /* Offset inside structure.  */
2418   unsigned HOST_WIDE_INT offset;
2419
2420   /* Size of the field.  */
2421   unsigned HOST_WIDE_INT size;
2422
2423 };
2424 #define SFT_PARENT_VAR(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.parent_var)
2425 #define SFT_OFFSET(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.offset)
2426 #define SFT_SIZE(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.size)
2427
2428 /* For any sort of a ..._DECL node, this points to the original (abstract)
2429    decl node which this decl is an instance of, or else it is NULL indicating
2430    that this decl is not an instance of some other decl.  For example,
2431    in a nested declaration of an inline function, this points back to the
2432    definition.  */
2433 #define DECL_ABSTRACT_ORIGIN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
2434
2435 /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
2436    origin.  This is useful when setting the DECL_ABSTRACT_ORIGIN.  */
2437 #define DECL_ORIGIN(NODE) \
2438   (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE))
2439
2440 /* Nonzero for any sort of ..._DECL node means this decl node represents an
2441    inline instance of some original (abstract) decl from an inline function;
2442    suppress any warnings about shadowing some other variable.  FUNCTION_DECL
2443    nodes can also have their abstract origin set to themselves.  */
2444 #define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
2445                                 && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
2446
2447 /* In a DECL this is the field where attributes are stored.  */
2448 #define DECL_ATTRIBUTES(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
2449
2450 /* For a FUNCTION_DECL, holds the tree of BINDINGs.
2451    For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
2452    For a VAR_DECL, holds the initial value.
2453    For a PARM_DECL, not used--default
2454    values for parameters are encoded in the type of the function,
2455    not in the PARM_DECL slot.
2456    For a FIELD_DECL, this is used for enumeration values and the C
2457    frontend uses it for temporarily storing bitwidth of bitfields.
2458
2459    ??? Need to figure out some way to check this isn't a PARM_DECL.  */
2460 #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial)
2461
2462 /* Holds the size of the datum, in bits, as a tree expression.
2463    Need not be constant.  */
2464 #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
2465 /* Likewise for the size in bytes.  */
2466 #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
2467 /* Holds the alignment required for the datum, in bits.  */
2468 #define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
2469 /* The alignment of NODE, in bytes.  */
2470 #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
2471 /* Set if the alignment of this DECL has been set by the user, for
2472    example with an 'aligned' attribute.  */
2473 #define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.user_align)
2474 /* Holds the machine mode corresponding to the declaration of a variable or
2475    field.  Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
2476    FIELD_DECL.  */
2477 #define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
2478
2479 /* For FUNCTION_DECL, if it is built-in, this identifies which built-in
2480    operation it is.  Note, however, that this field is overloaded, with
2481    DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be
2482    checked before any access to the former.  */
2483 #define DECL_FUNCTION_CODE(NODE) \
2484   (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code)
2485 #define DECL_DEBUG_EXPR_IS_FROM(NODE) \
2486   (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
2487
2488 /* Nonzero for a given ..._DECL node means that the name of this node should
2489    be ignored for symbolic debug purposes.  */
2490 #define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
2491
2492 /* Nonzero for a given ..._DECL node means that this node represents an
2493    "abstract instance" of the given declaration (e.g. in the original
2494    declaration of an inline function).  When generating symbolic debugging
2495    information, we mustn't try to generate any address information for nodes
2496    marked as "abstract instances" because we don't actually generate
2497    any code or allocate any data space for such instances.  */
2498 #define DECL_ABSTRACT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
2499
2500 /* Language-specific decl information.  */
2501 #define DECL_LANG_SPECIFIC(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
2502
2503 /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
2504    do not allocate storage, and refer to a definition elsewhere.  Note that
2505    this does not necessarily imply the entity represented by NODE
2506    has no program source-level definition in this translation unit.  For
2507    example, for a FUNCTION_DECL, DECL_SAVED_TREE may be non-NULL and
2508    DECL_EXTERNAL may be true simultaneously; that can be the case for
2509    a C99 "extern inline" function.  */
2510 #define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_2)
2511
2512 /* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
2513    initializations.  */
2514 #define DEFAULT_INIT_PRIORITY 65535
2515 #define MAX_INIT_PRIORITY 65535
2516 #define MAX_RESERVED_INIT_PRIORITY 100
2517
2518
2519 /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
2520    For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
2521
2522    For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
2523
2524    Also set in some languages for variables, etc., outside the normal
2525    lexical scope, such as class instance variables.  */
2526 #define DECL_NONLOCAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
2527
2528 /* Used in VAR_DECLs to indicate that the variable is a vtable.
2529    Used in FIELD_DECLs for vtable pointers.
2530    Used in FUNCTION_DECLs to indicate that the function is virtual.  */
2531 #define DECL_VIRTUAL_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
2532
2533 /* Used to indicate that this DECL represents a compiler-generated entity.  */
2534 #define DECL_ARTIFICIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
2535
2536 /* Additional flags for language-specific uses.  */
2537 #define DECL_LANG_FLAG_0(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
2538 #define DECL_LANG_FLAG_1(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
2539 #define DECL_LANG_FLAG_2(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
2540 #define DECL_LANG_FLAG_3(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
2541 #define DECL_LANG_FLAG_4(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
2542 #define DECL_LANG_FLAG_5(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
2543 #define DECL_LANG_FLAG_6(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
2544 #define DECL_LANG_FLAG_7(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
2545
2546 /* Used to indicate an alias set for the memory pointed to by this
2547    particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have
2548    pointer (or reference) type.  */
2549 #define DECL_POINTER_ALIAS_SET(NODE) \
2550   (DECL_COMMON_CHECK (NODE)->decl_common.pointer_alias_set)
2551
2552 /* Nonzero if an alias set has been assigned to this declaration.  */
2553 #define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
2554   (DECL_POINTER_ALIAS_SET (NODE) != - 1)
2555
2556 /* Nonzero for a decl which is at file scope.  */
2557 #define DECL_FILE_SCOPE_P(EXP)                                  \
2558   (! DECL_CONTEXT (EXP)                                         \
2559    || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
2560
2561 /* Nonzero for a decl that is decorated using attribute used.
2562    This indicates compiler tools that this decl needs to be preserved.  */
2563 #define DECL_PRESERVE_P(DECL) \
2564   DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
2565
2566 /* For function local variables of COMPLEX type, indicates that the
2567    variable is not aliased, and that all modifications to the variable
2568    have been adjusted so that they are killing assignments.  Thus the
2569    variable may now be treated as a GIMPLE register, and use real
2570    instead of virtual ops in SSA form.  */
2571 #define DECL_COMPLEX_GIMPLE_REG_P(DECL) \
2572   DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag
2573
2574 /* This is true if DECL is call clobbered in the current function.
2575    The result of this flag should always be the same as
2576    bitmap_bit_p (call_clobbered_vars, DECL_UID (decl)).  */
2577 #define DECL_CALL_CLOBBERED(DECL) \
2578   DECL_COMMON_CHECK (DECL)->decl_common.call_clobbered_flag
2579
2580 struct tree_decl_common GTY(())
2581 {
2582   struct tree_decl_minimal common;
2583   tree size;
2584
2585   ENUM_BITFIELD(machine_mode) mode : 8;
2586
2587   unsigned nonlocal_flag : 1;
2588   unsigned virtual_flag : 1;
2589   unsigned ignored_flag : 1;
2590   unsigned abstract_flag : 1;
2591   unsigned artificial_flag : 1;
2592   unsigned user_align : 1;
2593   unsigned preserve_flag: 1;
2594   unsigned debug_expr_is_from : 1;
2595
2596   unsigned lang_flag_0 : 1;
2597   unsigned lang_flag_1 : 1;
2598   unsigned lang_flag_2 : 1;
2599   unsigned lang_flag_3 : 1;
2600   unsigned lang_flag_4 : 1;
2601   unsigned lang_flag_5 : 1;
2602   unsigned lang_flag_6 : 1;
2603   unsigned lang_flag_7 : 1;
2604
2605   /* In LABEL_DECL, this is DECL_ERROR_ISSUED.
2606      In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
2607   unsigned decl_flag_0 : 1;
2608   /* In FIELD_DECL, this is DECL_PACKED.  */
2609   unsigned decl_flag_1 : 1;
2610   /* In FIELD_DECL, this is DECL_BIT_FIELD
2611      In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
2612      In TYPE_DECL, this is TYPE_DECL_SUPRESS_DEBUG.  */
2613   unsigned decl_flag_2 : 1;
2614   /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P
2615      In VAR_DECL and PARM_DECL, this is DECL_HAS_VALUE_EXPR.  */
2616   unsigned decl_flag_3 : 1;
2617   /* Logically, these two would go in a theoretical base shared by var and
2618      parm decl. */
2619   unsigned gimple_reg_flag : 1;
2620   unsigned call_clobbered_flag : 1;
2621
2622   /* APPLE LOCAL duplicate decls in multiple files. */
2623   unsigned duplicate_decl : 1;
2624
2625   unsigned int align : 24;
2626   /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs.  */
2627   unsigned int off_align : 8;
2628
2629   tree size_unit;
2630   tree initial;
2631   tree attributes;
2632   tree abstract_origin;
2633
2634   HOST_WIDE_INT pointer_alias_set;
2635   /* Points to a structure whose details depend on the language in use.  */
2636   struct lang_decl *lang_specific;
2637 };
2638
2639 extern tree decl_value_expr_lookup (tree);
2640 extern void decl_value_expr_insert (tree, tree);
2641
2642 /* In a VAR_DECL or PARM_DECL, the location at which the value may be found,
2643    if transformations have made this more complicated than evaluating the
2644    decl itself.  This should only be used for debugging; once this field has
2645    been set, the decl itself may not legitimately appear in the function.  */
2646 #define DECL_HAS_VALUE_EXPR_P(NODE) \
2647   (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_flag_3)
2648 #define DECL_VALUE_EXPR(NODE) \
2649   (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
2650 #define SET_DECL_VALUE_EXPR(NODE, VAL)                  \
2651   (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
2652
2653 /* Holds the RTL expression for the value of a variable or function.
2654    This value can be evaluated lazily for functions, variables with
2655    static storage duration, and labels.  */
2656 #define DECL_RTL(NODE)                                  \
2657   (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl            \
2658    ? (NODE)->decl_with_rtl.rtl                                  \
2659    : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl))
2660
2661 /* Set the DECL_RTL for NODE to RTL.  */
2662 #define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL)
2663
2664 /* Returns nonzero if NODE is a tree node that can contain RTL.  */
2665 #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
2666
2667 /* Returns nonzero if the DECL_RTL for NODE has already been set.  */
2668 #define DECL_RTL_SET_P(NODE)  (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
2669
2670 /* Copy the RTL from NODE1 to NODE2.  If the RTL was not set for
2671    NODE1, it will not be set for NODE2; this is a lazy copy.  */
2672 #define COPY_DECL_RTL(NODE1, NODE2) \
2673   (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
2674
2675 /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set.  */
2676 #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
2677
2678 /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'.  */
2679 #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
2680
2681 struct tree_decl_with_rtl GTY(())
2682 {
2683   struct tree_decl_common common;
2684   rtx rtl;
2685 };
2686
2687 /* In a FIELD_DECL, this is the field position, counting in bytes, of the
2688    DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
2689    of the structure.  */
2690 #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset)
2691
2692 /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the
2693    field from DECL_FIELD_OFFSET.  This field may be nonzero even for fields
2694    that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
2695    natural alignment of the field's type).  */
2696 #define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
2697
2698 /* In a FIELD_DECL, this indicates whether the field was a bit-field and
2699    if so, the type that was originally specified for it.
2700    TREE_TYPE may have been modified (in finish_struct).  */
2701 #define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
2702
2703 /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
2704    if nonzero, indicates that the field occupies the type.  */
2705 #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
2706
2707 /* For FIELD_DECLs, off_align holds the number of low-order bits of
2708    DECL_FIELD_OFFSET which are known to be always zero.
2709    DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
2710    has.  */
2711 #define DECL_OFFSET_ALIGN(NODE) \
2712   (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
2713
2714 /* Specify that DECL_ALIGN(NODE) is a multiple of X.  */
2715 #define SET_DECL_OFFSET_ALIGN(NODE, X) \
2716   (FIELD_DECL_CHECK (NODE)->decl_common.off_align = exact_log2 ((X) & -(X)))
2717 /* 1 if the alignment for this type was requested by "aligned" attribute,
2718    0 if it is the default for this type.  */
2719
2720 /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
2721    which this FIELD_DECL is defined.  This information is needed when
2722    writing debugging information about vfield and vbase decls for C++.  */
2723 #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext)
2724
2725 /* In a FIELD_DECL, indicates this field should be bit-packed.  */
2726 #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1)
2727
2728 /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
2729    specially.  */
2730 #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
2731
2732 /* Used in a FIELD_DECL to indicate that we cannot form the address of
2733    this component.  */
2734 #define DECL_NONADDRESSABLE_P(NODE) \
2735   (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)
2736
2737 struct tree_field_decl GTY(())
2738 {
2739   struct tree_decl_common common;
2740
2741   tree offset;
2742   tree bit_field_type;
2743   tree qualifier;
2744   tree bit_offset;
2745   tree fcontext;
2746
2747 };
2748
2749 /* A numeric unique identifier for a LABEL_DECL.  The UID allocation is
2750    dense, unique within any one function, and may be used to index arrays.
2751    If the value is -1, then no UID has been assigned.  */
2752 #define LABEL_DECL_UID(NODE) \
2753   (LABEL_DECL_CHECK (NODE)->decl_common.pointer_alias_set)
2754
2755 /* In LABEL_DECL nodes, nonzero means that an error message about
2756    jumping into such a binding contour has been printed for this label.  */
2757 #define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl_common.decl_flag_0)
2758
2759 struct tree_label_decl GTY(())
2760 {
2761   struct tree_decl_with_rtl common;
2762   /* Java's verifier has some need to store information about labels,
2763      and was using fields that no longer exist on labels.
2764      Once the verifier doesn't need these anymore, they should be removed.  */
2765   tree java_field_1;
2766   tree java_field_2;
2767   tree java_field_3;
2768   unsigned int java_field_4;
2769
2770 };
2771
2772 struct tree_result_decl GTY(())
2773 {
2774   struct tree_decl_with_rtl common;
2775 };
2776
2777 struct tree_const_decl GTY(())
2778 {
2779   struct tree_decl_with_rtl common;
2780 };
2781
2782 /* For a PARM_DECL, records the data type used to pass the argument,
2783    which may be different from the type seen in the program.  */
2784 #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
2785
2786 /* For PARM_DECL, holds an RTL for the stack slot or register
2787    where the data was actually passed.  */
2788 #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
2789
2790 struct tree_parm_decl GTY(())
2791 {
2792   struct tree_decl_with_rtl common;
2793   rtx incoming_rtl;
2794 };
2795
2796
2797 /* Nonzero in a decl means that the gimplifier has seen (or placed)
2798    this variable in a BIND_EXPR.  */
2799 #define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
2800   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
2801
2802 /* Used to indicate that the linkage status of this DECL is not yet known,
2803    so it should not be output now.  */
2804 #define DECL_DEFER_OUTPUT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
2805
2806 /* APPLE LOCAL duplicate decls in multiple files. */
2807 #define DECL_DUPLICATE_DECL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.duplicate_decl)
2808
2809 /* Nonzero for a given ..._DECL node means that no warnings should be
2810    generated just because this node is unused.  */
2811 #define DECL_IN_SYSTEM_HEADER(NODE) \
2812   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.in_system_header_flag)
2813
2814   /* Used to indicate that this DECL has weak linkage.  */
2815 #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
2816
2817 /* Internal to the gimplifier.  Indicates that the value is a formal
2818    temporary controlled by the gimplifier.  */
2819 #define DECL_GIMPLE_FORMAL_TEMP_P(DECL) \
2820   DECL_WITH_VIS_CHECK (DECL)->decl_with_vis.gimple_formal_temp
2821
2822 /* Used to indicate that the DECL is a dllimport.  */
2823 #define DECL_DLLIMPORT_P(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
2824
2825 /* DECL_BASED_ON_RESTRICT_P records whether a VAR_DECL is a temporary
2826    based on a variable with a restrict qualified type.  If it is,
2827    DECL_RESTRICT_BASE returns the restrict qualified variable on which
2828    it is based.  */
2829
2830 #define DECL_BASED_ON_RESTRICT_P(NODE) \
2831   (VAR_DECL_CHECK (NODE)->decl_with_vis.based_on_restrict_p)
2832 #define DECL_GET_RESTRICT_BASE(NODE) \
2833   (decl_restrict_base_lookup (VAR_DECL_CHECK (NODE)))
2834 #define SET_DECL_RESTRICT_BASE(NODE, VAL) \
2835   (decl_restrict_base_insert (VAR_DECL_CHECK (NODE), (VAL)))
2836
2837 extern tree decl_restrict_base_lookup (tree);
2838 extern void decl_restrict_base_insert (tree, tree);
2839
2840 /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
2841    not be put out unless it is needed in this translation unit.
2842    Entities like this are shared across translation units (like weak
2843    entities), but are guaranteed to be generated by any translation
2844    unit that needs them, and therefore need not be put out anywhere
2845    where they are not needed.  DECL_COMDAT is just a hint to the
2846    back-end; it is up to front-ends which set this flag to ensure
2847    that there will never be any harm, other than bloat, in putting out
2848    something which is DECL_COMDAT.  */
2849 #define DECL_COMDAT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
2850
2851 /* A replaceable function is one which may be replaced at link-time
2852    with an entirely different definition, provided that the
2853    replacement has the same type.  For example, functions declared
2854    with __attribute__((weak)) on most systems are replaceable.  
2855
2856    COMDAT functions are not replaceable, since all definitions of the
2857    function must be equivalent.  It is important that COMDAT functions
2858    not be treated as replaceable so that use of C++ template
2859    instantiations is not penalized.  
2860
2861    For example, DECL_REPLACEABLE is used to determine whether or not a
2862    function (including a template instantiation) which is not
2863    explicitly declared "inline" can be inlined.  If the function is
2864    DECL_REPLACEABLE then it is not safe to do the inlining, since the
2865    implementation chosen at link-time may be different.  However, a
2866    function that is not DECL_REPLACEABLE can be inlined, since all
2867    versions of the function will be functionally identical.  */
2868 #define DECL_REPLACEABLE_P(NODE) \
2869   (!DECL_COMDAT (NODE) && !targetm.binds_local_p (NODE))
2870
2871 /* The name of the object as the assembler will see it (but before any
2872    translations made by ASM_OUTPUT_LABELREF).  Often this is the same
2873    as DECL_NAME.  It is an IDENTIFIER_NODE.  */
2874 #define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
2875
2876 /* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
2877    This is true of all DECL nodes except FIELD_DECL.  */
2878 #define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
2879   (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))
2880
2881 /* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set.  If zero,
2882    the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
2883    yet.  */
2884 #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
2885   (HAS_DECL_ASSEMBLER_NAME_P (NODE) &&  DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
2886
2887 /* Set the DECL_ASSEMBLER_NAME for NODE to NAME.  */
2888 #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
2889   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME))
2890
2891 /* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2.  Note that if DECL1's
2892    DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause
2893    the DECL_ASSEMBLER_NAME of either DECL to be set.  In other words, the
2894    semantics of using this macro, are different than saying:
2895
2896      SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1))
2897
2898    which will try to set the DECL_ASSEMBLER_NAME for DECL1.  */
2899
2900 #define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2)                          \
2901   (DECL_ASSEMBLER_NAME_SET_P (DECL1)                                    \
2902    ? (void) SET_DECL_ASSEMBLER_NAME (DECL2,                             \
2903                                      DECL_ASSEMBLER_NAME (DECL1))       \
2904    : (void) 0)
2905
2906 /* Records the section name in a section attribute.  Used to pass
2907    the name from decl_attributes to make_function_rtl and make_decl_rtl.  */
2908 #define DECL_SECTION_NAME(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name)
2909
2910 /* Value of the decls's visibility attribute */
2911 #define DECL_VISIBILITY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
2912
2913 /* Nonzero means that the decl had its visibility specified rather than
2914    being inferred.  */
2915 #define DECL_VISIBILITY_SPECIFIED(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
2916
2917 /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
2918    multiple translation units should be merged.  */
2919 #define DECL_ONE_ONLY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.one_only)
2920
2921 struct tree_decl_with_vis GTY(())
2922 {
2923  struct tree_decl_with_rtl common;
2924  tree assembler_name;
2925  tree section_name;
2926
2927  /* Belong to VAR_DECL exclusively.  */
2928  unsigned defer_output:1;
2929  unsigned hard_register:1;
2930  unsigned thread_local:1;
2931  unsigned common_flag:1;
2932  unsigned in_text_section : 1;
2933  unsigned gimple_formal_temp : 1;
2934  unsigned dllimport_flag : 1;
2935  unsigned based_on_restrict_p : 1;
2936  /* Used by C++.  Might become a generic decl flag.  */
2937  unsigned shadowed_for_var_p : 1;
2938
2939  /* Don't belong to VAR_DECL exclusively.  */
2940  unsigned in_system_header_flag : 1;
2941  unsigned weak_flag:1;
2942  unsigned seen_in_bind_expr : 1;
2943  unsigned comdat_flag : 1;
2944  ENUM_BITFIELD(symbol_visibility) visibility : 2;
2945  unsigned visibility_specified : 1;
2946  /* Belong to FUNCTION_DECL exclusively.  */
2947  unsigned one_only : 1;
2948  unsigned init_priority_p:1;
2949
2950  /* Belongs to VAR_DECL exclusively.  */
2951  ENUM_BITFIELD(tls_model) tls_model : 3;
2952
2953  /* APPLE LOCAL begin radar 5732232 - blocks */
2954  /* Belong to VAR_DECL exclusively. */
2955  unsigned block_decl_byref : 1;
2956  unsigned block_decl_copied : 1;
2957  /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */
2958  unsigned copyable_byref_local_var : 1;
2959  unsigned copyable_byref_local_nonpod : 1;
2960  /* APPLE LOCAL radar 6172148 */
2961  unsigned block_synthesized_function : 1;
2962  /* APPLE LOCAL radar 5847976 */
2963  unsigned block_weak : 1;
2964  /* 5 unused bits. */
2965  /* APPLE LOCAL end radar 5932809 - copyable byref blocks */
2966  /* APPLE LOCAL end radar 5732232 - blocks */
2967 };
2968
2969 /* In a VAR_DECL that's static,
2970    nonzero if the space is in the text section.  */
2971 #define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
2972
2973 /* Nonzero for a given ..._DECL node means that this node should be
2974    put in .common, if possible.  If a DECL_INITIAL is given, and it
2975    is not error_mark_node, then the decl cannot be put in .common.  */
2976 #define DECL_COMMON(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
2977
2978 /* In a VAR_DECL, nonzero if the decl is a register variable with
2979    an explicit asm specification.  */
2980 #define DECL_HARD_REGISTER(NODE)  (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
2981
2982 extern tree decl_debug_expr_lookup (tree);
2983 extern void decl_debug_expr_insert (tree, tree);
2984 /* For VAR_DECL, this is set to either an expression that it was split
2985    from (if DECL_DEBUG_EXPR_IS_FROM is true), otherwise a tree_list of
2986    subexpressions that it was split into.  */
2987 #define DECL_DEBUG_EXPR(NODE) \
2988   (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE)))
2989
2990 #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
2991   (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
2992
2993
2994 extern unsigned short decl_init_priority_lookup (tree);
2995 extern void decl_init_priority_insert (tree, unsigned short);
2996
2997 /* In a non-local VAR_DECL with static storage duration, this is the
2998    initialization priority.  If this value is zero, the NODE will be
2999    initialized at the DEFAULT_INIT_PRIORITY.  Only used by C++ FE*/
3000
3001 #define DECL_HAS_INIT_PRIORITY_P(NODE) \
3002   (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
3003 #define DECL_INIT_PRIORITY(NODE) \
3004   (decl_init_priority_lookup (VAR_DECL_CHECK (NODE)))
3005 #define SET_DECL_INIT_PRIORITY(NODE, VAL) \
3006   (decl_init_priority_insert (VAR_DECL_CHECK (NODE), VAL))
3007
3008 /* In a VAR_DECL, the model to use if the data should be allocated from
3009    thread-local storage.  */
3010 #define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
3011
3012 /* APPLE LOCAL begin radar 5732232 - blocks */
3013 #define BLOCK_DECL_BYREF(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_byref)
3014 #define BLOCK_DECL_COPIED(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_copied)
3015 /* APPLE LOCAL end radar 5732232 - blocks */
3016 /* APPLE LOCAL radar 6172148 */
3017 #define BLOCK_SYNTHESIZED_FUNC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.block_synthesized_function)
3018 /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */
3019 #define COPYABLE_BYREF_LOCAL_VAR(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_var)
3020 #define COPYABLE_BYREF_LOCAL_NONPOD(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_nonpod)
3021 /* APPLE LOCAL radar 5847976 */
3022 #define COPYABLE_WEAK_BLOCK(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_weak)
3023 /* APPLE LOCAL end radar 5932809 - copyable byref blocks */
3024
3025 /* In a VAR_DECL, nonzero if the data should be allocated from
3026    thread-local storage.  */
3027 #define DECL_THREAD_LOCAL_P(NODE) \
3028   (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model != TLS_MODEL_NONE)
3029
3030 struct tree_var_decl GTY(())
3031 {
3032   struct tree_decl_with_vis common;
3033 };
3034
3035
3036 /* This field is used to reference anything in decl.result and is meant only
3037    for use by the garbage collector.  */
3038 #define DECL_RESULT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
3039
3040 /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
3041    Before the struct containing the FUNCTION_DECL is laid out,
3042    DECL_VINDEX may point to a FUNCTION_DECL in a base class which
3043    is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
3044    function.  When the class is laid out, this pointer is changed
3045    to an INTEGER_CST node which is suitable for use as an index
3046    into the virtual function table.
3047    C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK.  */
3048 #define DECL_VINDEX(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
3049
3050 struct tree_decl_non_common GTY(())
3051
3052 {
3053   struct tree_decl_with_vis common;
3054   /* C++ uses this in namespaces.  */
3055   tree saved_tree;
3056   /* C++ uses this in templates.  */
3057   tree arguments;
3058   /* Almost all FE's use this.  */
3059   tree result;
3060   /* C++ uses this in namespaces.  */
3061   tree vindex;
3062 };
3063
3064 /* In FUNCTION_DECL, holds the decl for the return value.  */
3065 #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
3066
3067 /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
3068 #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
3069
3070 /* In a FUNCTION_DECL, the saved representation of the body of the
3071    entire function.  */
3072 #define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree)
3073
3074 /* Nonzero in a FUNCTION_DECL means this function should be treated
3075    as if it were a malloc, meaning it returns a pointer that is
3076    not an alias.  */
3077 #define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
3078
3079 /* Nonzero in a FUNCTION_DECL means this function may return more
3080    than once.  */
3081 #define DECL_IS_RETURNS_TWICE(NODE) \
3082   (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag)
3083
3084 /* Nonzero in a FUNCTION_DECL means this function should be treated
3085    as "pure" function (like const function, but may read global memory).  */
3086 #define DECL_IS_PURE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)
3087
3088 /* Nonzero in a FUNCTION_DECL means this function should be treated
3089    as "novops" function (function that does not read global memory,
3090    but may have arbitrary side effects).  */
3091 #define DECL_IS_NOVOPS(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
3092
3093 /* Used in FUNCTION_DECLs to indicate that they should be run automatically
3094    at the beginning or end of execution.  */
3095 #define DECL_STATIC_CONSTRUCTOR(NODE) \
3096   (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag)
3097
3098 #define DECL_STATIC_DESTRUCTOR(NODE) \
3099 (FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag)
3100
3101 /* Used in FUNCTION_DECLs to indicate that function entry and exit should
3102    be instrumented with calls to support routines.  */
3103 #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \
3104   (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit)
3105
3106 /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
3107    disabled in this function.  */
3108 #define DECL_NO_LIMIT_STACK(NODE) \
3109   (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
3110
3111 /* In a FUNCTION_DECL with a nonzero DECL_CONTEXT, indicates that a
3112    static chain is not needed.  */
3113 #define DECL_NO_STATIC_CHAIN(NODE) \
3114   (FUNCTION_DECL_CHECK (NODE)->function_decl.regdecl_flag)
3115
3116 /* Nonzero for a decl that cgraph has decided should be inlined into
3117    at least one call site.  It is not meaningful to look at this
3118    directly; always use cgraph_function_possibly_inlined_p.  */
3119 #define DECL_POSSIBLY_INLINED(DECL) \
3120   FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
3121
3122 /* Nonzero in a FUNCTION_DECL means this function can be substituted
3123    where it is called.  */
3124 #define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag)
3125
3126 /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
3127    such as via the `inline' keyword in C/C++.  This flag controls the linkage
3128    semantics of 'inline'; whether or not the function is inlined is
3129    controlled by DECL_INLINE.  */
3130 #define DECL_DECLARED_INLINE_P(NODE) \
3131   (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
3132
3133 /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
3134    that describes the status of this function.  */
3135 #define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
3136
3137 /* In a FUNCTION_DECL, nonzero means a built in function.  */
3138 #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
3139
3140 /* For a builtin function, identify which part of the compiler defined it.  */
3141 #define DECL_BUILT_IN_CLASS(NODE) \
3142    (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class)
3143
3144 /* In FUNCTION_DECL, a chain of ..._DECL nodes.
3145    VAR_DECL and PARM_DECL reserve the arguments slot for language-specific
3146    uses.  */
3147 #define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
3148 #define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
3149
3150 /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
3151    arguments/result/saved_tree fields by front ends.   It was either inherit
3152    FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
3153    which seemed a bit strange.  */
3154
3155 struct tree_function_decl GTY(())
3156 {
3157   struct tree_decl_non_common common;
3158
3159   /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
3160      DECL_FUNCTION_CODE.  Otherwise unused.  */
3161   enum built_in_function function_code;
3162
3163   unsigned static_ctor_flag : 1;
3164   unsigned static_dtor_flag : 1;
3165   unsigned uninlinable : 1;
3166   unsigned possibly_inlined : 1;
3167   unsigned novops_flag : 1;
3168   unsigned returns_twice_flag : 1;
3169   unsigned malloc_flag : 1;
3170   unsigned pure_flag : 1;
3171
3172   unsigned declared_inline_flag : 1;
3173   unsigned regdecl_flag : 1;
3174   unsigned inline_flag : 1;
3175   unsigned no_instrument_function_entry_exit : 1;
3176   unsigned no_limit_stack : 1;
3177   ENUM_BITFIELD(built_in_class) built_in_class : 2;
3178
3179   struct function *f;
3180 };
3181
3182 /* For a TYPE_DECL, holds the "original" type.  (TREE_TYPE has the copy.) */
3183 #define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
3184
3185 /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
3186    into stabs.  Instead it will generate cross reference ('x') of names.
3187    This uses the same flag as DECL_EXTERNAL.  */
3188 #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
3189   (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_2)
3190
3191 struct tree_type_decl GTY(())
3192 {
3193   struct tree_decl_non_common common;
3194
3195 };
3196 \f
3197 /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
3198    To reduce overhead, the nodes containing the statements are not trees.
3199    This avoids the overhead of tree_common on all linked list elements.
3200
3201    Use the interface in tree-iterator.h to access this node.  */
3202
3203 #define STATEMENT_LIST_HEAD(NODE) \
3204   (STATEMENT_LIST_CHECK (NODE)->stmt_list.head)
3205 #define STATEMENT_LIST_TAIL(NODE) \
3206   (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
3207
3208 struct tree_statement_list_node
3209   GTY ((chain_next ("%h.next"), chain_prev ("%h.prev")))
3210 {
3211   struct tree_statement_list_node *prev;
3212   struct tree_statement_list_node *next;
3213   tree stmt;
3214 };
3215
3216 struct tree_statement_list
3217   GTY(())
3218 {
3219   struct tree_common common;
3220   struct tree_statement_list_node *head;
3221   struct tree_statement_list_node *tail;
3222 };
3223
3224 #define VALUE_HANDLE_ID(NODE)           \
3225   (VALUE_HANDLE_CHECK (NODE)->value_handle.id)
3226
3227 #define VALUE_HANDLE_EXPR_SET(NODE)     \
3228   (VALUE_HANDLE_CHECK (NODE)->value_handle.expr_set)
3229
3230 #define VALUE_HANDLE_VUSES(NODE)        \
3231   (VALUE_HANDLE_CHECK (NODE)->value_handle.vuses)
3232
3233 /* Defined and used in tree-ssa-pre.c.  */
3234 struct value_set;
3235
3236 struct tree_value_handle GTY(())
3237 {
3238   struct tree_common common;
3239
3240   /* The set of expressions represented by this handle.  */
3241   struct value_set * GTY ((skip)) expr_set;
3242
3243   /* Unique ID for this value handle.  IDs are handed out in a
3244      conveniently dense form starting at 0, so that we can make
3245      bitmaps of value handles.  */
3246   unsigned int id;
3247
3248   /* Set of virtual uses represented by this handle.  */
3249   VEC (tree, gc) *vuses;
3250 };
3251 \f
3252 /* Define the overall contents of a tree node.
3253    It may be any of the structures declared above
3254    for various types of node.  */
3255
3256 union tree_node GTY ((ptr_alias (union lang_tree_node),
3257                       desc ("tree_node_structure (&%h)")))
3258 {
3259   struct tree_common GTY ((tag ("TS_COMMON"))) common;
3260   struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
3261   struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
3262   struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
3263   struct tree_string GTY ((tag ("TS_STRING"))) string;
3264   struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
3265   struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
3266   struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal;
3267   struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common;
3268   struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl;
3269   struct tree_decl_non_common  GTY ((tag ("TS_DECL_NON_COMMON"))) decl_non_common;
3270   struct tree_parm_decl  GTY  ((tag ("TS_PARM_DECL"))) parm_decl;
3271   struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis;
3272   struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl;
3273   struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl;
3274   struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl;
3275   struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl;
3276   struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
3277   struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
3278   struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
3279   struct tree_type GTY ((tag ("TS_TYPE"))) type;
3280   struct tree_list GTY ((tag ("TS_LIST"))) list;
3281   struct tree_vec GTY ((tag ("TS_VEC"))) vec;
3282   struct tree_exp GTY ((tag ("TS_EXP"))) exp;
3283   struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
3284   struct tree_phi_node GTY ((tag ("TS_PHI_NODE"))) phi;
3285   struct tree_block GTY ((tag ("TS_BLOCK"))) block;
3286   struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
3287   struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
3288   struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
3289   struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
3290   struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
3291   struct tree_struct_field_tag GTY ((tag ("TS_STRUCT_FIELD_TAG"))) sft;
3292   struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
3293 };
3294 \f
3295 /* Standard named or nameless data types of the C compiler.  */
3296
3297 enum tree_index
3298 {
3299   TI_ERROR_MARK,
3300   TI_INTQI_TYPE,
3301   TI_INTHI_TYPE,
3302   TI_INTSI_TYPE,
3303   TI_INTDI_TYPE,
3304   TI_INTTI_TYPE,
3305
3306   TI_UINTQI_TYPE,
3307   TI_UINTHI_TYPE,
3308   TI_UINTSI_TYPE,
3309   TI_UINTDI_TYPE,
3310   TI_UINTTI_TYPE,
3311
3312   TI_UINT32_TYPE,
3313   TI_UINT64_TYPE,
3314
3315   TI_INTEGER_ZERO,
3316   TI_INTEGER_ONE,
3317   TI_INTEGER_MINUS_ONE,
3318   TI_NULL_POINTER,
3319
3320   TI_SIZE_ZERO,
3321   TI_SIZE_ONE,
3322
3323   TI_BITSIZE_ZERO,
3324   TI_BITSIZE_ONE,
3325   TI_BITSIZE_UNIT,
3326
3327   TI_PUBLIC,
3328   TI_PROTECTED,
3329   TI_PRIVATE,
3330
3331   TI_BOOLEAN_FALSE,
3332   TI_BOOLEAN_TRUE,
3333
3334   TI_COMPLEX_INTEGER_TYPE,
3335   TI_COMPLEX_FLOAT_TYPE,
3336   TI_COMPLEX_DOUBLE_TYPE,
3337   TI_COMPLEX_LONG_DOUBLE_TYPE,
3338
3339   TI_FLOAT_TYPE,
3340   TI_DOUBLE_TYPE,
3341   TI_LONG_DOUBLE_TYPE,
3342
3343   TI_FLOAT_PTR_TYPE,
3344   TI_DOUBLE_PTR_TYPE,
3345   TI_LONG_DOUBLE_PTR_TYPE,
3346   TI_INTEGER_PTR_TYPE,
3347
3348   TI_VOID_TYPE,
3349   TI_PTR_TYPE,
3350   TI_CONST_PTR_TYPE,
3351   TI_SIZE_TYPE,
3352   TI_PID_TYPE,
3353   TI_PTRDIFF_TYPE,
3354   TI_VA_LIST_TYPE,
3355   TI_VA_LIST_GPR_COUNTER_FIELD,
3356   TI_VA_LIST_FPR_COUNTER_FIELD,
3357   TI_BOOLEAN_TYPE,
3358   TI_FILEPTR_TYPE,
3359
3360   TI_DFLOAT32_TYPE,
3361   TI_DFLOAT64_TYPE,
3362   TI_DFLOAT128_TYPE,
3363   TI_DFLOAT32_PTR_TYPE,
3364   TI_DFLOAT64_PTR_TYPE,
3365   TI_DFLOAT128_PTR_TYPE,
3366
3367   TI_VOID_LIST_NODE,
3368
3369   TI_MAIN_IDENTIFIER,
3370
3371   TI_MAX
3372 };
3373
3374 extern GTY(()) tree global_trees[TI_MAX];
3375
3376 #define error_mark_node                 global_trees[TI_ERROR_MARK]
3377
3378 #define intQI_type_node                 global_trees[TI_INTQI_TYPE]
3379 #define intHI_type_node                 global_trees[TI_INTHI_TYPE]
3380 #define intSI_type_node                 global_trees[TI_INTSI_TYPE]
3381 #define intDI_type_node                 global_trees[TI_INTDI_TYPE]
3382 #define intTI_type_node                 global_trees[TI_INTTI_TYPE]
3383
3384 #define unsigned_intQI_type_node        global_trees[TI_UINTQI_TYPE]
3385 #define unsigned_intHI_type_node        global_trees[TI_UINTHI_TYPE]
3386 #define unsigned_intSI_type_node        global_trees[TI_UINTSI_TYPE]
3387 #define unsigned_intDI_type_node        global_trees[TI_UINTDI_TYPE]
3388 #define unsigned_intTI_type_node        global_trees[TI_UINTTI_TYPE]
3389
3390 #define uint32_type_node                global_trees[TI_UINT32_TYPE]
3391 #define uint64_type_node                global_trees[TI_UINT64_TYPE]
3392
3393 #define integer_zero_node               global_trees[TI_INTEGER_ZERO]
3394 #define integer_one_node                global_trees[TI_INTEGER_ONE]
3395 #define integer_minus_one_node          global_trees[TI_INTEGER_MINUS_ONE]
3396 #define size_zero_node                  global_trees[TI_SIZE_ZERO]
3397 #define size_one_node                   global_trees[TI_SIZE_ONE]
3398 #define bitsize_zero_node               global_trees[TI_BITSIZE_ZERO]
3399 #define bitsize_one_node                global_trees[TI_BITSIZE_ONE]
3400 #define bitsize_unit_node               global_trees[TI_BITSIZE_UNIT]
3401
3402 /* Base access nodes.  */
3403 #define access_public_node              global_trees[TI_PUBLIC]
3404 #define access_protected_node           global_trees[TI_PROTECTED]
3405 #define access_private_node             global_trees[TI_PRIVATE]
3406
3407 #define null_pointer_node               global_trees[TI_NULL_POINTER]
3408
3409 #define float_type_node                 global_trees[TI_FLOAT_TYPE]
3410 #define double_type_node                global_trees[TI_DOUBLE_TYPE]
3411 #define long_double_type_node           global_trees[TI_LONG_DOUBLE_TYPE]
3412
3413 #define float_ptr_type_node             global_trees[TI_FLOAT_PTR_TYPE]
3414 #define double_ptr_type_node            global_trees[TI_DOUBLE_PTR_TYPE]
3415 #define long_double_ptr_type_node       global_trees[TI_LONG_DOUBLE_PTR_TYPE]
3416 #define integer_ptr_type_node           global_trees[TI_INTEGER_PTR_TYPE]
3417
3418 #define complex_integer_type_node       global_trees[TI_COMPLEX_INTEGER_TYPE]
3419 #define complex_float_type_node         global_trees[TI_COMPLEX_FLOAT_TYPE]
3420 #define complex_double_type_node        global_trees[TI_COMPLEX_DOUBLE_TYPE]
3421 #define complex_long_double_type_node   global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
3422
3423 #define void_type_node                  global_trees[TI_VOID_TYPE]
3424 /* The C type `void *'.  */
3425 #define ptr_type_node                   global_trees[TI_PTR_TYPE]
3426 /* The C type `const void *'.  */
3427 #define const_ptr_type_node             global_trees[TI_CONST_PTR_TYPE]
3428 /* The C type `size_t'.  */
3429 #define size_type_node                  global_trees[TI_SIZE_TYPE]
3430 #define pid_type_node                   global_trees[TI_PID_TYPE]
3431 #define ptrdiff_type_node               global_trees[TI_PTRDIFF_TYPE]
3432 #define va_list_type_node               global_trees[TI_VA_LIST_TYPE]
3433 #define va_list_gpr_counter_field       global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
3434 #define va_list_fpr_counter_field       global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
3435 /* The C type `FILE *'.  */
3436 #define fileptr_type_node               global_trees[TI_FILEPTR_TYPE]
3437
3438 #define boolean_type_node               global_trees[TI_BOOLEAN_TYPE]
3439 #define boolean_false_node              global_trees[TI_BOOLEAN_FALSE]
3440 #define boolean_true_node               global_trees[TI_BOOLEAN_TRUE]
3441
3442 /* The decimal floating point types. */
3443 #define dfloat32_type_node              global_trees[TI_DFLOAT32_TYPE]
3444 #define dfloat64_type_node              global_trees[TI_DFLOAT64_TYPE]
3445 #define dfloat128_type_node             global_trees[TI_DFLOAT128_TYPE]
3446 #define dfloat32_ptr_type_node          global_trees[TI_DFLOAT32_PTR_TYPE]
3447 #define dfloat64_ptr_type_node          global_trees[TI_DFLOAT64_PTR_TYPE]
3448 #define dfloat128_ptr_type_node         global_trees[TI_DFLOAT128_PTR_TYPE]
3449
3450 /* The node that should be placed at the end of a parameter list to
3451    indicate that the function does not take a variable number of
3452    arguments.  The TREE_VALUE will be void_type_node and there will be
3453    no TREE_CHAIN.  Language-independent code should not assume
3454    anything else about this node.  */
3455 #define void_list_node                  global_trees[TI_VOID_LIST_NODE]
3456
3457 #define main_identifier_node            global_trees[TI_MAIN_IDENTIFIER]
3458 #define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
3459
3460 /* An enumeration of the standard C integer types.  These must be
3461    ordered so that shorter types appear before longer ones, and so
3462    that signed types appear before unsigned ones, for the correct
3463    functioning of interpret_integer() in c-lex.c.  */
3464 enum integer_type_kind
3465 {
3466   itk_char,
3467   itk_signed_char,
3468   itk_unsigned_char,
3469   itk_short,
3470   itk_unsigned_short,
3471   itk_int,
3472   itk_unsigned_int,
3473   itk_long,
3474   itk_unsigned_long,
3475   itk_long_long,
3476   itk_unsigned_long_long,
3477   itk_none
3478 };
3479
3480 typedef enum integer_type_kind integer_type_kind;
3481
3482 /* The standard C integer types.  Use integer_type_kind to index into
3483    this array.  */
3484 extern GTY(()) tree integer_types[itk_none];
3485
3486 #define char_type_node                  integer_types[itk_char]
3487 #define signed_char_type_node           integer_types[itk_signed_char]
3488 #define unsigned_char_type_node         integer_types[itk_unsigned_char]
3489 #define short_integer_type_node         integer_types[itk_short]
3490 #define short_unsigned_type_node        integer_types[itk_unsigned_short]
3491 #define integer_type_node               integer_types[itk_int]
3492 #define unsigned_type_node              integer_types[itk_unsigned_int]
3493 #define long_integer_type_node          integer_types[itk_long]
3494 #define long_unsigned_type_node         integer_types[itk_unsigned_long]
3495 #define long_long_integer_type_node     integer_types[itk_long_long]
3496 #define long_long_unsigned_type_node    integer_types[itk_unsigned_long_long]
3497 \f
3498 /* Set to the default thread-local storage (tls) model to use.  */
3499
3500 extern enum tls_model flag_tls_default;
3501
3502 \f
3503 /* A pointer-to-function member type looks like:
3504
3505      struct {
3506        __P __pfn;
3507        ptrdiff_t __delta;
3508      };
3509
3510    If __pfn is NULL, it is a NULL pointer-to-member-function.
3511
3512    (Because the vtable is always the first thing in the object, we
3513    don't need its offset.)  If the function is virtual, then PFN is
3514    one plus twice the index into the vtable; otherwise, it is just a
3515    pointer to the function.
3516
3517    Unfortunately, using the lowest bit of PFN doesn't work in
3518    architectures that don't impose alignment requirements on function
3519    addresses, or that use the lowest bit to tell one ISA from another,
3520    for example.  For such architectures, we use the lowest bit of
3521    DELTA instead of the lowest bit of the PFN, and DELTA will be
3522    multiplied by 2.  */
3523
3524 enum ptrmemfunc_vbit_where_t
3525 {
3526   ptrmemfunc_vbit_in_pfn,
3527   ptrmemfunc_vbit_in_delta
3528 };
3529 \f
3530 #define NULL_TREE (tree) NULL
3531
3532 extern tree decl_assembler_name (tree);
3533
3534 /* Compute the number of bytes occupied by 'node'.  This routine only
3535    looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH.  */
3536
3537 extern size_t tree_size (tree);
3538
3539 /* Compute the number of bytes occupied by a tree with code CODE.  This
3540    function cannot be used for TREE_VEC or PHI_NODE codes, which are of
3541    variable length.  */
3542 extern size_t tree_code_size (enum tree_code);
3543
3544 /* Lowest level primitive for allocating a node.
3545    The TREE_CODE is the only argument.  Contents are initialized
3546    to zero except for a few of the common fields.  */
3547
3548 extern tree make_node_stat (enum tree_code MEM_STAT_DECL);
3549 #define make_node(t) make_node_stat (t MEM_STAT_INFO)
3550
3551 /* Make a copy of a node, with all the same contents.  */
3552
3553 extern tree copy_node_stat (tree MEM_STAT_DECL);
3554 #define copy_node(t) copy_node_stat (t MEM_STAT_INFO)
3555
3556 /* Make a copy of a chain of TREE_LIST nodes.  */
3557
3558 extern tree copy_list (tree);
3559
3560 /* Make a BINFO.  */
3561 extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
3562 #define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
3563
3564 /* Make a TREE_VEC.  */
3565
3566 extern tree make_tree_vec_stat (int MEM_STAT_DECL);
3567 #define make_tree_vec(t) make_tree_vec_stat (t MEM_STAT_INFO)
3568
3569 /* Tree nodes for SSA analysis.  */
3570
3571 extern void init_phinodes (void);
3572 extern void fini_phinodes (void);
3573 extern void release_phi_node (tree);
3574 #ifdef GATHER_STATISTICS
3575 extern void phinodes_print_statistics (void);
3576 #endif
3577
3578 extern void init_ssanames (void);
3579 extern void fini_ssanames (void);
3580 extern tree make_ssa_name (tree, tree);
3581 extern tree duplicate_ssa_name (tree, tree);
3582 extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
3583 extern void release_ssa_name (tree);
3584 extern void release_defs (tree);
3585 extern void replace_ssa_name_symbol (tree, tree);
3586
3587 #ifdef GATHER_STATISTICS
3588 extern void ssanames_print_statistics (void);
3589 #endif
3590
3591 /* Return the (unique) IDENTIFIER_NODE node for a given name.
3592    The name is supplied as a char *.  */
3593
3594 extern tree get_identifier (const char *);
3595
3596 #if GCC_VERSION >= 3000
3597 #define get_identifier(str) \
3598   (__builtin_constant_p (str)                           \
3599     ? get_identifier_with_length ((str), strlen (str))  \
3600     : get_identifier (str))
3601 #endif
3602
3603
3604 /* Identical to get_identifier, except that the length is assumed
3605    known.  */
3606
3607 extern tree get_identifier_with_length (const char *, size_t);
3608
3609 /* If an identifier with the name TEXT (a null-terminated string) has
3610    previously been referred to, return that node; otherwise return
3611    NULL_TREE.  */
3612
3613 extern tree maybe_get_identifier (const char *);
3614
3615 /* Construct various types of nodes.  */
3616
3617 extern tree build_nt (enum tree_code, ...);
3618
3619 extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
3620 #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
3621 extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
3622 #define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO)
3623 extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
3624 #define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO)
3625 extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
3626 #define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO)
3627 extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
3628                          tree MEM_STAT_DECL);
3629 #define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
3630 extern tree build5_stat (enum tree_code, tree, tree, tree, tree, tree,
3631                          tree MEM_STAT_DECL);
3632 #define build5(c,t1,t2,t3,t4,t5,t6) build5_stat (c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
3633 extern tree build7_stat (enum tree_code, tree, tree, tree, tree, tree,
3634                          tree, tree, tree MEM_STAT_DECL);
3635 #define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \
3636   build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO)
3637
3638 extern tree build_int_cst (tree, HOST_WIDE_INT);
3639 extern tree build_int_cst_type (tree, HOST_WIDE_INT);
3640 extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
3641 extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
3642 extern tree build_vector (tree, tree);
3643 extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
3644 extern tree build_constructor (tree, VEC(constructor_elt,gc) *);
3645 extern tree build_constructor_single (tree, tree, tree);
3646 extern tree build_constructor_from_list (tree, tree);
3647 extern tree build_real_from_int_cst (tree, tree);
3648 extern tree build_complex (tree, tree, tree);
3649 extern tree build_one_cst (tree);
3650 extern tree build_string (int, const char *);
3651 extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);
3652 #define build_tree_list(t,q) build_tree_list_stat(t,q MEM_STAT_INFO)
3653 extern tree build_decl_stat (enum tree_code, tree, tree MEM_STAT_DECL);
3654 extern tree build_fn_decl (const char *, tree);
3655 #define build_decl(c,t,q) build_decl_stat (c,t,q MEM_STAT_INFO)
3656 extern tree build_block (tree, tree, tree, tree);
3657 #ifndef USE_MAPPED_LOCATION
3658 extern void annotate_with_file_line (tree, const char *, int);
3659 extern void annotate_with_locus (tree, location_t);
3660 #endif
3661 extern tree build_empty_stmt (void);
3662 extern tree build_omp_clause (enum omp_clause_code);
3663
3664 /* Construct various nodes representing data types.  */
3665
3666 extern tree make_signed_type (int);
3667 extern tree make_unsigned_type (int);
3668 extern tree signed_type_for (tree);
3669 extern tree unsigned_type_for (tree);
3670 extern void initialize_sizetypes (bool);
3671 extern void set_sizetype (tree);
3672 extern void fixup_unsigned_type (tree);
3673 extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool);
3674 extern tree build_pointer_type (tree);
3675 /* APPLE LOCAL radar 5732232 - blocks */
3676 extern tree build_block_pointer_type (tree);
3677 extern tree build_reference_type_for_mode (tree, enum machine_mode, bool);
3678 extern tree build_reference_type (tree);
3679 extern tree build_vector_type_for_mode (tree, enum machine_mode);
3680 extern tree build_vector_type (tree innertype, int nunits);
3681 extern tree build_type_no_quals (tree);
3682 extern tree build_index_type (tree);
3683 extern tree build_index_2_type (tree, tree);
3684 extern tree build_array_type (tree, tree);
3685 extern tree build_function_type (tree, tree);
3686 extern tree build_function_type_list (tree, ...);
3687 extern tree build_method_type_directly (tree, tree, tree);
3688 extern tree build_method_type (tree, tree);
3689 extern tree build_offset_type (tree, tree);
3690 extern tree build_complex_type (tree);
3691 extern tree build_resx (int);
3692 extern tree array_type_nelts (tree);
3693 extern bool in_array_bounds_p (tree);
3694 extern bool range_in_array_bounds_p (tree);
3695
3696 extern tree value_member (tree, tree);
3697 extern tree purpose_member (tree, tree);
3698
3699 extern int attribute_list_equal (tree, tree);
3700 extern int attribute_list_contained (tree, tree);
3701 extern int tree_int_cst_equal (tree, tree);
3702 extern int tree_int_cst_lt (tree, tree);
3703 extern int tree_int_cst_compare (tree, tree);
3704 extern int host_integerp (tree, int);
3705 extern HOST_WIDE_INT tree_low_cst (tree, int);
3706 extern int tree_int_cst_msb (tree);
3707 extern int tree_int_cst_sgn (tree);
3708 extern int tree_int_cst_sign_bit (tree);
3709 extern int tree_expr_nonnegative_p (tree);
3710 extern int tree_expr_nonnegative_warnv_p (tree, bool *);
3711 extern bool may_negate_without_overflow_p (tree);
3712 extern tree get_inner_array_type (tree);
3713
3714 /* From expmed.c.  Since rtl.h is included after tree.h, we can't
3715    put the prototype here.  Rtl.h does declare the prototype if
3716    tree.h had been included.  */
3717
3718 extern tree make_tree (tree, rtx);
3719 \f
3720 /* Return a type like TTYPE except that its TYPE_ATTRIBUTES
3721    is ATTRIBUTE.
3722
3723    Such modified types already made are recorded so that duplicates
3724    are not made.  */
3725
3726 extern tree build_type_attribute_variant (tree, tree);
3727 extern tree build_decl_attribute_variant (tree, tree);
3728
3729 /* Structure describing an attribute and a function to handle it.  */
3730 struct attribute_spec
3731 {
3732   /* The name of the attribute (without any leading or trailing __),
3733      or NULL to mark the end of a table of attributes.  */
3734   const char *const name;
3735   /* The minimum length of the list of arguments of the attribute.  */
3736   const int min_length;
3737   /* The maximum length of the list of arguments of the attribute
3738      (-1 for no maximum).  */
3739   const int max_length;
3740   /* Whether this attribute requires a DECL.  If it does, it will be passed
3741      from types of DECLs, function return types and array element types to
3742      the DECLs, function types and array types respectively; but when
3743      applied to a type in any other circumstances, it will be ignored with
3744      a warning.  (If greater control is desired for a given attribute,
3745      this should be false, and the flags argument to the handler may be
3746      used to gain greater control in that case.)  */
3747   const bool decl_required;
3748   /* Whether this attribute requires a type.  If it does, it will be passed
3749      from a DECL to the type of that DECL.  */
3750   const bool type_required;
3751   /* Whether this attribute requires a function (or method) type.  If it does,
3752      it will be passed from a function pointer type to the target type,
3753      and from a function return type (which is not itself a function
3754      pointer type) to the function type.  */
3755   const bool function_type_required;
3756   /* Function to handle this attribute.  NODE points to the node to which
3757      the attribute is to be applied.  If a DECL, it should be modified in
3758      place; if a TYPE, a copy should be created.  NAME is the name of the
3759      attribute (possibly with leading or trailing __).  ARGS is the TREE_LIST
3760      of the arguments (which may be NULL).  FLAGS gives further information
3761      about the context of the attribute.  Afterwards, the attributes will
3762      be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate,
3763      unless *NO_ADD_ATTRS is set to true (which should be done on error,
3764      as well as in any other cases when the attributes should not be added
3765      to the DECL or TYPE).  Depending on FLAGS, any attributes to be
3766      applied to another type or DECL later may be returned;
3767      otherwise the return value should be NULL_TREE.  This pointer may be
3768      NULL if no special handling is required beyond the checks implied
3769      by the rest of this structure.  */
3770   tree (*const handler) (tree *node, tree name, tree args,
3771                                  int flags, bool *no_add_attrs);
3772 };
3773
3774 /* Flags that may be passed in the third argument of decl_attributes, and
3775    to handler functions for attributes.  */
3776 enum attribute_flags
3777 {
3778   /* The type passed in is the type of a DECL, and any attributes that
3779      should be passed in again to be applied to the DECL rather than the
3780      type should be returned.  */
3781   ATTR_FLAG_DECL_NEXT = 1,
3782   /* The type passed in is a function return type, and any attributes that
3783      should be passed in again to be applied to the function type rather
3784      than the return type should be returned.  */
3785   ATTR_FLAG_FUNCTION_NEXT = 2,
3786   /* The type passed in is an array element type, and any attributes that
3787      should be passed in again to be applied to the array type rather
3788      than the element type should be returned.  */
3789   ATTR_FLAG_ARRAY_NEXT = 4,
3790   /* The type passed in is a structure, union or enumeration type being
3791      created, and should be modified in place.  */
3792   ATTR_FLAG_TYPE_IN_PLACE = 8,
3793   /* The attributes are being applied by default to a library function whose
3794      name indicates known behavior, and should be silently ignored if they
3795      are not in fact compatible with the function type.  */
3796   ATTR_FLAG_BUILT_IN = 16
3797 };
3798
3799 /* Default versions of target-overridable functions.  */
3800
3801 extern tree merge_decl_attributes (tree, tree);
3802 extern tree merge_type_attributes (tree, tree);
3803
3804 /* Given a tree node and a string, return nonzero if the tree node is
3805    a valid attribute name for the string.  */
3806
3807 extern int is_attribute_p (const char *, tree);
3808
3809 /* Given an attribute name and a list of attributes, return the list element
3810    of the attribute or NULL_TREE if not found.  */
3811
3812 extern tree lookup_attribute (const char *, tree);
3813
3814 /* Remove any instances of attribute ATTR_NAME in LIST and return the
3815    modified list.  */
3816
3817 extern tree remove_attribute (const char *, tree);
3818
3819 /* Given two attributes lists, return a list of their union.  */
3820
3821 extern tree merge_attributes (tree, tree);
3822
3823 #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
3824 /* Given two Windows decl attributes lists, possibly including
3825    dllimport, return a list of their union .  */
3826 extern tree merge_dllimport_decl_attributes (tree, tree);
3827
3828 /* Handle a "dllimport" or "dllexport" attribute.  */
3829 extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
3830 #endif
3831
3832 /* Check whether CAND is suitable to be returned from get_qualified_type
3833    (BASE, TYPE_QUALS).  */
3834
3835 extern bool check_qualified_type (tree, tree, int);
3836
3837 /* Return a version of the TYPE, qualified as indicated by the
3838    TYPE_QUALS, if one exists.  If no qualified version exists yet,
3839    return NULL_TREE.  */
3840
3841 extern tree get_qualified_type (tree, int);
3842
3843 /* Like get_qualified_type, but creates the type if it does not
3844    exist.  This function never returns NULL_TREE.  */
3845
3846 extern tree build_qualified_type (tree, int);
3847
3848 /* Like build_qualified_type, but only deals with the `const' and
3849    `volatile' qualifiers.  This interface is retained for backwards
3850    compatibility with the various front-ends; new code should use
3851    build_qualified_type instead.  */
3852
3853 #define build_type_variant(TYPE, CONST_P, VOLATILE_P)                   \
3854   build_qualified_type ((TYPE),                                         \
3855                         ((CONST_P) ? TYPE_QUAL_CONST : 0)               \
3856                         | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
3857
3858 /* Make a copy of a type node.  */
3859
3860 extern tree build_distinct_type_copy (tree);
3861 extern tree build_variant_type_copy (tree);
3862
3863 /* Finish up a builtin RECORD_TYPE. Give it a name and provide its
3864    fields. Optionally specify an alignment, and then lay it out.  */
3865
3866 extern void finish_builtin_struct (tree, const char *,
3867                                                          tree, tree);
3868
3869 /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
3870    TYPE_ALIGN and TYPE_MODE fields.  If called more than once on one
3871    node, does nothing except for the first time.  */
3872
3873 extern void layout_type (tree);
3874
3875 /* These functions allow a front-end to perform a manual layout of a
3876    RECORD_TYPE.  (For instance, if the placement of subsequent fields
3877    depends on the placement of fields so far.)  Begin by calling
3878    start_record_layout.  Then, call place_field for each of the
3879    fields.  Then, call finish_record_layout.  See layout_type for the
3880    default way in which these functions are used.  */
3881
3882 typedef struct record_layout_info_s
3883 {
3884   /* The RECORD_TYPE that we are laying out.  */
3885   tree t;
3886   /* The offset into the record so far, in bytes, not including bits in
3887      BITPOS.  */
3888   tree offset;
3889   /* The last known alignment of SIZE.  */
3890   unsigned int offset_align;
3891   /* The bit position within the last OFFSET_ALIGN bits, in bits.  */
3892   tree bitpos;
3893   /* The alignment of the record so far, in bits.  */
3894   unsigned int record_align;
3895   /* The alignment of the record so far, ignoring #pragma pack and
3896      __attribute__ ((packed)), in bits.  */
3897   unsigned int unpacked_align;
3898   /* The previous field layed out.  */
3899   tree prev_field;
3900   /* The static variables (i.e., class variables, as opposed to
3901      instance variables) encountered in T.  */
3902   tree pending_statics;
3903   /* Bits remaining in the current alignment group */
3904   int remaining_in_alignment;
3905   /* True if we've seen a packed field that didn't have normal
3906      alignment anyway.  */
3907   int packed_maybe_necessary;
3908 } *record_layout_info;
3909
3910 extern void set_lang_adjust_rli (void (*) (record_layout_info));
3911 extern record_layout_info start_record_layout (tree);
3912 extern tree bit_from_pos (tree, tree);
3913 extern tree byte_from_pos (tree, tree);
3914 extern void pos_from_bit (tree *, tree *, unsigned int, tree);
3915 extern void normalize_offset (tree *, tree *, unsigned int);
3916 extern tree rli_size_unit_so_far (record_layout_info);
3917 extern tree rli_size_so_far (record_layout_info);
3918 extern void normalize_rli (record_layout_info);
3919 extern void place_field (record_layout_info, tree);
3920 extern void compute_record_mode (tree);
3921 extern void finish_record_layout (record_layout_info, int);
3922
3923 /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
3924    return a canonicalized ..._TYPE node, so that duplicates are not made.
3925    How the hash code is computed is up to the caller, as long as any two
3926    callers that could hash identical-looking type nodes agree.  */
3927
3928 extern tree type_hash_canon (unsigned int, tree);
3929
3930 /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
3931    calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
3932    fields.  Call this only once for any given decl node.
3933
3934    Second argument is the boundary that this field can be assumed to
3935    be starting at (in bits).  Zero means it can be assumed aligned
3936    on any boundary that may be needed.  */
3937
3938 extern void layout_decl (tree, unsigned);
3939
3940 /* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
3941    a previous call to layout_decl and calls it again.  */
3942
3943 extern void relayout_decl (tree);
3944
3945 /* Return the mode for data of a given size SIZE and mode class CLASS.
3946    If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
3947    The value is BLKmode if no other mode is found.  This is like
3948    mode_for_size, but is passed a tree.  */
3949
3950 extern enum machine_mode mode_for_size_tree (tree, enum mode_class, int);
3951
3952 /* Return an expr equal to X but certainly not valid as an lvalue.  */
3953
3954 extern tree non_lvalue (tree);
3955
3956 extern tree convert (tree, tree);
3957 extern unsigned int expr_align (tree);
3958 extern tree expr_first (tree);
3959 extern tree expr_last (tree);
3960 extern tree expr_only (tree);
3961 extern tree size_in_bytes (tree);
3962 extern HOST_WIDE_INT int_size_in_bytes (tree);
3963 extern HOST_WIDE_INT max_int_size_in_bytes (tree);
3964 extern tree bit_position (tree);
3965 extern HOST_WIDE_INT int_bit_position (tree);
3966 extern tree byte_position (tree);
3967 extern HOST_WIDE_INT int_byte_position (tree);
3968
3969 /* Define data structures, macros, and functions for handling sizes
3970    and the various types used to represent sizes.  */
3971
3972 enum size_type_kind
3973 {
3974   SIZETYPE,             /* Normal representation of sizes in bytes.  */
3975   SSIZETYPE,            /* Signed representation of sizes in bytes.  */
3976   BITSIZETYPE,          /* Normal representation of sizes in bits.  */
3977   SBITSIZETYPE,         /* Signed representation of sizes in bits.  */
3978   TYPE_KIND_LAST};
3979
3980 extern GTY(()) tree sizetype_tab[(int) TYPE_KIND_LAST];
3981
3982 #define sizetype sizetype_tab[(int) SIZETYPE]
3983 #define bitsizetype sizetype_tab[(int) BITSIZETYPE]
3984 #define ssizetype sizetype_tab[(int) SSIZETYPE]
3985 #define sbitsizetype sizetype_tab[(int) SBITSIZETYPE]
3986
3987 extern tree size_int_kind (HOST_WIDE_INT, enum size_type_kind);
3988 extern tree size_binop (enum tree_code, tree, tree);
3989 extern tree size_diffop (tree, tree);
3990
3991 #define size_int(L) size_int_kind (L, SIZETYPE)
3992 #define ssize_int(L) size_int_kind (L, SSIZETYPE)
3993 #define bitsize_int(L) size_int_kind (L, BITSIZETYPE)
3994 #define sbitsize_int(L) size_int_kind (L, SBITSIZETYPE)
3995
3996 extern tree round_up (tree, int);
3997 extern tree round_down (tree, int);
3998 extern tree get_pending_sizes (void);
3999 extern void put_pending_size (tree);
4000 extern void put_pending_sizes (tree);
4001
4002 /* Type for sizes of data-type.  */
4003
4004 #define BITS_PER_UNIT_LOG \
4005   ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
4006    + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
4007    + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
4008
4009 /* If nonzero, an upper limit on alignment of structure fields, in bits,  */
4010 extern unsigned int maximum_field_alignment;
4011 /* and its original value in bytes, specified via -fpack-struct=<value>.  */
4012 extern unsigned int initial_max_fld_align;
4013
4014 /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
4015    by making the last node in X point to Y.
4016    Returns X, except if X is 0 returns Y.  */
4017
4018 extern tree chainon (tree, tree);
4019
4020 /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN.  */
4021
4022 extern tree tree_cons_stat (tree, tree, tree MEM_STAT_DECL);
4023 #define tree_cons(t,q,w) tree_cons_stat (t,q,w MEM_STAT_INFO)
4024
4025 /* Return the last tree node in a chain.  */
4026
4027 extern tree tree_last (tree);
4028
4029 /* Reverse the order of elements in a chain, and return the new head.  */
4030
4031 extern tree nreverse (tree);
4032
4033 /* Returns the length of a chain of nodes
4034    (number of chain pointers to follow before reaching a null pointer).  */
4035
4036 extern int list_length (tree);
4037
4038 /* Returns the number of FIELD_DECLs in a type.  */
4039
4040 extern int fields_length (tree);
4041
4042 /* Given an initializer INIT, return TRUE if INIT is zero or some
4043    aggregate of zeros.  Otherwise return FALSE.  */
4044
4045 extern bool initializer_zerop (tree);
4046
4047 /* Examine CTOR to discover:
4048    * how many scalar fields are set to nonzero values,
4049      and place it in *P_NZ_ELTS;
4050    * how many scalar fields in total are in CTOR,
4051      and place it in *P_ELT_COUNT.
4052    * if a type is a union, and the initializer from the constructor
4053      is not the largest element in the union, then set *p_must_clear.
4054
4055    Return whether or not CTOR is a valid static constant initializer, the same
4056    as "initializer_constant_valid_p (CTOR, TREE_TYPE (CTOR)) != 0".  */
4057
4058 extern bool categorize_ctor_elements (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
4059                                       bool *);
4060
4061 extern HOST_WIDE_INT count_type_elements (tree, bool);
4062
4063 /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0.  */
4064
4065 extern int integer_zerop (tree);
4066
4067 /* integer_onep (tree x) is nonzero if X is an integer constant of value 1.  */
4068
4069 extern int integer_onep (tree);
4070
4071 /* integer_all_onesp (tree x) is nonzero if X is an integer constant
4072    all of whose significant bits are 1.  */
4073
4074 extern int integer_all_onesp (tree);
4075
4076 /* integer_pow2p (tree x) is nonzero is X is an integer constant with
4077    exactly one bit 1.  */
4078
4079 extern int integer_pow2p (tree);
4080
4081 /* integer_nonzerop (tree x) is nonzero if X is an integer constant
4082    with a nonzero value.  */
4083
4084 extern int integer_nonzerop (tree);
4085
4086 extern bool zero_p (tree);
4087 extern bool cst_and_fits_in_hwi (tree);
4088 extern tree num_ending_zeros (tree);
4089
4090 /* staticp (tree x) is nonzero if X is a reference to data allocated
4091    at a fixed address in memory.  Returns the outermost data.  */
4092
4093 extern tree staticp (tree);
4094
4095 /* save_expr (EXP) returns an expression equivalent to EXP
4096    but it can be used multiple times within context CTX
4097    and only evaluate EXP once.  */
4098
4099 extern tree save_expr (tree);
4100
4101 /* Look inside EXPR and into any simple arithmetic operations.  Return
4102    the innermost non-arithmetic node.  */
4103
4104 extern tree skip_simple_arithmetic (tree);
4105
4106 /* Return which tree structure is used by T.  */
4107
4108 enum tree_node_structure_enum tree_node_structure (tree);
4109
4110 /* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
4111    or offset that depends on a field within a record.
4112
4113    Note that we only allow such expressions within simple arithmetic
4114    or a COND_EXPR.  */
4115
4116 extern bool contains_placeholder_p (tree);
4117
4118 /* This macro calls the above function but short-circuits the common
4119    case of a constant to save time.  Also check for null.  */
4120
4121 #define CONTAINS_PLACEHOLDER_P(EXP) \
4122   ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
4123
4124 /* Return 1 if any part of the computation of TYPE involves a PLACEHOLDER_EXPR.
4125    This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and field
4126    positions.  */
4127
4128 extern bool type_contains_placeholder_p (tree);
4129
4130 /* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
4131    return a tree with all occurrences of references to F in a
4132    PLACEHOLDER_EXPR replaced by R.   Note that we assume here that EXP
4133    contains only arithmetic expressions.  */
4134
4135 extern tree substitute_in_expr (tree, tree, tree);
4136
4137 /* This macro calls the above function but short-circuits the common
4138    case of a constant to save time and also checks for NULL.  */
4139
4140 #define SUBSTITUTE_IN_EXPR(EXP, F, R) \
4141   ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) : substitute_in_expr (EXP, F, R))
4142
4143 /* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
4144    for it within OBJ, a tree that is an object or a chain of references.  */
4145
4146 extern tree substitute_placeholder_in_expr (tree, tree);
4147
4148 /* This macro calls the above function but short-circuits the common
4149    case of a constant to save time and also checks for NULL.  */
4150
4151 #define SUBSTITUTE_PLACEHOLDER_IN_EXPR(EXP, OBJ) \
4152   ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP)    \
4153    : substitute_placeholder_in_expr (EXP, OBJ))
4154
4155 /* variable_size (EXP) is like save_expr (EXP) except that it
4156    is for the special case of something that is part of a
4157    variable size for a data type.  It makes special arrangements
4158    to compute the value at the right time when the data type
4159    belongs to a function parameter.  */
4160
4161 extern tree variable_size (tree);
4162
4163 /* stabilize_reference (EXP) returns a reference equivalent to EXP
4164    but it can be used multiple times
4165    and only evaluate the subexpressions once.  */
4166
4167 extern tree stabilize_reference (tree);
4168
4169 /* Subroutine of stabilize_reference; this is called for subtrees of
4170    references.  Any expression with side-effects must be put in a SAVE_EXPR
4171    to ensure that it is only evaluated once.  */
4172
4173 extern tree stabilize_reference_1 (tree);
4174
4175 /* Return EXP, stripped of any conversions to wider types
4176    in such a way that the result of converting to type FOR_TYPE
4177    is the same as if EXP were converted to FOR_TYPE.
4178    If FOR_TYPE is 0, it signifies EXP's type.  */
4179
4180 extern tree get_unwidened (tree, tree);
4181
4182 /* Return OP or a simpler expression for a narrower value
4183    which can be sign-extended or zero-extended to give back OP.
4184    Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
4185    or 0 if the value should be sign-extended.  */
4186
4187 extern tree get_narrower (tree, int *);
4188
4189 /* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
4190    look for nested component-refs or array-refs at constant positions
4191    and find the ultimate containing object, which is returned.  */
4192
4193 extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
4194                                  tree *, enum machine_mode *, int *, int *,
4195                                  bool);
4196
4197 /* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
4198    look for whether EXP or any nested component-refs within EXP is marked
4199    as PACKED.  */
4200
4201 extern bool contains_packed_reference (tree exp);
4202
4203 /* Return 1 if T is an expression that get_inner_reference handles.  */
4204
4205 extern int handled_component_p (tree);
4206
4207 /* Return a tree of sizetype representing the size, in bytes, of the element
4208    of EXP, an ARRAY_REF.  */
4209
4210 extern tree array_ref_element_size (tree);
4211
4212 /* Return a tree representing the lower bound of the array mentioned in
4213    EXP, an ARRAY_REF.  */
4214
4215 extern tree array_ref_low_bound (tree);
4216
4217 /* Return a tree representing the upper bound of the array mentioned in
4218    EXP, an ARRAY_REF.  */
4219
4220 extern tree array_ref_up_bound (tree);
4221
4222 /* Return a tree representing the offset, in bytes, of the field referenced
4223    by EXP.  This does not include any offset in DECL_FIELD_BIT_OFFSET.  */
4224
4225 extern tree component_ref_field_offset (tree);
4226
4227 /* Given a DECL or TYPE, return the scope in which it was declared, or
4228    NUL_TREE if there is no containing scope.  */
4229
4230 extern tree get_containing_scope (tree);
4231
4232 /* Return the FUNCTION_DECL which provides this _DECL with its context,
4233    or zero if none.  */
4234 extern tree decl_function_context (tree);
4235
4236 /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
4237    this _DECL with its context, or zero if none.  */
4238 extern tree decl_type_context (tree);
4239
4240 /* Return 1 if EXPR is the real constant zero.  */
4241 extern int real_zerop (tree);
4242 \f
4243 /* Declare commonly used variables for tree structure.  */
4244
4245 /* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
4246    Zero means allow extended lvalues.  */
4247
4248 extern int pedantic_lvalues;
4249
4250 /* Points to the FUNCTION_DECL of the function whose body we are reading.  */
4251
4252 extern GTY(()) tree current_function_decl;
4253
4254 /* Nonzero means a FUNC_BEGIN label was emitted.  */
4255 extern GTY(()) const char * current_function_func_begin_label;
4256 \f
4257 /* In tree.c */
4258 extern unsigned crc32_string (unsigned, const char *);
4259 extern void clean_symbol_name (char *);
4260 extern tree get_file_function_name (const char *);
4261 extern tree get_callee_fndecl (tree);
4262 extern void change_decl_assembler_name (tree, tree);
4263 extern int type_num_arguments (tree);
4264 extern bool associative_tree_code (enum tree_code);
4265 extern bool commutative_tree_code (enum tree_code);
4266 extern tree upper_bound_in_type (tree, tree);
4267 extern tree lower_bound_in_type (tree, tree);
4268 extern int operand_equal_for_phi_arg_p (tree, tree);
4269 extern bool empty_body_p (tree);
4270 \f
4271 /* In stmt.c */
4272
4273 extern void expand_expr_stmt (tree);
4274 extern int warn_if_unused_value (tree, location_t);
4275 extern void expand_label (tree);
4276 extern void expand_goto (tree);
4277
4278 extern rtx expand_stack_save (void);
4279 extern void expand_stack_restore (tree);
4280 extern void expand_return (tree);
4281 extern int is_body_block (tree);
4282
4283 /* In tree-eh.c */
4284 extern void using_eh_for_cleanups (void);
4285
4286 /* In fold-const.c */
4287
4288 /* Non-zero if we are folding constants inside an initializer; zero
4289    otherwise.  */
4290 extern int folding_initializer;
4291
4292 /* Fold constants as much as possible in an expression.
4293    Returns the simplified expression.
4294    Acts only on the top level of the expression;
4295    if the argument itself cannot be simplified, its
4296    subexpressions are not changed.  */
4297
4298 extern tree fold (tree);
4299 extern tree fold_unary (enum tree_code, tree, tree);
4300 extern tree fold_binary (enum tree_code, tree, tree, tree);
4301 extern tree fold_ternary (enum tree_code, tree, tree, tree, tree);
4302 extern tree fold_build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
4303 #define fold_build1(c,t1,t2) fold_build1_stat (c, t1, t2 MEM_STAT_INFO)
4304 extern tree fold_build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
4305 #define fold_build2(c,t1,t2,t3) fold_build2_stat (c, t1, t2, t3 MEM_STAT_INFO)
4306 extern tree fold_build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
4307 #define fold_build3(c,t1,t2,t3,t4) fold_build3_stat (c, t1, t2, t3, t4 MEM_STAT_INFO)
4308 extern tree fold_build1_initializer (enum tree_code, tree, tree);
4309 extern tree fold_build2_initializer (enum tree_code, tree, tree, tree);
4310 extern tree fold_build3_initializer (enum tree_code, tree, tree, tree, tree);
4311 extern tree fold_convert (tree, tree);
4312 extern tree fold_single_bit_test (enum tree_code, tree, tree, tree);
4313 extern tree fold_ignored_result (tree);
4314 extern tree fold_abs_const (tree, tree);
4315 extern tree fold_indirect_ref_1 (tree, tree);
4316 extern void fold_defer_overflow_warnings (void);
4317 extern void fold_undefer_overflow_warnings (bool, tree, int);
4318 extern void fold_undefer_and_ignore_overflow_warnings (void);
4319 extern bool fold_deferring_overflow_warnings_p (void);
4320
4321 extern tree force_fit_type (tree, int, bool, bool);
4322
4323 extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4324                                  unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4325                                  unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
4326                                  bool);
4327 #define add_double(l1,h1,l2,h2,lv,hv) \
4328   add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
4329 extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4330                        unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
4331 extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4332                                  unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4333                                  unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
4334                                  bool);
4335 #define mul_double(l1,h1,l2,h2,lv,hv) \
4336   mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
4337 extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4338                            HOST_WIDE_INT, unsigned int,
4339                            unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
4340 extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4341                            HOST_WIDE_INT, unsigned int,
4342                            unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
4343 extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4344                             HOST_WIDE_INT, unsigned int,
4345                             unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
4346 extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
4347                             HOST_WIDE_INT, unsigned int,
4348                             unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
4349
4350 extern int div_and_round_double (enum tree_code, int, unsigned HOST_WIDE_INT,
4351                                  HOST_WIDE_INT, unsigned HOST_WIDE_INT,
4352                                  HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
4353                                  HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
4354                                  HOST_WIDE_INT *);
4355
4356 enum operand_equal_flag
4357 {
4358   OEP_ONLY_CONST = 1,
4359   OEP_PURE_SAME = 2
4360 };
4361
4362 extern int operand_equal_p (tree, tree, unsigned int);
4363
4364 extern tree omit_one_operand (tree, tree, tree);
4365 extern tree omit_two_operands (tree, tree, tree, tree);
4366 extern tree invert_truthvalue (tree);
4367 extern tree fold_truth_not_expr (tree);
4368 extern tree fold_unary_to_constant (enum tree_code, tree, tree);
4369 extern tree fold_binary_to_constant (enum tree_code, tree, tree, tree);
4370 extern tree fold_read_from_constant_string (tree);
4371 extern tree int_const_binop (enum tree_code, tree, tree, int);
4372 extern tree build_fold_addr_expr (tree);
4373 extern tree fold_build_cleanup_point_expr (tree type, tree expr);
4374 extern tree fold_strip_sign_ops (tree);
4375 extern tree build_fold_addr_expr_with_type (tree, tree);
4376 extern tree build_fold_indirect_ref (tree);
4377 extern tree fold_indirect_ref (tree);
4378 extern tree constant_boolean_node (int, tree);
4379 extern tree build_low_bits_mask (tree, unsigned);
4380
4381 extern bool tree_swap_operands_p (tree, tree, bool);
4382 extern void swap_tree_operands (tree, tree *, tree *);
4383 extern enum tree_code swap_tree_comparison (enum tree_code);
4384
4385 extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
4386 extern enum tree_code invert_tree_comparison (enum tree_code, bool);
4387
4388 extern bool tree_expr_nonzero_p (tree);
4389 extern bool tree_expr_nonzero_warnv_p (tree, bool *);
4390
4391 /* In builtins.c */
4392 extern tree fold_builtin (tree, tree, bool);
4393 extern tree fold_builtin_fputs (tree, bool, bool, tree);
4394 extern tree fold_builtin_strcpy (tree, tree, tree);
4395 extern tree fold_builtin_strncpy (tree, tree, tree);
4396 extern tree fold_builtin_memory_chk (tree, tree, tree, bool,
4397                                      enum built_in_function);
4398 extern tree fold_builtin_stxcpy_chk (tree, tree, tree, bool,
4399                                      enum built_in_function);
4400 extern tree fold_builtin_strncpy_chk (tree, tree);
4401 extern tree fold_builtin_snprintf_chk (tree, tree, enum built_in_function);
4402 extern bool fold_builtin_next_arg (tree);
4403 extern enum built_in_function builtin_mathfn_code (tree);
4404 extern tree build_function_call_expr (tree, tree);
4405 extern tree mathfn_built_in (tree, enum built_in_function fn);
4406 extern tree strip_float_extensions (tree);
4407 extern tree c_strlen (tree, int);
4408 extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
4409 extern tree build_va_arg_indirect_ref (tree);
4410 tree build_string_literal (int, const char *);
4411
4412 /* In convert.c */
4413 extern tree strip_float_extensions (tree);
4414
4415 /* In alias.c */
4416 extern void record_component_aliases (tree);
4417 extern HOST_WIDE_INT get_alias_set (tree);
4418 extern int alias_sets_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
4419 extern int alias_sets_might_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
4420 extern int objects_must_conflict_p (tree, tree);
4421
4422 /* In tree.c */
4423 extern int really_constant_p (tree);
4424 extern int int_fits_type_p (tree, tree);
4425 extern bool variably_modified_type_p (tree, tree);
4426 extern int tree_log2 (tree);
4427 extern int tree_floor_log2 (tree);
4428 extern int simple_cst_equal (tree, tree);
4429 extern hashval_t iterative_hash_expr (tree, hashval_t);
4430 extern int compare_tree_int (tree, unsigned HOST_WIDE_INT);
4431 extern int type_list_equal (tree, tree);
4432 extern int chain_member (tree, tree);
4433 extern tree type_hash_lookup (unsigned int, tree);
4434 extern void type_hash_add (unsigned int, tree);
4435 extern int simple_cst_list_equal (tree, tree);
4436 extern void dump_tree_statistics (void);
4437 extern void expand_function_end (void);
4438 extern void expand_function_start (tree);
4439 extern void stack_protect_prologue (void);
4440 extern void stack_protect_epilogue (void);
4441 extern void recompute_tree_invariant_for_addr_expr (tree);
4442 extern bool is_global_var (tree t);
4443 extern bool needs_to_live_in_memory (tree);
4444 extern tree reconstruct_complex_type (tree, tree);
4445
4446 extern int real_onep (tree);
4447 extern int real_twop (tree);
4448 extern int real_minus_onep (tree);
4449 extern void init_ttree (void);
4450 extern void build_common_tree_nodes (bool, bool);
4451 extern void build_common_tree_nodes_2 (int);
4452 extern void build_common_builtin_nodes (void);
4453 extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
4454 extern tree build_range_type (tree, tree, tree);
4455 extern HOST_WIDE_INT int_cst_value (tree);
4456 extern tree tree_fold_gcd (tree, tree);
4457 extern tree build_addr (tree, tree);
4458
4459 extern bool fields_compatible_p (tree, tree);
4460 extern tree find_compatible_field (tree, tree);
4461
4462 /* In function.c */
4463 extern void expand_main_function (void);
4464 extern void init_dummy_function_start (void);
4465 extern void expand_dummy_function_end (void);
4466 extern unsigned int init_function_for_compilation (void);
4467 extern void allocate_struct_function (tree);
4468 extern void init_function_start (tree);
4469 extern bool use_register_for_decl (tree);
4470 extern void setjmp_vars_warning (tree);
4471 extern void setjmp_args_warning (void);
4472 extern void init_temp_slots (void);
4473 extern void free_temp_slots (void);
4474 extern void pop_temp_slots (void);
4475 extern void push_temp_slots (void);
4476 extern void preserve_temp_slots (rtx);
4477 extern int aggregate_value_p (tree, tree);
4478 extern void push_function_context (void);
4479 extern void pop_function_context (void);
4480 extern void push_function_context_to (tree);
4481 extern void pop_function_context_from (tree);
4482 extern tree gimplify_parameters (void);
4483
4484 /* In print-rtl.c */
4485 #ifdef BUFSIZ
4486 extern void print_rtl (FILE *, rtx);
4487 #endif
4488
4489 /* In print-tree.c */
4490 extern void debug_tree (tree);
4491 #ifdef BUFSIZ
4492 extern void dump_addr (FILE*, const char *, void *);
4493 extern void print_node (FILE *, const char *, tree, int);
4494 extern void print_node_brief (FILE *, const char *, tree, int);
4495 extern void indent_to (FILE *, int);
4496 #endif
4497
4498 /* In tree-inline.c:  */
4499 extern bool debug_find_tree (tree, tree);
4500 /* This is in tree-inline.c since the routine uses
4501    data structures from the inliner.  */
4502 extern tree unsave_expr_now (tree);
4503 extern tree build_duplicate_type (tree);
4504
4505 /* In emit-rtl.c */
4506 extern rtx emit_line_note (location_t);
4507
4508 /* In calls.c */
4509
4510 /* Nonzero if this is a call to a function whose return value depends
4511    solely on its arguments, has no side effects, and does not read
4512    global memory.  */
4513 #define ECF_CONST               1
4514 /* Nonzero if this call will never return.  */
4515 #define ECF_NORETURN            2
4516 /* Nonzero if this is a call to malloc or a related function.  */
4517 #define ECF_MALLOC              4
4518 /* Nonzero if it is plausible that this is a call to alloca.  */
4519 #define ECF_MAY_BE_ALLOCA       8
4520 /* Nonzero if this is a call to a function that won't throw an exception.  */
4521 #define ECF_NOTHROW             16
4522 /* Nonzero if this is a call to setjmp or a related function.  */
4523 #define ECF_RETURNS_TWICE       32
4524 /* Nonzero if this call replaces the current stack frame.  */
4525 #define ECF_SIBCALL             64
4526 /* Nonzero if this is a call to "pure" function (like const function,
4527    but may read memory.  */
4528 #define ECF_PURE                128
4529 /* Nonzero if this is a call to a function that returns with the stack
4530    pointer depressed.  */
4531 #define ECF_SP_DEPRESSED        256
4532 /* Create libcall block around the call.  */
4533 #define ECF_LIBCALL_BLOCK       512
4534 /* Function does not read or write memory (but may have side effects, so
4535    it does not necessarily fit ECF_CONST).  */
4536 #define ECF_NOVOPS              1024
4537
4538 extern int flags_from_decl_or_type (tree);
4539 extern int call_expr_flags (tree);
4540
4541 extern int setjmp_call_p (tree);
4542 extern bool alloca_call_p (tree);
4543 extern bool must_pass_in_stack_var_size (enum machine_mode, tree);
4544 extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, tree);
4545
4546 /* In attribs.c.  */
4547
4548 /* Process the attributes listed in ATTRIBUTES and install them in *NODE,
4549    which is either a DECL (including a TYPE_DECL) or a TYPE.  If a DECL,
4550    it should be modified in place; if a TYPE, a copy should be created
4551    unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS.  FLAGS gives further
4552    information, in the form of a bitwise OR of flags in enum attribute_flags
4553    from tree.h.  Depending on these flags, some attributes may be
4554    returned to be applied at a later stage (for example, to apply
4555    a decl attribute to the declaration rather than to its type).  */
4556 extern tree decl_attributes (tree *, tree, int);
4557
4558 /* In integrate.c */
4559 extern void set_decl_abstract_flags (tree, int);
4560 extern void set_decl_origin_self (tree);
4561
4562 /* In stor-layout.c */
4563 extern void set_min_and_max_values_for_integral_type (tree, int, bool);
4564 extern void fixup_signed_type (tree);
4565 extern void internal_reference_types (void);
4566 extern unsigned int update_alignment_for_field (record_layout_info, tree,
4567                                                 unsigned int);
4568 /* varasm.c */
4569 extern void make_decl_rtl (tree);
4570 extern void make_decl_one_only (tree);
4571 extern int supports_one_only (void);
4572 extern void resolve_unique_section (tree, int, int);
4573 extern void mark_referenced (tree);
4574 extern void mark_decl_referenced (tree);
4575 extern void notice_global_symbol (tree);
4576 extern void set_user_assembler_name (tree, const char *);
4577 extern void process_pending_assemble_externals (void);
4578 extern void finish_aliases_1 (void);
4579 extern void finish_aliases_2 (void);
4580
4581 /* In stmt.c */
4582 extern void expand_computed_goto (tree);
4583 extern bool parse_output_constraint (const char **, int, int, int,
4584                                      bool *, bool *, bool *);
4585 extern bool parse_input_constraint (const char **, int, int, int, int,
4586                                     const char * const *, bool *, bool *);
4587 extern void expand_asm_expr (tree);
4588 extern tree resolve_asm_operand_names (tree, tree, tree);
4589 extern void expand_case (tree);
4590 extern void expand_decl (tree);
4591 extern void expand_anon_union_decl (tree, tree, tree);
4592 #ifdef HARD_CONST
4593 /* Silly ifdef to avoid having all includers depend on hard-reg-set.h.  */
4594 extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
4595 #endif
4596
4597 /* In gimplify.c.  */
4598 extern tree create_artificial_label (void);
4599 extern void gimplify_function_tree (tree);
4600 extern const char *get_name (tree);
4601 extern tree unshare_expr (tree);
4602 extern void sort_case_labels (tree);
4603 \f
4604 /* Interface of the DWARF2 unwind info support.  */
4605
4606 /* Generate a new label for the CFI info to refer to.  */
4607
4608 extern char *dwarf2out_cfi_label (void);
4609
4610 /* Entry point to update the canonical frame address (CFA).  */
4611
4612 extern void dwarf2out_def_cfa (const char *, unsigned, HOST_WIDE_INT);
4613
4614 /* Add the CFI for saving a register window.  */
4615
4616 extern void dwarf2out_window_save (const char *);
4617
4618 /* Add a CFI to update the running total of the size of arguments pushed
4619    onto the stack.  */
4620
4621 extern void dwarf2out_args_size (const char *, HOST_WIDE_INT);
4622
4623 /* Entry point for saving a register to the stack.  */
4624
4625 extern void dwarf2out_reg_save (const char *, unsigned, HOST_WIDE_INT);
4626
4627 /* Entry point for saving the return address in the stack.  */
4628
4629 extern void dwarf2out_return_save (const char *, HOST_WIDE_INT);
4630
4631 /* Entry point for saving the return address in a register.  */
4632
4633 extern void dwarf2out_return_reg (const char *, unsigned);
4634
4635 /* Entry point for saving the first register into the second.  */
4636
4637 extern void dwarf2out_reg_save_reg (const char *, rtx, rtx);
4638
4639 /* In tree-inline.c  */
4640
4641 /* The type of a set of already-visited pointers.  Functions for creating
4642    and manipulating it are declared in pointer-set.h */
4643 struct pointer_set_t;
4644
4645 /* The type of a callback function for walking over tree structure.  */
4646
4647 typedef tree (*walk_tree_fn) (tree *, int *, void *);
4648 extern tree walk_tree (tree*, walk_tree_fn, void*, struct pointer_set_t*);
4649 extern tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*);
4650
4651 /* Assign the RTX to declaration.  */
4652
4653 extern void set_decl_rtl (tree, rtx);
4654 extern void set_decl_incoming_rtl (tree, rtx);
4655 \f
4656 /* Enum and arrays used for tree allocation stats.
4657    Keep in sync with tree.c:tree_node_kind_names.  */
4658 typedef enum
4659 {
4660   d_kind,
4661   t_kind,
4662   b_kind,
4663   s_kind,
4664   r_kind,
4665   e_kind,
4666   c_kind,
4667   id_kind,
4668   perm_list_kind,
4669   temp_list_kind,
4670   vec_kind,
4671   binfo_kind,
4672   phi_kind,
4673   ssa_name_kind,
4674   constr_kind,
4675   x_kind,
4676   lang_decl,
4677   lang_type,
4678   omp_clause_kind,
4679   all_kinds
4680 } tree_node_kind;
4681
4682 extern int tree_node_counts[];
4683 extern int tree_node_sizes[];
4684
4685 /* True if we are in gimple form and the actions of the folders need to
4686    be restricted.  False if we are not in gimple form and folding is not
4687    restricted to creating gimple expressions.  */
4688 extern bool in_gimple_form;
4689
4690 /* In tree-gimple.c.  */
4691 extern tree get_base_address (tree t);
4692
4693 /* In tree-vectorizer.c.  */
4694 extern void vect_set_verbosity_level (const char *);
4695
4696 struct tree_map GTY(())
4697 {
4698   unsigned int hash;
4699   tree from;
4700   tree to;
4701 };
4702
4703 extern unsigned int tree_map_hash (const void *);
4704 extern int tree_map_marked_p (const void *);
4705 extern int tree_map_eq (const void *, const void *);
4706
4707 /* In tree-ssa-address.c.  */
4708 extern tree tree_mem_ref_addr (tree, tree);
4709 extern void copy_mem_ref_info (tree, tree);
4710
4711 /* In tree-vrp.c */
4712 extern bool ssa_name_nonzero_p (tree);
4713 extern bool ssa_name_nonnegative_p (tree);
4714
4715 /* In tree-object-size.c.  */
4716 extern void init_object_sizes (void);
4717 extern void fini_object_sizes (void);
4718 extern unsigned HOST_WIDE_INT compute_builtin_object_size (tree, int);
4719
4720 /* In expr.c.  */
4721 extern unsigned HOST_WIDE_INT highest_pow2_factor (tree);
4722
4723 /* APPLE LOCAL begin radar 6300081  */
4724 extern GTY(()) tree generic_block_literal_struct_type;
4725 /* APPLE LOCAL end radar 6300081  */
4726
4727 #endif  /* GCC_TREE_H  */