xref: /dragonfly/contrib/gcc-4.7/gcc/tree.h (revision 5ce9237c)
1e4b17023SJohn Marino /* Front-end tree definitions for GNU compiler.
2e4b17023SJohn Marino    Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3e4b17023SJohn Marino    2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4e4b17023SJohn Marino    Free Software Foundation, Inc.
5e4b17023SJohn Marino 
6e4b17023SJohn Marino This file is part of GCC.
7e4b17023SJohn Marino 
8e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under
9e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free
10e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later
11e4b17023SJohn Marino version.
12e4b17023SJohn Marino 
13e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or
15e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16e4b17023SJohn Marino for more details.
17e4b17023SJohn Marino 
18e4b17023SJohn Marino You should have received a copy of the GNU General Public License
19e4b17023SJohn Marino along with GCC; see the file COPYING3.  If not see
20e4b17023SJohn Marino <http://www.gnu.org/licenses/>.  */
21e4b17023SJohn Marino 
22e4b17023SJohn Marino #ifndef GCC_TREE_H
23e4b17023SJohn Marino #define GCC_TREE_H
24e4b17023SJohn Marino 
25e4b17023SJohn Marino #include "hashtab.h"
26e4b17023SJohn Marino #include "machmode.h"
27e4b17023SJohn Marino #include "input.h"
28e4b17023SJohn Marino #include "statistics.h"
29e4b17023SJohn Marino #include "vec.h"
30e4b17023SJohn Marino #include "vecir.h"
31e4b17023SJohn Marino #include "double-int.h"
32e4b17023SJohn Marino #include "real.h"
33e4b17023SJohn Marino #include "fixed-value.h"
34e4b17023SJohn Marino #include "alias.h"
35e4b17023SJohn Marino #include "flags.h"
36e4b17023SJohn Marino 
37e4b17023SJohn Marino /* Codes of tree nodes */
38e4b17023SJohn Marino 
39e4b17023SJohn Marino #define DEFTREECODE(SYM, STRING, TYPE, NARGS)   SYM,
40e4b17023SJohn Marino #define END_OF_BASE_TREE_CODES LAST_AND_UNUSED_TREE_CODE,
41e4b17023SJohn Marino 
42e4b17023SJohn Marino enum tree_code {
43e4b17023SJohn Marino #include "all-tree.def"
44e4b17023SJohn Marino MAX_TREE_CODES
45e4b17023SJohn Marino };
46e4b17023SJohn Marino 
47e4b17023SJohn Marino #undef DEFTREECODE
48e4b17023SJohn Marino #undef END_OF_BASE_TREE_CODES
49e4b17023SJohn Marino 
50e4b17023SJohn Marino extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
51e4b17023SJohn Marino #define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
52e4b17023SJohn Marino 
53e4b17023SJohn Marino /* Macros for initializing `tree_contains_struct'.  */
54e4b17023SJohn Marino #define MARK_TS_BASE(C)					\
55e4b17023SJohn Marino   do {							\
56e4b17023SJohn Marino     tree_contains_struct[C][TS_BASE] = 1;		\
57e4b17023SJohn Marino   } while (0)
58e4b17023SJohn Marino 
59e4b17023SJohn Marino #define MARK_TS_TYPED(C)				\
60e4b17023SJohn Marino   do {							\
61e4b17023SJohn Marino     MARK_TS_BASE (C);					\
62e4b17023SJohn Marino     tree_contains_struct[C][TS_TYPED] = 1;		\
63e4b17023SJohn Marino   } while (0)
64e4b17023SJohn Marino 
65e4b17023SJohn Marino #define MARK_TS_COMMON(C)				\
66e4b17023SJohn Marino   do {							\
67e4b17023SJohn Marino     MARK_TS_TYPED (C);					\
68e4b17023SJohn Marino     tree_contains_struct[C][TS_COMMON] = 1;		\
69e4b17023SJohn Marino   } while (0)
70e4b17023SJohn Marino 
71e4b17023SJohn Marino #define MARK_TS_TYPE_COMMON(C)				\
72e4b17023SJohn Marino   do {							\
73e4b17023SJohn Marino     MARK_TS_COMMON (C);					\
74e4b17023SJohn Marino     tree_contains_struct[C][TS_TYPE_COMMON] = 1;	\
75e4b17023SJohn Marino   } while (0)
76e4b17023SJohn Marino 
77e4b17023SJohn Marino #define MARK_TS_TYPE_WITH_LANG_SPECIFIC(C)		\
78e4b17023SJohn Marino   do {							\
79e4b17023SJohn Marino     MARK_TS_TYPE_COMMON (C);				\
80e4b17023SJohn Marino     tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = 1;	\
81e4b17023SJohn Marino   } while (0)
82e4b17023SJohn Marino 
83e4b17023SJohn Marino #define MARK_TS_DECL_MINIMAL(C)				\
84e4b17023SJohn Marino   do {							\
85e4b17023SJohn Marino     MARK_TS_COMMON (C);					\
86e4b17023SJohn Marino     tree_contains_struct[C][TS_DECL_MINIMAL] = 1;	\
87e4b17023SJohn Marino   } while (0)
88e4b17023SJohn Marino 
89e4b17023SJohn Marino #define MARK_TS_DECL_COMMON(C)				\
90e4b17023SJohn Marino   do {							\
91e4b17023SJohn Marino     MARK_TS_DECL_MINIMAL (C);				\
92e4b17023SJohn Marino     tree_contains_struct[C][TS_DECL_COMMON] = 1;	\
93e4b17023SJohn Marino   } while (0)
94e4b17023SJohn Marino 
95e4b17023SJohn Marino #define MARK_TS_DECL_WRTL(C)				\
96e4b17023SJohn Marino   do {							\
97e4b17023SJohn Marino     MARK_TS_DECL_COMMON (C);				\
98e4b17023SJohn Marino     tree_contains_struct[C][TS_DECL_WRTL] = 1;		\
99e4b17023SJohn Marino   } while (0)
100e4b17023SJohn Marino 
101e4b17023SJohn Marino #define MARK_TS_DECL_WITH_VIS(C)			\
102e4b17023SJohn Marino   do {							\
103e4b17023SJohn Marino     MARK_TS_DECL_WRTL (C);				\
104e4b17023SJohn Marino     tree_contains_struct[C][TS_DECL_WITH_VIS] = 1;	\
105e4b17023SJohn Marino   } while (0)
106e4b17023SJohn Marino 
107e4b17023SJohn Marino #define MARK_TS_DECL_NON_COMMON(C)			\
108e4b17023SJohn Marino   do {							\
109e4b17023SJohn Marino     MARK_TS_DECL_WITH_VIS (C);				\
110e4b17023SJohn Marino     tree_contains_struct[C][TS_DECL_NON_COMMON] = 1;	\
111e4b17023SJohn Marino   } while (0)
112e4b17023SJohn Marino 
113e4b17023SJohn Marino /* Number of language-independent tree codes.  */
114e4b17023SJohn Marino #define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE)
115e4b17023SJohn Marino 
116e4b17023SJohn Marino /* Tree code classes.  */
117e4b17023SJohn Marino 
118e4b17023SJohn Marino /* Each tree_code has an associated code class represented by a
119e4b17023SJohn Marino    TREE_CODE_CLASS.  */
120e4b17023SJohn Marino 
121e4b17023SJohn Marino enum tree_code_class {
122e4b17023SJohn Marino   tcc_exceptional, /* An exceptional code (fits no category).  */
123e4b17023SJohn Marino   tcc_constant,    /* A constant.  */
124e4b17023SJohn Marino   /* Order of tcc_type and tcc_declaration is important.  */
125e4b17023SJohn Marino   tcc_type,        /* A type object code.  */
126e4b17023SJohn Marino   tcc_declaration, /* A declaration (also serving as variable refs).  */
127e4b17023SJohn Marino   tcc_reference,   /* A reference to storage.  */
128e4b17023SJohn Marino   tcc_comparison,  /* A comparison expression.  */
129e4b17023SJohn Marino   tcc_unary,       /* A unary arithmetic expression.  */
130e4b17023SJohn Marino   tcc_binary,      /* A binary arithmetic expression.  */
131e4b17023SJohn Marino   tcc_statement,   /* A statement expression, which have side effects
132e4b17023SJohn Marino 		      but usually no interesting value.  */
133e4b17023SJohn Marino   tcc_vl_exp,      /* A function call or other expression with a
134e4b17023SJohn Marino 		      variable-length operand vector.  */
135e4b17023SJohn Marino   tcc_expression   /* Any other expression.  */
136e4b17023SJohn Marino };
137e4b17023SJohn Marino 
138e4b17023SJohn Marino /* Each tree code class has an associated string representation.
139e4b17023SJohn Marino    These must correspond to the tree_code_class entries.  */
140e4b17023SJohn Marino 
141e4b17023SJohn Marino extern const char *const tree_code_class_strings[];
142e4b17023SJohn Marino 
143e4b17023SJohn Marino /* Returns the string representing CLASS.  */
144e4b17023SJohn Marino 
145e4b17023SJohn Marino #define TREE_CODE_CLASS_STRING(CLASS)\
146e4b17023SJohn Marino         tree_code_class_strings[(int) (CLASS)]
147e4b17023SJohn Marino 
148e4b17023SJohn Marino extern const enum tree_code_class tree_code_type[];
149e4b17023SJohn Marino #define TREE_CODE_CLASS(CODE)	tree_code_type[(int) (CODE)]
150e4b17023SJohn Marino 
151e4b17023SJohn Marino /* Nonzero if CODE represents an exceptional code.  */
152e4b17023SJohn Marino 
153e4b17023SJohn Marino #define EXCEPTIONAL_CLASS_P(CODE)\
154e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_exceptional)
155e4b17023SJohn Marino 
156e4b17023SJohn Marino /* Nonzero if CODE represents a constant.  */
157e4b17023SJohn Marino 
158e4b17023SJohn Marino #define CONSTANT_CLASS_P(CODE)\
159e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_constant)
160e4b17023SJohn Marino 
161e4b17023SJohn Marino /* Nonzero if CODE represents a type.  */
162e4b17023SJohn Marino 
163e4b17023SJohn Marino #define TYPE_P(CODE)\
164e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_type)
165e4b17023SJohn Marino 
166e4b17023SJohn Marino /* Nonzero if CODE represents a declaration.  */
167e4b17023SJohn Marino 
168e4b17023SJohn Marino #define DECL_P(CODE)\
169e4b17023SJohn Marino         (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration)
170e4b17023SJohn Marino 
171e4b17023SJohn Marino /* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL.  */
172e4b17023SJohn Marino 
173e4b17023SJohn Marino #define VAR_OR_FUNCTION_DECL_P(DECL)\
174e4b17023SJohn Marino   (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL)
175e4b17023SJohn Marino 
176e4b17023SJohn Marino /* Nonzero if CODE represents a INDIRECT_REF.  Keep these checks in
177e4b17023SJohn Marino    ascending code order.  */
178e4b17023SJohn Marino 
179e4b17023SJohn Marino #define INDIRECT_REF_P(CODE)\
180e4b17023SJohn Marino   (TREE_CODE (CODE) == INDIRECT_REF)
181e4b17023SJohn Marino 
182e4b17023SJohn Marino /* Nonzero if CODE represents a reference.  */
183e4b17023SJohn Marino 
184e4b17023SJohn Marino #define REFERENCE_CLASS_P(CODE)\
185e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_reference)
186e4b17023SJohn Marino 
187e4b17023SJohn Marino /* Nonzero if CODE represents a comparison.  */
188e4b17023SJohn Marino 
189e4b17023SJohn Marino #define COMPARISON_CLASS_P(CODE)\
190e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_comparison)
191e4b17023SJohn Marino 
192e4b17023SJohn Marino /* Nonzero if CODE represents a unary arithmetic expression.  */
193e4b17023SJohn Marino 
194e4b17023SJohn Marino #define UNARY_CLASS_P(CODE)\
195e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_unary)
196e4b17023SJohn Marino 
197e4b17023SJohn Marino /* Nonzero if CODE represents a binary arithmetic expression.  */
198e4b17023SJohn Marino 
199e4b17023SJohn Marino #define BINARY_CLASS_P(CODE)\
200e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_binary)
201e4b17023SJohn Marino 
202e4b17023SJohn Marino /* Nonzero if CODE represents a statement expression.  */
203e4b17023SJohn Marino 
204e4b17023SJohn Marino #define STATEMENT_CLASS_P(CODE)\
205e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_statement)
206e4b17023SJohn Marino 
207e4b17023SJohn Marino /* Nonzero if CODE represents a function call-like expression with a
208e4b17023SJohn Marino    variable-length operand vector.  */
209e4b17023SJohn Marino 
210e4b17023SJohn Marino #define VL_EXP_CLASS_P(CODE)\
211e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_vl_exp)
212e4b17023SJohn Marino 
213e4b17023SJohn Marino /* Nonzero if CODE represents any other expression.  */
214e4b17023SJohn Marino 
215e4b17023SJohn Marino #define EXPRESSION_CLASS_P(CODE)\
216e4b17023SJohn Marino 	(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_expression)
217e4b17023SJohn Marino 
218e4b17023SJohn Marino /* Returns nonzero iff CODE represents a type or declaration.  */
219e4b17023SJohn Marino 
220e4b17023SJohn Marino #define IS_TYPE_OR_DECL_P(CODE)\
221e4b17023SJohn Marino 	(TYPE_P (CODE) || DECL_P (CODE))
222e4b17023SJohn Marino 
223e4b17023SJohn Marino /* Returns nonzero iff CLASS is the tree-code class of an
224e4b17023SJohn Marino    expression.  */
225e4b17023SJohn Marino 
226e4b17023SJohn Marino #define IS_EXPR_CODE_CLASS(CLASS)\
227e4b17023SJohn Marino 	((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
228e4b17023SJohn Marino 
229e4b17023SJohn Marino /* Returns nonzero iff NODE is an expression of some kind.  */
230e4b17023SJohn Marino 
231e4b17023SJohn Marino #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
232e4b17023SJohn Marino 
233e4b17023SJohn Marino /* Number of argument-words in each kind of tree-node.  */
234e4b17023SJohn Marino 
235e4b17023SJohn Marino extern const unsigned char tree_code_length[];
236e4b17023SJohn Marino #define TREE_CODE_LENGTH(CODE)	tree_code_length[(int) (CODE)]
237e4b17023SJohn Marino 
238e4b17023SJohn Marino /* Names of tree components.  */
239e4b17023SJohn Marino 
240e4b17023SJohn Marino extern const char *const tree_code_name[];
241e4b17023SJohn Marino 
242e4b17023SJohn Marino /* We have to be able to tell cgraph about the needed-ness of the target
243e4b17023SJohn Marino    of an alias.  This requires that the decl have been defined.  Aliases
244e4b17023SJohn Marino    that precede their definition have to be queued for later processing.  */
245e4b17023SJohn Marino 
246e4b17023SJohn Marino /* The deferred processing proceeds in several passes.  We memorize the
247e4b17023SJohn Marino    diagnostics emitted for a pair to prevent repeating messages when the
248e4b17023SJohn Marino    queue gets re-scanned after possible updates.  */
249e4b17023SJohn Marino 
250e4b17023SJohn Marino typedef enum {
251e4b17023SJohn Marino   ALIAS_DIAG_NONE      = 0x0,
252e4b17023SJohn Marino   ALIAS_DIAG_TO_UNDEF  = 0x1,
253e4b17023SJohn Marino   ALIAS_DIAG_TO_EXTERN = 0x2
254e4b17023SJohn Marino } alias_diag_flags;
255e4b17023SJohn Marino 
256e4b17023SJohn Marino typedef struct GTY(()) alias_pair
257e4b17023SJohn Marino {
258e4b17023SJohn Marino   tree decl;
259e4b17023SJohn Marino   tree target;
260e4b17023SJohn Marino   int  emitted_diags;  /* alias_diags already emitted for this pair.  */
261e4b17023SJohn Marino } alias_pair;
262e4b17023SJohn Marino 
263e4b17023SJohn Marino /* Define gc'd vector type.  */
264e4b17023SJohn Marino DEF_VEC_O(alias_pair);
265e4b17023SJohn Marino DEF_VEC_ALLOC_O(alias_pair,gc);
266e4b17023SJohn Marino 
267e4b17023SJohn Marino extern GTY(()) VEC(alias_pair,gc) * alias_pairs;
268e4b17023SJohn Marino 
269e4b17023SJohn Marino 
270e4b17023SJohn Marino /* Classify which part of the compiler has defined a given builtin function.
271e4b17023SJohn Marino    Note that we assume below that this is no more than two bits.  */
272e4b17023SJohn Marino enum built_in_class
273e4b17023SJohn Marino {
274e4b17023SJohn Marino   NOT_BUILT_IN = 0,
275e4b17023SJohn Marino   BUILT_IN_FRONTEND,
276e4b17023SJohn Marino   BUILT_IN_MD,
277e4b17023SJohn Marino   BUILT_IN_NORMAL
278e4b17023SJohn Marino };
279e4b17023SJohn Marino 
280e4b17023SJohn Marino /* Last marker used for LTO stremaing of built_in_class.  We can not add it
281e4b17023SJohn Marino    to the enum since we need the enumb to fit in 2 bits.  */
282e4b17023SJohn Marino #define BUILT_IN_LAST (BUILT_IN_NORMAL + 1)
283e4b17023SJohn Marino 
284e4b17023SJohn Marino /* Names for the above.  */
285e4b17023SJohn Marino extern const char *const built_in_class_names[4];
286e4b17023SJohn Marino 
287e4b17023SJohn Marino /* Codes that identify the various built in functions
288e4b17023SJohn Marino    so that expand_call can identify them quickly.  */
289e4b17023SJohn Marino 
290e4b17023SJohn Marino #define DEF_BUILTIN(ENUM, N, C, T, LT, B, F, NA, AT, IM, COND) ENUM,
291e4b17023SJohn Marino enum built_in_function
292e4b17023SJohn Marino {
293e4b17023SJohn Marino #include "builtins.def"
294e4b17023SJohn Marino 
295e4b17023SJohn Marino   /* Complex division routines in libgcc.  These are done via builtins
296e4b17023SJohn Marino      because emit_library_call_value can't handle complex values.  */
297e4b17023SJohn Marino   BUILT_IN_COMPLEX_MUL_MIN,
298e4b17023SJohn Marino   BUILT_IN_COMPLEX_MUL_MAX
299e4b17023SJohn Marino     = BUILT_IN_COMPLEX_MUL_MIN
300e4b17023SJohn Marino       + MAX_MODE_COMPLEX_FLOAT
301e4b17023SJohn Marino       - MIN_MODE_COMPLEX_FLOAT,
302e4b17023SJohn Marino 
303e4b17023SJohn Marino   BUILT_IN_COMPLEX_DIV_MIN,
304e4b17023SJohn Marino   BUILT_IN_COMPLEX_DIV_MAX
305e4b17023SJohn Marino     = BUILT_IN_COMPLEX_DIV_MIN
306e4b17023SJohn Marino       + MAX_MODE_COMPLEX_FLOAT
307e4b17023SJohn Marino       - MIN_MODE_COMPLEX_FLOAT,
308e4b17023SJohn Marino 
309e4b17023SJohn Marino   /* Upper bound on non-language-specific builtins.  */
310e4b17023SJohn Marino   END_BUILTINS
311e4b17023SJohn Marino };
312e4b17023SJohn Marino #undef DEF_BUILTIN
313e4b17023SJohn Marino 
314e4b17023SJohn Marino /* Names for the above.  */
315e4b17023SJohn Marino extern const char * built_in_names[(int) END_BUILTINS];
316e4b17023SJohn Marino 
317e4b17023SJohn Marino /* Helper macros for math builtins.  */
318e4b17023SJohn Marino 
319e4b17023SJohn Marino #define BUILTIN_EXP10_P(FN) \
320e4b17023SJohn Marino  ((FN) == BUILT_IN_EXP10 || (FN) == BUILT_IN_EXP10F || (FN) == BUILT_IN_EXP10L \
321e4b17023SJohn Marino   || (FN) == BUILT_IN_POW10 || (FN) == BUILT_IN_POW10F || (FN) == BUILT_IN_POW10L)
322e4b17023SJohn Marino 
323e4b17023SJohn Marino #define BUILTIN_EXPONENT_P(FN) (BUILTIN_EXP10_P (FN) \
324e4b17023SJohn Marino   || (FN) == BUILT_IN_EXP || (FN) == BUILT_IN_EXPF || (FN) == BUILT_IN_EXPL \
325e4b17023SJohn Marino   || (FN) == BUILT_IN_EXP2 || (FN) == BUILT_IN_EXP2F || (FN) == BUILT_IN_EXP2L)
326e4b17023SJohn Marino 
327e4b17023SJohn Marino #define BUILTIN_SQRT_P(FN) \
328e4b17023SJohn Marino  ((FN) == BUILT_IN_SQRT || (FN) == BUILT_IN_SQRTF || (FN) == BUILT_IN_SQRTL)
329e4b17023SJohn Marino 
330e4b17023SJohn Marino #define BUILTIN_CBRT_P(FN) \
331e4b17023SJohn Marino  ((FN) == BUILT_IN_CBRT || (FN) == BUILT_IN_CBRTF || (FN) == BUILT_IN_CBRTL)
332e4b17023SJohn Marino 
333e4b17023SJohn Marino #define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
334e4b17023SJohn Marino 
335e4b17023SJohn Marino #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
336e4b17023SJohn Marino #define CASE_FLT_FN_REENT(FN) case FN##_R: case FN##F_R: case FN##L_R
337e4b17023SJohn Marino #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL
338e4b17023SJohn Marino 
339e4b17023SJohn Marino /* In an OMP_CLAUSE node.  */
340e4b17023SJohn Marino 
341e4b17023SJohn Marino /* Number of operands and names for each clause.  */
342e4b17023SJohn Marino extern unsigned const char omp_clause_num_ops[];
343e4b17023SJohn Marino extern const char * const omp_clause_code_name[];
344e4b17023SJohn Marino 
345e4b17023SJohn Marino /* Clause codes.  Do not reorder, as this is used to index into the tables
346e4b17023SJohn Marino    omp_clause_num_ops and omp_clause_code_name.  */
347e4b17023SJohn Marino enum omp_clause_code
348e4b17023SJohn Marino {
349e4b17023SJohn Marino   /* Clause zero is special-cased inside the parser
350e4b17023SJohn Marino      (c_parser_omp_variable_list).  */
351e4b17023SJohn Marino   OMP_CLAUSE_ERROR = 0,
352e4b17023SJohn Marino 
353e4b17023SJohn Marino   /* OpenMP clause: private (variable_list).  */
354e4b17023SJohn Marino   OMP_CLAUSE_PRIVATE,
355e4b17023SJohn Marino 
356e4b17023SJohn Marino   /* OpenMP clause: shared (variable_list).  */
357e4b17023SJohn Marino   OMP_CLAUSE_SHARED,
358e4b17023SJohn Marino 
359e4b17023SJohn Marino   /* OpenMP clause: firstprivate (variable_list).  */
360e4b17023SJohn Marino   OMP_CLAUSE_FIRSTPRIVATE,
361e4b17023SJohn Marino 
362e4b17023SJohn Marino   /* OpenMP clause: lastprivate (variable_list).  */
363e4b17023SJohn Marino   OMP_CLAUSE_LASTPRIVATE,
364e4b17023SJohn Marino 
365e4b17023SJohn Marino   /* OpenMP clause: reduction (operator:variable_list).
366e4b17023SJohn Marino      OMP_CLAUSE_REDUCTION_CODE: The tree_code of the operator.
367e4b17023SJohn Marino      Operand 1: OMP_CLAUSE_REDUCTION_INIT: Stmt-list to initialize the var.
368e4b17023SJohn Marino      Operand 2: OMP_CLAUSE_REDUCTION_MERGE: Stmt-list to merge private var
369e4b17023SJohn Marino                 into the shared one.
370e4b17023SJohn Marino      Operand 3: OMP_CLAUSE_REDUCTION_PLACEHOLDER: A dummy VAR_DECL
371e4b17023SJohn Marino                 placeholder used in OMP_CLAUSE_REDUCTION_{INIT,MERGE}.  */
372e4b17023SJohn Marino   OMP_CLAUSE_REDUCTION,
373e4b17023SJohn Marino 
374e4b17023SJohn Marino   /* OpenMP clause: copyin (variable_list).  */
375e4b17023SJohn Marino   OMP_CLAUSE_COPYIN,
376e4b17023SJohn Marino 
377e4b17023SJohn Marino   /* OpenMP clause: copyprivate (variable_list).  */
378e4b17023SJohn Marino   OMP_CLAUSE_COPYPRIVATE,
379e4b17023SJohn Marino 
380e4b17023SJohn Marino   /* OpenMP clause: if (scalar-expression).  */
381e4b17023SJohn Marino   OMP_CLAUSE_IF,
382e4b17023SJohn Marino 
383e4b17023SJohn Marino   /* OpenMP clause: num_threads (integer-expression).  */
384e4b17023SJohn Marino   OMP_CLAUSE_NUM_THREADS,
385e4b17023SJohn Marino 
386e4b17023SJohn Marino   /* OpenMP clause: schedule.  */
387e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE,
388e4b17023SJohn Marino 
389e4b17023SJohn Marino   /* OpenMP clause: nowait.  */
390e4b17023SJohn Marino   OMP_CLAUSE_NOWAIT,
391e4b17023SJohn Marino 
392e4b17023SJohn Marino   /* OpenMP clause: ordered.  */
393e4b17023SJohn Marino   OMP_CLAUSE_ORDERED,
394e4b17023SJohn Marino 
395e4b17023SJohn Marino   /* OpenMP clause: default.  */
396e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT,
397e4b17023SJohn Marino 
398e4b17023SJohn Marino   /* OpenMP clause: collapse (constant-integer-expression).  */
399e4b17023SJohn Marino   OMP_CLAUSE_COLLAPSE,
400e4b17023SJohn Marino 
401e4b17023SJohn Marino   /* OpenMP clause: untied.  */
402e4b17023SJohn Marino   OMP_CLAUSE_UNTIED,
403e4b17023SJohn Marino 
404e4b17023SJohn Marino   /* OpenMP clause: final (scalar-expression).  */
405e4b17023SJohn Marino   OMP_CLAUSE_FINAL,
406e4b17023SJohn Marino 
407e4b17023SJohn Marino   /* OpenMP clause: mergeable.  */
408e4b17023SJohn Marino   OMP_CLAUSE_MERGEABLE
409e4b17023SJohn Marino };
410e4b17023SJohn Marino 
411e4b17023SJohn Marino /* The definition of tree nodes fills the next several pages.  */
412e4b17023SJohn Marino 
413e4b17023SJohn Marino /* A tree node can represent a data type, a variable, an expression
414e4b17023SJohn Marino    or a statement.  Each node has a TREE_CODE which says what kind of
415e4b17023SJohn Marino    thing it represents.  Some common codes are:
416e4b17023SJohn Marino    INTEGER_TYPE -- represents a type of integers.
417e4b17023SJohn Marino    ARRAY_TYPE -- represents a type of pointer.
418e4b17023SJohn Marino    VAR_DECL -- represents a declared variable.
419e4b17023SJohn Marino    INTEGER_CST -- represents a constant integer value.
420e4b17023SJohn Marino    PLUS_EXPR -- represents a sum (an expression).
421e4b17023SJohn Marino 
422e4b17023SJohn Marino    As for the contents of a tree node: there are some fields
423e4b17023SJohn Marino    that all nodes share.  Each TREE_CODE has various special-purpose
424e4b17023SJohn Marino    fields as well.  The fields of a node are never accessed directly,
425e4b17023SJohn Marino    always through accessor macros.  */
426e4b17023SJohn Marino 
427e4b17023SJohn Marino /* Every kind of tree node starts with this structure,
428e4b17023SJohn Marino    so all nodes have these fields.
429e4b17023SJohn Marino 
430e4b17023SJohn Marino    See the accessor macros, defined below, for documentation of the
431e4b17023SJohn Marino    fields.  */
432e4b17023SJohn Marino 
433e4b17023SJohn Marino struct GTY(()) tree_base {
434e4b17023SJohn Marino   ENUM_BITFIELD(tree_code) code : 16;
435e4b17023SJohn Marino 
436e4b17023SJohn Marino   unsigned side_effects_flag : 1;
437e4b17023SJohn Marino   unsigned constant_flag : 1;
438e4b17023SJohn Marino   unsigned addressable_flag : 1;
439e4b17023SJohn Marino   unsigned volatile_flag : 1;
440e4b17023SJohn Marino   unsigned readonly_flag : 1;
441e4b17023SJohn Marino   unsigned unsigned_flag : 1;
442e4b17023SJohn Marino   unsigned asm_written_flag: 1;
443e4b17023SJohn Marino   unsigned nowarning_flag : 1;
444e4b17023SJohn Marino 
445e4b17023SJohn Marino   unsigned used_flag : 1;
446e4b17023SJohn Marino   unsigned nothrow_flag : 1;
447e4b17023SJohn Marino   unsigned static_flag : 1;
448e4b17023SJohn Marino   unsigned public_flag : 1;
449e4b17023SJohn Marino   unsigned private_flag : 1;
450e4b17023SJohn Marino   unsigned protected_flag : 1;
451e4b17023SJohn Marino   unsigned deprecated_flag : 1;
452e4b17023SJohn Marino   unsigned saturating_flag : 1;
453e4b17023SJohn Marino 
454e4b17023SJohn Marino   unsigned default_def_flag : 1;
455e4b17023SJohn Marino   unsigned lang_flag_0 : 1;
456e4b17023SJohn Marino   unsigned lang_flag_1 : 1;
457e4b17023SJohn Marino   unsigned lang_flag_2 : 1;
458e4b17023SJohn Marino   unsigned lang_flag_3 : 1;
459e4b17023SJohn Marino   unsigned lang_flag_4 : 1;
460e4b17023SJohn Marino   unsigned lang_flag_5 : 1;
461e4b17023SJohn Marino   unsigned lang_flag_6 : 1;
462e4b17023SJohn Marino 
463e4b17023SJohn Marino   unsigned visited : 1;
464e4b17023SJohn Marino   unsigned packed_flag : 1;
465e4b17023SJohn Marino   unsigned user_align : 1;
466e4b17023SJohn Marino   unsigned nameless_flag : 1;
467e4b17023SJohn Marino 
468e4b17023SJohn Marino   unsigned spare : 12;
469e4b17023SJohn Marino 
470e4b17023SJohn Marino   /* This field is only used with type nodes; the only reason it is present
471e4b17023SJohn Marino      in tree_base instead of tree_type is to save space.  The size of the
472e4b17023SJohn Marino      field must be large enough to hold addr_space_t values.  */
473e4b17023SJohn Marino   unsigned address_space : 8;
474e4b17023SJohn Marino };
475e4b17023SJohn Marino 
476e4b17023SJohn Marino struct GTY(()) tree_typed {
477e4b17023SJohn Marino   struct tree_base base;
478e4b17023SJohn Marino   tree type;
479e4b17023SJohn Marino };
480e4b17023SJohn Marino 
481e4b17023SJohn Marino struct GTY(()) tree_common {
482e4b17023SJohn Marino   struct tree_typed typed;
483e4b17023SJohn Marino   tree chain;
484e4b17023SJohn Marino };
485e4b17023SJohn Marino 
486e4b17023SJohn Marino /* The following table lists the uses of each of the above flags and
487e4b17023SJohn Marino    for which types of nodes they are defined.
488e4b17023SJohn Marino 
489e4b17023SJohn Marino    addressable_flag:
490e4b17023SJohn Marino 
491e4b17023SJohn Marino        TREE_ADDRESSABLE in
492e4b17023SJohn Marino            VAR_DECL, PARM_DECL, RESULT_DECL, FUNCTION_DECL, LABEL_DECL
493*5ce9237cSJohn Marino            SSA_NAME
494e4b17023SJohn Marino            all types
495e4b17023SJohn Marino            CONSTRUCTOR, IDENTIFIER_NODE
496*5ce9237cSJohn Marino            STMT_EXPR
497e4b17023SJohn Marino 
498e4b17023SJohn Marino        CALL_EXPR_TAILCALL in
499e4b17023SJohn Marino            CALL_EXPR
500e4b17023SJohn Marino 
501e4b17023SJohn Marino        CASE_LOW_SEEN in
502e4b17023SJohn Marino            CASE_LABEL_EXPR
503e4b17023SJohn Marino 
504e4b17023SJohn Marino    static_flag:
505e4b17023SJohn Marino 
506e4b17023SJohn Marino        TREE_STATIC in
507e4b17023SJohn Marino            VAR_DECL, FUNCTION_DECL
508e4b17023SJohn Marino            CONSTRUCTOR
509e4b17023SJohn Marino 
510e4b17023SJohn Marino        TREE_NO_TRAMPOLINE in
511e4b17023SJohn Marino            ADDR_EXPR
512e4b17023SJohn Marino 
513e4b17023SJohn Marino        BINFO_VIRTUAL_P in
514e4b17023SJohn Marino            TREE_BINFO
515e4b17023SJohn Marino 
516e4b17023SJohn Marino        TREE_SYMBOL_REFERENCED in
517e4b17023SJohn Marino            IDENTIFIER_NODE
518e4b17023SJohn Marino 
519e4b17023SJohn Marino        CLEANUP_EH_ONLY in
520e4b17023SJohn Marino            TARGET_EXPR, WITH_CLEANUP_EXPR
521e4b17023SJohn Marino 
522e4b17023SJohn Marino        TRY_CATCH_IS_CLEANUP in
523e4b17023SJohn Marino            TRY_CATCH_EXPR
524e4b17023SJohn Marino 
525e4b17023SJohn Marino        ASM_INPUT_P in
526e4b17023SJohn Marino            ASM_EXPR
527e4b17023SJohn Marino 
528e4b17023SJohn Marino        TYPE_REF_CAN_ALIAS_ALL in
529e4b17023SJohn Marino            POINTER_TYPE, REFERENCE_TYPE
530e4b17023SJohn Marino 
531e4b17023SJohn Marino        MOVE_NONTEMPORAL in
532e4b17023SJohn Marino            MODIFY_EXPR
533e4b17023SJohn Marino 
534e4b17023SJohn Marino        CASE_HIGH_SEEN in
535e4b17023SJohn Marino            CASE_LABEL_EXPR
536e4b17023SJohn Marino 
537e4b17023SJohn Marino        ENUM_IS_SCOPED in
538e4b17023SJohn Marino 	   ENUMERAL_TYPE
539e4b17023SJohn Marino 
540e4b17023SJohn Marino        TRANSACTION_EXPR_OUTER in
541e4b17023SJohn Marino 	   TRANSACTION_EXPR
542e4b17023SJohn Marino 
543e4b17023SJohn Marino    public_flag:
544e4b17023SJohn Marino 
545e4b17023SJohn Marino        TREE_OVERFLOW in
546e4b17023SJohn Marino            INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
547e4b17023SJohn Marino 
548e4b17023SJohn Marino        TREE_PUBLIC in
549e4b17023SJohn Marino            VAR_DECL, FUNCTION_DECL
550e4b17023SJohn Marino            IDENTIFIER_NODE
551e4b17023SJohn Marino 
552e4b17023SJohn Marino        ASM_VOLATILE_P in
553e4b17023SJohn Marino            ASM_EXPR
554e4b17023SJohn Marino 
555e4b17023SJohn Marino        CALL_EXPR_VA_ARG_PACK in
556e4b17023SJohn Marino            CALL_EXPR
557e4b17023SJohn Marino 
558e4b17023SJohn Marino        TYPE_CACHED_VALUES_P in
559e4b17023SJohn Marino            all types
560e4b17023SJohn Marino 
561e4b17023SJohn Marino        SAVE_EXPR_RESOLVED_P in
562e4b17023SJohn Marino            SAVE_EXPR
563e4b17023SJohn Marino 
564e4b17023SJohn Marino        OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE in
565e4b17023SJohn Marino            OMP_CLAUSE_LASTPRIVATE
566e4b17023SJohn Marino 
567e4b17023SJohn Marino        OMP_CLAUSE_PRIVATE_DEBUG in
568e4b17023SJohn Marino            OMP_CLAUSE_PRIVATE
569e4b17023SJohn Marino 
570e4b17023SJohn Marino        TRANSACTION_EXPR_RELAXED in
571e4b17023SJohn Marino 	   TRANSACTION_EXPR
572e4b17023SJohn Marino 
573e4b17023SJohn Marino    private_flag:
574e4b17023SJohn Marino 
575e4b17023SJohn Marino        TREE_PRIVATE in
576e4b17023SJohn Marino            all decls
577e4b17023SJohn Marino 
578e4b17023SJohn Marino        CALL_EXPR_RETURN_SLOT_OPT in
579e4b17023SJohn Marino            CALL_EXPR
580e4b17023SJohn Marino 
581e4b17023SJohn Marino        OMP_SECTION_LAST in
582e4b17023SJohn Marino            OMP_SECTION
583e4b17023SJohn Marino 
584e4b17023SJohn Marino        OMP_PARALLEL_COMBINED in
585e4b17023SJohn Marino            OMP_PARALLEL
586e4b17023SJohn Marino        OMP_CLAUSE_PRIVATE_OUTER_REF in
587e4b17023SJohn Marino 	   OMP_CLAUSE_PRIVATE
588e4b17023SJohn Marino 
589e4b17023SJohn Marino        TYPE_REF_IS_RVALUE in
590e4b17023SJohn Marino 	   REFERENCE_TYPE
591e4b17023SJohn Marino 
592e4b17023SJohn Marino    protected_flag:
593e4b17023SJohn Marino 
594e4b17023SJohn Marino        TREE_PROTECTED in
595e4b17023SJohn Marino            BLOCK
596e4b17023SJohn Marino            all decls
597e4b17023SJohn Marino 
598e4b17023SJohn Marino        CALL_FROM_THUNK_P and
599e4b17023SJohn Marino        CALL_ALLOCA_FOR_VAR_P in
600e4b17023SJohn Marino            CALL_EXPR
601e4b17023SJohn Marino 
602e4b17023SJohn Marino    side_effects_flag:
603e4b17023SJohn Marino 
604e4b17023SJohn Marino        TREE_SIDE_EFFECTS in
605e4b17023SJohn Marino            all expressions
606e4b17023SJohn Marino            all decls
607e4b17023SJohn Marino            all constants
608e4b17023SJohn Marino 
609e4b17023SJohn Marino        FORCED_LABEL in
610e4b17023SJohn Marino            LABEL_DECL
611e4b17023SJohn Marino 
612e4b17023SJohn Marino    volatile_flag:
613e4b17023SJohn Marino 
614e4b17023SJohn Marino        TREE_THIS_VOLATILE in
615e4b17023SJohn Marino            all expressions
616e4b17023SJohn Marino            all decls
617e4b17023SJohn Marino 
618e4b17023SJohn Marino        TYPE_VOLATILE in
619e4b17023SJohn Marino            all types
620e4b17023SJohn Marino 
621e4b17023SJohn Marino    readonly_flag:
622e4b17023SJohn Marino 
623e4b17023SJohn Marino        TREE_READONLY in
624e4b17023SJohn Marino            all expressions
625e4b17023SJohn Marino            all decls
626e4b17023SJohn Marino 
627e4b17023SJohn Marino        TYPE_READONLY in
628e4b17023SJohn Marino            all types
629e4b17023SJohn Marino 
630e4b17023SJohn Marino    constant_flag:
631e4b17023SJohn Marino 
632e4b17023SJohn Marino        TREE_CONSTANT in
633e4b17023SJohn Marino            all expressions
634e4b17023SJohn Marino            all decls
635e4b17023SJohn Marino            all constants
636e4b17023SJohn Marino 
637e4b17023SJohn Marino        TYPE_SIZES_GIMPLIFIED in
638e4b17023SJohn Marino            all types
639e4b17023SJohn Marino 
640e4b17023SJohn Marino    unsigned_flag:
641e4b17023SJohn Marino 
642e4b17023SJohn Marino        TYPE_UNSIGNED in
643e4b17023SJohn Marino            all types
644e4b17023SJohn Marino 
645e4b17023SJohn Marino        DECL_UNSIGNED in
646e4b17023SJohn Marino            all decls
647e4b17023SJohn Marino 
648e4b17023SJohn Marino    asm_written_flag:
649e4b17023SJohn Marino 
650e4b17023SJohn Marino        TREE_ASM_WRITTEN in
651e4b17023SJohn Marino            VAR_DECL, FUNCTION_DECL, TYPE_DECL
652e4b17023SJohn Marino            RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
653e4b17023SJohn Marino            BLOCK, SSA_NAME, STRING_CST
654e4b17023SJohn Marino 
655e4b17023SJohn Marino    used_flag:
656e4b17023SJohn Marino 
657e4b17023SJohn Marino        TREE_USED in
658e4b17023SJohn Marino            all expressions
659e4b17023SJohn Marino            all decls
660e4b17023SJohn Marino            IDENTIFIER_NODE
661e4b17023SJohn Marino 
662e4b17023SJohn Marino    nothrow_flag:
663e4b17023SJohn Marino 
664e4b17023SJohn Marino        TREE_NOTHROW in
665e4b17023SJohn Marino            CALL_EXPR
666e4b17023SJohn Marino            FUNCTION_DECL
667e4b17023SJohn Marino 
668e4b17023SJohn Marino        TYPE_ALIGN_OK in
669e4b17023SJohn Marino            all types
670e4b17023SJohn Marino 
671e4b17023SJohn Marino        TREE_THIS_NOTRAP in
672e4b17023SJohn Marino           INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF, ARRAY_RANGE_REF
673e4b17023SJohn Marino 
674e4b17023SJohn Marino    deprecated_flag:
675e4b17023SJohn Marino 
676e4b17023SJohn Marino        TREE_DEPRECATED in
677e4b17023SJohn Marino            all decls
678e4b17023SJohn Marino 	   all types
679e4b17023SJohn Marino 
680e4b17023SJohn Marino        IDENTIFIER_TRANSPARENT_ALIAS in
681e4b17023SJohn Marino            IDENTIFIER_NODE
682e4b17023SJohn Marino 
683e4b17023SJohn Marino    visited:
684e4b17023SJohn Marino 
685e4b17023SJohn Marino        TREE_VISITED in
686e4b17023SJohn Marino            all trees (used liberally by many passes)
687e4b17023SJohn Marino 
688e4b17023SJohn Marino    saturating_flag:
689e4b17023SJohn Marino 
690e4b17023SJohn Marino        TYPE_SATURATING in
691e4b17023SJohn Marino            all types
692e4b17023SJohn Marino 
693e4b17023SJohn Marino    nowarning_flag:
694e4b17023SJohn Marino 
695e4b17023SJohn Marino        TREE_NO_WARNING in
696e4b17023SJohn Marino            all expressions
697e4b17023SJohn Marino            all decls
698e4b17023SJohn Marino 
699e4b17023SJohn Marino        TYPE_ARTIFICIAL in
700e4b17023SJohn Marino            all types
701e4b17023SJohn Marino 
702e4b17023SJohn Marino    default_def_flag:
703e4b17023SJohn Marino 
704e4b17023SJohn Marino        TYPE_VECTOR_OPAQUE in
705e4b17023SJohn Marino 	   VECTOR_TYPE
706e4b17023SJohn Marino 
707e4b17023SJohn Marino        SSA_NAME_IS_DEFAULT_DEF in
708e4b17023SJohn Marino            SSA_NAME
709e4b17023SJohn Marino */
710e4b17023SJohn Marino 
711e4b17023SJohn Marino #undef DEFTREESTRUCT
712e4b17023SJohn Marino #define DEFTREESTRUCT(ENUM, NAME) ENUM,
713e4b17023SJohn Marino enum tree_node_structure_enum {
714e4b17023SJohn Marino #include "treestruct.def"
715e4b17023SJohn Marino   LAST_TS_ENUM
716e4b17023SJohn Marino };
717e4b17023SJohn Marino #undef DEFTREESTRUCT
718e4b17023SJohn Marino 
719e4b17023SJohn Marino /* Define accessors for the fields that all tree nodes have
720e4b17023SJohn Marino    (though some fields are not used for all kinds of nodes).  */
721e4b17023SJohn Marino 
722e4b17023SJohn Marino /* The tree-code says what kind of node it is.
723e4b17023SJohn Marino    Codes are defined in tree.def.  */
724e4b17023SJohn Marino #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
725e4b17023SJohn Marino #define TREE_SET_CODE(NODE, VALUE) ((NODE)->base.code = (VALUE))
726e4b17023SJohn Marino 
727e4b17023SJohn Marino /* When checking is enabled, errors will be generated if a tree node
728e4b17023SJohn Marino    is accessed incorrectly. The macros die with a fatal error.  */
729e4b17023SJohn Marino #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
730e4b17023SJohn Marino 
731e4b17023SJohn Marino #define TREE_CHECK(T, CODE) __extension__				\
732e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
733e4b17023SJohn Marino     if (TREE_CODE (__t) != (CODE))					\
734e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 	\
735e4b17023SJohn Marino 			 (CODE), 0);					\
736e4b17023SJohn Marino     __t; })
737e4b17023SJohn Marino 
738e4b17023SJohn Marino #define TREE_NOT_CHECK(T, CODE) __extension__				\
739e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
740e4b17023SJohn Marino     if (TREE_CODE (__t) == (CODE))					\
741e4b17023SJohn Marino       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
742e4b17023SJohn Marino 			     (CODE), 0);				\
743e4b17023SJohn Marino     __t; })
744e4b17023SJohn Marino 
745e4b17023SJohn Marino #define TREE_CHECK2(T, CODE1, CODE2) __extension__			\
746e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
747e4b17023SJohn Marino     if (TREE_CODE (__t) != (CODE1)					\
748e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE2))					\
749e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,		\
750e4b17023SJohn Marino  			 (CODE1), (CODE2), 0);				\
751e4b17023SJohn Marino     __t; })
752e4b17023SJohn Marino 
753e4b17023SJohn Marino #define TREE_NOT_CHECK2(T, CODE1, CODE2) __extension__			\
754e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
755e4b17023SJohn Marino     if (TREE_CODE (__t) == (CODE1)					\
756e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE2))					\
757e4b17023SJohn Marino       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
758e4b17023SJohn Marino 			     (CODE1), (CODE2), 0);			\
759e4b17023SJohn Marino     __t; })
760e4b17023SJohn Marino 
761e4b17023SJohn Marino #define TREE_CHECK3(T, CODE1, CODE2, CODE3) __extension__		\
762e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
763e4b17023SJohn Marino     if (TREE_CODE (__t) != (CODE1)					\
764e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE2)					\
765e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE3))					\
766e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,		\
767e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), 0);		\
768e4b17023SJohn Marino     __t; })
769e4b17023SJohn Marino 
770e4b17023SJohn Marino #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) __extension__		\
771e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
772e4b17023SJohn Marino     if (TREE_CODE (__t) == (CODE1)					\
773e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE2)					\
774e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE3))					\
775e4b17023SJohn Marino       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
776e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), 0);		\
777e4b17023SJohn Marino     __t; })
778e4b17023SJohn Marino 
779e4b17023SJohn Marino #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__	\
780e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
781e4b17023SJohn Marino     if (TREE_CODE (__t) != (CODE1)					\
782e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE2)					\
783e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE3)					\
784e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE4))					\
785e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,		\
786e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), (CODE4), 0);	\
787e4b17023SJohn Marino     __t; })
788e4b17023SJohn Marino 
789e4b17023SJohn Marino #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__	\
790e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
791e4b17023SJohn Marino     if (TREE_CODE (__t) == (CODE1)					\
792e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE2)					\
793e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE3)					\
794e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE4))					\
795e4b17023SJohn Marino       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
796e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), (CODE4), 0);	\
797e4b17023SJohn Marino     __t; })
798e4b17023SJohn Marino 
799e4b17023SJohn Marino #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__	\
800e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
801e4b17023SJohn Marino     if (TREE_CODE (__t) != (CODE1)					\
802e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE2)					\
803e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE3)					\
804e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE4)					\
805e4b17023SJohn Marino 	&& TREE_CODE (__t) != (CODE5))					\
806e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,		\
807e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
808e4b17023SJohn Marino     __t; })
809e4b17023SJohn Marino 
810e4b17023SJohn Marino #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__ \
811e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
812e4b17023SJohn Marino     if (TREE_CODE (__t) == (CODE1)					\
813e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE2)					\
814e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE3)					\
815e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE4)					\
816e4b17023SJohn Marino 	|| TREE_CODE (__t) == (CODE5))					\
817e4b17023SJohn Marino       tree_not_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
818e4b17023SJohn Marino 			     (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\
819e4b17023SJohn Marino     __t; })
820e4b17023SJohn Marino 
821e4b17023SJohn Marino #define CONTAINS_STRUCT_CHECK(T, STRUCT) __extension__			\
822e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
823e4b17023SJohn Marino   if (tree_contains_struct[TREE_CODE(__t)][(STRUCT)] != 1)		\
824e4b17023SJohn Marino       tree_contains_struct_check_failed (__t, (STRUCT), __FILE__, __LINE__,	\
825e4b17023SJohn Marino 			       __FUNCTION__);				\
826e4b17023SJohn Marino     __t; })
827e4b17023SJohn Marino 
828e4b17023SJohn Marino #define TREE_CLASS_CHECK(T, CLASS) __extension__			\
829e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
830e4b17023SJohn Marino     if (TREE_CODE_CLASS (TREE_CODE(__t)) != (CLASS))			\
831e4b17023SJohn Marino       tree_class_check_failed (__t, (CLASS), __FILE__, __LINE__,	\
832e4b17023SJohn Marino 			       __FUNCTION__);				\
833e4b17023SJohn Marino     __t; })
834e4b17023SJohn Marino 
835e4b17023SJohn Marino #define TREE_RANGE_CHECK(T, CODE1, CODE2) __extension__			\
836e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
837e4b17023SJohn Marino     if (TREE_CODE (__t) < (CODE1) || TREE_CODE (__t) > (CODE2))		\
838e4b17023SJohn Marino       tree_range_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,	\
839e4b17023SJohn Marino 			       (CODE1), (CODE2));			\
840e4b17023SJohn Marino     __t; })
841e4b17023SJohn Marino 
842e4b17023SJohn Marino #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) __extension__			\
843e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
844e4b17023SJohn Marino     if (TREE_CODE (__t) != OMP_CLAUSE)					\
845e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,  	\
846e4b17023SJohn Marino 			 OMP_CLAUSE, 0);				\
847e4b17023SJohn Marino     if (__t->omp_clause.code != (CODE))					\
848e4b17023SJohn Marino       omp_clause_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 	\
849e4b17023SJohn Marino 			       (CODE));					\
850e4b17023SJohn Marino     __t; })
851e4b17023SJohn Marino 
852e4b17023SJohn Marino #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) __extension__		\
853e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
854e4b17023SJohn Marino     if (TREE_CODE (__t) != OMP_CLAUSE)					\
855e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,  	\
856e4b17023SJohn Marino 			 OMP_CLAUSE, 0);				\
857e4b17023SJohn Marino     if ((int) __t->omp_clause.code < (int) (CODE1)			\
858e4b17023SJohn Marino         || (int) __t->omp_clause.code > (int) (CODE2))			\
859e4b17023SJohn Marino       omp_clause_range_check_failed (__t, __FILE__, __LINE__,		\
860e4b17023SJohn Marino 				     __FUNCTION__, (CODE1), (CODE2));	\
861e4b17023SJohn Marino     __t; })
862e4b17023SJohn Marino 
863e4b17023SJohn Marino /* These checks have to be special cased.  */
864e4b17023SJohn Marino #define EXPR_CHECK(T) __extension__					\
865e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
866e4b17023SJohn Marino     char const __c = TREE_CODE_CLASS (TREE_CODE (__t));			\
867e4b17023SJohn Marino     if (!IS_EXPR_CODE_CLASS (__c))					\
868e4b17023SJohn Marino       tree_class_check_failed (__t, tcc_expression, __FILE__, __LINE__,	\
869e4b17023SJohn Marino 			       __FUNCTION__);				\
870e4b17023SJohn Marino     __t; })
871e4b17023SJohn Marino 
872e4b17023SJohn Marino /* These checks have to be special cased.  */
873e4b17023SJohn Marino #define NON_TYPE_CHECK(T) __extension__					\
874e4b17023SJohn Marino ({  __typeof (T) const __t = (T);					\
875e4b17023SJohn Marino     if (TYPE_P (__t))							\
876e4b17023SJohn Marino       tree_not_class_check_failed (__t, tcc_type, __FILE__, __LINE__,	\
877e4b17023SJohn Marino 				   __FUNCTION__);			\
878e4b17023SJohn Marino     __t; })
879e4b17023SJohn Marino 
880e4b17023SJohn Marino #define TREE_VEC_ELT_CHECK(T, I) __extension__				\
881e4b17023SJohn Marino (*({__typeof (T) const __t = (T);					\
882e4b17023SJohn Marino     const int __i = (I);						\
883e4b17023SJohn Marino     if (TREE_CODE (__t) != TREE_VEC)					\
884e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,		\
885e4b17023SJohn Marino   			 TREE_VEC, 0);					\
886e4b17023SJohn Marino     if (__i < 0 || __i >= __t->vec.length)				\
887e4b17023SJohn Marino       tree_vec_elt_check_failed (__i, __t->vec.length,			\
888e4b17023SJohn Marino 				 __FILE__, __LINE__, __FUNCTION__);	\
889e4b17023SJohn Marino     &__t->vec.a[__i]; }))
890e4b17023SJohn Marino 
891e4b17023SJohn Marino #define OMP_CLAUSE_ELT_CHECK(T, I) __extension__			\
892e4b17023SJohn Marino (*({__typeof (T) const __t = (T);					\
893e4b17023SJohn Marino     const int __i = (I);						\
894e4b17023SJohn Marino     if (TREE_CODE (__t) != OMP_CLAUSE)					\
895e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__,  	\
896e4b17023SJohn Marino 			 OMP_CLAUSE, 0);				\
897e4b17023SJohn Marino     if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])	\
898e4b17023SJohn Marino       omp_clause_operand_check_failed (__i, __t, __FILE__, __LINE__,	\
899e4b17023SJohn Marino 	                               __FUNCTION__);			\
900e4b17023SJohn Marino     &__t->omp_clause.ops[__i]; }))
901e4b17023SJohn Marino 
902e4b17023SJohn Marino /* Special checks for TREE_OPERANDs.  */
903e4b17023SJohn Marino #define TREE_OPERAND_CHECK(T, I) __extension__				\
904e4b17023SJohn Marino (*({__typeof (T) const __t = EXPR_CHECK (T);				\
905e4b17023SJohn Marino     const int __i = (I);						\
906e4b17023SJohn Marino     if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))			\
907e4b17023SJohn Marino       tree_operand_check_failed (__i, __t,				\
908e4b17023SJohn Marino 				 __FILE__, __LINE__, __FUNCTION__);	\
909e4b17023SJohn Marino     &__t->exp.operands[__i]; }))
910e4b17023SJohn Marino 
911e4b17023SJohn Marino #define TREE_OPERAND_CHECK_CODE(T, CODE, I) __extension__		\
912e4b17023SJohn Marino (*({__typeof (T) const __t = (T);					\
913e4b17023SJohn Marino     const int __i = (I);						\
914e4b17023SJohn Marino     if (TREE_CODE (__t) != CODE)					\
915e4b17023SJohn Marino       tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, (CODE), 0);\
916e4b17023SJohn Marino     if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))			\
917e4b17023SJohn Marino       tree_operand_check_failed (__i, __t,				\
918e4b17023SJohn Marino 				 __FILE__, __LINE__, __FUNCTION__);	\
919e4b17023SJohn Marino     &__t->exp.operands[__i]; }))
920e4b17023SJohn Marino 
921e4b17023SJohn Marino /* Nodes are chained together for many purposes.
922e4b17023SJohn Marino    Types are chained together to record them for being output to the debugger
923e4b17023SJohn Marino    (see the function `chain_type').
924e4b17023SJohn Marino    Decls in the same scope are chained together to record the contents
925e4b17023SJohn Marino    of the scope.
926e4b17023SJohn Marino    Statement nodes for successive statements used to be chained together.
927e4b17023SJohn Marino    Often lists of things are represented by TREE_LIST nodes that
928e4b17023SJohn Marino    are chained together.  */
929e4b17023SJohn Marino 
930e4b17023SJohn Marino #define TREE_CHAIN(NODE) __extension__ \
931e4b17023SJohn Marino (*({__typeof (NODE) const __t = CONTAINS_STRUCT_CHECK (NODE, TS_COMMON);\
932e4b17023SJohn Marino     &__t->common.chain; }))
933e4b17023SJohn Marino 
934e4b17023SJohn Marino /* In all nodes that are expressions, this is the data type of the expression.
935e4b17023SJohn Marino    In POINTER_TYPE nodes, this is the type that the pointer points to.
936e4b17023SJohn Marino    In ARRAY_TYPE nodes, this is the type of the elements.
937e4b17023SJohn Marino    In VECTOR_TYPE nodes, this is the type of the elements.  */
938e4b17023SJohn Marino #define TREE_TYPE(NODE) __extension__ \
939e4b17023SJohn Marino (*({__typeof (NODE) const __t = CONTAINS_STRUCT_CHECK (NODE, TS_TYPED); \
940e4b17023SJohn Marino     &__t->typed.type; }))
941e4b17023SJohn Marino 
942e4b17023SJohn Marino extern void tree_contains_struct_check_failed (const_tree,
943e4b17023SJohn Marino 					       const enum tree_node_structure_enum,
944e4b17023SJohn Marino 					       const char *, int, const char *)
945e4b17023SJohn Marino   ATTRIBUTE_NORETURN;
946e4b17023SJohn Marino 
947e4b17023SJohn Marino extern void tree_check_failed (const_tree, const char *, int, const char *,
948e4b17023SJohn Marino 			       ...) ATTRIBUTE_NORETURN;
949e4b17023SJohn Marino extern void tree_not_check_failed (const_tree, const char *, int, const char *,
950e4b17023SJohn Marino 				   ...) ATTRIBUTE_NORETURN;
951e4b17023SJohn Marino extern void tree_class_check_failed (const_tree, const enum tree_code_class,
952e4b17023SJohn Marino 				     const char *, int, const char *)
953e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
954e4b17023SJohn Marino extern void tree_range_check_failed (const_tree, const char *, int,
955e4b17023SJohn Marino 				     const char *, enum tree_code,
956e4b17023SJohn Marino 				     enum tree_code)
957e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
958e4b17023SJohn Marino extern void tree_not_class_check_failed (const_tree,
959e4b17023SJohn Marino 					 const enum tree_code_class,
960e4b17023SJohn Marino 					 const char *, int, const char *)
961e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
962e4b17023SJohn Marino extern void tree_vec_elt_check_failed (int, int, const char *,
963e4b17023SJohn Marino 				       int, const char *)
964e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
965e4b17023SJohn Marino extern void phi_node_elt_check_failed (int, int, const char *,
966e4b17023SJohn Marino 				       int, const char *)
967e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
968e4b17023SJohn Marino extern void tree_operand_check_failed (int, const_tree,
969e4b17023SJohn Marino 				       const char *, int, const char *)
970e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
971e4b17023SJohn Marino extern void omp_clause_check_failed (const_tree, const char *, int,
972e4b17023SJohn Marino 				     const char *, enum omp_clause_code)
973e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
974e4b17023SJohn Marino extern void omp_clause_operand_check_failed (int, const_tree, const char *,
975e4b17023SJohn Marino 				             int, const char *)
976e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
977e4b17023SJohn Marino extern void omp_clause_range_check_failed (const_tree, const char *, int,
978e4b17023SJohn Marino 			       const char *, enum omp_clause_code,
979e4b17023SJohn Marino 			       enum omp_clause_code)
980e4b17023SJohn Marino     ATTRIBUTE_NORETURN;
981e4b17023SJohn Marino 
982e4b17023SJohn Marino #else /* not ENABLE_TREE_CHECKING, or not gcc */
983e4b17023SJohn Marino 
984e4b17023SJohn Marino #define CONTAINS_STRUCT_CHECK(T, ENUM)          (T)
985e4b17023SJohn Marino #define TREE_CHECK(T, CODE)			(T)
986e4b17023SJohn Marino #define TREE_NOT_CHECK(T, CODE)			(T)
987e4b17023SJohn Marino #define TREE_CHECK2(T, CODE1, CODE2)		(T)
988e4b17023SJohn Marino #define TREE_NOT_CHECK2(T, CODE1, CODE2)	(T)
989e4b17023SJohn Marino #define TREE_CHECK3(T, CODE1, CODE2, CODE3)	(T)
990e4b17023SJohn Marino #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3)	(T)
991e4b17023SJohn Marino #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
992e4b17023SJohn Marino #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
993e4b17023SJohn Marino #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
994e4b17023SJohn Marino #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
995e4b17023SJohn Marino #define TREE_CLASS_CHECK(T, CODE)		(T)
996e4b17023SJohn Marino #define TREE_RANGE_CHECK(T, CODE1, CODE2)	(T)
997e4b17023SJohn Marino #define EXPR_CHECK(T)				(T)
998e4b17023SJohn Marino #define NON_TYPE_CHECK(T)			(T)
999e4b17023SJohn Marino #define TREE_VEC_ELT_CHECK(T, I)		((T)->vec.a[I])
1000e4b17023SJohn Marino #define TREE_OPERAND_CHECK(T, I)		((T)->exp.operands[I])
1001e4b17023SJohn Marino #define TREE_OPERAND_CHECK_CODE(T, CODE, I)	((T)->exp.operands[I])
1002e4b17023SJohn Marino #define OMP_CLAUSE_ELT_CHECK(T, i)	        ((T)->omp_clause.ops[i])
1003e4b17023SJohn Marino #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2)	(T)
1004e4b17023SJohn Marino #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE)	(T)
1005e4b17023SJohn Marino 
1006e4b17023SJohn Marino #define TREE_CHAIN(NODE) ((NODE)->common.chain)
1007e4b17023SJohn Marino #define TREE_TYPE(NODE) ((NODE)->typed.type)
1008e4b17023SJohn Marino 
1009e4b17023SJohn Marino #endif
1010e4b17023SJohn Marino 
1011e4b17023SJohn Marino #define TREE_BLOCK(NODE)		*(tree_block (NODE))
1012e4b17023SJohn Marino 
1013e4b17023SJohn Marino #include "tree-check.h"
1014e4b17023SJohn Marino 
1015e4b17023SJohn Marino #define TYPE_CHECK(T)		TREE_CLASS_CHECK (T, tcc_type)
1016e4b17023SJohn Marino #define DECL_MINIMAL_CHECK(T)   CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
1017e4b17023SJohn Marino #define DECL_COMMON_CHECK(T)    CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
1018e4b17023SJohn Marino #define DECL_WRTL_CHECK(T)      CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
1019e4b17023SJohn Marino #define DECL_WITH_VIS_CHECK(T)  CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
1020e4b17023SJohn Marino #define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON)
1021e4b17023SJohn Marino #define CST_CHECK(T)		TREE_CLASS_CHECK (T, tcc_constant)
1022e4b17023SJohn Marino #define STMT_CHECK(T)		TREE_CLASS_CHECK (T, tcc_statement)
1023e4b17023SJohn Marino #define VL_EXP_CHECK(T)		TREE_CLASS_CHECK (T, tcc_vl_exp)
1024e4b17023SJohn Marino #define FUNC_OR_METHOD_CHECK(T)	TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
1025e4b17023SJohn Marino #define PTR_OR_REF_CHECK(T)	TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
1026e4b17023SJohn Marino 
1027e4b17023SJohn Marino #define RECORD_OR_UNION_CHECK(T)	\
1028e4b17023SJohn Marino   TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
1029e4b17023SJohn Marino #define NOT_RECORD_OR_UNION_CHECK(T) \
1030e4b17023SJohn Marino   TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
1031e4b17023SJohn Marino 
1032e4b17023SJohn Marino #define NUMERICAL_TYPE_CHECK(T)					\
1033e4b17023SJohn Marino   TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE,	\
1034e4b17023SJohn Marino 	       FIXED_POINT_TYPE)
1035e4b17023SJohn Marino 
1036e4b17023SJohn Marino /* Here is how primitive or already-canonicalized types' hash codes
1037e4b17023SJohn Marino    are made.  */
1038e4b17023SJohn Marino #define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
1039e4b17023SJohn Marino 
1040e4b17023SJohn Marino /* A simple hash function for an arbitrary tree node.  This must not be
1041e4b17023SJohn Marino    used in hash tables which are saved to a PCH.  */
1042e4b17023SJohn Marino #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
1043e4b17023SJohn Marino 
1044e4b17023SJohn Marino /* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR).  */
1045e4b17023SJohn Marino #define CONVERT_EXPR_CODE_P(CODE)				\
1046e4b17023SJohn Marino   ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
1047e4b17023SJohn Marino 
1048e4b17023SJohn Marino /* Similarly, but accept an expressions instead of a tree code.  */
1049e4b17023SJohn Marino #define CONVERT_EXPR_P(EXP)	CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
1050e4b17023SJohn Marino 
1051e4b17023SJohn Marino /* Generate case for NOP_EXPR, CONVERT_EXPR.  */
1052e4b17023SJohn Marino 
1053e4b17023SJohn Marino #define CASE_CONVERT						\
1054e4b17023SJohn Marino   case NOP_EXPR:						\
1055e4b17023SJohn Marino   case CONVERT_EXPR
1056e4b17023SJohn Marino 
1057e4b17023SJohn Marino /* Given an expression as a tree, strip any conversion that generates
1058e4b17023SJohn Marino    no instruction.  Accepts both tree and const_tree arguments since
1059e4b17023SJohn Marino    we are not modifying the tree itself.  */
1060e4b17023SJohn Marino 
1061e4b17023SJohn Marino #define STRIP_NOPS(EXP) \
1062e4b17023SJohn Marino   (EXP) = tree_strip_nop_conversions (CONST_CAST_TREE (EXP))
1063e4b17023SJohn Marino 
1064e4b17023SJohn Marino /* Like STRIP_NOPS, but don't let the signedness change either.  */
1065e4b17023SJohn Marino 
1066e4b17023SJohn Marino #define STRIP_SIGN_NOPS(EXP) \
1067e4b17023SJohn Marino   (EXP) = tree_strip_sign_nop_conversions (CONST_CAST_TREE (EXP))
1068e4b17023SJohn Marino 
1069e4b17023SJohn Marino /* Like STRIP_NOPS, but don't alter the TREE_TYPE either.  */
1070e4b17023SJohn Marino 
1071e4b17023SJohn Marino #define STRIP_TYPE_NOPS(EXP) \
1072e4b17023SJohn Marino   while ((CONVERT_EXPR_P (EXP)					\
1073e4b17023SJohn Marino 	  || TREE_CODE (EXP) == NON_LVALUE_EXPR)		\
1074e4b17023SJohn Marino 	 && TREE_OPERAND (EXP, 0) != error_mark_node		\
1075e4b17023SJohn Marino 	 && (TREE_TYPE (EXP)					\
1076e4b17023SJohn Marino 	     == TREE_TYPE (TREE_OPERAND (EXP, 0))))		\
1077e4b17023SJohn Marino     (EXP) = TREE_OPERAND (EXP, 0)
1078e4b17023SJohn Marino 
1079e4b17023SJohn Marino /* Remove unnecessary type conversions according to
1080e4b17023SJohn Marino    tree_ssa_useless_type_conversion.  */
1081e4b17023SJohn Marino 
1082e4b17023SJohn Marino #define STRIP_USELESS_TYPE_CONVERSION(EXP) \
1083e4b17023SJohn Marino   (EXP) = tree_ssa_strip_useless_type_conversions (EXP)
1084e4b17023SJohn Marino 
1085e4b17023SJohn Marino /* Nonzero if TYPE represents an integral type.  Note that we do not
1086e4b17023SJohn Marino    include COMPLEX types here.  Keep these checks in ascending code
1087e4b17023SJohn Marino    order.  */
1088e4b17023SJohn Marino 
1089e4b17023SJohn Marino #define INTEGRAL_TYPE_P(TYPE)  \
1090e4b17023SJohn Marino   (TREE_CODE (TYPE) == ENUMERAL_TYPE  \
1091e4b17023SJohn Marino    || TREE_CODE (TYPE) == BOOLEAN_TYPE \
1092e4b17023SJohn Marino    || TREE_CODE (TYPE) == INTEGER_TYPE)
1093e4b17023SJohn Marino 
1094e4b17023SJohn Marino /* Nonzero if TYPE represents a non-saturating fixed-point type.  */
1095e4b17023SJohn Marino 
1096e4b17023SJohn Marino #define NON_SAT_FIXED_POINT_TYPE_P(TYPE) \
1097e4b17023SJohn Marino   (TREE_CODE (TYPE) == FIXED_POINT_TYPE && !TYPE_SATURATING (TYPE))
1098e4b17023SJohn Marino 
1099e4b17023SJohn Marino /* Nonzero if TYPE represents a saturating fixed-point type.  */
1100e4b17023SJohn Marino 
1101e4b17023SJohn Marino #define SAT_FIXED_POINT_TYPE_P(TYPE) \
1102e4b17023SJohn Marino   (TREE_CODE (TYPE) == FIXED_POINT_TYPE && TYPE_SATURATING (TYPE))
1103e4b17023SJohn Marino 
1104e4b17023SJohn Marino /* Nonzero if TYPE represents a fixed-point type.  */
1105e4b17023SJohn Marino 
1106e4b17023SJohn Marino #define FIXED_POINT_TYPE_P(TYPE)	(TREE_CODE (TYPE) == FIXED_POINT_TYPE)
1107e4b17023SJohn Marino 
1108e4b17023SJohn Marino /* Nonzero if TYPE represents a scalar floating-point type.  */
1109e4b17023SJohn Marino 
1110e4b17023SJohn Marino #define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
1111e4b17023SJohn Marino 
1112e4b17023SJohn Marino /* Nonzero if TYPE represents a complex floating-point type.  */
1113e4b17023SJohn Marino 
1114e4b17023SJohn Marino #define COMPLEX_FLOAT_TYPE_P(TYPE)	\
1115e4b17023SJohn Marino   (TREE_CODE (TYPE) == COMPLEX_TYPE	\
1116e4b17023SJohn Marino    && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
1117e4b17023SJohn Marino 
1118e4b17023SJohn Marino /* Nonzero if TYPE represents a vector integer type.  */
1119e4b17023SJohn Marino 
1120e4b17023SJohn Marino #define VECTOR_INTEGER_TYPE_P(TYPE)                   \
1121e4b17023SJohn Marino              (TREE_CODE (TYPE) == VECTOR_TYPE      \
1122e4b17023SJohn Marino                  && TREE_CODE (TREE_TYPE (TYPE)) == INTEGER_TYPE)
1123e4b17023SJohn Marino 
1124e4b17023SJohn Marino 
1125e4b17023SJohn Marino /* Nonzero if TYPE represents a vector floating-point type.  */
1126e4b17023SJohn Marino 
1127e4b17023SJohn Marino #define VECTOR_FLOAT_TYPE_P(TYPE)	\
1128e4b17023SJohn Marino   (TREE_CODE (TYPE) == VECTOR_TYPE	\
1129e4b17023SJohn Marino    && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
1130e4b17023SJohn Marino 
1131e4b17023SJohn Marino /* Nonzero if TYPE represents a floating-point type, including complex
1132e4b17023SJohn Marino    and vector floating-point types.  The vector and complex check does
1133e4b17023SJohn Marino    not use the previous two macros to enable early folding.  */
1134e4b17023SJohn Marino 
1135e4b17023SJohn Marino #define FLOAT_TYPE_P(TYPE)			\
1136e4b17023SJohn Marino   (SCALAR_FLOAT_TYPE_P (TYPE)			\
1137e4b17023SJohn Marino    || ((TREE_CODE (TYPE) == COMPLEX_TYPE 	\
1138e4b17023SJohn Marino         || TREE_CODE (TYPE) == VECTOR_TYPE)	\
1139e4b17023SJohn Marino        && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE))))
1140e4b17023SJohn Marino 
1141e4b17023SJohn Marino /* Nonzero if TYPE represents a decimal floating-point type.  */
1142e4b17023SJohn Marino #define DECIMAL_FLOAT_TYPE_P(TYPE)		\
1143e4b17023SJohn Marino   (SCALAR_FLOAT_TYPE_P (TYPE)			\
1144e4b17023SJohn Marino    && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TYPE)))
1145e4b17023SJohn Marino 
1146e4b17023SJohn Marino /* Nonzero if TYPE is a record or union type.  */
1147e4b17023SJohn Marino #define RECORD_OR_UNION_TYPE_P(TYPE)		\
1148e4b17023SJohn Marino   (TREE_CODE (TYPE) == RECORD_TYPE		\
1149e4b17023SJohn Marino    || TREE_CODE (TYPE) == UNION_TYPE		\
1150e4b17023SJohn Marino    || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
1151e4b17023SJohn Marino 
1152e4b17023SJohn Marino /* Nonzero if TYPE represents an aggregate (multi-component) type.
1153e4b17023SJohn Marino    Keep these checks in ascending code order.  */
1154e4b17023SJohn Marino 
1155e4b17023SJohn Marino #define AGGREGATE_TYPE_P(TYPE) \
1156e4b17023SJohn Marino   (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
1157e4b17023SJohn Marino 
1158e4b17023SJohn Marino /* Nonzero if TYPE represents a pointer or reference type.
1159e4b17023SJohn Marino    (It should be renamed to INDIRECT_TYPE_P.)  Keep these checks in
1160e4b17023SJohn Marino    ascending code order.  */
1161e4b17023SJohn Marino 
1162e4b17023SJohn Marino #define POINTER_TYPE_P(TYPE) \
1163e4b17023SJohn Marino   (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
1164e4b17023SJohn Marino 
1165e4b17023SJohn Marino /* Nonzero if this type is a complete type.  */
1166e4b17023SJohn Marino #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
1167e4b17023SJohn Marino 
1168e4b17023SJohn Marino /* Nonzero if this type is the (possibly qualified) void type.  */
1169e4b17023SJohn Marino #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
1170e4b17023SJohn Marino 
1171e4b17023SJohn Marino /* Nonzero if this type is complete or is cv void.  */
1172e4b17023SJohn Marino #define COMPLETE_OR_VOID_TYPE_P(NODE) \
1173e4b17023SJohn Marino   (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE))
1174e4b17023SJohn Marino 
1175e4b17023SJohn Marino /* Nonzero if this type is complete or is an array with unspecified bound.  */
1176e4b17023SJohn Marino #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \
1177e4b17023SJohn Marino   (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : (NODE)))
1178e4b17023SJohn Marino 
1179e4b17023SJohn Marino 
1180e4b17023SJohn Marino /* Define many boolean fields that all tree nodes have.  */
1181e4b17023SJohn Marino 
1182e4b17023SJohn Marino /* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address
1183e4b17023SJohn Marino    of this is needed.  So it cannot be in a register.
1184e4b17023SJohn Marino    In a FUNCTION_DECL it has no meaning.
1185e4b17023SJohn Marino    In LABEL_DECL nodes, it means a goto for this label has been seen
1186e4b17023SJohn Marino    from a place outside all binding contours that restore stack levels.
1187*5ce9237cSJohn Marino    In an artificial SSA_NAME that points to a stack partition with at least
1188*5ce9237cSJohn Marino    two variables, it means that at least one variable has TREE_ADDRESSABLE.
1189e4b17023SJohn Marino    In ..._TYPE nodes, it means that objects of this type must be fully
1190e4b17023SJohn Marino    addressable.  This means that pieces of this object cannot go into
1191e4b17023SJohn Marino    register parameters, for example.  If this a function type, this
1192e4b17023SJohn Marino    means that the value must be returned in memory.
1193*5ce9237cSJohn Marino    In CONSTRUCTOR nodes, it means object constructed must be in memory.
1194e4b17023SJohn Marino    In IDENTIFIER_NODEs, this means that some extern decl for this name
1195*5ce9237cSJohn Marino    had its address taken.  That matters for inline functions.
1196*5ce9237cSJohn Marino    In a STMT_EXPR, it means we want the result of the enclosed expression.  */
1197e4b17023SJohn Marino #define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
1198e4b17023SJohn Marino 
1199e4b17023SJohn Marino /* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
1200e4b17023SJohn Marino    exit of a function.  Calls for which this is true are candidates for tail
1201e4b17023SJohn Marino    call optimizations.  */
1202e4b17023SJohn Marino #define CALL_EXPR_TAILCALL(NODE) \
1203e4b17023SJohn Marino   (CALL_EXPR_CHECK(NODE)->base.addressable_flag)
1204e4b17023SJohn Marino 
1205e4b17023SJohn Marino /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
1206e4b17023SJohn Marino    CASE_LOW operand has been processed.  */
1207e4b17023SJohn Marino #define CASE_LOW_SEEN(NODE) \
1208e4b17023SJohn Marino   (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag)
1209e4b17023SJohn Marino 
1210e4b17023SJohn Marino #define PREDICT_EXPR_OUTCOME(NODE) \
1211e4b17023SJohn Marino   ((enum prediction) (PREDICT_EXPR_CHECK(NODE)->base.addressable_flag))
1212e4b17023SJohn Marino #define SET_PREDICT_EXPR_OUTCOME(NODE, OUTCOME) \
1213e4b17023SJohn Marino   (PREDICT_EXPR_CHECK(NODE)->base.addressable_flag = (int) OUTCOME)
1214e4b17023SJohn Marino #define PREDICT_EXPR_PREDICTOR(NODE) \
1215e4b17023SJohn Marino   ((enum br_predictor)tree_low_cst (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0), 0))
1216e4b17023SJohn Marino 
1217e4b17023SJohn Marino /* In a VAR_DECL, nonzero means allocate static storage.
1218e4b17023SJohn Marino    In a FUNCTION_DECL, nonzero if function has been defined.
1219e4b17023SJohn Marino    In a CONSTRUCTOR, nonzero means allocate static storage.  */
1220e4b17023SJohn Marino #define TREE_STATIC(NODE) ((NODE)->base.static_flag)
1221e4b17023SJohn Marino 
1222e4b17023SJohn Marino /* In an ADDR_EXPR, nonzero means do not use a trampoline.  */
1223e4b17023SJohn Marino #define TREE_NO_TRAMPOLINE(NODE) (ADDR_EXPR_CHECK (NODE)->base.static_flag)
1224e4b17023SJohn Marino 
1225e4b17023SJohn Marino /* In a TARGET_EXPR or WITH_CLEANUP_EXPR, means that the pertinent cleanup
1226e4b17023SJohn Marino    should only be executed if an exception is thrown, not on normal exit
1227e4b17023SJohn Marino    of its scope.  */
1228e4b17023SJohn Marino #define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
1229e4b17023SJohn Marino 
1230e4b17023SJohn Marino /* In a TRY_CATCH_EXPR, means that the handler should be considered a
1231e4b17023SJohn Marino    separate cleanup in honor_protect_cleanup_actions.  */
1232e4b17023SJohn Marino #define TRY_CATCH_IS_CLEANUP(NODE) \
1233e4b17023SJohn Marino   (TRY_CATCH_EXPR_CHECK (NODE)->base.static_flag)
1234e4b17023SJohn Marino 
1235e4b17023SJohn Marino /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
1236e4b17023SJohn Marino    CASE_HIGH operand has been processed.  */
1237e4b17023SJohn Marino #define CASE_HIGH_SEEN(NODE) \
1238e4b17023SJohn Marino   (CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
1239e4b17023SJohn Marino 
1240e4b17023SJohn Marino /* Used to mark scoped enums.  */
1241e4b17023SJohn Marino #define ENUM_IS_SCOPED(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.static_flag)
1242e4b17023SJohn Marino 
1243e4b17023SJohn Marino /* Determines whether an ENUMERAL_TYPE has defined the list of constants. */
1244e4b17023SJohn Marino #define ENUM_IS_OPAQUE(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.private_flag)
1245e4b17023SJohn Marino 
1246e4b17023SJohn Marino /* In an expr node (usually a conversion) this means the node was made
1247e4b17023SJohn Marino    implicitly and should not lead to any sort of warning.  In a decl node,
1248e4b17023SJohn Marino    warnings concerning the decl should be suppressed.  This is used at
1249e4b17023SJohn Marino    least for used-before-set warnings, and it set after one warning is
1250e4b17023SJohn Marino    emitted.  */
1251e4b17023SJohn Marino #define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
1252e4b17023SJohn Marino 
1253e4b17023SJohn Marino /* Used to indicate that this TYPE represents a compiler-generated entity.  */
1254e4b17023SJohn Marino #define TYPE_ARTIFICIAL(NODE) (TYPE_CHECK (NODE)->base.nowarning_flag)
1255e4b17023SJohn Marino 
1256e4b17023SJohn Marino /* In an IDENTIFIER_NODE, this means that assemble_name was called with
1257e4b17023SJohn Marino    this string as an argument.  */
1258e4b17023SJohn Marino #define TREE_SYMBOL_REFERENCED(NODE) \
1259e4b17023SJohn Marino   (IDENTIFIER_NODE_CHECK (NODE)->base.static_flag)
1260e4b17023SJohn Marino 
1261e4b17023SJohn Marino /* Nonzero in a pointer or reference type means the data pointed to
1262e4b17023SJohn Marino    by this type can alias anything.  */
1263e4b17023SJohn Marino #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
1264e4b17023SJohn Marino   (PTR_OR_REF_CHECK (NODE)->base.static_flag)
1265e4b17023SJohn Marino 
1266e4b17023SJohn Marino /* In a MODIFY_EXPR, means that the store in the expression is nontemporal.  */
1267e4b17023SJohn Marino #define MOVE_NONTEMPORAL(NODE) \
1268e4b17023SJohn Marino   (EXPR_CHECK (NODE)->base.static_flag)
1269e4b17023SJohn Marino 
1270e4b17023SJohn Marino /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
1271e4b17023SJohn Marino    there was an overflow in folding.  */
1272e4b17023SJohn Marino 
1273e4b17023SJohn Marino #define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)
1274e4b17023SJohn Marino 
1275e4b17023SJohn Marino /* TREE_OVERFLOW can only be true for EXPR of CONSTANT_CLASS_P.  */
1276e4b17023SJohn Marino 
1277e4b17023SJohn Marino #define TREE_OVERFLOW_P(EXPR) \
1278e4b17023SJohn Marino  (CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
1279e4b17023SJohn Marino 
1280e4b17023SJohn Marino /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
1281e4b17023SJohn Marino    nonzero means name is to be accessible from outside this translation unit.
1282e4b17023SJohn Marino    In an IDENTIFIER_NODE, nonzero means an external declaration
1283e4b17023SJohn Marino    accessible from outside this translation unit was previously seen
1284e4b17023SJohn Marino    for this name in an inner scope.  */
1285e4b17023SJohn Marino #define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
1286e4b17023SJohn Marino 
1287e4b17023SJohn Marino /* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
1288e4b17023SJohn Marino    of cached values, or is something else.  */
1289e4b17023SJohn Marino #define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->base.public_flag)
1290e4b17023SJohn Marino 
1291e4b17023SJohn Marino /* In a SAVE_EXPR, indicates that the original expression has already
1292e4b17023SJohn Marino    been substituted with a VAR_DECL that contains the value.  */
1293e4b17023SJohn Marino #define SAVE_EXPR_RESOLVED_P(NODE) \
1294e4b17023SJohn Marino   (SAVE_EXPR_CHECK (NODE)->base.public_flag)
1295e4b17023SJohn Marino 
1296e4b17023SJohn Marino /* Set on a CALL_EXPR if this stdarg call should be passed the argument
1297e4b17023SJohn Marino    pack.  */
1298e4b17023SJohn Marino #define CALL_EXPR_VA_ARG_PACK(NODE) \
1299e4b17023SJohn Marino   (CALL_EXPR_CHECK(NODE)->base.public_flag)
1300e4b17023SJohn Marino 
1301e4b17023SJohn Marino /* In any expression, decl, or constant, nonzero means it has side effects or
1302e4b17023SJohn Marino    reevaluation of the whole expression could produce a different value.
1303e4b17023SJohn Marino    This is set if any subexpression is a function call, a side effect or a
1304e4b17023SJohn Marino    reference to a volatile variable.  In a ..._DECL, this is set only if the
1305e4b17023SJohn Marino    declaration said `volatile'.  This will never be set for a constant.  */
1306e4b17023SJohn Marino #define TREE_SIDE_EFFECTS(NODE) \
1307e4b17023SJohn Marino   (NON_TYPE_CHECK (NODE)->base.side_effects_flag)
1308e4b17023SJohn Marino 
1309e4b17023SJohn Marino /* In a LABEL_DECL, nonzero means this label had its address taken
1310e4b17023SJohn Marino    and therefore can never be deleted and is a jump target for
1311e4b17023SJohn Marino    computed gotos.  */
1312e4b17023SJohn Marino #define FORCED_LABEL(NODE) (LABEL_DECL_CHECK (NODE)->base.side_effects_flag)
1313e4b17023SJohn Marino 
1314e4b17023SJohn Marino /* Nonzero means this expression is volatile in the C sense:
1315e4b17023SJohn Marino    its address should be of type `volatile WHATEVER *'.
1316e4b17023SJohn Marino    In other words, the declared item is volatile qualified.
1317e4b17023SJohn Marino    This is used in _DECL nodes and _REF nodes.
1318e4b17023SJohn Marino    On a FUNCTION_DECL node, this means the function does not
1319e4b17023SJohn Marino    return normally.  This is the same effect as setting
1320e4b17023SJohn Marino    the attribute noreturn on the function in C.
1321e4b17023SJohn Marino 
1322e4b17023SJohn Marino    In a ..._TYPE node, means this type is volatile-qualified.
1323e4b17023SJohn Marino    But use TYPE_VOLATILE instead of this macro when the node is a type,
1324e4b17023SJohn Marino    because eventually we may make that a different bit.
1325e4b17023SJohn Marino 
1326e4b17023SJohn Marino    If this bit is set in an expression, so is TREE_SIDE_EFFECTS.  */
1327e4b17023SJohn Marino #define TREE_THIS_VOLATILE(NODE) ((NODE)->base.volatile_flag)
1328e4b17023SJohn Marino 
1329e4b17023SJohn Marino /* Nonzero means this node will not trap.  In an INDIRECT_REF, means
1330e4b17023SJohn Marino    accessing the memory pointed to won't generate a trap.  However,
1331e4b17023SJohn Marino    this only applies to an object when used appropriately: it doesn't
1332e4b17023SJohn Marino    mean that writing a READONLY mem won't trap.
1333e4b17023SJohn Marino 
1334e4b17023SJohn Marino    In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
1335e4b17023SJohn Marino    (or slice of the array) always belongs to the range of the array.
1336e4b17023SJohn Marino    I.e. that the access will not trap, provided that the access to
1337e4b17023SJohn Marino    the base to the array will not trap.  */
1338e4b17023SJohn Marino #define TREE_THIS_NOTRAP(NODE) \
1339e4b17023SJohn Marino   (TREE_CHECK5 (NODE, INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF,	\
1340e4b17023SJohn Marino 		ARRAY_RANGE_REF)->base.nothrow_flag)
1341e4b17023SJohn Marino 
1342e4b17023SJohn Marino /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
1343e4b17023SJohn Marino    nonzero means it may not be the lhs of an assignment.
1344e4b17023SJohn Marino    Nonzero in a FUNCTION_DECL means this function should be treated
1345e4b17023SJohn Marino    as "const" function (can only read its arguments).  */
1346e4b17023SJohn Marino #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
1347e4b17023SJohn Marino 
1348e4b17023SJohn Marino /* Value of expression is constant.  Always on in all ..._CST nodes.  May
1349e4b17023SJohn Marino    also appear in an expression or decl where the value is constant.  */
1350e4b17023SJohn Marino #define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->base.constant_flag)
1351e4b17023SJohn Marino 
1352e4b17023SJohn Marino /* Nonzero if NODE, a type, has had its sizes gimplified.  */
1353e4b17023SJohn Marino #define TYPE_SIZES_GIMPLIFIED(NODE) \
1354e4b17023SJohn Marino   (TYPE_CHECK (NODE)->base.constant_flag)
1355e4b17023SJohn Marino 
1356e4b17023SJohn Marino /* In a decl (most significantly a FIELD_DECL), means an unsigned field.  */
1357e4b17023SJohn Marino #define DECL_UNSIGNED(NODE) \
1358e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->base.unsigned_flag)
1359e4b17023SJohn Marino 
1360e4b17023SJohn Marino /* In integral and pointer types, means an unsigned type.  */
1361e4b17023SJohn Marino #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.unsigned_flag)
1362e4b17023SJohn Marino 
1363e4b17023SJohn Marino /* Nonzero in a VAR_DECL or STRING_CST means assembler code has been written.
1364e4b17023SJohn Marino    Nonzero in a FUNCTION_DECL means that the function has been compiled.
1365e4b17023SJohn Marino    This is interesting in an inline function, since it might not need
1366e4b17023SJohn Marino    to be compiled separately.
1367e4b17023SJohn Marino    Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ENUMERAL_TYPE
1368e4b17023SJohn Marino    or TYPE_DECL if the debugging info for the type has been written.
1369e4b17023SJohn Marino    In a BLOCK node, nonzero if reorder_blocks has already seen this block.
1370e4b17023SJohn Marino    In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
1371e4b17023SJohn Marino    PHI node.  */
1372e4b17023SJohn Marino #define TREE_ASM_WRITTEN(NODE) ((NODE)->base.asm_written_flag)
1373e4b17023SJohn Marino 
1374e4b17023SJohn Marino /* Nonzero in a _DECL if the name is used in its scope.
1375e4b17023SJohn Marino    Nonzero in an expr node means inhibit warning if value is unused.
1376e4b17023SJohn Marino    In IDENTIFIER_NODEs, this means that some extern decl for this name
1377e4b17023SJohn Marino    was used.
1378e4b17023SJohn Marino    In a BLOCK, this means that the block contains variables that are used.  */
1379e4b17023SJohn Marino #define TREE_USED(NODE) ((NODE)->base.used_flag)
1380e4b17023SJohn Marino 
1381e4b17023SJohn Marino /* In a FUNCTION_DECL, nonzero means a call to the function cannot
1382e4b17023SJohn Marino    throw an exception.  In a CALL_EXPR, nonzero means the call cannot
1383e4b17023SJohn Marino    throw.  We can't easily check the node type here as the C++
1384e4b17023SJohn Marino    frontend also uses this flag (for AGGR_INIT_EXPR).  */
1385e4b17023SJohn Marino #define TREE_NOTHROW(NODE) ((NODE)->base.nothrow_flag)
1386e4b17023SJohn Marino 
1387e4b17023SJohn Marino /* In a CALL_EXPR, means that it's safe to use the target of the call
1388e4b17023SJohn Marino    expansion as the return slot for a call that returns in memory.  */
1389e4b17023SJohn Marino #define CALL_EXPR_RETURN_SLOT_OPT(NODE) \
1390e4b17023SJohn Marino   (CALL_EXPR_CHECK (NODE)->base.private_flag)
1391e4b17023SJohn Marino 
1392e4b17023SJohn Marino /* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that it is
1393e4b17023SJohn Marino    passed by invisible reference (and the TREE_TYPE is a pointer to the true
1394e4b17023SJohn Marino    type).  */
1395e4b17023SJohn Marino #define DECL_BY_REFERENCE(NODE) \
1396e4b17023SJohn Marino   (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
1397e4b17023SJohn Marino 		RESULT_DECL)->decl_common.decl_by_reference_flag)
1398e4b17023SJohn Marino 
1399e4b17023SJohn Marino /* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that this decl
1400e4b17023SJohn Marino    can be used as restricted tag to disambiguate against other restrict
1401e4b17023SJohn Marino    pointers.  Used by fortran to capture something like non-addressability
1402e4b17023SJohn Marino    (which it isn't really because the middle-end does take addresses of
1403e4b17023SJohn Marino    such variables).  */
1404e4b17023SJohn Marino #define DECL_RESTRICTED_P(NODE) \
1405e4b17023SJohn Marino   (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
1406e4b17023SJohn Marino 		RESULT_DECL)->decl_common.decl_restricted_flag)
1407e4b17023SJohn Marino 
1408e4b17023SJohn Marino #define DECL_READ_P(NODE) \
1409e4b17023SJohn Marino   (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_read_flag)
1410e4b17023SJohn Marino 
1411e4b17023SJohn Marino #define DECL_NONSHAREABLE(NODE) \
1412e4b17023SJohn Marino   (TREE_CHECK2 (NODE, VAR_DECL, \
1413e4b17023SJohn Marino 		RESULT_DECL)->decl_common.decl_nonshareable_flag)
1414e4b17023SJohn Marino 
1415e4b17023SJohn Marino /* In a CALL_EXPR, means that the call is the jump from a thunk to the
1416e4b17023SJohn Marino    thunked-to function.  */
1417e4b17023SJohn Marino #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->base.protected_flag)
1418e4b17023SJohn Marino 
1419e4b17023SJohn Marino /* In a CALL_EXPR, if the function being called is BUILT_IN_ALLOCA, means that
1420e4b17023SJohn Marino    it has been built for the declaration of a variable-sized object.  */
1421e4b17023SJohn Marino #define CALL_ALLOCA_FOR_VAR_P(NODE) \
1422e4b17023SJohn Marino   (CALL_EXPR_CHECK (NODE)->base.protected_flag)
1423e4b17023SJohn Marino 
1424e4b17023SJohn Marino /* In a type, nonzero means that all objects of the type are guaranteed by the
1425e4b17023SJohn Marino    language or front-end to be properly aligned, so we can indicate that a MEM
1426e4b17023SJohn Marino    of this type is aligned at least to the alignment of the type, even if it
1427e4b17023SJohn Marino    doesn't appear that it is.  We see this, for example, in object-oriented
1428e4b17023SJohn Marino    languages where a tag field may show this is an object of a more-aligned
1429e4b17023SJohn Marino    variant of the more generic type.
1430e4b17023SJohn Marino 
1431e4b17023SJohn Marino    In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
1432e4b17023SJohn Marino    freelist.  */
1433e4b17023SJohn Marino #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
1434e4b17023SJohn Marino 
1435e4b17023SJohn Marino /* Used in classes in C++.  */
1436e4b17023SJohn Marino #define TREE_PRIVATE(NODE) ((NODE)->base.private_flag)
1437e4b17023SJohn Marino /* Used in classes in C++. */
1438e4b17023SJohn Marino #define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
1439e4b17023SJohn Marino 
1440e4b17023SJohn Marino /* True if reference type NODE is a C++ rvalue reference.  */
1441e4b17023SJohn Marino #define TYPE_REF_IS_RVALUE(NODE) \
1442e4b17023SJohn Marino   (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
1443e4b17023SJohn Marino 
1444e4b17023SJohn Marino /* Nonzero in a _DECL if the use of the name is defined as a
1445e4b17023SJohn Marino    deprecated feature by __attribute__((deprecated)).  */
1446e4b17023SJohn Marino #define TREE_DEPRECATED(NODE) \
1447e4b17023SJohn Marino   ((NODE)->base.deprecated_flag)
1448e4b17023SJohn Marino 
1449e4b17023SJohn Marino /* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
1450e4b17023SJohn Marino    uses are to be substituted for uses of the TREE_CHAINed identifier.  */
1451e4b17023SJohn Marino #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
1452e4b17023SJohn Marino   (IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
1453e4b17023SJohn Marino 
1454e4b17023SJohn Marino /* In fixed-point types, means a saturating type.  */
1455e4b17023SJohn Marino #define TYPE_SATURATING(NODE) ((NODE)->base.saturating_flag)
1456e4b17023SJohn Marino 
1457e4b17023SJohn Marino /* These flags are available for each language front end to use internally.  */
1458e4b17023SJohn Marino #define TREE_LANG_FLAG_0(NODE) ((NODE)->base.lang_flag_0)
1459e4b17023SJohn Marino #define TREE_LANG_FLAG_1(NODE) ((NODE)->base.lang_flag_1)
1460e4b17023SJohn Marino #define TREE_LANG_FLAG_2(NODE) ((NODE)->base.lang_flag_2)
1461e4b17023SJohn Marino #define TREE_LANG_FLAG_3(NODE) ((NODE)->base.lang_flag_3)
1462e4b17023SJohn Marino #define TREE_LANG_FLAG_4(NODE) ((NODE)->base.lang_flag_4)
1463e4b17023SJohn Marino #define TREE_LANG_FLAG_5(NODE) ((NODE)->base.lang_flag_5)
1464e4b17023SJohn Marino #define TREE_LANG_FLAG_6(NODE) ((NODE)->base.lang_flag_6)
1465e4b17023SJohn Marino 
1466e4b17023SJohn Marino /* Define additional fields and accessors for nodes representing constants.  */
1467e4b17023SJohn Marino 
1468e4b17023SJohn Marino /* In an INTEGER_CST node.  These two together make a 2-word integer.
1469e4b17023SJohn Marino    If the data type is signed, the value is sign-extended to 2 words
1470e4b17023SJohn Marino    even though not all of them may really be in use.
1471e4b17023SJohn Marino    In an unsigned constant shorter than 2 words, the extra bits are 0.  */
1472e4b17023SJohn Marino #define TREE_INT_CST(NODE) (INTEGER_CST_CHECK (NODE)->int_cst.int_cst)
1473e4b17023SJohn Marino #define TREE_INT_CST_LOW(NODE) (TREE_INT_CST (NODE).low)
1474e4b17023SJohn Marino #define TREE_INT_CST_HIGH(NODE) (TREE_INT_CST (NODE).high)
1475e4b17023SJohn Marino 
1476e4b17023SJohn Marino #define INT_CST_LT(A, B)				\
1477e4b17023SJohn Marino   (TREE_INT_CST_HIGH (A) < TREE_INT_CST_HIGH (B)	\
1478e4b17023SJohn Marino    || (TREE_INT_CST_HIGH (A) == TREE_INT_CST_HIGH (B)	\
1479e4b17023SJohn Marino        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
1480e4b17023SJohn Marino 
1481e4b17023SJohn Marino #define INT_CST_LT_UNSIGNED(A, B)				\
1482e4b17023SJohn Marino   (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A)		\
1483e4b17023SJohn Marino     < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))		\
1484e4b17023SJohn Marino    || (((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (A)		\
1485e4b17023SJohn Marino 	== (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (B))	\
1486e4b17023SJohn Marino        && TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B)))
1487e4b17023SJohn Marino 
1488e4b17023SJohn Marino struct GTY(()) tree_int_cst {
1489e4b17023SJohn Marino   struct tree_typed typed;
1490e4b17023SJohn Marino   double_int int_cst;
1491e4b17023SJohn Marino };
1492e4b17023SJohn Marino 
1493e4b17023SJohn Marino /* In a REAL_CST node.  struct real_value is an opaque entity, with
1494e4b17023SJohn Marino    manipulators defined in real.h.  We don't want tree.h depending on
1495e4b17023SJohn Marino    real.h and transitively on tm.h.  */
1496e4b17023SJohn Marino struct real_value;
1497e4b17023SJohn Marino 
1498e4b17023SJohn Marino #define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
1499e4b17023SJohn Marino #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
1500e4b17023SJohn Marino 
1501e4b17023SJohn Marino struct GTY(()) tree_real_cst {
1502e4b17023SJohn Marino   struct tree_typed typed;
1503e4b17023SJohn Marino   struct real_value * real_cst_ptr;
1504e4b17023SJohn Marino };
1505e4b17023SJohn Marino 
1506e4b17023SJohn Marino /* In a FIXED_CST node.  */
1507e4b17023SJohn Marino struct fixed_value;
1508e4b17023SJohn Marino 
1509e4b17023SJohn Marino #define TREE_FIXED_CST_PTR(NODE) \
1510e4b17023SJohn Marino   (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
1511e4b17023SJohn Marino #define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
1512e4b17023SJohn Marino 
1513e4b17023SJohn Marino struct GTY(()) tree_fixed_cst {
1514e4b17023SJohn Marino   struct tree_typed typed;
1515e4b17023SJohn Marino   struct fixed_value * fixed_cst_ptr;
1516e4b17023SJohn Marino };
1517e4b17023SJohn Marino 
1518e4b17023SJohn Marino /* In a STRING_CST */
1519e4b17023SJohn Marino /* In C terms, this is sizeof, not strlen.  */
1520e4b17023SJohn Marino #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
1521e4b17023SJohn Marino #define TREE_STRING_POINTER(NODE) \
1522e4b17023SJohn Marino   ((const char *)(STRING_CST_CHECK (NODE)->string.str))
1523e4b17023SJohn Marino 
1524e4b17023SJohn Marino struct GTY(()) tree_string {
1525e4b17023SJohn Marino   struct tree_typed typed;
1526e4b17023SJohn Marino   int length;
1527e4b17023SJohn Marino   char str[1];
1528e4b17023SJohn Marino };
1529e4b17023SJohn Marino 
1530e4b17023SJohn Marino /* In a COMPLEX_CST node.  */
1531e4b17023SJohn Marino #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
1532e4b17023SJohn Marino #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
1533e4b17023SJohn Marino 
1534e4b17023SJohn Marino struct GTY(()) tree_complex {
1535e4b17023SJohn Marino   struct tree_typed typed;
1536e4b17023SJohn Marino   tree real;
1537e4b17023SJohn Marino   tree imag;
1538e4b17023SJohn Marino };
1539e4b17023SJohn Marino 
1540e4b17023SJohn Marino /* In a VECTOR_CST node.  */
1541e4b17023SJohn Marino #define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elements)
1542e4b17023SJohn Marino 
1543e4b17023SJohn Marino struct GTY(()) tree_vector {
1544e4b17023SJohn Marino   struct tree_typed typed;
1545e4b17023SJohn Marino   tree elements;
1546e4b17023SJohn Marino };
1547e4b17023SJohn Marino 
1548e4b17023SJohn Marino #include "symtab.h"
1549e4b17023SJohn Marino 
1550e4b17023SJohn Marino /* Define fields and accessors for some special-purpose tree nodes.  */
1551e4b17023SJohn Marino 
1552e4b17023SJohn Marino #define IDENTIFIER_LENGTH(NODE) \
1553e4b17023SJohn Marino   (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len)
1554e4b17023SJohn Marino #define IDENTIFIER_POINTER(NODE) \
1555e4b17023SJohn Marino   ((const char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str)
1556e4b17023SJohn Marino #define IDENTIFIER_HASH_VALUE(NODE) \
1557e4b17023SJohn Marino   (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.hash_value)
1558e4b17023SJohn Marino 
1559e4b17023SJohn Marino /* Translate a hash table identifier pointer to a tree_identifier
1560e4b17023SJohn Marino    pointer, and vice versa.  */
1561e4b17023SJohn Marino 
1562e4b17023SJohn Marino #define HT_IDENT_TO_GCC_IDENT(NODE) \
1563e4b17023SJohn Marino   ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
1564e4b17023SJohn Marino #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
1565e4b17023SJohn Marino 
1566e4b17023SJohn Marino struct GTY(()) tree_identifier {
1567e4b17023SJohn Marino   struct tree_common common;
1568e4b17023SJohn Marino   struct ht_identifier id;
1569e4b17023SJohn Marino };
1570e4b17023SJohn Marino 
1571e4b17023SJohn Marino /* In a TREE_LIST node.  */
1572e4b17023SJohn Marino #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
1573e4b17023SJohn Marino #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
1574e4b17023SJohn Marino 
1575e4b17023SJohn Marino struct GTY(()) tree_list {
1576e4b17023SJohn Marino   struct tree_common common;
1577e4b17023SJohn Marino   tree purpose;
1578e4b17023SJohn Marino   tree value;
1579e4b17023SJohn Marino };
1580e4b17023SJohn Marino 
1581e4b17023SJohn Marino /* In a TREE_VEC node.  */
1582e4b17023SJohn Marino #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->vec.length)
1583e4b17023SJohn Marino #define TREE_VEC_END(NODE) \
1584e4b17023SJohn Marino   ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->vec.length]))
1585e4b17023SJohn Marino 
1586e4b17023SJohn Marino #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
1587e4b17023SJohn Marino 
1588e4b17023SJohn Marino struct GTY(()) tree_vec {
1589e4b17023SJohn Marino   struct tree_common common;
1590e4b17023SJohn Marino   int length;
1591e4b17023SJohn Marino   tree GTY ((length ("TREE_VEC_LENGTH ((tree)&%h)"))) a[1];
1592e4b17023SJohn Marino };
1593e4b17023SJohn Marino 
1594e4b17023SJohn Marino /* In a CONSTRUCTOR node.  */
1595e4b17023SJohn Marino #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
1596e4b17023SJohn Marino #define CONSTRUCTOR_ELT(NODE,IDX) \
1597e4b17023SJohn Marino   (VEC_index (constructor_elt, CONSTRUCTOR_ELTS (NODE), IDX))
1598e4b17023SJohn Marino #define CONSTRUCTOR_NELTS(NODE) \
1599e4b17023SJohn Marino   (VEC_length (constructor_elt, CONSTRUCTOR_ELTS (NODE)))
1600e4b17023SJohn Marino 
1601e4b17023SJohn Marino /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
1602e4b17023SJohn Marino    value of each element (stored within VAL). IX must be a scratch variable
1603e4b17023SJohn Marino    of unsigned integer type.  */
1604e4b17023SJohn Marino #define FOR_EACH_CONSTRUCTOR_VALUE(V, IX, VAL) \
1605e4b17023SJohn Marino   for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
1606e4b17023SJohn Marino 	       ? false \
1607e4b17023SJohn Marino 	       : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
1608e4b17023SJohn Marino 	       true); \
1609e4b17023SJohn Marino        (IX)++)
1610e4b17023SJohn Marino 
1611e4b17023SJohn Marino /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding both
1612e4b17023SJohn Marino    the value of each element (stored within VAL) and its index (stored
1613e4b17023SJohn Marino    within INDEX). IX must be a scratch variable of unsigned integer type.  */
1614e4b17023SJohn Marino #define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
1615e4b17023SJohn Marino   for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
1616e4b17023SJohn Marino 	       ? false \
1617e4b17023SJohn Marino 	       : (((void) (VAL = VEC_index (constructor_elt, V, IX)->value)), \
1618e4b17023SJohn Marino 		  (INDEX = VEC_index (constructor_elt, V, IX)->index), \
1619e4b17023SJohn Marino 		  true); \
1620e4b17023SJohn Marino        (IX)++)
1621e4b17023SJohn Marino 
1622e4b17023SJohn Marino /* Append a new constructor element to V, with the specified INDEX and VAL.  */
1623e4b17023SJohn Marino #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
1624e4b17023SJohn Marino   do { \
1625e4b17023SJohn Marino     constructor_elt *_ce___ = VEC_safe_push (constructor_elt, gc, V, NULL); \
1626e4b17023SJohn Marino     _ce___->index = INDEX; \
1627e4b17023SJohn Marino     _ce___->value = VALUE; \
1628e4b17023SJohn Marino   } while (0)
1629e4b17023SJohn Marino 
1630e4b17023SJohn Marino /* True if NODE, a FIELD_DECL, is to be processed as a bitfield for
1631e4b17023SJohn Marino    constructor output purposes.  */
1632e4b17023SJohn Marino #define CONSTRUCTOR_BITFIELD_P(NODE) \
1633e4b17023SJohn Marino   (DECL_BIT_FIELD (FIELD_DECL_CHECK (NODE)) && DECL_MODE (NODE) != BLKmode)
1634e4b17023SJohn Marino 
1635e4b17023SJohn Marino /* True if NODE is a clobber right hand side, an expression of indeterminate
1636e4b17023SJohn Marino    value that clobbers the LHS in a copy instruction.  We use a volatile
1637e4b17023SJohn Marino    empty CONSTRUCTOR for this, as it matches most of the necessary semantic.
1638e4b17023SJohn Marino    In particular the volatile flag causes us to not prematurely remove
1639e4b17023SJohn Marino    such clobber instructions.  */
1640e4b17023SJohn Marino #define TREE_CLOBBER_P(NODE) \
1641e4b17023SJohn Marino   (TREE_CODE (NODE) == CONSTRUCTOR && TREE_THIS_VOLATILE (NODE))
1642e4b17023SJohn Marino 
1643e4b17023SJohn Marino /* A single element of a CONSTRUCTOR. VALUE holds the actual value of the
1644e4b17023SJohn Marino    element. INDEX can optionally design the position of VALUE: in arrays,
1645e4b17023SJohn Marino    it is the index where VALUE has to be placed; in structures, it is the
1646e4b17023SJohn Marino    FIELD_DECL of the member.  */
1647e4b17023SJohn Marino typedef struct GTY(()) constructor_elt_d {
1648e4b17023SJohn Marino   tree index;
1649e4b17023SJohn Marino   tree value;
1650e4b17023SJohn Marino } constructor_elt;
1651e4b17023SJohn Marino 
1652e4b17023SJohn Marino DEF_VEC_O(constructor_elt);
1653e4b17023SJohn Marino DEF_VEC_ALLOC_O(constructor_elt,gc);
1654e4b17023SJohn Marino 
1655e4b17023SJohn Marino struct GTY(()) tree_constructor {
1656e4b17023SJohn Marino   struct tree_typed typed;
1657e4b17023SJohn Marino   VEC(constructor_elt,gc) *elts;
1658e4b17023SJohn Marino };
1659e4b17023SJohn Marino 
1660e4b17023SJohn Marino /* Define fields and accessors for some nodes that represent expressions.  */
1661e4b17023SJohn Marino 
1662e4b17023SJohn Marino /* Nonzero if NODE is an empty statement (NOP_EXPR <0>).  */
1663e4b17023SJohn Marino #define IS_EMPTY_STMT(NODE)	(TREE_CODE (NODE) == NOP_EXPR \
1664e4b17023SJohn Marino 				 && VOID_TYPE_P (TREE_TYPE (NODE)) \
1665e4b17023SJohn Marino 				 && integer_zerop (TREE_OPERAND (NODE, 0)))
1666e4b17023SJohn Marino 
1667e4b17023SJohn Marino /* In ordinary expression nodes.  */
1668e4b17023SJohn Marino #define TREE_OPERAND_LENGTH(NODE) tree_operand_length (NODE)
1669e4b17023SJohn Marino #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
1670e4b17023SJohn Marino 
1671e4b17023SJohn Marino /* In a tcc_vl_exp node, operand 0 is an INT_CST node holding the operand
1672e4b17023SJohn Marino    length.  Its value includes the length operand itself; that is,
1673e4b17023SJohn Marino    the minimum valid length is 1.
1674e4b17023SJohn Marino    Note that we have to bypass the use of TREE_OPERAND to access
1675e4b17023SJohn Marino    that field to avoid infinite recursion in expanding the macros.  */
1676e4b17023SJohn Marino #define VL_EXP_OPERAND_LENGTH(NODE) \
1677e4b17023SJohn Marino   ((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
1678e4b17023SJohn Marino 
1679e4b17023SJohn Marino /* Nonzero if is_gimple_debug() may possibly hold.  */
1680e4b17023SJohn Marino #define MAY_HAVE_DEBUG_STMTS    (flag_var_tracking_assignments)
1681e4b17023SJohn Marino 
1682e4b17023SJohn Marino /* In a LOOP_EXPR node.  */
1683e4b17023SJohn Marino #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
1684e4b17023SJohn Marino 
1685e4b17023SJohn Marino /* The source location of this expression.  Non-tree_exp nodes such as
1686e4b17023SJohn Marino    decls and constants can be shared among multiple locations, so
1687e4b17023SJohn Marino    return nothing.  */
1688e4b17023SJohn Marino #define EXPR_LOCATION(NODE) \
1689e4b17023SJohn Marino   (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
1690e4b17023SJohn Marino #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
1691e4b17023SJohn Marino #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
1692e4b17023SJohn Marino #define EXPR_LOC_OR_HERE(NODE) (EXPR_HAS_LOCATION (NODE) ? (NODE)->exp.locus : input_location)
1693e4b17023SJohn Marino #define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
1694e4b17023SJohn Marino #define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
1695e4b17023SJohn Marino 
1696e4b17023SJohn Marino /* True if a tree is an expression or statement that can have a
1697e4b17023SJohn Marino    location.  */
1698e4b17023SJohn Marino #define CAN_HAVE_LOCATION_P(NODE) ((NODE) && EXPR_P (NODE))
1699e4b17023SJohn Marino 
1700e4b17023SJohn Marino extern void protected_set_expr_location (tree, location_t);
1701e4b17023SJohn Marino 
1702e4b17023SJohn Marino /* In a TARGET_EXPR node.  */
1703e4b17023SJohn Marino #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
1704e4b17023SJohn Marino #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 1)
1705e4b17023SJohn Marino #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 2)
1706e4b17023SJohn Marino 
1707e4b17023SJohn Marino /* DECL_EXPR accessor. This gives access to the DECL associated with
1708e4b17023SJohn Marino    the given declaration statement.  */
1709e4b17023SJohn Marino #define DECL_EXPR_DECL(NODE)    TREE_OPERAND (DECL_EXPR_CHECK (NODE), 0)
1710e4b17023SJohn Marino 
1711e4b17023SJohn Marino #define EXIT_EXPR_COND(NODE)	     TREE_OPERAND (EXIT_EXPR_CHECK (NODE), 0)
1712e4b17023SJohn Marino 
1713e4b17023SJohn Marino /* COMPOUND_LITERAL_EXPR accessors.  */
1714e4b17023SJohn Marino #define COMPOUND_LITERAL_EXPR_DECL_EXPR(NODE)		\
1715e4b17023SJohn Marino   TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0)
1716e4b17023SJohn Marino #define COMPOUND_LITERAL_EXPR_DECL(NODE)			\
1717e4b17023SJohn Marino   DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_EXPR (NODE))
1718e4b17023SJohn Marino 
1719e4b17023SJohn Marino /* SWITCH_EXPR accessors. These give access to the condition, body and
1720e4b17023SJohn Marino    original condition type (before any compiler conversions)
1721e4b17023SJohn Marino    of the switch statement, respectively.  */
1722e4b17023SJohn Marino #define SWITCH_COND(NODE)       TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 0)
1723e4b17023SJohn Marino #define SWITCH_BODY(NODE)       TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 1)
1724e4b17023SJohn Marino #define SWITCH_LABELS(NODE)     TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 2)
1725e4b17023SJohn Marino 
1726e4b17023SJohn Marino /* CASE_LABEL_EXPR accessors. These give access to the high and low values
1727e4b17023SJohn Marino    of a case label, respectively.  */
1728e4b17023SJohn Marino #define CASE_LOW(NODE)          	TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
1729e4b17023SJohn Marino #define CASE_HIGH(NODE)         	TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
1730e4b17023SJohn Marino #define CASE_LABEL(NODE)		TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
1731e4b17023SJohn Marino #define CASE_CHAIN(NODE)		TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 3)
1732e4b17023SJohn Marino 
1733e4b17023SJohn Marino /* The operands of a TARGET_MEM_REF.  Operands 0 and 1 have to match
1734e4b17023SJohn Marino    corresponding MEM_REF operands.  */
1735e4b17023SJohn Marino #define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
1736e4b17023SJohn Marino #define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
1737e4b17023SJohn Marino #define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
1738e4b17023SJohn Marino #define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
1739e4b17023SJohn Marino #define TMR_INDEX2(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
1740e4b17023SJohn Marino 
1741e4b17023SJohn Marino /* The operands of a BIND_EXPR.  */
1742e4b17023SJohn Marino #define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
1743e4b17023SJohn Marino #define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
1744e4b17023SJohn Marino #define BIND_EXPR_BLOCK(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 2))
1745e4b17023SJohn Marino 
1746e4b17023SJohn Marino /* GOTO_EXPR accessor. This gives access to the label associated with
1747e4b17023SJohn Marino    a goto statement.  */
1748e4b17023SJohn Marino #define GOTO_DESTINATION(NODE)  TREE_OPERAND ((NODE), 0)
1749e4b17023SJohn Marino 
1750e4b17023SJohn Marino /* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the
1751e4b17023SJohn Marino    instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and
1752e4b17023SJohn Marino    ASM_CLOBBERS represent the outputs, inputs, and clobbers for the
1753e4b17023SJohn Marino    statement.  */
1754e4b17023SJohn Marino #define ASM_STRING(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 0)
1755e4b17023SJohn Marino #define ASM_OUTPUTS(NODE)       TREE_OPERAND (ASM_EXPR_CHECK (NODE), 1)
1756e4b17023SJohn Marino #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
1757e4b17023SJohn Marino #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
1758e4b17023SJohn Marino #define ASM_LABELS(NODE)	TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
1759e4b17023SJohn Marino /* Nonzero if we want to create an ASM_INPUT instead of an
1760e4b17023SJohn Marino    ASM_OPERAND with no operands.  */
1761e4b17023SJohn Marino #define ASM_INPUT_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
1762e4b17023SJohn Marino #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
1763e4b17023SJohn Marino 
1764e4b17023SJohn Marino /* COND_EXPR accessors.  */
1765e4b17023SJohn Marino #define COND_EXPR_COND(NODE)	(TREE_OPERAND (COND_EXPR_CHECK (NODE), 0))
1766e4b17023SJohn Marino #define COND_EXPR_THEN(NODE)	(TREE_OPERAND (COND_EXPR_CHECK (NODE), 1))
1767e4b17023SJohn Marino #define COND_EXPR_ELSE(NODE)	(TREE_OPERAND (COND_EXPR_CHECK (NODE), 2))
1768e4b17023SJohn Marino 
1769e4b17023SJohn Marino /* Accessors for the chains of recurrences.  */
1770e4b17023SJohn Marino #define CHREC_VAR(NODE)           TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 0)
1771e4b17023SJohn Marino #define CHREC_LEFT(NODE)          TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 1)
1772e4b17023SJohn Marino #define CHREC_RIGHT(NODE)         TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 2)
1773e4b17023SJohn Marino #define CHREC_VARIABLE(NODE)      TREE_INT_CST_LOW (CHREC_VAR (NODE))
1774e4b17023SJohn Marino 
1775e4b17023SJohn Marino /* LABEL_EXPR accessor. This gives access to the label associated with
1776e4b17023SJohn Marino    the given label expression.  */
1777e4b17023SJohn Marino #define LABEL_EXPR_LABEL(NODE)  TREE_OPERAND (LABEL_EXPR_CHECK (NODE), 0)
1778e4b17023SJohn Marino 
1779e4b17023SJohn Marino /* VDEF_EXPR accessors are specified in tree-flow.h, along with the other
1780e4b17023SJohn Marino    accessors for SSA operands.  */
1781e4b17023SJohn Marino 
1782e4b17023SJohn Marino /* CATCH_EXPR accessors.  */
1783e4b17023SJohn Marino #define CATCH_TYPES(NODE)	TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
1784e4b17023SJohn Marino #define CATCH_BODY(NODE)	TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
1785e4b17023SJohn Marino 
1786e4b17023SJohn Marino /* EH_FILTER_EXPR accessors.  */
1787e4b17023SJohn Marino #define EH_FILTER_TYPES(NODE)	TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 0)
1788e4b17023SJohn Marino #define EH_FILTER_FAILURE(NODE)	TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1)
1789e4b17023SJohn Marino 
1790e4b17023SJohn Marino /* OBJ_TYPE_REF accessors.  */
1791e4b17023SJohn Marino #define OBJ_TYPE_REF_EXPR(NODE)	  TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0)
1792e4b17023SJohn Marino #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1)
1793e4b17023SJohn Marino #define OBJ_TYPE_REF_TOKEN(NODE)  TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 2)
1794e4b17023SJohn Marino 
1795e4b17023SJohn Marino /* ASSERT_EXPR accessors.  */
1796e4b17023SJohn Marino #define ASSERT_EXPR_VAR(NODE)	TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 0)
1797e4b17023SJohn Marino #define ASSERT_EXPR_COND(NODE)	TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 1)
1798e4b17023SJohn Marino 
1799e4b17023SJohn Marino /* CALL_EXPR accessors.
1800e4b17023SJohn Marino  */
1801e4b17023SJohn Marino #define CALL_EXPR_FN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 1)
1802e4b17023SJohn Marino #define CALL_EXPR_STATIC_CHAIN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 2)
1803e4b17023SJohn Marino #define CALL_EXPR_ARG(NODE, I) TREE_OPERAND (CALL_EXPR_CHECK (NODE), (I) + 3)
1804e4b17023SJohn Marino #define call_expr_nargs(NODE) (VL_EXP_OPERAND_LENGTH(NODE) - 3)
1805e4b17023SJohn Marino 
1806e4b17023SJohn Marino /* CALL_EXPR_ARGP returns a pointer to the argument vector for NODE.
1807e4b17023SJohn Marino    We can't use &CALL_EXPR_ARG (NODE, 0) because that will complain if
1808e4b17023SJohn Marino    the argument count is zero when checking is enabled.  Instead, do
1809e4b17023SJohn Marino    the pointer arithmetic to advance past the 3 fixed operands in a
1810e4b17023SJohn Marino    CALL_EXPR.  That produces a valid pointer to just past the end of the
1811e4b17023SJohn Marino    operand array, even if it's not valid to dereference it.  */
1812e4b17023SJohn Marino #define CALL_EXPR_ARGP(NODE) \
1813e4b17023SJohn Marino   (&(TREE_OPERAND (CALL_EXPR_CHECK (NODE), 0)) + 3)
1814e4b17023SJohn Marino 
1815e4b17023SJohn Marino /* TM directives and accessors.  */
1816e4b17023SJohn Marino #define TRANSACTION_EXPR_BODY(NODE) \
1817e4b17023SJohn Marino   TREE_OPERAND (TRANSACTION_EXPR_CHECK (NODE), 0)
1818e4b17023SJohn Marino #define TRANSACTION_EXPR_OUTER(NODE) \
1819e4b17023SJohn Marino   (TRANSACTION_EXPR_CHECK (NODE)->base.static_flag)
1820e4b17023SJohn Marino #define TRANSACTION_EXPR_RELAXED(NODE) \
1821e4b17023SJohn Marino   (TRANSACTION_EXPR_CHECK (NODE)->base.public_flag)
1822e4b17023SJohn Marino 
1823e4b17023SJohn Marino /* OpenMP directive and clause accessors.  */
1824e4b17023SJohn Marino 
1825e4b17023SJohn Marino #define OMP_BODY(NODE) \
1826e4b17023SJohn Marino   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_CRITICAL), 0)
1827e4b17023SJohn Marino #define OMP_CLAUSES(NODE) \
1828e4b17023SJohn Marino   TREE_OPERAND (TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_SINGLE), 1)
1829e4b17023SJohn Marino 
1830e4b17023SJohn Marino #define OMP_PARALLEL_BODY(NODE)    TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
1831e4b17023SJohn Marino #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
1832e4b17023SJohn Marino 
1833e4b17023SJohn Marino #define OMP_TASK_BODY(NODE)	   TREE_OPERAND (OMP_TASK_CHECK (NODE), 0)
1834e4b17023SJohn Marino #define OMP_TASK_CLAUSES(NODE)	   TREE_OPERAND (OMP_TASK_CHECK (NODE), 1)
1835e4b17023SJohn Marino 
1836e4b17023SJohn Marino #define OMP_TASKREG_CHECK(NODE)	  TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK)
1837e4b17023SJohn Marino #define OMP_TASKREG_BODY(NODE)    TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0)
1838e4b17023SJohn Marino #define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1)
1839e4b17023SJohn Marino 
1840e4b17023SJohn Marino #define OMP_FOR_BODY(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 0)
1841e4b17023SJohn Marino #define OMP_FOR_CLAUSES(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 1)
1842e4b17023SJohn Marino #define OMP_FOR_INIT(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 2)
1843e4b17023SJohn Marino #define OMP_FOR_COND(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 3)
1844e4b17023SJohn Marino #define OMP_FOR_INCR(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 4)
1845e4b17023SJohn Marino #define OMP_FOR_PRE_BODY(NODE)	   TREE_OPERAND (OMP_FOR_CHECK (NODE), 5)
1846e4b17023SJohn Marino 
1847e4b17023SJohn Marino #define OMP_SECTIONS_BODY(NODE)    TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
1848e4b17023SJohn Marino #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
1849e4b17023SJohn Marino 
1850e4b17023SJohn Marino #define OMP_SECTION_BODY(NODE)	   TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
1851e4b17023SJohn Marino 
1852e4b17023SJohn Marino #define OMP_SINGLE_BODY(NODE)	   TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 0)
1853e4b17023SJohn Marino #define OMP_SINGLE_CLAUSES(NODE)   TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 1)
1854e4b17023SJohn Marino 
1855e4b17023SJohn Marino #define OMP_MASTER_BODY(NODE)	   TREE_OPERAND (OMP_MASTER_CHECK (NODE), 0)
1856e4b17023SJohn Marino 
1857e4b17023SJohn Marino #define OMP_ORDERED_BODY(NODE)	   TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 0)
1858e4b17023SJohn Marino 
1859e4b17023SJohn Marino #define OMP_CRITICAL_BODY(NODE)    TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 0)
1860e4b17023SJohn Marino #define OMP_CRITICAL_NAME(NODE)    TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 1)
1861e4b17023SJohn Marino 
1862e4b17023SJohn Marino #define OMP_CLAUSE_CHAIN(NODE)     TREE_CHAIN (OMP_CLAUSE_CHECK (NODE))
1863e4b17023SJohn Marino #define OMP_CLAUSE_DECL(NODE)      					\
1864e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE),	\
1865e4b17023SJohn Marino 					      OMP_CLAUSE_PRIVATE,	\
1866e4b17023SJohn Marino 	                                      OMP_CLAUSE_COPYPRIVATE), 0)
1867e4b17023SJohn Marino #define OMP_CLAUSE_HAS_LOCATION(NODE) \
1868e4b17023SJohn Marino   ((OMP_CLAUSE_CHECK (NODE))->omp_clause.locus != UNKNOWN_LOCATION)
1869e4b17023SJohn Marino #define OMP_CLAUSE_LOCATION(NODE)  (OMP_CLAUSE_CHECK (NODE))->omp_clause.locus
1870e4b17023SJohn Marino 
1871e4b17023SJohn Marino /* True on an OMP_SECTION statement that was the last lexical member.
1872e4b17023SJohn Marino    This status is meaningful in the implementation of lastprivate.  */
1873e4b17023SJohn Marino #define OMP_SECTION_LAST(NODE) \
1874e4b17023SJohn Marino   (OMP_SECTION_CHECK (NODE)->base.private_flag)
1875e4b17023SJohn Marino 
1876e4b17023SJohn Marino /* True on an OMP_PARALLEL statement if it represents an explicit
1877e4b17023SJohn Marino    combined parallel work-sharing constructs.  */
1878e4b17023SJohn Marino #define OMP_PARALLEL_COMBINED(NODE) \
1879e4b17023SJohn Marino   (OMP_PARALLEL_CHECK (NODE)->base.private_flag)
1880e4b17023SJohn Marino 
1881e4b17023SJohn Marino /* True on a PRIVATE clause if its decl is kept around for debugging
1882e4b17023SJohn Marino    information only and its DECL_VALUE_EXPR is supposed to point
1883e4b17023SJohn Marino    to what it has been remapped to.  */
1884e4b17023SJohn Marino #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
1885e4b17023SJohn Marino   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE)->base.public_flag)
1886e4b17023SJohn Marino 
1887e4b17023SJohn Marino /* True on a PRIVATE clause if ctor needs access to outer region's
1888e4b17023SJohn Marino    variable.  */
1889e4b17023SJohn Marino #define OMP_CLAUSE_PRIVATE_OUTER_REF(NODE) \
1890e4b17023SJohn Marino   TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
1891e4b17023SJohn Marino 
1892e4b17023SJohn Marino /* True on a LASTPRIVATE clause if a FIRSTPRIVATE clause for the same
1893e4b17023SJohn Marino    decl is present in the chain.  */
1894e4b17023SJohn Marino #define OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE(NODE) \
1895e4b17023SJohn Marino   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE)->base.public_flag)
1896e4b17023SJohn Marino #define OMP_CLAUSE_LASTPRIVATE_STMT(NODE) \
1897e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE,			\
1898e4b17023SJohn Marino 						OMP_CLAUSE_LASTPRIVATE),\
1899e4b17023SJohn Marino 		      1)
1900e4b17023SJohn Marino #define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \
1901e4b17023SJohn Marino   (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
1902e4b17023SJohn Marino 
1903e4b17023SJohn Marino #define OMP_CLAUSE_FINAL_EXPR(NODE) \
1904e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FINAL), 0)
1905e4b17023SJohn Marino #define OMP_CLAUSE_IF_EXPR(NODE) \
1906e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
1907e4b17023SJohn Marino #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \
1908e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0)
1909e4b17023SJohn Marino #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \
1910e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE), 0)
1911e4b17023SJohn Marino 
1912e4b17023SJohn Marino #define OMP_CLAUSE_COLLAPSE_EXPR(NODE) \
1913e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 0)
1914e4b17023SJohn Marino #define OMP_CLAUSE_COLLAPSE_ITERVAR(NODE) \
1915e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 1)
1916e4b17023SJohn Marino #define OMP_CLAUSE_COLLAPSE_COUNT(NODE) \
1917e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 2)
1918e4b17023SJohn Marino 
1919e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_CODE(NODE)	\
1920e4b17023SJohn Marino   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION)->omp_clause.subcode.reduction_code)
1921e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_INIT(NODE) \
1922e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
1923e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
1924e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
1925e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \
1926e4b17023SJohn Marino   (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
1927e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \
1928e4b17023SJohn Marino   (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge
1929e4b17023SJohn Marino #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
1930e4b17023SJohn Marino   OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
1931e4b17023SJohn Marino 
1932e4b17023SJohn Marino enum omp_clause_schedule_kind
1933e4b17023SJohn Marino {
1934e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE_STATIC,
1935e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE_DYNAMIC,
1936e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE_GUIDED,
1937e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE_AUTO,
1938e4b17023SJohn Marino   OMP_CLAUSE_SCHEDULE_RUNTIME
1939e4b17023SJohn Marino };
1940e4b17023SJohn Marino 
1941e4b17023SJohn Marino #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
1942e4b17023SJohn Marino   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
1943e4b17023SJohn Marino 
1944e4b17023SJohn Marino enum omp_clause_default_kind
1945e4b17023SJohn Marino {
1946e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT_UNSPECIFIED,
1947e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT_SHARED,
1948e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT_NONE,
1949e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT_PRIVATE,
1950e4b17023SJohn Marino   OMP_CLAUSE_DEFAULT_FIRSTPRIVATE
1951e4b17023SJohn Marino };
1952e4b17023SJohn Marino 
1953e4b17023SJohn Marino #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
1954e4b17023SJohn Marino   (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
1955e4b17023SJohn Marino 
1956e4b17023SJohn Marino struct GTY(()) tree_exp {
1957e4b17023SJohn Marino   struct tree_typed typed;
1958e4b17023SJohn Marino   location_t locus;
1959e4b17023SJohn Marino   tree block;
1960e4b17023SJohn Marino   tree GTY ((special ("tree_exp"),
1961e4b17023SJohn Marino 	     desc ("TREE_CODE ((tree) &%0)")))
1962e4b17023SJohn Marino     operands[1];
1963e4b17023SJohn Marino };
1964e4b17023SJohn Marino 
1965e4b17023SJohn Marino /* SSA_NAME accessors.  */
1966e4b17023SJohn Marino 
1967e4b17023SJohn Marino /* Returns the variable being referenced.  Once released, this is the
1968e4b17023SJohn Marino    only field that can be relied upon.  */
1969e4b17023SJohn Marino #define SSA_NAME_VAR(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.var
1970e4b17023SJohn Marino 
1971e4b17023SJohn Marino /* Returns the statement which defines this SSA name.  */
1972e4b17023SJohn Marino #define SSA_NAME_DEF_STMT(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
1973e4b17023SJohn Marino 
1974e4b17023SJohn Marino /* Returns the SSA version number of this SSA name.  Note that in
1975e4b17023SJohn Marino    tree SSA, version numbers are not per variable and may be recycled.  */
1976e4b17023SJohn Marino #define SSA_NAME_VERSION(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.version
1977e4b17023SJohn Marino 
1978e4b17023SJohn Marino /* Nonzero if this SSA name occurs in an abnormal PHI.  SSA_NAMES are
1979e4b17023SJohn Marino    never output, so we can safely use the ASM_WRITTEN_FLAG for this
1980e4b17023SJohn Marino    status bit.  */
1981e4b17023SJohn Marino #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
1982e4b17023SJohn Marino     SSA_NAME_CHECK (NODE)->base.asm_written_flag
1983e4b17023SJohn Marino 
1984e4b17023SJohn Marino /* Nonzero if this SSA_NAME expression is currently on the free list of
1985e4b17023SJohn Marino    SSA_NAMES.  Using NOTHROW_FLAG seems reasonably safe since throwing
1986e4b17023SJohn Marino    has no meaning for an SSA_NAME.  */
1987e4b17023SJohn Marino #define SSA_NAME_IN_FREE_LIST(NODE) \
1988e4b17023SJohn Marino     SSA_NAME_CHECK (NODE)->base.nothrow_flag
1989e4b17023SJohn Marino 
1990e4b17023SJohn Marino /* Nonzero if this SSA_NAME is the default definition for the
1991e4b17023SJohn Marino    underlying symbol.  A default SSA name is created for symbol S if
1992e4b17023SJohn Marino    the very first reference to S in the function is a read operation.
1993e4b17023SJohn Marino    Default definitions are always created by an empty statement and
1994e4b17023SJohn Marino    belong to no basic block.  */
1995e4b17023SJohn Marino #define SSA_NAME_IS_DEFAULT_DEF(NODE) \
1996e4b17023SJohn Marino     SSA_NAME_CHECK (NODE)->base.default_def_flag
1997e4b17023SJohn Marino 
1998e4b17023SJohn Marino /* Attributes for SSA_NAMEs for pointer-type variables.  */
1999e4b17023SJohn Marino #define SSA_NAME_PTR_INFO(N) \
2000e4b17023SJohn Marino     SSA_NAME_CHECK (N)->ssa_name.ptr_info
2001e4b17023SJohn Marino 
2002e4b17023SJohn Marino /* Defined in tree-flow.h.  */
2003e4b17023SJohn Marino struct ptr_info_def;
2004e4b17023SJohn Marino 
2005e4b17023SJohn Marino /* Immediate use linking structure.  This structure is used for maintaining
2006e4b17023SJohn Marino    a doubly linked list of uses of an SSA_NAME.  */
2007e4b17023SJohn Marino typedef struct GTY(()) ssa_use_operand_d {
2008e4b17023SJohn Marino   struct ssa_use_operand_d* GTY((skip(""))) prev;
2009e4b17023SJohn Marino   struct ssa_use_operand_d* GTY((skip(""))) next;
2010e4b17023SJohn Marino   /* Immediate uses for a given SSA name are maintained as a cyclic
2011e4b17023SJohn Marino      list.  To recognize the root of this list, the location field
2012e4b17023SJohn Marino      needs to point to the original SSA name.  Since statements and
2013e4b17023SJohn Marino      SSA names are of different data types, we need this union.  See
2014e4b17023SJohn Marino      the explanation in struct immediate_use_iterator_d.  */
2015e4b17023SJohn Marino   union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc;
2016e4b17023SJohn Marino   tree *GTY((skip(""))) use;
2017e4b17023SJohn Marino } ssa_use_operand_t;
2018e4b17023SJohn Marino 
2019e4b17023SJohn Marino /* Return the immediate_use information for an SSA_NAME. */
2020e4b17023SJohn Marino #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
2021e4b17023SJohn Marino 
2022e4b17023SJohn Marino struct GTY(()) tree_ssa_name {
2023e4b17023SJohn Marino   struct tree_typed typed;
2024e4b17023SJohn Marino 
2025e4b17023SJohn Marino   /* _DECL wrapped by this SSA name.  */
2026e4b17023SJohn Marino   tree var;
2027e4b17023SJohn Marino 
2028e4b17023SJohn Marino   /* Statement that defines this SSA name.  */
2029e4b17023SJohn Marino   gimple def_stmt;
2030e4b17023SJohn Marino 
2031e4b17023SJohn Marino   /* SSA version number.  */
2032e4b17023SJohn Marino   unsigned int version;
2033e4b17023SJohn Marino 
2034e4b17023SJohn Marino   /* Pointer attributes used for alias analysis.  */
2035e4b17023SJohn Marino   struct ptr_info_def *ptr_info;
2036e4b17023SJohn Marino 
2037e4b17023SJohn Marino   /* Immediate uses list for this SSA_NAME.  */
2038e4b17023SJohn Marino   struct ssa_use_operand_d imm_uses;
2039e4b17023SJohn Marino };
2040e4b17023SJohn Marino 
2041e4b17023SJohn Marino struct GTY(()) phi_arg_d {
2042e4b17023SJohn Marino   /* imm_use MUST be the first element in struct because we do some
2043e4b17023SJohn Marino      pointer arithmetic with it.  See phi_arg_index_from_use.  */
2044e4b17023SJohn Marino   struct ssa_use_operand_d imm_use;
2045e4b17023SJohn Marino   tree def;
2046e4b17023SJohn Marino   location_t locus;
2047e4b17023SJohn Marino };
2048e4b17023SJohn Marino 
2049e4b17023SJohn Marino 
2050e4b17023SJohn Marino #define OMP_CLAUSE_CODE(NODE)					\
2051e4b17023SJohn Marino 	(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
2052e4b17023SJohn Marino 
2053e4b17023SJohn Marino #define OMP_CLAUSE_SET_CODE(NODE, CODE)				\
2054e4b17023SJohn Marino 	((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
2055e4b17023SJohn Marino 
2056e4b17023SJohn Marino #define OMP_CLAUSE_CODE(NODE)					\
2057e4b17023SJohn Marino 	(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
2058e4b17023SJohn Marino 
2059e4b17023SJohn Marino #define OMP_CLAUSE_OPERAND(NODE, I)				\
2060e4b17023SJohn Marino 	OMP_CLAUSE_ELT_CHECK (NODE, I)
2061e4b17023SJohn Marino 
2062e4b17023SJohn Marino struct GTY(()) tree_omp_clause {
2063e4b17023SJohn Marino   struct tree_common common;
2064e4b17023SJohn Marino   location_t locus;
2065e4b17023SJohn Marino   enum omp_clause_code code;
2066e4b17023SJohn Marino   union omp_clause_subcode {
2067e4b17023SJohn Marino     enum omp_clause_default_kind  default_kind;
2068e4b17023SJohn Marino     enum omp_clause_schedule_kind schedule_kind;
2069e4b17023SJohn Marino     enum tree_code                reduction_code;
2070e4b17023SJohn Marino   } GTY ((skip)) subcode;
2071e4b17023SJohn Marino 
2072e4b17023SJohn Marino   /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's
2073e4b17023SJohn Marino      usage.  */
2074e4b17023SJohn Marino   gimple_seq gimple_reduction_init;
2075e4b17023SJohn Marino   gimple_seq gimple_reduction_merge;
2076e4b17023SJohn Marino 
2077e4b17023SJohn Marino   tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
2078e4b17023SJohn Marino };
2079e4b17023SJohn Marino 
2080e4b17023SJohn Marino 
2081e4b17023SJohn Marino /* In a BLOCK node.  */
2082e4b17023SJohn Marino #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
2083e4b17023SJohn Marino #define BLOCK_NONLOCALIZED_VARS(NODE) \
2084e4b17023SJohn Marino   (BLOCK_CHECK (NODE)->block.nonlocalized_vars)
2085e4b17023SJohn Marino #define BLOCK_NUM_NONLOCALIZED_VARS(NODE) \
2086e4b17023SJohn Marino   VEC_length (tree, BLOCK_NONLOCALIZED_VARS (NODE))
2087e4b17023SJohn Marino #define BLOCK_NONLOCALIZED_VAR(NODE,N) \
2088e4b17023SJohn Marino   VEC_index (tree, BLOCK_NONLOCALIZED_VARS (NODE), N)
2089e4b17023SJohn Marino #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
2090e4b17023SJohn Marino #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
2091e4b17023SJohn Marino #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain)
2092e4b17023SJohn Marino #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
2093e4b17023SJohn Marino #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
2094e4b17023SJohn Marino 
2095e4b17023SJohn Marino /* An index number for this block.  These values are not guaranteed to
2096e4b17023SJohn Marino    be unique across functions -- whether or not they are depends on
2097e4b17023SJohn Marino    the debugging output format in use.  */
2098e4b17023SJohn Marino #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
2099e4b17023SJohn Marino 
2100e4b17023SJohn Marino /* If block reordering splits a lexical block into discontiguous
2101e4b17023SJohn Marino    address ranges, we'll make a copy of the original block.
2102e4b17023SJohn Marino 
2103e4b17023SJohn Marino    Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN.
2104e4b17023SJohn Marino    In that case, we have one source block that has been replicated
2105e4b17023SJohn Marino    (through inlining or unrolling) into many logical blocks, and that
2106e4b17023SJohn Marino    these logical blocks have different physical variables in them.
2107e4b17023SJohn Marino 
2108e4b17023SJohn Marino    In this case, we have one logical block split into several
2109e4b17023SJohn Marino    non-contiguous address ranges.  Most debug formats can't actually
2110e4b17023SJohn Marino    represent this idea directly, so we fake it by creating multiple
2111e4b17023SJohn Marino    logical blocks with the same variables in them.  However, for those
2112e4b17023SJohn Marino    that do support non-contiguous regions, these allow the original
2113e4b17023SJohn Marino    logical block to be reconstructed, along with the set of address
2114e4b17023SJohn Marino    ranges.
2115e4b17023SJohn Marino 
2116e4b17023SJohn Marino    One of the logical block fragments is arbitrarily chosen to be
2117e4b17023SJohn Marino    the ORIGIN.  The other fragments will point to the origin via
2118e4b17023SJohn Marino    BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer
2119e4b17023SJohn Marino    be null.  The list of fragments will be chained through
2120e4b17023SJohn Marino    BLOCK_FRAGMENT_CHAIN from the origin.  */
2121e4b17023SJohn Marino 
2122e4b17023SJohn Marino #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
2123e4b17023SJohn Marino #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
2124e4b17023SJohn Marino 
2125e4b17023SJohn Marino /* For an inlined function, this gives the location where it was called
2126e4b17023SJohn Marino    from.  This is only set in the top level block, which corresponds to the
2127e4b17023SJohn Marino    inlined function scope.  This is used in the debug output routines.  */
2128e4b17023SJohn Marino 
2129e4b17023SJohn Marino #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
2130e4b17023SJohn Marino 
2131e4b17023SJohn Marino struct GTY(()) tree_block {
2132e4b17023SJohn Marino   struct tree_base base;
2133e4b17023SJohn Marino   tree chain;
2134e4b17023SJohn Marino 
2135e4b17023SJohn Marino   unsigned abstract_flag : 1;
2136e4b17023SJohn Marino   unsigned block_num : 31;
2137e4b17023SJohn Marino 
2138e4b17023SJohn Marino   location_t locus;
2139e4b17023SJohn Marino 
2140e4b17023SJohn Marino   tree vars;
2141e4b17023SJohn Marino   VEC(tree,gc) *nonlocalized_vars;
2142e4b17023SJohn Marino 
2143e4b17023SJohn Marino   tree subblocks;
2144e4b17023SJohn Marino   tree supercontext;
2145e4b17023SJohn Marino   tree abstract_origin;
2146e4b17023SJohn Marino   tree fragment_origin;
2147e4b17023SJohn Marino   tree fragment_chain;
2148e4b17023SJohn Marino };
2149e4b17023SJohn Marino 
2150e4b17023SJohn Marino /* Define fields and accessors for nodes representing data types.  */
2151e4b17023SJohn Marino 
2152e4b17023SJohn Marino /* See tree.def for documentation of the use of these fields.
2153e4b17023SJohn Marino    Look at the documentation of the various ..._TYPE tree codes.
2154e4b17023SJohn Marino 
2155e4b17023SJohn Marino    Note that the type.values, type.minval, and type.maxval fields are
2156e4b17023SJohn Marino    overloaded and used for different macros in different kinds of types.
2157e4b17023SJohn Marino    Each macro must check to ensure the tree node is of the proper kind of
2158e4b17023SJohn Marino    type.  Note also that some of the front-ends also overload these fields,
2159e4b17023SJohn Marino    so they must be checked as well.  */
2160e4b17023SJohn Marino 
2161e4b17023SJohn Marino #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type_common.uid)
2162e4b17023SJohn Marino #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type_common.size)
2163e4b17023SJohn Marino #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type_common.size_unit)
2164e4b17023SJohn Marino #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type_common.pointer_to)
2165e4b17023SJohn Marino #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type_common.reference_to)
2166e4b17023SJohn Marino #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type_common.precision)
2167e4b17023SJohn Marino #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type_common.name)
2168e4b17023SJohn Marino #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.next_variant)
2169e4b17023SJohn Marino #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.main_variant)
2170e4b17023SJohn Marino #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type_common.context)
2171e4b17023SJohn Marino 
2172e4b17023SJohn Marino /* Vector types need to check target flags to determine type.  */
2173e4b17023SJohn Marino extern enum machine_mode vector_type_mode (const_tree);
2174e4b17023SJohn Marino #define TYPE_MODE(NODE) \
2175e4b17023SJohn Marino   (TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \
2176e4b17023SJohn Marino    ? vector_type_mode (NODE) : (NODE)->type_common.mode)
2177e4b17023SJohn Marino #define SET_TYPE_MODE(NODE, MODE) \
2178e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.mode = (MODE))
2179e4b17023SJohn Marino 
2180e4b17023SJohn Marino /* The "canonical" type for this type node, which is used by frontends to
2181e4b17023SJohn Marino    compare the type for equality with another type.  If two types are
2182e4b17023SJohn Marino    equal (based on the semantics of the language), then they will have
2183e4b17023SJohn Marino    equivalent TYPE_CANONICAL entries.
2184e4b17023SJohn Marino 
2185e4b17023SJohn Marino    As a special case, if TYPE_CANONICAL is NULL_TREE, and thus
2186e4b17023SJohn Marino    TYPE_STRUCTURAL_EQUALITY_P is true, then it cannot
2187e4b17023SJohn Marino    be used for comparison against other types.  Instead, the type is
2188e4b17023SJohn Marino    said to require structural equality checks, described in
2189e4b17023SJohn Marino    TYPE_STRUCTURAL_EQUALITY_P.
2190e4b17023SJohn Marino 
2191e4b17023SJohn Marino    For unqualified aggregate and function types the middle-end relies on
2192e4b17023SJohn Marino    TYPE_CANONICAL to tell whether two variables can be assigned
2193e4b17023SJohn Marino    to each other without a conversion.  The middle-end also makes sure
2194e4b17023SJohn Marino    to assign the same alias-sets to the type partition with equal
2195e4b17023SJohn Marino    TYPE_CANONICAL of their unqualified variants.  */
2196e4b17023SJohn Marino #define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type_common.canonical)
2197e4b17023SJohn Marino /* Indicates that the type node requires structural equality
2198e4b17023SJohn Marino    checks.  The compiler will need to look at the composition of the
2199e4b17023SJohn Marino    type to determine whether it is equal to another type, rather than
2200e4b17023SJohn Marino    just comparing canonical type pointers.  For instance, we would need
2201e4b17023SJohn Marino    to look at the return and parameter types of a FUNCTION_TYPE
2202e4b17023SJohn Marino    node.  */
2203e4b17023SJohn Marino #define TYPE_STRUCTURAL_EQUALITY_P(NODE) (TYPE_CANONICAL (NODE) == NULL_TREE)
2204e4b17023SJohn Marino /* Sets the TYPE_CANONICAL field to NULL_TREE, indicating that the
2205e4b17023SJohn Marino    type node requires structural equality.  */
2206e4b17023SJohn Marino #define SET_TYPE_STRUCTURAL_EQUALITY(NODE) (TYPE_CANONICAL (NODE) = NULL_TREE)
2207e4b17023SJohn Marino 
2208e4b17023SJohn Marino #define TYPE_IBIT(NODE) (GET_MODE_IBIT (TYPE_MODE (NODE)))
2209e4b17023SJohn Marino #define TYPE_FBIT(NODE) (GET_MODE_FBIT (TYPE_MODE (NODE)))
2210e4b17023SJohn Marino 
2211e4b17023SJohn Marino /* The (language-specific) typed-based alias set for this type.
2212e4b17023SJohn Marino    Objects whose TYPE_ALIAS_SETs are different cannot alias each
2213e4b17023SJohn Marino    other.  If the TYPE_ALIAS_SET is -1, no alias set has yet been
2214e4b17023SJohn Marino    assigned to this type.  If the TYPE_ALIAS_SET is 0, objects of this
2215e4b17023SJohn Marino    type can alias objects of any type.  */
2216e4b17023SJohn Marino #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type_common.alias_set)
2217e4b17023SJohn Marino 
2218e4b17023SJohn Marino /* Nonzero iff the typed-based alias set for this type has been
2219e4b17023SJohn Marino    calculated.  */
2220e4b17023SJohn Marino #define TYPE_ALIAS_SET_KNOWN_P(NODE) \
2221e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.alias_set != -1)
2222e4b17023SJohn Marino 
2223e4b17023SJohn Marino /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
2224e4b17023SJohn Marino    to this type.  */
2225e4b17023SJohn Marino #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
2226e4b17023SJohn Marino 
2227e4b17023SJohn Marino /* The alignment necessary for objects of this type.
2228e4b17023SJohn Marino    The value is an int, measured in bits.  */
2229e4b17023SJohn Marino #define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align)
2230e4b17023SJohn Marino 
2231e4b17023SJohn Marino /* 1 if the alignment for this type was requested by "aligned" attribute,
2232e4b17023SJohn Marino    0 if it is the default for this type.  */
2233e4b17023SJohn Marino #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->base.user_align)
2234e4b17023SJohn Marino 
2235e4b17023SJohn Marino /* The alignment for NODE, in bytes.  */
2236e4b17023SJohn Marino #define TYPE_ALIGN_UNIT(NODE) (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
2237e4b17023SJohn Marino 
2238e4b17023SJohn Marino /* If your language allows you to declare types, and you want debug info
2239e4b17023SJohn Marino    for them, then you need to generate corresponding TYPE_DECL nodes.
2240e4b17023SJohn Marino    These "stub" TYPE_DECL nodes have no name, and simply point at the
2241e4b17023SJohn Marino    type node.  You then set the TYPE_STUB_DECL field of the type node
2242e4b17023SJohn Marino    to point back at the TYPE_DECL node.  This allows the debug routines
2243e4b17023SJohn Marino    to know that the two nodes represent the same type, so that we only
2244e4b17023SJohn Marino    get one debug info record for them.  */
2245e4b17023SJohn Marino #define TYPE_STUB_DECL(NODE) (TREE_CHAIN (TYPE_CHECK (NODE)))
2246e4b17023SJohn Marino 
2247e4b17023SJohn Marino /* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
2248e4b17023SJohn Marino    has BLKmode only because it lacks the alignment requirement for
2249e4b17023SJohn Marino    its size.  */
2250e4b17023SJohn Marino #define TYPE_NO_FORCE_BLK(NODE) \
2251e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
2252e4b17023SJohn Marino 
2253e4b17023SJohn Marino /* In an INTEGER_TYPE, it means the type represents a size.  We use
2254e4b17023SJohn Marino    this both for validity checking and to permit optimizations that
2255e4b17023SJohn Marino    are unsafe for other types.  Note that the C `size_t' type should
2256e4b17023SJohn Marino    *not* have this flag set.  The `size_t' type is simply a typedef
2257e4b17023SJohn Marino    for an ordinary integer type that happens to be the type of an
2258e4b17023SJohn Marino    expression returned by `sizeof'; `size_t' has no special
2259e4b17023SJohn Marino    properties.  Expressions whose type have TYPE_IS_SIZETYPE set are
2260e4b17023SJohn Marino    always actual sizes.  */
2261e4b17023SJohn Marino #define TYPE_IS_SIZETYPE(NODE) \
2262e4b17023SJohn Marino   (INTEGER_TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
2263e4b17023SJohn Marino 
2264e4b17023SJohn Marino /* Nonzero in a type considered volatile as a whole.  */
2265e4b17023SJohn Marino #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
2266e4b17023SJohn Marino 
2267e4b17023SJohn Marino /* Means this type is const-qualified.  */
2268e4b17023SJohn Marino #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
2269e4b17023SJohn Marino 
2270e4b17023SJohn Marino /* If nonzero, this type is `restrict'-qualified, in the C sense of
2271e4b17023SJohn Marino    the term.  */
2272e4b17023SJohn Marino #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type_common.restrict_flag)
2273e4b17023SJohn Marino 
2274e4b17023SJohn Marino /* If nonzero, type's name shouldn't be emitted into debug info.  */
2275e4b17023SJohn Marino #define TYPE_NAMELESS(NODE) (TYPE_CHECK (NODE)->base.nameless_flag)
2276e4b17023SJohn Marino 
2277e4b17023SJohn Marino /* The address space the type is in.  */
2278e4b17023SJohn Marino #define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.address_space)
2279e4b17023SJohn Marino 
2280e4b17023SJohn Marino /* There is a TYPE_QUAL value for each type qualifier.  They can be
2281e4b17023SJohn Marino    combined by bitwise-or to form the complete set of qualifiers for a
2282e4b17023SJohn Marino    type.  */
2283e4b17023SJohn Marino enum cv_qualifier
2284e4b17023SJohn Marino   {
2285e4b17023SJohn Marino     TYPE_UNQUALIFIED   = 0x0,
2286e4b17023SJohn Marino     TYPE_QUAL_CONST    = 0x1,
2287e4b17023SJohn Marino     TYPE_QUAL_VOLATILE = 0x2,
2288e4b17023SJohn Marino     TYPE_QUAL_RESTRICT = 0x4
2289e4b17023SJohn Marino   };
2290e4b17023SJohn Marino 
2291e4b17023SJohn Marino /* Encode/decode the named memory support as part of the qualifier.  If more
2292e4b17023SJohn Marino    than 8 qualifiers are added, these macros need to be adjusted.  */
2293e4b17023SJohn Marino #define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
2294e4b17023SJohn Marino #define DECODE_QUAL_ADDR_SPACE(X) (((X) >> 8) & 0xFF)
2295e4b17023SJohn Marino 
2296e4b17023SJohn Marino /* Return all qualifiers except for the address space qualifiers.  */
2297e4b17023SJohn Marino #define CLEAR_QUAL_ADDR_SPACE(X) ((X) & ~0xFF00)
2298e4b17023SJohn Marino 
2299e4b17023SJohn Marino /* Only keep the address space out of the qualifiers and discard the other
2300e4b17023SJohn Marino    qualifiers.  */
2301e4b17023SJohn Marino #define KEEP_QUAL_ADDR_SPACE(X) ((X) & 0xFF00)
2302e4b17023SJohn Marino 
2303e4b17023SJohn Marino /* The set of type qualifiers for this type.  */
2304e4b17023SJohn Marino #define TYPE_QUALS(NODE)					\
2305e4b17023SJohn Marino   ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST)		\
2306e4b17023SJohn Marino 	  | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE)		\
2307e4b17023SJohn Marino 	  | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)		\
2308e4b17023SJohn Marino 	  | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE)))))
2309e4b17023SJohn Marino 
2310e4b17023SJohn Marino /* The same as TYPE_QUALS without the address space qualifications.  */
2311e4b17023SJohn Marino #define TYPE_QUALS_NO_ADDR_SPACE(NODE)				\
2312e4b17023SJohn Marino   ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST)		\
2313e4b17023SJohn Marino 	  | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE)		\
2314e4b17023SJohn Marino 	  | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
2315e4b17023SJohn Marino 
2316e4b17023SJohn Marino /* These flags are available for each language front end to use internally.  */
2317e4b17023SJohn Marino #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)
2318e4b17023SJohn Marino #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_1)
2319e4b17023SJohn Marino #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_2)
2320e4b17023SJohn Marino #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_3)
2321e4b17023SJohn Marino #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_4)
2322e4b17023SJohn Marino #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_5)
2323e4b17023SJohn Marino #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_6)
2324e4b17023SJohn Marino 
2325e4b17023SJohn Marino /* Used to keep track of visited nodes in tree traversals.  This is set to
2326e4b17023SJohn Marino    0 by copy_node and make_node.  */
2327e4b17023SJohn Marino #define TREE_VISITED(NODE) ((NODE)->base.visited)
2328e4b17023SJohn Marino 
2329e4b17023SJohn Marino /* If set in an ARRAY_TYPE, indicates a string type (for languages
2330e4b17023SJohn Marino    that distinguish string from array of char).
2331e4b17023SJohn Marino    If set in a INTEGER_TYPE, indicates a character type.  */
2332e4b17023SJohn Marino #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type_common.string_flag)
2333e4b17023SJohn Marino 
2334e4b17023SJohn Marino /* For a VECTOR_TYPE, this is the number of sub-parts of the vector.  */
2335e4b17023SJohn Marino #define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
2336e4b17023SJohn Marino   (((unsigned HOST_WIDE_INT) 1) \
2337e4b17023SJohn Marino    << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision)
2338e4b17023SJohn Marino 
2339e4b17023SJohn Marino /* Set precision to n when we have 2^n sub-parts of the vector.  */
2340e4b17023SJohn Marino #define SET_TYPE_VECTOR_SUBPARTS(VECTOR_TYPE, X) \
2341e4b17023SJohn Marino   (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision = exact_log2 (X))
2342e4b17023SJohn Marino 
2343e4b17023SJohn Marino /* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
2344e4b17023SJohn Marino    about missing conversions to other vector types of the same size.  */
2345e4b17023SJohn Marino #define TYPE_VECTOR_OPAQUE(NODE) \
2346e4b17023SJohn Marino   (VECTOR_TYPE_CHECK (NODE)->base.default_def_flag)
2347e4b17023SJohn Marino 
2348e4b17023SJohn Marino /* Indicates that objects of this type must be initialized by calling a
2349e4b17023SJohn Marino    function when they are created.  */
2350e4b17023SJohn Marino #define TYPE_NEEDS_CONSTRUCTING(NODE) \
2351e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.needs_constructing_flag)
2352e4b17023SJohn Marino 
2353e4b17023SJohn Marino /* Indicates that a UNION_TYPE object should be passed the same way that
2354e4b17023SJohn Marino    the first union alternative would be passed, or that a RECORD_TYPE
2355e4b17023SJohn Marino    object should be passed the same way that the first (and only) member
2356e4b17023SJohn Marino    would be passed.  */
2357e4b17023SJohn Marino #define TYPE_TRANSPARENT_AGGR(NODE) \
2358e4b17023SJohn Marino   (RECORD_OR_UNION_CHECK (NODE)->type_common.transparent_aggr_flag)
2359e4b17023SJohn Marino 
2360e4b17023SJohn Marino /* For an ARRAY_TYPE, indicates that it is not permitted to take the
2361e4b17023SJohn Marino    address of a component of the type.  This is the counterpart of
2362e4b17023SJohn Marino    DECL_NONADDRESSABLE_P for arrays, see the definition of this flag.  */
2363e4b17023SJohn Marino #define TYPE_NONALIASED_COMPONENT(NODE) \
2364e4b17023SJohn Marino   (ARRAY_TYPE_CHECK (NODE)->type_common.transparent_aggr_flag)
2365e4b17023SJohn Marino 
2366e4b17023SJohn Marino /* Indicated that objects of this type should be laid out in as
2367e4b17023SJohn Marino    compact a way as possible.  */
2368e4b17023SJohn Marino #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->base.packed_flag)
2369e4b17023SJohn Marino 
2370e4b17023SJohn Marino /* Used by type_contains_placeholder_p to avoid recomputation.
2371e4b17023SJohn Marino    Values are: 0 (unknown), 1 (false), 2 (true).  Never access
2372e4b17023SJohn Marino    this field directly.  */
2373e4b17023SJohn Marino #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
2374e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.contains_placeholder_bits)
2375e4b17023SJohn Marino 
2376e4b17023SJohn Marino /* The debug output functions use the symtab union field to store
2377e4b17023SJohn Marino    information specific to the debugging format.  The different debug
2378e4b17023SJohn Marino    output hooks store different types in the union field.  These three
2379e4b17023SJohn Marino    macros are used to access different fields in the union.  The debug
2380e4b17023SJohn Marino    hooks are responsible for consistently using only a specific
2381e4b17023SJohn Marino    macro.  */
2382e4b17023SJohn Marino 
2383e4b17023SJohn Marino /* Symtab field as an integer.  Used by stabs generator in dbxout.c to
2384e4b17023SJohn Marino    hold the type's number in the generated stabs.  */
2385e4b17023SJohn Marino #define TYPE_SYMTAB_ADDRESS(NODE) \
2386e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.symtab.address)
2387e4b17023SJohn Marino 
2388e4b17023SJohn Marino /* Symtab field as a string.  Used by COFF generator in sdbout.c to
2389e4b17023SJohn Marino    hold struct/union type tag names.  */
2390e4b17023SJohn Marino #define TYPE_SYMTAB_POINTER(NODE) \
2391e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.symtab.pointer)
2392e4b17023SJohn Marino 
2393e4b17023SJohn Marino /* Symtab field as a pointer to a DWARF DIE.  Used by DWARF generator
2394e4b17023SJohn Marino    in dwarf2out.c to point to the DIE generated for the type.  */
2395e4b17023SJohn Marino #define TYPE_SYMTAB_DIE(NODE) \
2396e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_common.symtab.die)
2397e4b17023SJohn Marino 
2398e4b17023SJohn Marino /* The garbage collector needs to know the interpretation of the
2399e4b17023SJohn Marino    symtab field.  These constants represent the different types in the
2400e4b17023SJohn Marino    union.  */
2401e4b17023SJohn Marino 
2402e4b17023SJohn Marino #define TYPE_SYMTAB_IS_ADDRESS (0)
2403e4b17023SJohn Marino #define TYPE_SYMTAB_IS_POINTER (1)
2404e4b17023SJohn Marino #define TYPE_SYMTAB_IS_DIE (2)
2405e4b17023SJohn Marino 
2406e4b17023SJohn Marino struct die_struct;
2407e4b17023SJohn Marino 
2408e4b17023SJohn Marino struct GTY(()) tree_type_common {
2409e4b17023SJohn Marino   struct tree_common common;
2410e4b17023SJohn Marino   tree size;
2411e4b17023SJohn Marino   tree size_unit;
2412e4b17023SJohn Marino   tree attributes;
2413e4b17023SJohn Marino   unsigned int uid;
2414e4b17023SJohn Marino 
2415e4b17023SJohn Marino   unsigned int precision : 10;
2416e4b17023SJohn Marino   unsigned no_force_blk_flag : 1;
2417e4b17023SJohn Marino   unsigned needs_constructing_flag : 1;
2418e4b17023SJohn Marino   unsigned transparent_aggr_flag : 1;
2419e4b17023SJohn Marino   unsigned restrict_flag : 1;
2420e4b17023SJohn Marino   unsigned contains_placeholder_bits : 2;
2421e4b17023SJohn Marino 
2422e4b17023SJohn Marino   ENUM_BITFIELD(machine_mode) mode : 8;
2423e4b17023SJohn Marino 
2424e4b17023SJohn Marino   unsigned string_flag : 1;
2425e4b17023SJohn Marino   unsigned lang_flag_0 : 1;
2426e4b17023SJohn Marino   unsigned lang_flag_1 : 1;
2427e4b17023SJohn Marino   unsigned lang_flag_2 : 1;
2428e4b17023SJohn Marino   unsigned lang_flag_3 : 1;
2429e4b17023SJohn Marino   unsigned lang_flag_4 : 1;
2430e4b17023SJohn Marino   unsigned lang_flag_5 : 1;
2431e4b17023SJohn Marino   unsigned lang_flag_6 : 1;
2432e4b17023SJohn Marino 
2433e4b17023SJohn Marino   unsigned int align;
2434e4b17023SJohn Marino   alias_set_type alias_set;
2435e4b17023SJohn Marino   tree pointer_to;
2436e4b17023SJohn Marino   tree reference_to;
2437e4b17023SJohn Marino   union tree_type_symtab {
2438e4b17023SJohn Marino     int GTY ((tag ("TYPE_SYMTAB_IS_ADDRESS"))) address;
2439e4b17023SJohn Marino     const char * GTY ((tag ("TYPE_SYMTAB_IS_POINTER"))) pointer;
2440e4b17023SJohn Marino     struct die_struct * GTY ((tag ("TYPE_SYMTAB_IS_DIE"))) die;
2441e4b17023SJohn Marino   } GTY ((desc ("debug_hooks->tree_type_symtab_field"))) symtab;
2442e4b17023SJohn Marino   tree name;
2443e4b17023SJohn Marino   tree next_variant;
2444e4b17023SJohn Marino   tree main_variant;
2445e4b17023SJohn Marino   tree context;
2446e4b17023SJohn Marino   tree canonical;
2447e4b17023SJohn Marino };
2448e4b17023SJohn Marino 
2449e4b17023SJohn Marino #define TYPE_LANG_SPECIFIC(NODE) \
2450e4b17023SJohn Marino   (TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
2451e4b17023SJohn Marino 
2452e4b17023SJohn Marino struct GTY(()) tree_type_with_lang_specific {
2453e4b17023SJohn Marino   struct tree_type_common common;
2454e4b17023SJohn Marino   /* Points to a structure whose details depend on the language in use.  */
2455e4b17023SJohn Marino   struct lang_type *lang_specific;
2456e4b17023SJohn Marino };
2457e4b17023SJohn Marino 
2458e4b17023SJohn Marino #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type_non_common.values)
2459e4b17023SJohn Marino #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type_non_common.values)
2460e4b17023SJohn Marino #define TYPE_FIELDS(NODE) \
2461e4b17023SJohn Marino   (RECORD_OR_UNION_CHECK (NODE)->type_non_common.values)
2462e4b17023SJohn Marino #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type_non_common.values)
2463e4b17023SJohn Marino #define TYPE_ARG_TYPES(NODE) \
2464e4b17023SJohn Marino   (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.values)
2465e4b17023SJohn Marino #define TYPE_VALUES_RAW(NODE) (TYPE_CHECK(NODE)->type_non_common.values)
2466e4b17023SJohn Marino 
2467e4b17023SJohn Marino #define TYPE_METHODS(NODE) \
2468e4b17023SJohn Marino   (RECORD_OR_UNION_CHECK (NODE)->type_non_common.maxval)
2469e4b17023SJohn Marino #define TYPE_VFIELD(NODE) \
2470e4b17023SJohn Marino   (RECORD_OR_UNION_CHECK (NODE)->type_non_common.minval)
2471e4b17023SJohn Marino #define TYPE_METHOD_BASETYPE(NODE) \
2472e4b17023SJohn Marino   (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.maxval)
2473e4b17023SJohn Marino #define TYPE_OFFSET_BASETYPE(NODE) \
2474e4b17023SJohn Marino   (OFFSET_TYPE_CHECK (NODE)->type_non_common.maxval)
2475e4b17023SJohn Marino #define TYPE_MAXVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.maxval)
2476e4b17023SJohn Marino #define TYPE_MINVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.minval)
2477e4b17023SJohn Marino #define TYPE_NEXT_PTR_TO(NODE) \
2478e4b17023SJohn Marino   (POINTER_TYPE_CHECK (NODE)->type_non_common.minval)
2479e4b17023SJohn Marino #define TYPE_NEXT_REF_TO(NODE) \
2480e4b17023SJohn Marino   (REFERENCE_TYPE_CHECK (NODE)->type_non_common.minval)
2481e4b17023SJohn Marino #define TYPE_MIN_VALUE(NODE) \
2482e4b17023SJohn Marino   (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.minval)
2483e4b17023SJohn Marino #define TYPE_MAX_VALUE(NODE) \
2484e4b17023SJohn Marino   (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.maxval)
2485e4b17023SJohn Marino 
2486e4b17023SJohn Marino /* If non-NULL, this is an upper bound of the size (in bytes) of an
2487e4b17023SJohn Marino    object of the given ARRAY_TYPE_NON_COMMON.  This allows temporaries to be
2488e4b17023SJohn Marino    allocated.  */
2489e4b17023SJohn Marino #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
2490e4b17023SJohn Marino   (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type_non_common.maxval)
2491e4b17023SJohn Marino 
2492e4b17023SJohn Marino /* For record and union types, information about this type, as a base type
2493e4b17023SJohn Marino    for itself.  */
2494e4b17023SJohn Marino #define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK(NODE)->type_non_common.binfo)
2495e4b17023SJohn Marino 
2496e4b17023SJohn Marino /* For non record and union types, used in a language-dependent way.  */
2497e4b17023SJohn Marino #define TYPE_LANG_SLOT_1(NODE) \
2498e4b17023SJohn Marino   (NOT_RECORD_OR_UNION_CHECK(NODE)->type_non_common.binfo)
2499e4b17023SJohn Marino 
2500e4b17023SJohn Marino struct GTY(()) tree_type_non_common {
2501e4b17023SJohn Marino   struct tree_type_with_lang_specific with_lang_specific;
2502e4b17023SJohn Marino   tree values;
2503e4b17023SJohn Marino   tree minval;
2504e4b17023SJohn Marino   tree maxval;
2505e4b17023SJohn Marino   tree binfo;
2506e4b17023SJohn Marino };
2507e4b17023SJohn Marino 
2508e4b17023SJohn Marino /* Define accessor macros for information about type inheritance
2509e4b17023SJohn Marino    and basetypes.
2510e4b17023SJohn Marino 
2511e4b17023SJohn Marino    A "basetype" means a particular usage of a data type for inheritance
2512e4b17023SJohn Marino    in another type.  Each such basetype usage has its own "binfo"
2513e4b17023SJohn Marino    object to describe it.  The binfo object is a TREE_VEC node.
2514e4b17023SJohn Marino 
2515e4b17023SJohn Marino    Inheritance is represented by the binfo nodes allocated for a
2516e4b17023SJohn Marino    given type.  For example, given types C and D, such that D is
2517e4b17023SJohn Marino    inherited by C, 3 binfo nodes will be allocated: one for describing
2518e4b17023SJohn Marino    the binfo properties of C, similarly one for D, and one for
2519e4b17023SJohn Marino    describing the binfo properties of D as a base type for C.
2520e4b17023SJohn Marino    Thus, given a pointer to class C, one can get a pointer to the binfo
2521e4b17023SJohn Marino    of D acting as a basetype for C by looking at C's binfo's basetypes.  */
2522e4b17023SJohn Marino 
2523e4b17023SJohn Marino /* BINFO specific flags.  */
2524e4b17023SJohn Marino 
2525e4b17023SJohn Marino /* Nonzero means that the derivation chain is via a `virtual' declaration.  */
2526e4b17023SJohn Marino #define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->base.static_flag)
2527e4b17023SJohn Marino 
2528e4b17023SJohn Marino /* Flags for language dependent use.  */
2529e4b17023SJohn Marino #define BINFO_MARKED(NODE) TREE_LANG_FLAG_0(TREE_BINFO_CHECK(NODE))
2530e4b17023SJohn Marino #define BINFO_FLAG_1(NODE) TREE_LANG_FLAG_1(TREE_BINFO_CHECK(NODE))
2531e4b17023SJohn Marino #define BINFO_FLAG_2(NODE) TREE_LANG_FLAG_2(TREE_BINFO_CHECK(NODE))
2532e4b17023SJohn Marino #define BINFO_FLAG_3(NODE) TREE_LANG_FLAG_3(TREE_BINFO_CHECK(NODE))
2533e4b17023SJohn Marino #define BINFO_FLAG_4(NODE) TREE_LANG_FLAG_4(TREE_BINFO_CHECK(NODE))
2534e4b17023SJohn Marino #define BINFO_FLAG_5(NODE) TREE_LANG_FLAG_5(TREE_BINFO_CHECK(NODE))
2535e4b17023SJohn Marino #define BINFO_FLAG_6(NODE) TREE_LANG_FLAG_6(TREE_BINFO_CHECK(NODE))
2536e4b17023SJohn Marino 
2537e4b17023SJohn Marino /* The actual data type node being inherited in this basetype.  */
2538e4b17023SJohn Marino #define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK(NODE))
2539e4b17023SJohn Marino 
2540e4b17023SJohn Marino /* The offset where this basetype appears in its containing type.
2541e4b17023SJohn Marino    BINFO_OFFSET slot holds the offset (in bytes)
2542e4b17023SJohn Marino    from the base of the complete object to the base of the part of the
2543e4b17023SJohn Marino    object that is allocated on behalf of this `type'.
2544e4b17023SJohn Marino    This is always 0 except when there is multiple inheritance.  */
2545e4b17023SJohn Marino 
2546e4b17023SJohn Marino #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK(NODE)->binfo.offset)
2547e4b17023SJohn Marino #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
2548e4b17023SJohn Marino 
2549e4b17023SJohn Marino /* The virtual function table belonging to this basetype.  Virtual
2550e4b17023SJohn Marino    function tables provide a mechanism for run-time method dispatching.
2551e4b17023SJohn Marino    The entries of a virtual function table are language-dependent.  */
2552e4b17023SJohn Marino 
2553e4b17023SJohn Marino #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtable)
2554e4b17023SJohn Marino 
2555e4b17023SJohn Marino /* The virtual functions in the virtual function table.  This is
2556e4b17023SJohn Marino    a TREE_LIST that is used as an initial approximation for building
2557e4b17023SJohn Marino    a virtual function table for this basetype.  */
2558e4b17023SJohn Marino #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK(NODE)->binfo.virtuals)
2559e4b17023SJohn Marino 
2560e4b17023SJohn Marino /* A vector of binfos for the direct basetypes inherited by this
2561e4b17023SJohn Marino    basetype.
2562e4b17023SJohn Marino 
2563e4b17023SJohn Marino    If this basetype describes type D as inherited in C, and if the
2564e4b17023SJohn Marino    basetypes of D are E and F, then this vector contains binfos for
2565e4b17023SJohn Marino    inheritance of E and F by C.  */
2566e4b17023SJohn Marino #define BINFO_BASE_BINFOS(NODE) (&TREE_BINFO_CHECK(NODE)->binfo.base_binfos)
2567e4b17023SJohn Marino 
2568e4b17023SJohn Marino /* The number of basetypes for NODE.  */
2569e4b17023SJohn Marino #define BINFO_N_BASE_BINFOS(NODE) (VEC_length (tree, BINFO_BASE_BINFOS (NODE)))
2570e4b17023SJohn Marino 
2571e4b17023SJohn Marino /* Accessor macro to get to the Nth base binfo of this binfo.  */
2572e4b17023SJohn Marino #define BINFO_BASE_BINFO(NODE,N) \
2573e4b17023SJohn Marino  (VEC_index (tree, BINFO_BASE_BINFOS (NODE), (N)))
2574e4b17023SJohn Marino #define BINFO_BASE_ITERATE(NODE,N,B) \
2575e4b17023SJohn Marino  (VEC_iterate (tree, BINFO_BASE_BINFOS (NODE), (N), (B)))
2576e4b17023SJohn Marino #define BINFO_BASE_APPEND(NODE,T) \
2577e4b17023SJohn Marino  (VEC_quick_push (tree, BINFO_BASE_BINFOS (NODE), (T)))
2578e4b17023SJohn Marino 
2579e4b17023SJohn Marino /* For a BINFO record describing a virtual base class, i.e., one where
2580e4b17023SJohn Marino    TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
2581e4b17023SJohn Marino    base.  The actual contents are language-dependent.  In the C++
2582e4b17023SJohn Marino    front-end this field is an INTEGER_CST giving an offset into the
2583e4b17023SJohn Marino    vtable where the offset to the virtual base can be found.  */
2584e4b17023SJohn Marino #define BINFO_VPTR_FIELD(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vptr_field)
2585e4b17023SJohn Marino 
2586e4b17023SJohn Marino /* Indicates the accesses this binfo has to its bases. The values are
2587e4b17023SJohn Marino    access_public_node, access_protected_node or access_private_node.
2588e4b17023SJohn Marino    If this array is not present, public access is implied.  */
2589e4b17023SJohn Marino #define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses)
2590e4b17023SJohn Marino 
2591e4b17023SJohn Marino #define BINFO_BASE_ACCESS(NODE,N) \
2592e4b17023SJohn Marino   VEC_index (tree, BINFO_BASE_ACCESSES (NODE), (N))
2593e4b17023SJohn Marino #define BINFO_BASE_ACCESS_APPEND(NODE,T) \
2594e4b17023SJohn Marino   VEC_quick_push (tree, BINFO_BASE_ACCESSES (NODE), (T))
2595e4b17023SJohn Marino 
2596e4b17023SJohn Marino /* The index in the VTT where this subobject's sub-VTT can be found.
2597e4b17023SJohn Marino    NULL_TREE if there is no sub-VTT.  */
2598e4b17023SJohn Marino #define BINFO_SUBVTT_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_subvtt)
2599e4b17023SJohn Marino 
2600e4b17023SJohn Marino /* The index in the VTT where the vptr for this subobject can be
2601e4b17023SJohn Marino    found.  NULL_TREE if there is no secondary vptr in the VTT.  */
2602e4b17023SJohn Marino #define BINFO_VPTR_INDEX(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtt_vptr)
2603e4b17023SJohn Marino 
2604e4b17023SJohn Marino /* The BINFO_INHERITANCE_CHAIN points at the binfo for the base
2605e4b17023SJohn Marino    inheriting this base for non-virtual bases. For virtual bases it
2606e4b17023SJohn Marino    points either to the binfo for which this is a primary binfo, or to
2607e4b17023SJohn Marino    the binfo of the most derived type.  */
2608e4b17023SJohn Marino #define BINFO_INHERITANCE_CHAIN(NODE) \
2609e4b17023SJohn Marino 	(TREE_BINFO_CHECK(NODE)->binfo.inheritance)
2610e4b17023SJohn Marino 
2611e4b17023SJohn Marino struct GTY (()) tree_binfo {
2612e4b17023SJohn Marino   struct tree_common common;
2613e4b17023SJohn Marino 
2614e4b17023SJohn Marino   tree offset;
2615e4b17023SJohn Marino   tree vtable;
2616e4b17023SJohn Marino   tree virtuals;
2617e4b17023SJohn Marino   tree vptr_field;
2618e4b17023SJohn Marino   VEC(tree,gc) *base_accesses;
2619e4b17023SJohn Marino   tree inheritance;
2620e4b17023SJohn Marino 
2621e4b17023SJohn Marino   tree vtt_subvtt;
2622e4b17023SJohn Marino   tree vtt_vptr;
2623e4b17023SJohn Marino 
2624e4b17023SJohn Marino   VEC(tree,none) base_binfos;
2625e4b17023SJohn Marino };
2626e4b17023SJohn Marino 
2627e4b17023SJohn Marino 
2628e4b17023SJohn Marino /* Define fields and accessors for nodes representing declared names.  */
2629e4b17023SJohn Marino 
2630e4b17023SJohn Marino /* Nonzero if DECL represents a variable for the SSA passes.  */
2631e4b17023SJohn Marino #define SSA_VAR_P(DECL)							\
2632e4b17023SJohn Marino 	(TREE_CODE (DECL) == VAR_DECL					\
2633e4b17023SJohn Marino 	 || TREE_CODE (DECL) == PARM_DECL				\
2634e4b17023SJohn Marino 	 || TREE_CODE (DECL) == RESULT_DECL				\
2635e4b17023SJohn Marino 	 || (TREE_CODE (DECL) == SSA_NAME				\
2636e4b17023SJohn Marino 	     && (TREE_CODE (SSA_NAME_VAR (DECL)) == VAR_DECL		\
2637e4b17023SJohn Marino 		 || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL	\
2638e4b17023SJohn Marino 		 || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL)))
2639e4b17023SJohn Marino 
2640e4b17023SJohn Marino 
2641e4b17023SJohn Marino 
2642e4b17023SJohn Marino 
2643e4b17023SJohn Marino /* Enumerate visibility settings.  */
2644e4b17023SJohn Marino #ifndef SYMBOL_VISIBILITY_DEFINED
2645e4b17023SJohn Marino #define SYMBOL_VISIBILITY_DEFINED
2646e4b17023SJohn Marino enum symbol_visibility
2647e4b17023SJohn Marino {
2648e4b17023SJohn Marino   VISIBILITY_DEFAULT,
2649e4b17023SJohn Marino   VISIBILITY_PROTECTED,
2650e4b17023SJohn Marino   VISIBILITY_HIDDEN,
2651e4b17023SJohn Marino   VISIBILITY_INTERNAL
2652e4b17023SJohn Marino };
2653e4b17023SJohn Marino #endif
2654e4b17023SJohn Marino 
2655e4b17023SJohn Marino struct function;
2656e4b17023SJohn Marino 
2657e4b17023SJohn Marino #define DECL_CHAIN(NODE) (TREE_CHAIN (DECL_MINIMAL_CHECK (NODE)))
2658e4b17023SJohn Marino 
2659e4b17023SJohn Marino /* This is the name of the object as written by the user.
2660e4b17023SJohn Marino    It is an IDENTIFIER_NODE.  */
2661e4b17023SJohn Marino #define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name)
2662e4b17023SJohn Marino 
2663e4b17023SJohn Marino /* Every ..._DECL node gets a unique number.  */
2664e4b17023SJohn Marino #define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
2665e4b17023SJohn Marino 
2666e4b17023SJohn Marino /* DEBUG_EXPR_DECLs get negative UID numbers, to catch erroneous
2667e4b17023SJohn Marino    uses.  */
2668e4b17023SJohn Marino #define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
2669e4b17023SJohn Marino 
2670e4b17023SJohn Marino /* Every ..._DECL node gets a unique number that stays the same even
2671e4b17023SJohn Marino    when the decl is copied by the inliner once it is set.  */
2672e4b17023SJohn Marino #define DECL_PT_UID(NODE) \
2673e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid == -1u \
2674e4b17023SJohn Marino    ? (NODE)->decl_minimal.uid : (NODE)->decl_common.pt_uid)
2675e4b17023SJohn Marino /* Initialize the ..._DECL node pt-uid to the decls uid.  */
2676e4b17023SJohn Marino #define SET_DECL_PT_UID(NODE, UID) \
2677e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid = (UID))
2678e4b17023SJohn Marino /* Whether the ..._DECL node pt-uid has been initialized and thus needs to
2679e4b17023SJohn Marino    be preserved when copyin the decl.  */
2680e4b17023SJohn Marino #define DECL_PT_UID_SET_P(NODE) \
2681e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid != -1u)
2682e4b17023SJohn Marino 
2683e4b17023SJohn Marino /* These two fields describe where in the source code the declaration
2684e4b17023SJohn Marino    was.  If the declaration appears in several places (as for a C
2685e4b17023SJohn Marino    function that is declared first and then defined later), this
2686e4b17023SJohn Marino    information should refer to the definition.  */
2687e4b17023SJohn Marino #define DECL_SOURCE_LOCATION(NODE) \
2688e4b17023SJohn Marino   (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
2689e4b17023SJohn Marino #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
2690e4b17023SJohn Marino #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
2691e4b17023SJohn Marino #define DECL_IS_BUILTIN(DECL) \
2692e4b17023SJohn Marino   (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
2693e4b17023SJohn Marino 
2694e4b17023SJohn Marino /*  For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
2695e4b17023SJohn Marino     QUAL_UNION_TYPE node that the field is a member of.  For VAR_DECL,
2696e4b17023SJohn Marino     PARM_DECL, FUNCTION_DECL, LABEL_DECL, RESULT_DECL, and CONST_DECL
2697e4b17023SJohn Marino     nodes, this points to either the FUNCTION_DECL for the containing
2698e4b17023SJohn Marino     function, the RECORD_TYPE or UNION_TYPE for the containing type, or
2699e4b17023SJohn Marino     NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
2700e4b17023SJohn Marino     scope".  In particular, for VAR_DECLs which are virtual table pointers
2701e4b17023SJohn Marino     (they have DECL_VIRTUAL set), we use DECL_CONTEXT to determine the type
2702e4b17023SJohn Marino     they belong to.  */
2703e4b17023SJohn Marino #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
2704e4b17023SJohn Marino #define DECL_FIELD_CONTEXT(NODE) \
2705e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
2706e4b17023SJohn Marino 
2707e4b17023SJohn Marino /* If nonzero, decl's name shouldn't be emitted into debug info.  */
2708e4b17023SJohn Marino #define DECL_NAMELESS(NODE) (DECL_MINIMAL_CHECK (NODE)->base.nameless_flag)
2709e4b17023SJohn Marino 
2710e4b17023SJohn Marino struct GTY(()) tree_decl_minimal {
2711e4b17023SJohn Marino   struct tree_common common;
2712e4b17023SJohn Marino   location_t locus;
2713e4b17023SJohn Marino   unsigned int uid;
2714e4b17023SJohn Marino   tree name;
2715e4b17023SJohn Marino   tree context;
2716e4b17023SJohn Marino };
2717e4b17023SJohn Marino 
2718e4b17023SJohn Marino 
2719e4b17023SJohn Marino /* For any sort of a ..._DECL node, this points to the original (abstract)
2720e4b17023SJohn Marino    decl node which this decl is an inlined/cloned instance of, or else it
2721e4b17023SJohn Marino    is NULL indicating that this decl is not an instance of some other decl.
2722e4b17023SJohn Marino 
2723e4b17023SJohn Marino    The C front-end also uses this in a nested declaration of an inline
2724e4b17023SJohn Marino    function, to point back to the definition.  */
2725e4b17023SJohn Marino #define DECL_ABSTRACT_ORIGIN(NODE) \
2726e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
2727e4b17023SJohn Marino 
2728e4b17023SJohn Marino /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
2729e4b17023SJohn Marino    origin.  This is useful when setting the DECL_ABSTRACT_ORIGIN.  */
2730e4b17023SJohn Marino #define DECL_ORIGIN(NODE) \
2731e4b17023SJohn Marino   (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE))
2732e4b17023SJohn Marino 
2733e4b17023SJohn Marino /* Nonzero for any sort of ..._DECL node means this decl node represents an
2734e4b17023SJohn Marino    inline instance of some original (abstract) decl from an inline function;
2735e4b17023SJohn Marino    suppress any warnings about shadowing some other variable.  FUNCTION_DECL
2736e4b17023SJohn Marino    nodes can also have their abstract origin set to themselves.  */
2737e4b17023SJohn Marino #define DECL_FROM_INLINE(NODE) \
2738e4b17023SJohn Marino   (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
2739e4b17023SJohn Marino    && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
2740e4b17023SJohn Marino 
2741e4b17023SJohn Marino /* In a DECL this is the field where attributes are stored.  */
2742e4b17023SJohn Marino #define DECL_ATTRIBUTES(NODE) \
2743e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
2744e4b17023SJohn Marino 
2745e4b17023SJohn Marino /* For a FUNCTION_DECL, holds the tree of BINDINGs.
2746e4b17023SJohn Marino    For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
2747e4b17023SJohn Marino    For a VAR_DECL, holds the initial value.
2748e4b17023SJohn Marino    For a PARM_DECL, used for DECL_ARG_TYPE--default
2749e4b17023SJohn Marino    values for parameters are encoded in the type of the function,
2750e4b17023SJohn Marino    not in the PARM_DECL slot.
2751e4b17023SJohn Marino    For a FIELD_DECL, this is used for enumeration values and the C
2752e4b17023SJohn Marino    frontend uses it for temporarily storing bitwidth of bitfields.
2753e4b17023SJohn Marino 
2754e4b17023SJohn Marino    ??? Need to figure out some way to check this isn't a PARM_DECL.  */
2755e4b17023SJohn Marino #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial)
2756e4b17023SJohn Marino 
2757e4b17023SJohn Marino /* Holds the size of the datum, in bits, as a tree expression.
2758e4b17023SJohn Marino    Need not be constant.  */
2759e4b17023SJohn Marino #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
2760e4b17023SJohn Marino /* Likewise for the size in bytes.  */
2761e4b17023SJohn Marino #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
2762e4b17023SJohn Marino /* Holds the alignment required for the datum, in bits.  */
2763e4b17023SJohn Marino #define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
2764e4b17023SJohn Marino /* The alignment of NODE, in bytes.  */
2765e4b17023SJohn Marino #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
2766e4b17023SJohn Marino /* Set if the alignment of this DECL has been set by the user, for
2767e4b17023SJohn Marino    example with an 'aligned' attribute.  */
2768e4b17023SJohn Marino #define DECL_USER_ALIGN(NODE) \
2769e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->base.user_align)
2770e4b17023SJohn Marino /* Holds the machine mode corresponding to the declaration of a variable or
2771e4b17023SJohn Marino    field.  Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
2772e4b17023SJohn Marino    FIELD_DECL.  */
2773e4b17023SJohn Marino #define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
2774e4b17023SJohn Marino 
2775e4b17023SJohn Marino /* For FUNCTION_DECL, if it is built-in, this identifies which built-in
2776e4b17023SJohn Marino    operation it is.  Note, however, that this field is overloaded, with
2777e4b17023SJohn Marino    DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be
2778e4b17023SJohn Marino    checked before any access to the former.  */
2779e4b17023SJohn Marino #define DECL_FUNCTION_CODE(NODE) \
2780e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code)
2781e4b17023SJohn Marino #define DECL_DEBUG_EXPR_IS_FROM(NODE) \
2782e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
2783e4b17023SJohn Marino 
2784e4b17023SJohn Marino #define DECL_FUNCTION_PERSONALITY(NODE) \
2785e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.personality)
2786e4b17023SJohn Marino 
2787e4b17023SJohn Marino /* Nonzero for a given ..._DECL node means that the name of this node should
2788e4b17023SJohn Marino    be ignored for symbolic debug purposes.  For a TYPE_DECL, this means that
2789e4b17023SJohn Marino    the associated type should be ignored.  For a FUNCTION_DECL, the body of
2790e4b17023SJohn Marino    the function should also be ignored.  */
2791e4b17023SJohn Marino #define DECL_IGNORED_P(NODE) \
2792e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
2793e4b17023SJohn Marino 
2794e4b17023SJohn Marino /* Nonzero for a given ..._DECL node means that this node represents an
2795e4b17023SJohn Marino    "abstract instance" of the given declaration (e.g. in the original
2796e4b17023SJohn Marino    declaration of an inline function).  When generating symbolic debugging
2797e4b17023SJohn Marino    information, we mustn't try to generate any address information for nodes
2798e4b17023SJohn Marino    marked as "abstract instances" because we don't actually generate
2799e4b17023SJohn Marino    any code or allocate any data space for such instances.  */
2800e4b17023SJohn Marino #define DECL_ABSTRACT(NODE) \
2801e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
2802e4b17023SJohn Marino 
2803e4b17023SJohn Marino /* Language-specific decl information.  */
2804e4b17023SJohn Marino #define DECL_LANG_SPECIFIC(NODE) \
2805e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
2806e4b17023SJohn Marino 
2807e4b17023SJohn Marino /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
2808e4b17023SJohn Marino    do not allocate storage, and refer to a definition elsewhere.  Note that
2809e4b17023SJohn Marino    this does not necessarily imply the entity represented by NODE
2810e4b17023SJohn Marino    has no program source-level definition in this translation unit.  For
2811e4b17023SJohn Marino    example, for a FUNCTION_DECL, DECL_SAVED_TREE may be non-NULL and
2812e4b17023SJohn Marino    DECL_EXTERNAL may be true simultaneously; that can be the case for
2813e4b17023SJohn Marino    a C99 "extern inline" function.  */
2814e4b17023SJohn Marino #define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_1)
2815e4b17023SJohn Marino 
2816e4b17023SJohn Marino /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
2817e4b17023SJohn Marino    For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
2818e4b17023SJohn Marino 
2819e4b17023SJohn Marino    For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
2820e4b17023SJohn Marino 
2821e4b17023SJohn Marino    Also set in some languages for variables, etc., outside the normal
2822e4b17023SJohn Marino    lexical scope, such as class instance variables.  */
2823e4b17023SJohn Marino #define DECL_NONLOCAL(NODE) \
2824e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
2825e4b17023SJohn Marino 
2826e4b17023SJohn Marino /* Used in VAR_DECLs to indicate that the variable is a vtable.
2827e4b17023SJohn Marino    Used in FIELD_DECLs for vtable pointers.
2828e4b17023SJohn Marino    Used in FUNCTION_DECLs to indicate that the function is virtual.  */
2829e4b17023SJohn Marino #define DECL_VIRTUAL_P(NODE) \
2830e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
2831e4b17023SJohn Marino 
2832e4b17023SJohn Marino /* Used to indicate that this DECL represents a compiler-generated entity.  */
2833e4b17023SJohn Marino #define DECL_ARTIFICIAL(NODE) \
2834e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
2835e4b17023SJohn Marino 
2836e4b17023SJohn Marino /* Additional flags for language-specific uses.  */
2837e4b17023SJohn Marino #define DECL_LANG_FLAG_0(NODE) \
2838e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
2839e4b17023SJohn Marino #define DECL_LANG_FLAG_1(NODE) \
2840e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
2841e4b17023SJohn Marino #define DECL_LANG_FLAG_2(NODE) \
2842e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
2843e4b17023SJohn Marino #define DECL_LANG_FLAG_3(NODE) \
2844e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
2845e4b17023SJohn Marino #define DECL_LANG_FLAG_4(NODE) \
2846e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
2847e4b17023SJohn Marino #define DECL_LANG_FLAG_5(NODE) \
2848e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
2849e4b17023SJohn Marino #define DECL_LANG_FLAG_6(NODE) \
2850e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
2851e4b17023SJohn Marino #define DECL_LANG_FLAG_7(NODE) \
2852e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
2853e4b17023SJohn Marino #define DECL_LANG_FLAG_8(NODE) \
2854e4b17023SJohn Marino   (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_8)
2855e4b17023SJohn Marino 
2856e4b17023SJohn Marino /* Nonzero for a scope which is equal to file scope.  */
2857e4b17023SJohn Marino #define SCOPE_FILE_SCOPE_P(EXP)	\
2858e4b17023SJohn Marino   (! (EXP) || TREE_CODE (EXP) == TRANSLATION_UNIT_DECL)
2859e4b17023SJohn Marino /* Nonzero for a decl which is at file scope.  */
2860e4b17023SJohn Marino #define DECL_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (DECL_CONTEXT (EXP))
2861e4b17023SJohn Marino /* Nonzero for a type which is at file scope.  */
2862e4b17023SJohn Marino #define TYPE_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (TYPE_CONTEXT (EXP))
2863e4b17023SJohn Marino 
2864e4b17023SJohn Marino /* Nonzero for a decl that is decorated using attribute used.
2865e4b17023SJohn Marino    This indicates to compiler tools that this decl needs to be preserved.  */
2866e4b17023SJohn Marino #define DECL_PRESERVE_P(DECL) \
2867e4b17023SJohn Marino   DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
2868e4b17023SJohn Marino 
2869e4b17023SJohn Marino /* For function local variables of COMPLEX and VECTOR types,
2870e4b17023SJohn Marino    indicates that the variable is not aliased, and that all
2871e4b17023SJohn Marino    modifications to the variable have been adjusted so that
2872e4b17023SJohn Marino    they are killing assignments.  Thus the variable may now
2873e4b17023SJohn Marino    be treated as a GIMPLE register, and use real instead of
2874e4b17023SJohn Marino    virtual ops in SSA form.  */
2875e4b17023SJohn Marino #define DECL_GIMPLE_REG_P(DECL) \
2876e4b17023SJohn Marino   DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag
2877e4b17023SJohn Marino 
2878e4b17023SJohn Marino struct GTY(()) tree_decl_common {
2879e4b17023SJohn Marino   struct tree_decl_minimal common;
2880e4b17023SJohn Marino   tree size;
2881e4b17023SJohn Marino 
2882e4b17023SJohn Marino   ENUM_BITFIELD(machine_mode) mode : 8;
2883e4b17023SJohn Marino 
2884e4b17023SJohn Marino   unsigned nonlocal_flag : 1;
2885e4b17023SJohn Marino   unsigned virtual_flag : 1;
2886e4b17023SJohn Marino   unsigned ignored_flag : 1;
2887e4b17023SJohn Marino   unsigned abstract_flag : 1;
2888e4b17023SJohn Marino   unsigned artificial_flag : 1;
2889e4b17023SJohn Marino   unsigned preserve_flag: 1;
2890e4b17023SJohn Marino   unsigned debug_expr_is_from : 1;
2891e4b17023SJohn Marino 
2892e4b17023SJohn Marino   unsigned lang_flag_0 : 1;
2893e4b17023SJohn Marino   unsigned lang_flag_1 : 1;
2894e4b17023SJohn Marino   unsigned lang_flag_2 : 1;
2895e4b17023SJohn Marino   unsigned lang_flag_3 : 1;
2896e4b17023SJohn Marino   unsigned lang_flag_4 : 1;
2897e4b17023SJohn Marino   unsigned lang_flag_5 : 1;
2898e4b17023SJohn Marino   unsigned lang_flag_6 : 1;
2899e4b17023SJohn Marino   unsigned lang_flag_7 : 1;
2900e4b17023SJohn Marino   unsigned lang_flag_8 : 1;
2901e4b17023SJohn Marino 
2902e4b17023SJohn Marino   /* In LABEL_DECL, this is DECL_ERROR_ISSUED.
2903e4b17023SJohn Marino      In VAR_DECL and PARM_DECL, this is DECL_REGISTER.  */
2904e4b17023SJohn Marino   unsigned decl_flag_0 : 1;
2905e4b17023SJohn Marino   /* In FIELD_DECL, this is DECL_BIT_FIELD
2906e4b17023SJohn Marino      In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL.
2907e4b17023SJohn Marino      In TYPE_DECL, this is TYPE_DECL_SUPPRESS_DEBUG.  */
2908e4b17023SJohn Marino   unsigned decl_flag_1 : 1;
2909e4b17023SJohn Marino   /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P
2910e4b17023SJohn Marino      In VAR_DECL, PARM_DECL and RESULT_DECL, this is
2911e4b17023SJohn Marino      DECL_HAS_VALUE_EXPR_P.  */
2912e4b17023SJohn Marino   unsigned decl_flag_2 : 1;
2913e4b17023SJohn Marino   /* Logically, these two would go in a theoretical base shared by var and
2914e4b17023SJohn Marino      parm decl. */
2915e4b17023SJohn Marino   unsigned gimple_reg_flag : 1;
2916e4b17023SJohn Marino   /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_BY_REFERENCE.  */
2917e4b17023SJohn Marino   unsigned decl_by_reference_flag : 1;
2918e4b17023SJohn Marino   /* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_RESTRICTED_P.  */
2919e4b17023SJohn Marino   unsigned decl_restricted_flag : 1;
2920e4b17023SJohn Marino 
2921e4b17023SJohn Marino   /* In VAR_DECL and PARM_DECL set when the decl has been used except for
2922e4b17023SJohn Marino      being set.  */
2923e4b17023SJohn Marino   unsigned decl_read_flag : 1;
2924e4b17023SJohn Marino 
2925e4b17023SJohn Marino   /* In VAR_DECL or RESULT_DECL set when significant code movement precludes
2926e4b17023SJohn Marino      attempting to share the stack slot with some other variable.  */
2927e4b17023SJohn Marino   unsigned decl_nonshareable_flag : 1;
2928e4b17023SJohn Marino 
2929e4b17023SJohn Marino   /* DECL_OFFSET_ALIGN, used only for FIELD_DECLs.  */
2930e4b17023SJohn Marino   unsigned int off_align : 8;
2931e4b17023SJohn Marino 
2932e4b17023SJohn Marino   /* 24-bits unused.  */
2933e4b17023SJohn Marino 
2934e4b17023SJohn Marino   /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
2935e4b17023SJohn Marino   unsigned int align;
2936e4b17023SJohn Marino 
2937e4b17023SJohn Marino   /* UID for points-to sets, stable over copying from inlining.  */
2938e4b17023SJohn Marino   unsigned int pt_uid;
2939e4b17023SJohn Marino 
2940e4b17023SJohn Marino   tree size_unit;
2941e4b17023SJohn Marino   tree initial;
2942e4b17023SJohn Marino   tree attributes;
2943e4b17023SJohn Marino   tree abstract_origin;
2944e4b17023SJohn Marino 
2945e4b17023SJohn Marino   /* Points to a structure whose details depend on the language in use.  */
2946e4b17023SJohn Marino   struct lang_decl *lang_specific;
2947e4b17023SJohn Marino };
2948e4b17023SJohn Marino 
2949e4b17023SJohn Marino extern tree decl_value_expr_lookup (tree);
2950e4b17023SJohn Marino extern void decl_value_expr_insert (tree, tree);
2951e4b17023SJohn Marino 
2952e4b17023SJohn Marino /* In a VAR_DECL or PARM_DECL, the location at which the value may be found,
2953e4b17023SJohn Marino    if transformations have made this more complicated than evaluating the
2954e4b17023SJohn Marino    decl itself.  This should only be used for debugging; once this field has
2955e4b17023SJohn Marino    been set, the decl itself may not legitimately appear in the function.  */
2956e4b17023SJohn Marino #define DECL_HAS_VALUE_EXPR_P(NODE) \
2957e4b17023SJohn Marino   (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, RESULT_DECL) \
2958e4b17023SJohn Marino    ->decl_common.decl_flag_2)
2959e4b17023SJohn Marino #define DECL_VALUE_EXPR(NODE) \
2960e4b17023SJohn Marino   (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
2961e4b17023SJohn Marino #define SET_DECL_VALUE_EXPR(NODE, VAL) \
2962e4b17023SJohn Marino   (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
2963e4b17023SJohn Marino 
2964e4b17023SJohn Marino /* Holds the RTL expression for the value of a variable or function.
2965e4b17023SJohn Marino    This value can be evaluated lazily for functions, variables with
2966e4b17023SJohn Marino    static storage duration, and labels.  */
2967e4b17023SJohn Marino #define DECL_RTL(NODE)					\
2968e4b17023SJohn Marino   (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl		\
2969e4b17023SJohn Marino    ? (NODE)->decl_with_rtl.rtl					\
2970e4b17023SJohn Marino    : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl))
2971e4b17023SJohn Marino 
2972e4b17023SJohn Marino /* Set the DECL_RTL for NODE to RTL.  */
2973e4b17023SJohn Marino #define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL)
2974e4b17023SJohn Marino 
2975e4b17023SJohn Marino /* Returns nonzero if NODE is a tree node that can contain RTL.  */
2976e4b17023SJohn Marino #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
2977e4b17023SJohn Marino 
2978e4b17023SJohn Marino /* Returns nonzero if the DECL_RTL for NODE has already been set.  */
2979e4b17023SJohn Marino #define DECL_RTL_SET_P(NODE) \
2980e4b17023SJohn Marino   (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
2981e4b17023SJohn Marino 
2982e4b17023SJohn Marino /* Copy the RTL from NODE1 to NODE2.  If the RTL was not set for
2983e4b17023SJohn Marino    NODE1, it will not be set for NODE2; this is a lazy copy.  */
2984e4b17023SJohn Marino #define COPY_DECL_RTL(NODE1, NODE2) \
2985e4b17023SJohn Marino   (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl \
2986e4b17023SJohn Marino    = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
2987e4b17023SJohn Marino 
2988e4b17023SJohn Marino /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set.  */
2989e4b17023SJohn Marino #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
2990e4b17023SJohn Marino 
2991e4b17023SJohn Marino #if (GCC_VERSION >= 2007)
2992e4b17023SJohn Marino #define DECL_RTL_KNOWN_SET(decl) __extension__				\
2993e4b17023SJohn Marino ({  tree const __d = (decl);						\
2994e4b17023SJohn Marino     gcc_checking_assert (DECL_RTL_SET_P (__d));				\
2995e4b17023SJohn Marino     /* Dereference it so the compiler knows it can't be NULL even	\
2996e4b17023SJohn Marino        without assertion checking.  */					\
2997e4b17023SJohn Marino     &*DECL_RTL_IF_SET (__d); })
2998e4b17023SJohn Marino #else
2999e4b17023SJohn Marino #define DECL_RTL_KNOWN_SET(decl) (&*DECL_RTL_IF_SET (decl))
3000e4b17023SJohn Marino #endif
3001e4b17023SJohn Marino 
3002e4b17023SJohn Marino /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'.  */
3003e4b17023SJohn Marino #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
3004e4b17023SJohn Marino 
3005e4b17023SJohn Marino struct GTY(()) tree_decl_with_rtl {
3006e4b17023SJohn Marino   struct tree_decl_common common;
3007e4b17023SJohn Marino   rtx rtl;
3008e4b17023SJohn Marino };
3009e4b17023SJohn Marino 
3010e4b17023SJohn Marino /* In a FIELD_DECL, this is the field position, counting in bytes, of the
3011e4b17023SJohn Marino    DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
3012e4b17023SJohn Marino    of the structure.  */
3013e4b17023SJohn Marino #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset)
3014e4b17023SJohn Marino 
3015e4b17023SJohn Marino /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the
3016e4b17023SJohn Marino    field from DECL_FIELD_OFFSET.  This field may be nonzero even for fields
3017e4b17023SJohn Marino    that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
3018e4b17023SJohn Marino    natural alignment of the field's type).  */
3019e4b17023SJohn Marino #define DECL_FIELD_BIT_OFFSET(NODE) \
3020e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
3021e4b17023SJohn Marino 
3022e4b17023SJohn Marino /* In a FIELD_DECL, this indicates whether the field was a bit-field and
3023e4b17023SJohn Marino    if so, the type that was originally specified for it.
3024e4b17023SJohn Marino    TREE_TYPE may have been modified (in finish_struct).  */
3025e4b17023SJohn Marino #define DECL_BIT_FIELD_TYPE(NODE) \
3026e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
3027e4b17023SJohn Marino 
3028e4b17023SJohn Marino /* In a FIELD_DECL of a RECORD_TYPE, this is a pointer to the storage
3029e4b17023SJohn Marino    representative FIELD_DECL.  */
3030e4b17023SJohn Marino #define DECL_BIT_FIELD_REPRESENTATIVE(NODE) \
3031e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
3032e4b17023SJohn Marino 
3033e4b17023SJohn Marino /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
3034e4b17023SJohn Marino    if nonzero, indicates that the field occupies the type.  */
3035e4b17023SJohn Marino #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
3036e4b17023SJohn Marino 
3037e4b17023SJohn Marino /* For FIELD_DECLs, off_align holds the number of low-order bits of
3038e4b17023SJohn Marino    DECL_FIELD_OFFSET which are known to be always zero.
3039e4b17023SJohn Marino    DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
3040e4b17023SJohn Marino    has.  */
3041e4b17023SJohn Marino #define DECL_OFFSET_ALIGN(NODE) \
3042e4b17023SJohn Marino   (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
3043e4b17023SJohn Marino 
3044e4b17023SJohn Marino /* Specify that DECL_ALIGN(NODE) is a multiple of X.  */
3045e4b17023SJohn Marino #define SET_DECL_OFFSET_ALIGN(NODE, X) \
3046e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)
3047e4b17023SJohn Marino 
3048e4b17023SJohn Marino /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
3049e4b17023SJohn Marino    which this FIELD_DECL is defined.  This information is needed when
3050e4b17023SJohn Marino    writing debugging information about vfield and vbase decls for C++.  */
3051e4b17023SJohn Marino #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext)
3052e4b17023SJohn Marino 
3053e4b17023SJohn Marino /* In a FIELD_DECL, indicates this field should be bit-packed.  */
3054e4b17023SJohn Marino #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->base.packed_flag)
3055e4b17023SJohn Marino 
3056e4b17023SJohn Marino /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
3057e4b17023SJohn Marino    specially.  */
3058e4b17023SJohn Marino #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1)
3059e4b17023SJohn Marino 
3060e4b17023SJohn Marino /* Used in a FIELD_DECL to indicate that we cannot form the address of
3061e4b17023SJohn Marino    this component.  This makes it possible for Type-Based Alias Analysis
3062e4b17023SJohn Marino    to disambiguate accesses to this field with indirect accesses using
3063e4b17023SJohn Marino    the field's type:
3064e4b17023SJohn Marino 
3065e4b17023SJohn Marino      struct S { int i; } s;
3066e4b17023SJohn Marino      int *p;
3067e4b17023SJohn Marino 
3068e4b17023SJohn Marino    If the flag is set on 'i', TBAA computes that s.i and *p never conflict.
3069e4b17023SJohn Marino 
3070e4b17023SJohn Marino    From the implementation's viewpoint, the alias set of the type of the
3071e4b17023SJohn Marino    field 'i' (int) will not be recorded as a subset of that of the type of
3072e4b17023SJohn Marino    's' (struct S) in record_component_aliases.  The counterpart is that
3073e4b17023SJohn Marino    accesses to s.i must not be given the alias set of the type of 'i'
3074e4b17023SJohn Marino    (int) but instead directly that of the type of 's' (struct S).  */
3075e4b17023SJohn Marino #define DECL_NONADDRESSABLE_P(NODE) \
3076e4b17023SJohn Marino   (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
3077e4b17023SJohn Marino 
3078e4b17023SJohn Marino struct GTY(()) tree_field_decl {
3079e4b17023SJohn Marino   struct tree_decl_common common;
3080e4b17023SJohn Marino 
3081e4b17023SJohn Marino   tree offset;
3082e4b17023SJohn Marino   tree bit_field_type;
3083e4b17023SJohn Marino   tree qualifier;
3084e4b17023SJohn Marino   tree bit_offset;
3085e4b17023SJohn Marino   tree fcontext;
3086e4b17023SJohn Marino };
3087e4b17023SJohn Marino 
3088e4b17023SJohn Marino /* A numeric unique identifier for a LABEL_DECL.  The UID allocation is
3089e4b17023SJohn Marino    dense, unique within any one function, and may be used to index arrays.
3090e4b17023SJohn Marino    If the value is -1, then no UID has been assigned.  */
3091e4b17023SJohn Marino #define LABEL_DECL_UID(NODE) \
3092e4b17023SJohn Marino   (LABEL_DECL_CHECK (NODE)->label_decl.label_decl_uid)
3093e4b17023SJohn Marino 
3094e4b17023SJohn Marino /* In a LABEL_DECL, the EH region number for which the label is the
3095e4b17023SJohn Marino    post_landing_pad.  */
3096e4b17023SJohn Marino #define EH_LANDING_PAD_NR(NODE) \
3097e4b17023SJohn Marino   (LABEL_DECL_CHECK (NODE)->label_decl.eh_landing_pad_nr)
3098e4b17023SJohn Marino 
3099e4b17023SJohn Marino /* In LABEL_DECL nodes, nonzero means that an error message about
3100e4b17023SJohn Marino    jumping into such a binding contour has been printed for this label.  */
3101e4b17023SJohn Marino #define DECL_ERROR_ISSUED(NODE) \
3102e4b17023SJohn Marino   (LABEL_DECL_CHECK (NODE)->decl_common.decl_flag_0)
3103e4b17023SJohn Marino 
3104e4b17023SJohn Marino struct GTY(()) tree_label_decl {
3105e4b17023SJohn Marino   struct tree_decl_with_rtl common;
3106e4b17023SJohn Marino   int label_decl_uid;
3107e4b17023SJohn Marino   int eh_landing_pad_nr;
3108e4b17023SJohn Marino };
3109e4b17023SJohn Marino 
3110e4b17023SJohn Marino struct var_ann_d;
3111e4b17023SJohn Marino struct GTY(()) tree_result_decl {
3112e4b17023SJohn Marino   struct tree_decl_with_rtl common;
3113e4b17023SJohn Marino   struct var_ann_d *ann;
3114e4b17023SJohn Marino };
3115e4b17023SJohn Marino 
3116e4b17023SJohn Marino struct GTY(()) tree_const_decl {
3117e4b17023SJohn Marino   struct tree_decl_common common;
3118e4b17023SJohn Marino };
3119e4b17023SJohn Marino 
3120e4b17023SJohn Marino /* For a PARM_DECL, records the data type used to pass the argument,
3121e4b17023SJohn Marino    which may be different from the type seen in the program.  */
3122e4b17023SJohn Marino #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
3123e4b17023SJohn Marino 
3124e4b17023SJohn Marino /* For PARM_DECL, holds an RTL for the stack slot or register
3125e4b17023SJohn Marino    where the data was actually passed.  */
3126e4b17023SJohn Marino #define DECL_INCOMING_RTL(NODE) \
3127e4b17023SJohn Marino   (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
3128e4b17023SJohn Marino 
3129e4b17023SJohn Marino struct GTY(()) tree_parm_decl {
3130e4b17023SJohn Marino   struct tree_decl_with_rtl common;
3131e4b17023SJohn Marino   rtx incoming_rtl;
3132e4b17023SJohn Marino   struct var_ann_d *ann;
3133e4b17023SJohn Marino };
3134e4b17023SJohn Marino 
3135e4b17023SJohn Marino 
3136e4b17023SJohn Marino /* Nonzero for a given ..._DECL node means that no warnings should be
3137e4b17023SJohn Marino    generated just because this node is unused.  */
3138e4b17023SJohn Marino #define DECL_IN_SYSTEM_HEADER(NODE) \
3139e4b17023SJohn Marino   (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
3140e4b17023SJohn Marino 
3141e4b17023SJohn Marino /* Used to indicate that the linkage status of this DECL is not yet known,
3142e4b17023SJohn Marino    so it should not be output now.  */
3143e4b17023SJohn Marino #define DECL_DEFER_OUTPUT(NODE) \
3144e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
3145e4b17023SJohn Marino 
3146e4b17023SJohn Marino /* In a VAR_DECL that's static,
3147e4b17023SJohn Marino    nonzero if the space is in the text section.  */
3148e4b17023SJohn Marino #define DECL_IN_TEXT_SECTION(NODE) \
3149e4b17023SJohn Marino   (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
3150e4b17023SJohn Marino 
3151e4b17023SJohn Marino /* In a VAR_DECL that's static,
3152e4b17023SJohn Marino    nonzero if it belongs to the global constant pool.  */
3153e4b17023SJohn Marino #define DECL_IN_CONSTANT_POOL(NODE) \
3154e4b17023SJohn Marino   (VAR_DECL_CHECK (NODE)->decl_with_vis.in_constant_pool)
3155e4b17023SJohn Marino 
3156e4b17023SJohn Marino /* Nonzero for a given ..._DECL node means that this node should be
3157e4b17023SJohn Marino    put in .common, if possible.  If a DECL_INITIAL is given, and it
3158e4b17023SJohn Marino    is not error_mark_node, then the decl cannot be put in .common.  */
3159e4b17023SJohn Marino #define DECL_COMMON(NODE) \
3160e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
3161e4b17023SJohn Marino 
3162e4b17023SJohn Marino /* In a VAR_DECL, nonzero if the decl is a register variable with
3163e4b17023SJohn Marino    an explicit asm specification.  */
3164e4b17023SJohn Marino #define DECL_HARD_REGISTER(NODE)  \
3165e4b17023SJohn Marino   (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
3166e4b17023SJohn Marino 
3167e4b17023SJohn Marino   /* Used to indicate that this DECL has weak linkage.  */
3168e4b17023SJohn Marino #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
3169e4b17023SJohn Marino 
3170e4b17023SJohn Marino /* Used to indicate that the DECL is a dllimport.  */
3171e4b17023SJohn Marino #define DECL_DLLIMPORT_P(NODE) \
3172e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
3173e4b17023SJohn Marino 
3174e4b17023SJohn Marino /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
3175e4b17023SJohn Marino    not be put out unless it is needed in this translation unit.
3176e4b17023SJohn Marino    Entities like this are shared across translation units (like weak
3177e4b17023SJohn Marino    entities), but are guaranteed to be generated by any translation
3178e4b17023SJohn Marino    unit that needs them, and therefore need not be put out anywhere
3179e4b17023SJohn Marino    where they are not needed.  DECL_COMDAT is just a hint to the
3180e4b17023SJohn Marino    back-end; it is up to front-ends which set this flag to ensure
3181e4b17023SJohn Marino    that there will never be any harm, other than bloat, in putting out
3182e4b17023SJohn Marino    something which is DECL_COMDAT.  */
3183e4b17023SJohn Marino #define DECL_COMDAT(NODE) \
3184e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
3185e4b17023SJohn Marino 
3186e4b17023SJohn Marino #define DECL_COMDAT_GROUP(NODE) \
3187e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_group)
3188e4b17023SJohn Marino 
3189e4b17023SJohn Marino /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
3190e4b17023SJohn Marino    multiple translation units should be merged.  */
3191e4b17023SJohn Marino #define DECL_ONE_ONLY(NODE) (DECL_COMDAT_GROUP (NODE) != NULL_TREE)
3192e4b17023SJohn Marino 
3193e4b17023SJohn Marino /* The name of the object as the assembler will see it (but before any
3194e4b17023SJohn Marino    translations made by ASM_OUTPUT_LABELREF).  Often this is the same
3195e4b17023SJohn Marino    as DECL_NAME.  It is an IDENTIFIER_NODE.  */
3196e4b17023SJohn Marino #define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
3197e4b17023SJohn Marino 
3198e4b17023SJohn Marino /* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
3199e4b17023SJohn Marino    This is true of all DECL nodes except FIELD_DECL.  */
3200e4b17023SJohn Marino #define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
3201e4b17023SJohn Marino   (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))
3202e4b17023SJohn Marino 
3203e4b17023SJohn Marino /* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set.  If zero,
3204e4b17023SJohn Marino    the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
3205e4b17023SJohn Marino    yet.  */
3206e4b17023SJohn Marino #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
3207e4b17023SJohn Marino   (HAS_DECL_ASSEMBLER_NAME_P (NODE) \
3208e4b17023SJohn Marino    && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
3209e4b17023SJohn Marino 
3210e4b17023SJohn Marino /* Set the DECL_ASSEMBLER_NAME for NODE to NAME.  */
3211e4b17023SJohn Marino #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
3212e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME))
3213e4b17023SJohn Marino 
3214e4b17023SJohn Marino /* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2.  Note that if DECL1's
3215e4b17023SJohn Marino    DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause
3216e4b17023SJohn Marino    the DECL_ASSEMBLER_NAME of either DECL to be set.  In other words, the
3217e4b17023SJohn Marino    semantics of using this macro, are different than saying:
3218e4b17023SJohn Marino 
3219e4b17023SJohn Marino      SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1))
3220e4b17023SJohn Marino 
3221e4b17023SJohn Marino    which will try to set the DECL_ASSEMBLER_NAME for DECL1.  */
3222e4b17023SJohn Marino 
3223e4b17023SJohn Marino #define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2)				\
3224e4b17023SJohn Marino   (DECL_ASSEMBLER_NAME_SET_P (DECL1)					\
3225e4b17023SJohn Marino    ? (void) SET_DECL_ASSEMBLER_NAME (DECL2,				\
3226e4b17023SJohn Marino 				     DECL_ASSEMBLER_NAME (DECL1))	\
3227e4b17023SJohn Marino    : (void) 0)
3228e4b17023SJohn Marino 
3229e4b17023SJohn Marino /* Records the section name in a section attribute.  Used to pass
3230e4b17023SJohn Marino    the name from decl_attributes to make_function_rtl and make_decl_rtl.  */
3231e4b17023SJohn Marino #define DECL_SECTION_NAME(NODE) \
3232e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name)
3233e4b17023SJohn Marino 
3234e4b17023SJohn Marino /* Nonzero in a decl means that the gimplifier has seen (or placed)
3235e4b17023SJohn Marino    this variable in a BIND_EXPR.  */
3236e4b17023SJohn Marino #define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
3237e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
3238e4b17023SJohn Marino 
3239e4b17023SJohn Marino /* Value of the decls's visibility attribute */
3240e4b17023SJohn Marino #define DECL_VISIBILITY(NODE) \
3241e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
3242e4b17023SJohn Marino 
3243e4b17023SJohn Marino /* Nonzero means that the decl had its visibility specified rather than
3244e4b17023SJohn Marino    being inferred.  */
3245e4b17023SJohn Marino #define DECL_VISIBILITY_SPECIFIED(NODE) \
3246e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
3247e4b17023SJohn Marino 
3248e4b17023SJohn Marino /* In a VAR_DECL, the model to use if the data should be allocated from
3249e4b17023SJohn Marino    thread-local storage.  */
3250e4b17023SJohn Marino #define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model)
3251e4b17023SJohn Marino 
3252e4b17023SJohn Marino /* In a VAR_DECL, nonzero if the data should be allocated from
3253e4b17023SJohn Marino    thread-local storage.  */
3254e4b17023SJohn Marino #define DECL_THREAD_LOCAL_P(NODE) \
3255e4b17023SJohn Marino   (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
3256e4b17023SJohn Marino 
3257e4b17023SJohn Marino /* In a non-local VAR_DECL with static storage duration, true if the
3258e4b17023SJohn Marino    variable has an initialization priority.  If false, the variable
3259e4b17023SJohn Marino    will be initialized at the DEFAULT_INIT_PRIORITY.  */
3260e4b17023SJohn Marino #define DECL_HAS_INIT_PRIORITY_P(NODE) \
3261e4b17023SJohn Marino   (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
3262e4b17023SJohn Marino 
3263e4b17023SJohn Marino /* Specify whether the section name was set by user or by
3264e4b17023SJohn Marino    compiler via -ffunction-sections.  */
3265e4b17023SJohn Marino #define DECL_HAS_IMPLICIT_SECTION_NAME_P(NODE) \
3266e4b17023SJohn Marino   (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.implicit_section_name_p)
3267e4b17023SJohn Marino 
3268e4b17023SJohn Marino struct GTY(()) tree_decl_with_vis {
3269e4b17023SJohn Marino  struct tree_decl_with_rtl common;
3270e4b17023SJohn Marino  tree assembler_name;
3271e4b17023SJohn Marino  tree section_name;
3272e4b17023SJohn Marino  tree comdat_group;
3273e4b17023SJohn Marino 
3274e4b17023SJohn Marino  /* Belong to VAR_DECL exclusively.  */
3275e4b17023SJohn Marino  unsigned defer_output : 1;
3276e4b17023SJohn Marino  unsigned hard_register : 1;
3277e4b17023SJohn Marino  unsigned thread_local : 1;
3278e4b17023SJohn Marino  unsigned common_flag : 1;
3279e4b17023SJohn Marino  unsigned in_text_section : 1;
3280e4b17023SJohn Marino  unsigned in_constant_pool : 1;
3281e4b17023SJohn Marino  unsigned dllimport_flag : 1;
3282e4b17023SJohn Marino  /* Don't belong to VAR_DECL exclusively.  */
3283e4b17023SJohn Marino  unsigned weak_flag : 1;
3284e4b17023SJohn Marino 
3285e4b17023SJohn Marino  unsigned seen_in_bind_expr : 1;
3286e4b17023SJohn Marino  unsigned comdat_flag : 1;
3287e4b17023SJohn Marino  ENUM_BITFIELD(symbol_visibility) visibility : 2;
3288e4b17023SJohn Marino  unsigned visibility_specified : 1;
3289e4b17023SJohn Marino  /* Belongs to VAR_DECL exclusively.  */
3290e4b17023SJohn Marino  ENUM_BITFIELD(tls_model) tls_model : 3;
3291e4b17023SJohn Marino 
3292e4b17023SJohn Marino  /* Belong to FUNCTION_DECL exclusively.  */
3293e4b17023SJohn Marino  unsigned init_priority_p : 1;
3294e4b17023SJohn Marino  /* Used by C++ only.  Might become a generic decl flag.  */
3295e4b17023SJohn Marino  unsigned shadowed_for_var_p : 1;
3296e4b17023SJohn Marino  /* When SECTION_NAME is implied by -ffunsection-section.  */
3297e4b17023SJohn Marino  unsigned implicit_section_name_p : 1;
3298e4b17023SJohn Marino  /* 13 unused bits. */
3299e4b17023SJohn Marino };
3300e4b17023SJohn Marino 
3301e4b17023SJohn Marino extern tree decl_debug_expr_lookup (tree);
3302e4b17023SJohn Marino extern void decl_debug_expr_insert (tree, tree);
3303e4b17023SJohn Marino /* For VAR_DECL, this is set to either an expression that it was split
3304e4b17023SJohn Marino    from (if DECL_DEBUG_EXPR_IS_FROM is true), otherwise a tree_list of
3305e4b17023SJohn Marino    subexpressions that it was split into.  */
3306e4b17023SJohn Marino #define DECL_DEBUG_EXPR(NODE) \
3307e4b17023SJohn Marino   (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE)))
3308e4b17023SJohn Marino 
3309e4b17023SJohn Marino #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
3310e4b17023SJohn Marino   (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
3311e4b17023SJohn Marino 
3312e4b17023SJohn Marino /* An initialization priority.  */
3313e4b17023SJohn Marino typedef unsigned short priority_type;
3314e4b17023SJohn Marino 
3315e4b17023SJohn Marino extern priority_type decl_init_priority_lookup (tree);
3316e4b17023SJohn Marino extern priority_type decl_fini_priority_lookup (tree);
3317e4b17023SJohn Marino extern void decl_init_priority_insert (tree, priority_type);
3318e4b17023SJohn Marino extern void decl_fini_priority_insert (tree, priority_type);
3319e4b17023SJohn Marino 
3320e4b17023SJohn Marino /* For a VAR_DECL or FUNCTION_DECL the initialization priority of
3321e4b17023SJohn Marino    NODE.  */
3322e4b17023SJohn Marino #define DECL_INIT_PRIORITY(NODE) \
3323e4b17023SJohn Marino   (decl_init_priority_lookup (NODE))
3324e4b17023SJohn Marino /* Set the initialization priority for NODE to VAL.  */
3325e4b17023SJohn Marino #define SET_DECL_INIT_PRIORITY(NODE, VAL) \
3326e4b17023SJohn Marino   (decl_init_priority_insert (NODE, VAL))
3327e4b17023SJohn Marino 
3328e4b17023SJohn Marino /* For a FUNCTION_DECL the finalization priority of NODE.  */
3329e4b17023SJohn Marino #define DECL_FINI_PRIORITY(NODE) \
3330e4b17023SJohn Marino   (decl_fini_priority_lookup (NODE))
3331e4b17023SJohn Marino /* Set the finalization priority for NODE to VAL.  */
3332e4b17023SJohn Marino #define SET_DECL_FINI_PRIORITY(NODE, VAL) \
3333e4b17023SJohn Marino   (decl_fini_priority_insert (NODE, VAL))
3334e4b17023SJohn Marino 
3335e4b17023SJohn Marino /* The initialization priority for entities for which no explicit
3336e4b17023SJohn Marino    initialization priority has been specified.  */
3337e4b17023SJohn Marino #define DEFAULT_INIT_PRIORITY 65535
3338e4b17023SJohn Marino 
3339e4b17023SJohn Marino /* The maximum allowed initialization priority.  */
3340e4b17023SJohn Marino #define MAX_INIT_PRIORITY 65535
3341e4b17023SJohn Marino 
3342e4b17023SJohn Marino /* The largest priority value reserved for use by system runtime
3343e4b17023SJohn Marino    libraries.  */
3344e4b17023SJohn Marino #define MAX_RESERVED_INIT_PRIORITY 100
3345e4b17023SJohn Marino 
3346e4b17023SJohn Marino #define DECL_VAR_ANN_PTR(NODE) \
3347e4b17023SJohn Marino   (TREE_CODE (NODE) == VAR_DECL ? &(NODE)->var_decl.ann \
3348e4b17023SJohn Marino    : TREE_CODE (NODE) == PARM_DECL ? &(NODE)->parm_decl.ann \
3349e4b17023SJohn Marino    : TREE_CODE (NODE) == RESULT_DECL ? &(NODE)->result_decl.ann \
3350e4b17023SJohn Marino    : NULL)
3351e4b17023SJohn Marino 
3352e4b17023SJohn Marino struct GTY(()) tree_var_decl {
3353e4b17023SJohn Marino   struct tree_decl_with_vis common;
3354e4b17023SJohn Marino   struct var_ann_d *ann;
3355e4b17023SJohn Marino };
3356e4b17023SJohn Marino 
3357e4b17023SJohn Marino 
3358e4b17023SJohn Marino /* This field is used to reference anything in decl.result and is meant only
3359e4b17023SJohn Marino    for use by the garbage collector.  */
3360e4b17023SJohn Marino #define DECL_RESULT_FLD(NODE) \
3361e4b17023SJohn Marino   (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
3362e4b17023SJohn Marino 
3363e4b17023SJohn Marino /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
3364e4b17023SJohn Marino    Before the struct containing the FUNCTION_DECL is laid out,
3365e4b17023SJohn Marino    DECL_VINDEX may point to a FUNCTION_DECL in a base class which
3366e4b17023SJohn Marino    is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
3367e4b17023SJohn Marino    function.  When the class is laid out, this pointer is changed
3368e4b17023SJohn Marino    to an INTEGER_CST node which is suitable for use as an index
3369e4b17023SJohn Marino    into the virtual function table.
3370e4b17023SJohn Marino    C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK.  */
3371e4b17023SJohn Marino #define DECL_VINDEX(NODE) \
3372e4b17023SJohn Marino   (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex)
3373e4b17023SJohn Marino 
3374e4b17023SJohn Marino struct GTY(())
3375e4b17023SJohn Marino  tree_decl_non_common {
3376e4b17023SJohn Marino   struct tree_decl_with_vis common;
3377e4b17023SJohn Marino   /* C++ uses this in namespaces.  */
3378e4b17023SJohn Marino   tree saved_tree;
3379e4b17023SJohn Marino   /* C++ uses this in templates.  */
3380e4b17023SJohn Marino   tree arguments;
3381e4b17023SJohn Marino   /* Almost all FE's use this.  */
3382e4b17023SJohn Marino   tree result;
3383e4b17023SJohn Marino   /* C++ uses this in namespaces and function_decls.  */
3384e4b17023SJohn Marino   tree vindex;
3385e4b17023SJohn Marino };
3386e4b17023SJohn Marino 
3387e4b17023SJohn Marino /* In FUNCTION_DECL, holds the decl for the return value.  */
3388e4b17023SJohn Marino #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
3389e4b17023SJohn Marino 
3390e4b17023SJohn Marino /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
3391e4b17023SJohn Marino #define DECL_UNINLINABLE(NODE) \
3392e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
3393e4b17023SJohn Marino 
3394e4b17023SJohn Marino /* In a FUNCTION_DECL, the saved representation of the body of the
3395e4b17023SJohn Marino    entire function.  */
3396e4b17023SJohn Marino #define DECL_SAVED_TREE(NODE) \
3397e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree)
3398e4b17023SJohn Marino 
3399e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function should be treated
3400e4b17023SJohn Marino    as if it were a malloc, meaning it returns a pointer that is
3401e4b17023SJohn Marino    not an alias.  */
3402e4b17023SJohn Marino #define DECL_IS_MALLOC(NODE) \
3403e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
3404e4b17023SJohn Marino 
3405e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function should be treated as
3406e4b17023SJohn Marino    C++ operator new, meaning that it returns a pointer for which we
3407e4b17023SJohn Marino    should not use type based aliasing.  */
3408e4b17023SJohn Marino #define DECL_IS_OPERATOR_NEW(NODE) \
3409e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.operator_new_flag)
3410e4b17023SJohn Marino 
3411e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function may return more
3412e4b17023SJohn Marino    than once.  */
3413e4b17023SJohn Marino #define DECL_IS_RETURNS_TWICE(NODE) \
3414e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag)
3415e4b17023SJohn Marino 
3416e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function should be treated
3417e4b17023SJohn Marino    as "pure" function (like const function, but may read global memory).  */
3418e4b17023SJohn Marino #define DECL_PURE_P(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)
3419e4b17023SJohn Marino 
3420e4b17023SJohn Marino /* Nonzero only if one of TREE_READONLY or DECL_PURE_P is nonzero AND
3421e4b17023SJohn Marino    the const or pure function may not terminate.  When this is nonzero
3422e4b17023SJohn Marino    for a const or pure function, it can be dealt with by cse passes
3423e4b17023SJohn Marino    but cannot be removed by dce passes since you are not allowed to
3424e4b17023SJohn Marino    change an infinite looping program into one that terminates without
3425e4b17023SJohn Marino    error.  */
3426e4b17023SJohn Marino #define DECL_LOOPING_CONST_OR_PURE_P(NODE) \
3427e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.looping_const_or_pure_flag)
3428e4b17023SJohn Marino 
3429e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function should be treated
3430e4b17023SJohn Marino    as "novops" function (function that does not read global memory,
3431e4b17023SJohn Marino    but may have arbitrary side effects).  */
3432e4b17023SJohn Marino #define DECL_IS_NOVOPS(NODE) \
3433e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
3434e4b17023SJohn Marino 
3435e4b17023SJohn Marino /* Used in FUNCTION_DECLs to indicate that they should be run automatically
3436e4b17023SJohn Marino    at the beginning or end of execution.  */
3437e4b17023SJohn Marino #define DECL_STATIC_CONSTRUCTOR(NODE) \
3438e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag)
3439e4b17023SJohn Marino 
3440e4b17023SJohn Marino #define DECL_STATIC_DESTRUCTOR(NODE) \
3441e4b17023SJohn Marino (FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag)
3442e4b17023SJohn Marino 
3443e4b17023SJohn Marino /* Used in FUNCTION_DECLs to indicate that function entry and exit should
3444e4b17023SJohn Marino    be instrumented with calls to support routines.  */
3445e4b17023SJohn Marino #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \
3446e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit)
3447e4b17023SJohn Marino 
3448e4b17023SJohn Marino /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
3449e4b17023SJohn Marino    disabled in this function.  */
3450e4b17023SJohn Marino #define DECL_NO_LIMIT_STACK(NODE) \
3451e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
3452e4b17023SJohn Marino 
3453e4b17023SJohn Marino /* In a FUNCTION_DECL indicates that a static chain is needed.  */
3454e4b17023SJohn Marino #define DECL_STATIC_CHAIN(NODE) \
3455e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.regdecl_flag)
3456e4b17023SJohn Marino 
3457e4b17023SJohn Marino /* Nonzero for a decl that cgraph has decided should be inlined into
3458e4b17023SJohn Marino    at least one call site.  It is not meaningful to look at this
3459e4b17023SJohn Marino    directly; always use cgraph_function_possibly_inlined_p.  */
3460e4b17023SJohn Marino #define DECL_POSSIBLY_INLINED(DECL) \
3461e4b17023SJohn Marino   FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
3462e4b17023SJohn Marino 
3463e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
3464e4b17023SJohn Marino    such as via the `inline' keyword in C/C++.  This flag controls the linkage
3465e4b17023SJohn Marino    semantics of 'inline'  */
3466e4b17023SJohn Marino #define DECL_DECLARED_INLINE_P(NODE) \
3467e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
3468e4b17023SJohn Marino 
3469e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL means this function should not get
3470e4b17023SJohn Marino    -Winline warnings.  */
3471e4b17023SJohn Marino #define DECL_NO_INLINE_WARNING_P(NODE) \
3472e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag)
3473e4b17023SJohn Marino 
3474e4b17023SJohn Marino /* Nonzero if a FUNCTION_CODE is a TM load/store.  */
3475e4b17023SJohn Marino #define BUILTIN_TM_LOAD_STORE_P(FN) \
3476e4b17023SJohn Marino   ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
3477e4b17023SJohn Marino 
3478e4b17023SJohn Marino /* Nonzero if a FUNCTION_CODE is a TM load.  */
3479e4b17023SJohn Marino #define BUILTIN_TM_LOAD_P(FN) \
3480e4b17023SJohn Marino   ((FN) >= BUILT_IN_TM_LOAD_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
3481e4b17023SJohn Marino 
3482e4b17023SJohn Marino /* Nonzero if a FUNCTION_CODE is a TM store.  */
3483e4b17023SJohn Marino #define BUILTIN_TM_STORE_P(FN) \
3484e4b17023SJohn Marino   ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_STORE_WAW_LDOUBLE)
3485e4b17023SJohn Marino 
3486e4b17023SJohn Marino #define CASE_BUILT_IN_TM_LOAD(FN)	\
3487e4b17023SJohn Marino   case BUILT_IN_TM_LOAD_##FN:		\
3488e4b17023SJohn Marino   case BUILT_IN_TM_LOAD_RAR_##FN:	\
3489e4b17023SJohn Marino   case BUILT_IN_TM_LOAD_RAW_##FN:	\
3490e4b17023SJohn Marino   case BUILT_IN_TM_LOAD_RFW_##FN
3491e4b17023SJohn Marino 
3492e4b17023SJohn Marino #define CASE_BUILT_IN_TM_STORE(FN)	\
3493e4b17023SJohn Marino   case BUILT_IN_TM_STORE_##FN:		\
3494e4b17023SJohn Marino   case BUILT_IN_TM_STORE_WAR_##FN:	\
3495e4b17023SJohn Marino   case BUILT_IN_TM_STORE_WAW_##FN
3496e4b17023SJohn Marino 
3497e4b17023SJohn Marino /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
3498e4b17023SJohn Marino    disregarding size and cost heuristics.  This is equivalent to using
3499e4b17023SJohn Marino    the always_inline attribute without the required diagnostics if the
3500e4b17023SJohn Marino    function cannot be inlined.  */
3501e4b17023SJohn Marino #define DECL_DISREGARD_INLINE_LIMITS(NODE) \
3502e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.disregard_inline_limits)
3503e4b17023SJohn Marino 
3504e4b17023SJohn Marino extern VEC(tree, gc) **decl_debug_args_lookup (tree);
3505e4b17023SJohn Marino extern VEC(tree, gc) **decl_debug_args_insert (tree);
3506e4b17023SJohn Marino 
3507e4b17023SJohn Marino /* Nonzero if a FUNCTION_DECL has DEBUG arguments attached to it.  */
3508e4b17023SJohn Marino #define DECL_HAS_DEBUG_ARGS_P(NODE) \
3509e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.has_debug_args_flag)
3510e4b17023SJohn Marino 
3511e4b17023SJohn Marino /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
3512e4b17023SJohn Marino    that describes the status of this function.  */
3513e4b17023SJohn Marino #define DECL_STRUCT_FUNCTION(NODE) \
3514e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
3515e4b17023SJohn Marino 
3516e4b17023SJohn Marino /* In a FUNCTION_DECL, nonzero means a built in function.  */
3517e4b17023SJohn Marino #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
3518e4b17023SJohn Marino 
3519e4b17023SJohn Marino /* For a builtin function, identify which part of the compiler defined it.  */
3520e4b17023SJohn Marino #define DECL_BUILT_IN_CLASS(NODE) \
3521e4b17023SJohn Marino    (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class)
3522e4b17023SJohn Marino 
3523e4b17023SJohn Marino /* In FUNCTION_DECL, a chain of ..._DECL nodes.
3524e4b17023SJohn Marino    VAR_DECL and PARM_DECL reserve the arguments slot for language-specific
3525e4b17023SJohn Marino    uses.  */
3526e4b17023SJohn Marino #define DECL_ARGUMENTS(NODE) \
3527e4b17023SJohn Marino   (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
3528e4b17023SJohn Marino #define DECL_ARGUMENT_FLD(NODE) \
3529e4b17023SJohn Marino   (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
3530e4b17023SJohn Marino 
3531e4b17023SJohn Marino /* In FUNCTION_DECL, the function specific target options to use when compiling
3532e4b17023SJohn Marino    this function.  */
3533e4b17023SJohn Marino #define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \
3534e4b17023SJohn Marino    (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target)
3535e4b17023SJohn Marino 
3536e4b17023SJohn Marino /* In FUNCTION_DECL, the function specific optimization options to use when
3537e4b17023SJohn Marino    compiling this function.  */
3538e4b17023SJohn Marino #define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \
3539e4b17023SJohn Marino    (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization)
3540e4b17023SJohn Marino 
3541e4b17023SJohn Marino /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
3542e4b17023SJohn Marino    arguments/result/saved_tree fields by front ends.   It was either inherit
3543e4b17023SJohn Marino    FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
3544e4b17023SJohn Marino    which seemed a bit strange.  */
3545e4b17023SJohn Marino 
3546e4b17023SJohn Marino struct GTY(()) tree_function_decl {
3547e4b17023SJohn Marino   struct tree_decl_non_common common;
3548e4b17023SJohn Marino 
3549e4b17023SJohn Marino   struct function *f;
3550e4b17023SJohn Marino 
3551e4b17023SJohn Marino   /* The personality function. Used for stack unwinding. */
3552e4b17023SJohn Marino   tree personality;
3553e4b17023SJohn Marino 
3554e4b17023SJohn Marino   /* Function specific options that are used by this function.  */
3555e4b17023SJohn Marino   tree function_specific_target;	/* target options */
3556e4b17023SJohn Marino   tree function_specific_optimization;	/* optimization options */
3557e4b17023SJohn Marino 
3558e4b17023SJohn Marino   /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
3559e4b17023SJohn Marino      DECL_FUNCTION_CODE.  Otherwise unused.
3560e4b17023SJohn Marino      ???  The bitfield needs to be able to hold all target function
3561e4b17023SJohn Marino 	  codes as well.  */
3562e4b17023SJohn Marino   ENUM_BITFIELD(built_in_function) function_code : 11;
3563e4b17023SJohn Marino   ENUM_BITFIELD(built_in_class) built_in_class : 2;
3564e4b17023SJohn Marino 
3565e4b17023SJohn Marino   unsigned static_ctor_flag : 1;
3566e4b17023SJohn Marino   unsigned static_dtor_flag : 1;
3567e4b17023SJohn Marino   unsigned uninlinable : 1;
3568e4b17023SJohn Marino 
3569e4b17023SJohn Marino   unsigned possibly_inlined : 1;
3570e4b17023SJohn Marino   unsigned novops_flag : 1;
3571e4b17023SJohn Marino   unsigned returns_twice_flag : 1;
3572e4b17023SJohn Marino   unsigned malloc_flag : 1;
3573e4b17023SJohn Marino   unsigned operator_new_flag : 1;
3574e4b17023SJohn Marino   unsigned declared_inline_flag : 1;
3575e4b17023SJohn Marino   unsigned regdecl_flag : 1;
3576e4b17023SJohn Marino   unsigned no_inline_warning_flag : 1;
3577e4b17023SJohn Marino 
3578e4b17023SJohn Marino   unsigned no_instrument_function_entry_exit : 1;
3579e4b17023SJohn Marino   unsigned no_limit_stack : 1;
3580e4b17023SJohn Marino   unsigned disregard_inline_limits : 1;
3581e4b17023SJohn Marino   unsigned pure_flag : 1;
3582e4b17023SJohn Marino   unsigned looping_const_or_pure_flag : 1;
3583e4b17023SJohn Marino   unsigned has_debug_args_flag : 1;
3584e4b17023SJohn Marino   unsigned tm_clone_flag : 1;
3585e4b17023SJohn Marino 
3586e4b17023SJohn Marino   /* 1 bit left */
3587e4b17023SJohn Marino };
3588e4b17023SJohn Marino 
3589e4b17023SJohn Marino /* The source language of the translation-unit.  */
3590e4b17023SJohn Marino #define TRANSLATION_UNIT_LANGUAGE(NODE) \
3591e4b17023SJohn Marino   (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
3592e4b17023SJohn Marino 
3593e4b17023SJohn Marino /* TRANSLATION_UNIT_DECL inherits from DECL_MINIMAL.  */
3594e4b17023SJohn Marino 
3595e4b17023SJohn Marino struct GTY(()) tree_translation_unit_decl {
3596e4b17023SJohn Marino   struct tree_decl_common common;
3597e4b17023SJohn Marino   /* Source language of this translation unit.  Used for DWARF output.  */
3598e4b17023SJohn Marino   const char * GTY((skip(""))) language;
3599e4b17023SJohn Marino   /* TODO: Non-optimization used to build this translation unit.  */
3600e4b17023SJohn Marino   /* TODO: Root of a partial DWARF tree for global types and decls.  */
3601e4b17023SJohn Marino };
3602e4b17023SJohn Marino 
3603e4b17023SJohn Marino /* A vector of all translation-units.  */
3604e4b17023SJohn Marino extern GTY (()) VEC(tree,gc) *all_translation_units;
3605e4b17023SJohn Marino 
3606e4b17023SJohn Marino /* For a TYPE_DECL, holds the "original" type.  (TREE_TYPE has the copy.) */
3607e4b17023SJohn Marino #define DECL_ORIGINAL_TYPE(NODE) \
3608e4b17023SJohn Marino   (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
3609e4b17023SJohn Marino 
3610e4b17023SJohn Marino /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
3611e4b17023SJohn Marino    into stabs.  Instead it will generate cross reference ('x') of names.
3612e4b17023SJohn Marino    This uses the same flag as DECL_EXTERNAL.  */
3613e4b17023SJohn Marino #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
3614e4b17023SJohn Marino   (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_1)
3615e4b17023SJohn Marino 
3616e4b17023SJohn Marino /* Getter of the imported declaration associated to the
3617e4b17023SJohn Marino    IMPORTED_DECL node.  */
3618e4b17023SJohn Marino #define IMPORTED_DECL_ASSOCIATED_DECL(NODE) \
3619e4b17023SJohn Marino (DECL_INITIAL (IMPORTED_DECL_CHECK (NODE)))
3620e4b17023SJohn Marino 
3621e4b17023SJohn Marino struct GTY(()) tree_type_decl {
3622e4b17023SJohn Marino   struct tree_decl_non_common common;
3623e4b17023SJohn Marino 
3624e4b17023SJohn Marino };
3625e4b17023SJohn Marino 
3626e4b17023SJohn Marino /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
3627e4b17023SJohn Marino    To reduce overhead, the nodes containing the statements are not trees.
3628e4b17023SJohn Marino    This avoids the overhead of tree_common on all linked list elements.
3629e4b17023SJohn Marino 
3630e4b17023SJohn Marino    Use the interface in tree-iterator.h to access this node.  */
3631e4b17023SJohn Marino 
3632e4b17023SJohn Marino #define STATEMENT_LIST_HEAD(NODE) \
3633e4b17023SJohn Marino   (STATEMENT_LIST_CHECK (NODE)->stmt_list.head)
3634e4b17023SJohn Marino #define STATEMENT_LIST_TAIL(NODE) \
3635e4b17023SJohn Marino   (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
3636e4b17023SJohn Marino 
3637e4b17023SJohn Marino struct GTY ((chain_next ("%h.next"), chain_prev ("%h.prev"))) tree_statement_list_node
3638e4b17023SJohn Marino  {
3639e4b17023SJohn Marino   struct tree_statement_list_node *prev;
3640e4b17023SJohn Marino   struct tree_statement_list_node *next;
3641e4b17023SJohn Marino   tree stmt;
3642e4b17023SJohn Marino };
3643e4b17023SJohn Marino 
3644e4b17023SJohn Marino struct GTY(()) tree_statement_list
3645e4b17023SJohn Marino  {
3646e4b17023SJohn Marino   struct tree_typed typed;
3647e4b17023SJohn Marino   struct tree_statement_list_node *head;
3648e4b17023SJohn Marino   struct tree_statement_list_node *tail;
3649e4b17023SJohn Marino };
3650e4b17023SJohn Marino 
3651e4b17023SJohn Marino 
3652e4b17023SJohn Marino /* Optimization options used by a function.  */
3653e4b17023SJohn Marino 
3654e4b17023SJohn Marino struct GTY(()) tree_optimization_option {
3655e4b17023SJohn Marino   struct tree_common common;
3656e4b17023SJohn Marino 
3657e4b17023SJohn Marino   /* The optimization options used by the user.  */
3658e4b17023SJohn Marino   struct cl_optimization opts;
3659e4b17023SJohn Marino };
3660e4b17023SJohn Marino 
3661e4b17023SJohn Marino #define TREE_OPTIMIZATION(NODE) \
3662e4b17023SJohn Marino   (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
3663e4b17023SJohn Marino 
3664e4b17023SJohn Marino /* Return a tree node that encapsulates the current optimization options.  */
3665e4b17023SJohn Marino extern tree build_optimization_node (void);
3666e4b17023SJohn Marino 
3667e4b17023SJohn Marino /* Target options used by a function.  */
3668e4b17023SJohn Marino 
3669e4b17023SJohn Marino struct GTY(()) tree_target_option {
3670e4b17023SJohn Marino   struct tree_common common;
3671e4b17023SJohn Marino 
3672e4b17023SJohn Marino   /* The optimization options used by the user.  */
3673e4b17023SJohn Marino   struct cl_target_option opts;
3674e4b17023SJohn Marino };
3675e4b17023SJohn Marino 
3676e4b17023SJohn Marino #define TREE_TARGET_OPTION(NODE) \
3677e4b17023SJohn Marino   (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
3678e4b17023SJohn Marino 
3679e4b17023SJohn Marino /* Return a tree node that encapsulates the current target options.  */
3680e4b17023SJohn Marino extern tree build_target_option_node (void);
3681e4b17023SJohn Marino 
3682e4b17023SJohn Marino 
3683e4b17023SJohn Marino /* Define the overall contents of a tree node.
3684e4b17023SJohn Marino    It may be any of the structures declared above
3685e4b17023SJohn Marino    for various types of node.  */
3686e4b17023SJohn Marino 
3687e4b17023SJohn Marino union GTY ((ptr_alias (union lang_tree_node),
3688e4b17023SJohn Marino 	    desc ("tree_node_structure (&%h)"), variable_size)) tree_node {
3689e4b17023SJohn Marino   struct tree_base GTY ((tag ("TS_BASE"))) base;
3690e4b17023SJohn Marino   struct tree_typed GTY ((tag ("TS_TYPED"))) typed;
3691e4b17023SJohn Marino   struct tree_common GTY ((tag ("TS_COMMON"))) common;
3692e4b17023SJohn Marino   struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
3693e4b17023SJohn Marino   struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
3694e4b17023SJohn Marino   struct tree_fixed_cst GTY ((tag ("TS_FIXED_CST"))) fixed_cst;
3695e4b17023SJohn Marino   struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
3696e4b17023SJohn Marino   struct tree_string GTY ((tag ("TS_STRING"))) string;
3697e4b17023SJohn Marino   struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
3698e4b17023SJohn Marino   struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier;
3699e4b17023SJohn Marino   struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal;
3700e4b17023SJohn Marino   struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common;
3701e4b17023SJohn Marino   struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl;
3702e4b17023SJohn Marino   struct tree_decl_non_common  GTY ((tag ("TS_DECL_NON_COMMON"))) decl_non_common;
3703e4b17023SJohn Marino   struct tree_parm_decl  GTY  ((tag ("TS_PARM_DECL"))) parm_decl;
3704e4b17023SJohn Marino   struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis;
3705e4b17023SJohn Marino   struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl;
3706e4b17023SJohn Marino   struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl;
3707e4b17023SJohn Marino   struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl;
3708e4b17023SJohn Marino   struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl;
3709e4b17023SJohn Marino   struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl;
3710e4b17023SJohn Marino   struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl;
3711e4b17023SJohn Marino   struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
3712e4b17023SJohn Marino   struct tree_translation_unit_decl GTY ((tag ("TS_TRANSLATION_UNIT_DECL")))
3713e4b17023SJohn Marino     translation_unit_decl;
3714e4b17023SJohn Marino   struct tree_type_common GTY ((tag ("TS_TYPE_COMMON"))) type_common;
3715e4b17023SJohn Marino   struct tree_type_with_lang_specific GTY ((tag ("TS_TYPE_WITH_LANG_SPECIFIC")))
3716e4b17023SJohn Marino     type_with_lang_specific;
3717e4b17023SJohn Marino   struct tree_type_non_common GTY ((tag ("TS_TYPE_NON_COMMON")))
3718e4b17023SJohn Marino     type_non_common;
3719e4b17023SJohn Marino   struct tree_list GTY ((tag ("TS_LIST"))) list;
3720e4b17023SJohn Marino   struct tree_vec GTY ((tag ("TS_VEC"))) vec;
3721e4b17023SJohn Marino   struct tree_exp GTY ((tag ("TS_EXP"))) exp;
3722e4b17023SJohn Marino   struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
3723e4b17023SJohn Marino   struct tree_block GTY ((tag ("TS_BLOCK"))) block;
3724e4b17023SJohn Marino   struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
3725e4b17023SJohn Marino   struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
3726e4b17023SJohn Marino   struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
3727e4b17023SJohn Marino   struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
3728e4b17023SJohn Marino   struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization;
3729e4b17023SJohn Marino   struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
3730e4b17023SJohn Marino };
3731e4b17023SJohn Marino 
3732e4b17023SJohn Marino /* Standard named or nameless data types of the C compiler.  */
3733e4b17023SJohn Marino 
3734e4b17023SJohn Marino enum tree_index
3735e4b17023SJohn Marino {
3736e4b17023SJohn Marino   TI_ERROR_MARK,
3737e4b17023SJohn Marino   TI_INTQI_TYPE,
3738e4b17023SJohn Marino   TI_INTHI_TYPE,
3739e4b17023SJohn Marino   TI_INTSI_TYPE,
3740e4b17023SJohn Marino   TI_INTDI_TYPE,
3741e4b17023SJohn Marino   TI_INTTI_TYPE,
3742e4b17023SJohn Marino 
3743e4b17023SJohn Marino   TI_UINTQI_TYPE,
3744e4b17023SJohn Marino   TI_UINTHI_TYPE,
3745e4b17023SJohn Marino   TI_UINTSI_TYPE,
3746e4b17023SJohn Marino   TI_UINTDI_TYPE,
3747e4b17023SJohn Marino   TI_UINTTI_TYPE,
3748e4b17023SJohn Marino 
3749e4b17023SJohn Marino   TI_UINT32_TYPE,
3750e4b17023SJohn Marino   TI_UINT64_TYPE,
3751e4b17023SJohn Marino 
3752e4b17023SJohn Marino   TI_INTEGER_ZERO,
3753e4b17023SJohn Marino   TI_INTEGER_ONE,
3754e4b17023SJohn Marino   TI_INTEGER_THREE,
3755e4b17023SJohn Marino   TI_INTEGER_MINUS_ONE,
3756e4b17023SJohn Marino   TI_NULL_POINTER,
3757e4b17023SJohn Marino 
3758e4b17023SJohn Marino   TI_SIZE_ZERO,
3759e4b17023SJohn Marino   TI_SIZE_ONE,
3760e4b17023SJohn Marino 
3761e4b17023SJohn Marino   TI_BITSIZE_ZERO,
3762e4b17023SJohn Marino   TI_BITSIZE_ONE,
3763e4b17023SJohn Marino   TI_BITSIZE_UNIT,
3764e4b17023SJohn Marino 
3765e4b17023SJohn Marino   TI_PUBLIC,
3766e4b17023SJohn Marino   TI_PROTECTED,
3767e4b17023SJohn Marino   TI_PRIVATE,
3768e4b17023SJohn Marino 
3769e4b17023SJohn Marino   TI_BOOLEAN_FALSE,
3770e4b17023SJohn Marino   TI_BOOLEAN_TRUE,
3771e4b17023SJohn Marino 
3772e4b17023SJohn Marino   TI_COMPLEX_INTEGER_TYPE,
3773e4b17023SJohn Marino   TI_COMPLEX_FLOAT_TYPE,
3774e4b17023SJohn Marino   TI_COMPLEX_DOUBLE_TYPE,
3775e4b17023SJohn Marino   TI_COMPLEX_LONG_DOUBLE_TYPE,
3776e4b17023SJohn Marino 
3777e4b17023SJohn Marino   TI_FLOAT_TYPE,
3778e4b17023SJohn Marino   TI_DOUBLE_TYPE,
3779e4b17023SJohn Marino   TI_LONG_DOUBLE_TYPE,
3780e4b17023SJohn Marino 
3781e4b17023SJohn Marino   TI_FLOAT_PTR_TYPE,
3782e4b17023SJohn Marino   TI_DOUBLE_PTR_TYPE,
3783e4b17023SJohn Marino   TI_LONG_DOUBLE_PTR_TYPE,
3784e4b17023SJohn Marino   TI_INTEGER_PTR_TYPE,
3785e4b17023SJohn Marino 
3786e4b17023SJohn Marino   TI_VOID_TYPE,
3787e4b17023SJohn Marino   TI_PTR_TYPE,
3788e4b17023SJohn Marino   TI_CONST_PTR_TYPE,
3789e4b17023SJohn Marino   TI_SIZE_TYPE,
3790e4b17023SJohn Marino   TI_PID_TYPE,
3791e4b17023SJohn Marino   TI_PTRDIFF_TYPE,
3792e4b17023SJohn Marino   TI_VA_LIST_TYPE,
3793e4b17023SJohn Marino   TI_VA_LIST_GPR_COUNTER_FIELD,
3794e4b17023SJohn Marino   TI_VA_LIST_FPR_COUNTER_FIELD,
3795e4b17023SJohn Marino   TI_BOOLEAN_TYPE,
3796e4b17023SJohn Marino   TI_FILEPTR_TYPE,
3797e4b17023SJohn Marino 
3798e4b17023SJohn Marino   TI_DFLOAT32_TYPE,
3799e4b17023SJohn Marino   TI_DFLOAT64_TYPE,
3800e4b17023SJohn Marino   TI_DFLOAT128_TYPE,
3801e4b17023SJohn Marino   TI_DFLOAT32_PTR_TYPE,
3802e4b17023SJohn Marino   TI_DFLOAT64_PTR_TYPE,
3803e4b17023SJohn Marino   TI_DFLOAT128_PTR_TYPE,
3804e4b17023SJohn Marino 
3805e4b17023SJohn Marino   TI_VOID_LIST_NODE,
3806e4b17023SJohn Marino 
3807e4b17023SJohn Marino   TI_MAIN_IDENTIFIER,
3808e4b17023SJohn Marino 
3809e4b17023SJohn Marino   TI_SAT_SFRACT_TYPE,
3810e4b17023SJohn Marino   TI_SAT_FRACT_TYPE,
3811e4b17023SJohn Marino   TI_SAT_LFRACT_TYPE,
3812e4b17023SJohn Marino   TI_SAT_LLFRACT_TYPE,
3813e4b17023SJohn Marino   TI_SAT_USFRACT_TYPE,
3814e4b17023SJohn Marino   TI_SAT_UFRACT_TYPE,
3815e4b17023SJohn Marino   TI_SAT_ULFRACT_TYPE,
3816e4b17023SJohn Marino   TI_SAT_ULLFRACT_TYPE,
3817e4b17023SJohn Marino   TI_SFRACT_TYPE,
3818e4b17023SJohn Marino   TI_FRACT_TYPE,
3819e4b17023SJohn Marino   TI_LFRACT_TYPE,
3820e4b17023SJohn Marino   TI_LLFRACT_TYPE,
3821e4b17023SJohn Marino   TI_USFRACT_TYPE,
3822e4b17023SJohn Marino   TI_UFRACT_TYPE,
3823e4b17023SJohn Marino   TI_ULFRACT_TYPE,
3824e4b17023SJohn Marino   TI_ULLFRACT_TYPE,
3825e4b17023SJohn Marino   TI_SAT_SACCUM_TYPE,
3826e4b17023SJohn Marino   TI_SAT_ACCUM_TYPE,
3827e4b17023SJohn Marino   TI_SAT_LACCUM_TYPE,
3828e4b17023SJohn Marino   TI_SAT_LLACCUM_TYPE,
3829e4b17023SJohn Marino   TI_SAT_USACCUM_TYPE,
3830e4b17023SJohn Marino   TI_SAT_UACCUM_TYPE,
3831e4b17023SJohn Marino   TI_SAT_ULACCUM_TYPE,
3832e4b17023SJohn Marino   TI_SAT_ULLACCUM_TYPE,
3833e4b17023SJohn Marino   TI_SACCUM_TYPE,
3834e4b17023SJohn Marino   TI_ACCUM_TYPE,
3835e4b17023SJohn Marino   TI_LACCUM_TYPE,
3836e4b17023SJohn Marino   TI_LLACCUM_TYPE,
3837e4b17023SJohn Marino   TI_USACCUM_TYPE,
3838e4b17023SJohn Marino   TI_UACCUM_TYPE,
3839e4b17023SJohn Marino   TI_ULACCUM_TYPE,
3840e4b17023SJohn Marino   TI_ULLACCUM_TYPE,
3841e4b17023SJohn Marino   TI_QQ_TYPE,
3842e4b17023SJohn Marino   TI_HQ_TYPE,
3843e4b17023SJohn Marino   TI_SQ_TYPE,
3844e4b17023SJohn Marino   TI_DQ_TYPE,
3845e4b17023SJohn Marino   TI_TQ_TYPE,
3846e4b17023SJohn Marino   TI_UQQ_TYPE,
3847e4b17023SJohn Marino   TI_UHQ_TYPE,
3848e4b17023SJohn Marino   TI_USQ_TYPE,
3849e4b17023SJohn Marino   TI_UDQ_TYPE,
3850e4b17023SJohn Marino   TI_UTQ_TYPE,
3851e4b17023SJohn Marino   TI_SAT_QQ_TYPE,
3852e4b17023SJohn Marino   TI_SAT_HQ_TYPE,
3853e4b17023SJohn Marino   TI_SAT_SQ_TYPE,
3854e4b17023SJohn Marino   TI_SAT_DQ_TYPE,
3855e4b17023SJohn Marino   TI_SAT_TQ_TYPE,
3856e4b17023SJohn Marino   TI_SAT_UQQ_TYPE,
3857e4b17023SJohn Marino   TI_SAT_UHQ_TYPE,
3858e4b17023SJohn Marino   TI_SAT_USQ_TYPE,
3859e4b17023SJohn Marino   TI_SAT_UDQ_TYPE,
3860e4b17023SJohn Marino   TI_SAT_UTQ_TYPE,
3861e4b17023SJohn Marino   TI_HA_TYPE,
3862e4b17023SJohn Marino   TI_SA_TYPE,
3863e4b17023SJohn Marino   TI_DA_TYPE,
3864e4b17023SJohn Marino   TI_TA_TYPE,
3865e4b17023SJohn Marino   TI_UHA_TYPE,
3866e4b17023SJohn Marino   TI_USA_TYPE,
3867e4b17023SJohn Marino   TI_UDA_TYPE,
3868e4b17023SJohn Marino   TI_UTA_TYPE,
3869e4b17023SJohn Marino   TI_SAT_HA_TYPE,
3870e4b17023SJohn Marino   TI_SAT_SA_TYPE,
3871e4b17023SJohn Marino   TI_SAT_DA_TYPE,
3872e4b17023SJohn Marino   TI_SAT_TA_TYPE,
3873e4b17023SJohn Marino   TI_SAT_UHA_TYPE,
3874e4b17023SJohn Marino   TI_SAT_USA_TYPE,
3875e4b17023SJohn Marino   TI_SAT_UDA_TYPE,
3876e4b17023SJohn Marino   TI_SAT_UTA_TYPE,
3877e4b17023SJohn Marino 
3878e4b17023SJohn Marino   TI_OPTIMIZATION_DEFAULT,
3879e4b17023SJohn Marino   TI_OPTIMIZATION_CURRENT,
3880e4b17023SJohn Marino   TI_TARGET_OPTION_DEFAULT,
3881e4b17023SJohn Marino   TI_TARGET_OPTION_CURRENT,
3882e4b17023SJohn Marino   TI_CURRENT_TARGET_PRAGMA,
3883e4b17023SJohn Marino   TI_CURRENT_OPTIMIZE_PRAGMA,
3884e4b17023SJohn Marino 
3885e4b17023SJohn Marino   TI_MAX
3886e4b17023SJohn Marino };
3887e4b17023SJohn Marino 
3888e4b17023SJohn Marino extern GTY(()) tree global_trees[TI_MAX];
3889e4b17023SJohn Marino 
3890e4b17023SJohn Marino #define error_mark_node			global_trees[TI_ERROR_MARK]
3891e4b17023SJohn Marino 
3892e4b17023SJohn Marino #define intQI_type_node			global_trees[TI_INTQI_TYPE]
3893e4b17023SJohn Marino #define intHI_type_node			global_trees[TI_INTHI_TYPE]
3894e4b17023SJohn Marino #define intSI_type_node			global_trees[TI_INTSI_TYPE]
3895e4b17023SJohn Marino #define intDI_type_node			global_trees[TI_INTDI_TYPE]
3896e4b17023SJohn Marino #define intTI_type_node			global_trees[TI_INTTI_TYPE]
3897e4b17023SJohn Marino 
3898e4b17023SJohn Marino #define unsigned_intQI_type_node	global_trees[TI_UINTQI_TYPE]
3899e4b17023SJohn Marino #define unsigned_intHI_type_node	global_trees[TI_UINTHI_TYPE]
3900e4b17023SJohn Marino #define unsigned_intSI_type_node	global_trees[TI_UINTSI_TYPE]
3901e4b17023SJohn Marino #define unsigned_intDI_type_node	global_trees[TI_UINTDI_TYPE]
3902e4b17023SJohn Marino #define unsigned_intTI_type_node	global_trees[TI_UINTTI_TYPE]
3903e4b17023SJohn Marino 
3904e4b17023SJohn Marino #define uint32_type_node		global_trees[TI_UINT32_TYPE]
3905e4b17023SJohn Marino #define uint64_type_node		global_trees[TI_UINT64_TYPE]
3906e4b17023SJohn Marino 
3907e4b17023SJohn Marino #define integer_zero_node		global_trees[TI_INTEGER_ZERO]
3908e4b17023SJohn Marino #define integer_one_node		global_trees[TI_INTEGER_ONE]
3909e4b17023SJohn Marino #define integer_three_node              global_trees[TI_INTEGER_THREE]
3910e4b17023SJohn Marino #define integer_minus_one_node		global_trees[TI_INTEGER_MINUS_ONE]
3911e4b17023SJohn Marino #define size_zero_node			global_trees[TI_SIZE_ZERO]
3912e4b17023SJohn Marino #define size_one_node			global_trees[TI_SIZE_ONE]
3913e4b17023SJohn Marino #define bitsize_zero_node		global_trees[TI_BITSIZE_ZERO]
3914e4b17023SJohn Marino #define bitsize_one_node		global_trees[TI_BITSIZE_ONE]
3915e4b17023SJohn Marino #define bitsize_unit_node		global_trees[TI_BITSIZE_UNIT]
3916e4b17023SJohn Marino 
3917e4b17023SJohn Marino /* Base access nodes.  */
3918e4b17023SJohn Marino #define access_public_node		global_trees[TI_PUBLIC]
3919e4b17023SJohn Marino #define access_protected_node	        global_trees[TI_PROTECTED]
3920e4b17023SJohn Marino #define access_private_node		global_trees[TI_PRIVATE]
3921e4b17023SJohn Marino 
3922e4b17023SJohn Marino #define null_pointer_node		global_trees[TI_NULL_POINTER]
3923e4b17023SJohn Marino 
3924e4b17023SJohn Marino #define float_type_node			global_trees[TI_FLOAT_TYPE]
3925e4b17023SJohn Marino #define double_type_node		global_trees[TI_DOUBLE_TYPE]
3926e4b17023SJohn Marino #define long_double_type_node		global_trees[TI_LONG_DOUBLE_TYPE]
3927e4b17023SJohn Marino 
3928e4b17023SJohn Marino #define float_ptr_type_node		global_trees[TI_FLOAT_PTR_TYPE]
3929e4b17023SJohn Marino #define double_ptr_type_node		global_trees[TI_DOUBLE_PTR_TYPE]
3930e4b17023SJohn Marino #define long_double_ptr_type_node	global_trees[TI_LONG_DOUBLE_PTR_TYPE]
3931e4b17023SJohn Marino #define integer_ptr_type_node		global_trees[TI_INTEGER_PTR_TYPE]
3932e4b17023SJohn Marino 
3933e4b17023SJohn Marino #define complex_integer_type_node	global_trees[TI_COMPLEX_INTEGER_TYPE]
3934e4b17023SJohn Marino #define complex_float_type_node		global_trees[TI_COMPLEX_FLOAT_TYPE]
3935e4b17023SJohn Marino #define complex_double_type_node	global_trees[TI_COMPLEX_DOUBLE_TYPE]
3936e4b17023SJohn Marino #define complex_long_double_type_node	global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
3937e4b17023SJohn Marino 
3938e4b17023SJohn Marino #define void_type_node			global_trees[TI_VOID_TYPE]
3939e4b17023SJohn Marino /* The C type `void *'.  */
3940e4b17023SJohn Marino #define ptr_type_node			global_trees[TI_PTR_TYPE]
3941e4b17023SJohn Marino /* The C type `const void *'.  */
3942e4b17023SJohn Marino #define const_ptr_type_node		global_trees[TI_CONST_PTR_TYPE]
3943e4b17023SJohn Marino /* The C type `size_t'.  */
3944e4b17023SJohn Marino #define size_type_node                  global_trees[TI_SIZE_TYPE]
3945e4b17023SJohn Marino #define pid_type_node                   global_trees[TI_PID_TYPE]
3946e4b17023SJohn Marino #define ptrdiff_type_node		global_trees[TI_PTRDIFF_TYPE]
3947e4b17023SJohn Marino #define va_list_type_node		global_trees[TI_VA_LIST_TYPE]
3948e4b17023SJohn Marino #define va_list_gpr_counter_field	global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
3949e4b17023SJohn Marino #define va_list_fpr_counter_field	global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
3950e4b17023SJohn Marino /* The C type `FILE *'.  */
3951e4b17023SJohn Marino #define fileptr_type_node		global_trees[TI_FILEPTR_TYPE]
3952e4b17023SJohn Marino 
3953e4b17023SJohn Marino #define boolean_type_node		global_trees[TI_BOOLEAN_TYPE]
3954e4b17023SJohn Marino #define boolean_false_node		global_trees[TI_BOOLEAN_FALSE]
3955e4b17023SJohn Marino #define boolean_true_node		global_trees[TI_BOOLEAN_TRUE]
3956e4b17023SJohn Marino 
3957e4b17023SJohn Marino /* The decimal floating point types. */
3958e4b17023SJohn Marino #define dfloat32_type_node              global_trees[TI_DFLOAT32_TYPE]
3959e4b17023SJohn Marino #define dfloat64_type_node              global_trees[TI_DFLOAT64_TYPE]
3960e4b17023SJohn Marino #define dfloat128_type_node             global_trees[TI_DFLOAT128_TYPE]
3961e4b17023SJohn Marino #define dfloat32_ptr_type_node          global_trees[TI_DFLOAT32_PTR_TYPE]
3962e4b17023SJohn Marino #define dfloat64_ptr_type_node          global_trees[TI_DFLOAT64_PTR_TYPE]
3963e4b17023SJohn Marino #define dfloat128_ptr_type_node         global_trees[TI_DFLOAT128_PTR_TYPE]
3964e4b17023SJohn Marino 
3965e4b17023SJohn Marino /* The fixed-point types.  */
3966e4b17023SJohn Marino #define sat_short_fract_type_node       global_trees[TI_SAT_SFRACT_TYPE]
3967e4b17023SJohn Marino #define sat_fract_type_node             global_trees[TI_SAT_FRACT_TYPE]
3968e4b17023SJohn Marino #define sat_long_fract_type_node        global_trees[TI_SAT_LFRACT_TYPE]
3969e4b17023SJohn Marino #define sat_long_long_fract_type_node   global_trees[TI_SAT_LLFRACT_TYPE]
3970e4b17023SJohn Marino #define sat_unsigned_short_fract_type_node \
3971e4b17023SJohn Marino 					global_trees[TI_SAT_USFRACT_TYPE]
3972e4b17023SJohn Marino #define sat_unsigned_fract_type_node    global_trees[TI_SAT_UFRACT_TYPE]
3973e4b17023SJohn Marino #define sat_unsigned_long_fract_type_node \
3974e4b17023SJohn Marino 					global_trees[TI_SAT_ULFRACT_TYPE]
3975e4b17023SJohn Marino #define sat_unsigned_long_long_fract_type_node \
3976e4b17023SJohn Marino 					global_trees[TI_SAT_ULLFRACT_TYPE]
3977e4b17023SJohn Marino #define short_fract_type_node           global_trees[TI_SFRACT_TYPE]
3978e4b17023SJohn Marino #define fract_type_node                 global_trees[TI_FRACT_TYPE]
3979e4b17023SJohn Marino #define long_fract_type_node            global_trees[TI_LFRACT_TYPE]
3980e4b17023SJohn Marino #define long_long_fract_type_node       global_trees[TI_LLFRACT_TYPE]
3981e4b17023SJohn Marino #define unsigned_short_fract_type_node  global_trees[TI_USFRACT_TYPE]
3982e4b17023SJohn Marino #define unsigned_fract_type_node        global_trees[TI_UFRACT_TYPE]
3983e4b17023SJohn Marino #define unsigned_long_fract_type_node   global_trees[TI_ULFRACT_TYPE]
3984e4b17023SJohn Marino #define unsigned_long_long_fract_type_node \
3985e4b17023SJohn Marino 					global_trees[TI_ULLFRACT_TYPE]
3986e4b17023SJohn Marino #define sat_short_accum_type_node       global_trees[TI_SAT_SACCUM_TYPE]
3987e4b17023SJohn Marino #define sat_accum_type_node             global_trees[TI_SAT_ACCUM_TYPE]
3988e4b17023SJohn Marino #define sat_long_accum_type_node        global_trees[TI_SAT_LACCUM_TYPE]
3989e4b17023SJohn Marino #define sat_long_long_accum_type_node   global_trees[TI_SAT_LLACCUM_TYPE]
3990e4b17023SJohn Marino #define sat_unsigned_short_accum_type_node \
3991e4b17023SJohn Marino 					global_trees[TI_SAT_USACCUM_TYPE]
3992e4b17023SJohn Marino #define sat_unsigned_accum_type_node    global_trees[TI_SAT_UACCUM_TYPE]
3993e4b17023SJohn Marino #define sat_unsigned_long_accum_type_node \
3994e4b17023SJohn Marino 					global_trees[TI_SAT_ULACCUM_TYPE]
3995e4b17023SJohn Marino #define sat_unsigned_long_long_accum_type_node \
3996e4b17023SJohn Marino 					global_trees[TI_SAT_ULLACCUM_TYPE]
3997e4b17023SJohn Marino #define short_accum_type_node           global_trees[TI_SACCUM_TYPE]
3998e4b17023SJohn Marino #define accum_type_node                 global_trees[TI_ACCUM_TYPE]
3999e4b17023SJohn Marino #define long_accum_type_node            global_trees[TI_LACCUM_TYPE]
4000e4b17023SJohn Marino #define long_long_accum_type_node       global_trees[TI_LLACCUM_TYPE]
4001e4b17023SJohn Marino #define unsigned_short_accum_type_node  global_trees[TI_USACCUM_TYPE]
4002e4b17023SJohn Marino #define unsigned_accum_type_node        global_trees[TI_UACCUM_TYPE]
4003e4b17023SJohn Marino #define unsigned_long_accum_type_node   global_trees[TI_ULACCUM_TYPE]
4004e4b17023SJohn Marino #define unsigned_long_long_accum_type_node \
4005e4b17023SJohn Marino 					global_trees[TI_ULLACCUM_TYPE]
4006e4b17023SJohn Marino #define qq_type_node                    global_trees[TI_QQ_TYPE]
4007e4b17023SJohn Marino #define hq_type_node                    global_trees[TI_HQ_TYPE]
4008e4b17023SJohn Marino #define sq_type_node                    global_trees[TI_SQ_TYPE]
4009e4b17023SJohn Marino #define dq_type_node                    global_trees[TI_DQ_TYPE]
4010e4b17023SJohn Marino #define tq_type_node                    global_trees[TI_TQ_TYPE]
4011e4b17023SJohn Marino #define uqq_type_node                   global_trees[TI_UQQ_TYPE]
4012e4b17023SJohn Marino #define uhq_type_node                   global_trees[TI_UHQ_TYPE]
4013e4b17023SJohn Marino #define usq_type_node                   global_trees[TI_USQ_TYPE]
4014e4b17023SJohn Marino #define udq_type_node                   global_trees[TI_UDQ_TYPE]
4015e4b17023SJohn Marino #define utq_type_node                   global_trees[TI_UTQ_TYPE]
4016e4b17023SJohn Marino #define sat_qq_type_node                global_trees[TI_SAT_QQ_TYPE]
4017e4b17023SJohn Marino #define sat_hq_type_node                global_trees[TI_SAT_HQ_TYPE]
4018e4b17023SJohn Marino #define sat_sq_type_node                global_trees[TI_SAT_SQ_TYPE]
4019e4b17023SJohn Marino #define sat_dq_type_node                global_trees[TI_SAT_DQ_TYPE]
4020e4b17023SJohn Marino #define sat_tq_type_node                global_trees[TI_SAT_TQ_TYPE]
4021e4b17023SJohn Marino #define sat_uqq_type_node               global_trees[TI_SAT_UQQ_TYPE]
4022e4b17023SJohn Marino #define sat_uhq_type_node               global_trees[TI_SAT_UHQ_TYPE]
4023e4b17023SJohn Marino #define sat_usq_type_node               global_trees[TI_SAT_USQ_TYPE]
4024e4b17023SJohn Marino #define sat_udq_type_node               global_trees[TI_SAT_UDQ_TYPE]
4025e4b17023SJohn Marino #define sat_utq_type_node               global_trees[TI_SAT_UTQ_TYPE]
4026e4b17023SJohn Marino #define ha_type_node                    global_trees[TI_HA_TYPE]
4027e4b17023SJohn Marino #define sa_type_node                    global_trees[TI_SA_TYPE]
4028e4b17023SJohn Marino #define da_type_node                    global_trees[TI_DA_TYPE]
4029e4b17023SJohn Marino #define ta_type_node                    global_trees[TI_TA_TYPE]
4030e4b17023SJohn Marino #define uha_type_node                   global_trees[TI_UHA_TYPE]
4031e4b17023SJohn Marino #define usa_type_node                   global_trees[TI_USA_TYPE]
4032e4b17023SJohn Marino #define uda_type_node                   global_trees[TI_UDA_TYPE]
4033e4b17023SJohn Marino #define uta_type_node                   global_trees[TI_UTA_TYPE]
4034e4b17023SJohn Marino #define sat_ha_type_node                global_trees[TI_SAT_HA_TYPE]
4035e4b17023SJohn Marino #define sat_sa_type_node                global_trees[TI_SAT_SA_TYPE]
4036e4b17023SJohn Marino #define sat_da_type_node                global_trees[TI_SAT_DA_TYPE]
4037e4b17023SJohn Marino #define sat_ta_type_node                global_trees[TI_SAT_TA_TYPE]
4038e4b17023SJohn Marino #define sat_uha_type_node               global_trees[TI_SAT_UHA_TYPE]
4039e4b17023SJohn Marino #define sat_usa_type_node               global_trees[TI_SAT_USA_TYPE]
4040e4b17023SJohn Marino #define sat_uda_type_node               global_trees[TI_SAT_UDA_TYPE]
4041e4b17023SJohn Marino #define sat_uta_type_node               global_trees[TI_SAT_UTA_TYPE]
4042e4b17023SJohn Marino 
4043e4b17023SJohn Marino /* The node that should be placed at the end of a parameter list to
4044e4b17023SJohn Marino    indicate that the function does not take a variable number of
4045e4b17023SJohn Marino    arguments.  The TREE_VALUE will be void_type_node and there will be
4046e4b17023SJohn Marino    no TREE_CHAIN.  Language-independent code should not assume
4047e4b17023SJohn Marino    anything else about this node.  */
4048e4b17023SJohn Marino #define void_list_node                  global_trees[TI_VOID_LIST_NODE]
4049e4b17023SJohn Marino 
4050e4b17023SJohn Marino #define main_identifier_node		global_trees[TI_MAIN_IDENTIFIER]
4051e4b17023SJohn Marino #define MAIN_NAME_P(NODE) \
4052e4b17023SJohn Marino   (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
4053e4b17023SJohn Marino 
4054e4b17023SJohn Marino /* Optimization options (OPTIMIZATION_NODE) to use for default and current
4055e4b17023SJohn Marino    functions.  */
4056e4b17023SJohn Marino #define optimization_default_node	global_trees[TI_OPTIMIZATION_DEFAULT]
4057e4b17023SJohn Marino #define optimization_current_node	global_trees[TI_OPTIMIZATION_CURRENT]
4058e4b17023SJohn Marino 
4059e4b17023SJohn Marino /* Default/current target options (TARGET_OPTION_NODE).  */
4060e4b17023SJohn Marino #define target_option_default_node	global_trees[TI_TARGET_OPTION_DEFAULT]
4061e4b17023SJohn Marino #define target_option_current_node	global_trees[TI_TARGET_OPTION_CURRENT]
4062e4b17023SJohn Marino 
4063e4b17023SJohn Marino /* Default tree list option(), optimize() pragmas to be linked into the
4064e4b17023SJohn Marino    attribute list.  */
4065e4b17023SJohn Marino #define current_target_pragma		global_trees[TI_CURRENT_TARGET_PRAGMA]
4066e4b17023SJohn Marino #define current_optimize_pragma		global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
4067e4b17023SJohn Marino 
4068e4b17023SJohn Marino /* An enumeration of the standard C integer types.  These must be
4069e4b17023SJohn Marino    ordered so that shorter types appear before longer ones, and so
4070e4b17023SJohn Marino    that signed types appear before unsigned ones, for the correct
4071e4b17023SJohn Marino    functioning of interpret_integer() in c-lex.c.  */
4072e4b17023SJohn Marino enum integer_type_kind
4073e4b17023SJohn Marino {
4074e4b17023SJohn Marino   itk_char,
4075e4b17023SJohn Marino   itk_signed_char,
4076e4b17023SJohn Marino   itk_unsigned_char,
4077e4b17023SJohn Marino   itk_short,
4078e4b17023SJohn Marino   itk_unsigned_short,
4079e4b17023SJohn Marino   itk_int,
4080e4b17023SJohn Marino   itk_unsigned_int,
4081e4b17023SJohn Marino   itk_long,
4082e4b17023SJohn Marino   itk_unsigned_long,
4083e4b17023SJohn Marino   itk_long_long,
4084e4b17023SJohn Marino   itk_unsigned_long_long,
4085e4b17023SJohn Marino   itk_int128,
4086e4b17023SJohn Marino   itk_unsigned_int128,
4087e4b17023SJohn Marino   itk_none
4088e4b17023SJohn Marino };
4089e4b17023SJohn Marino 
4090e4b17023SJohn Marino typedef enum integer_type_kind integer_type_kind;
4091e4b17023SJohn Marino 
4092e4b17023SJohn Marino /* The standard C integer types.  Use integer_type_kind to index into
4093e4b17023SJohn Marino    this array.  */
4094e4b17023SJohn Marino extern GTY(()) tree integer_types[itk_none];
4095e4b17023SJohn Marino 
4096e4b17023SJohn Marino #define char_type_node			integer_types[itk_char]
4097e4b17023SJohn Marino #define signed_char_type_node		integer_types[itk_signed_char]
4098e4b17023SJohn Marino #define unsigned_char_type_node		integer_types[itk_unsigned_char]
4099e4b17023SJohn Marino #define short_integer_type_node		integer_types[itk_short]
4100e4b17023SJohn Marino #define short_unsigned_type_node	integer_types[itk_unsigned_short]
4101e4b17023SJohn Marino #define integer_type_node		integer_types[itk_int]
4102e4b17023SJohn Marino #define unsigned_type_node		integer_types[itk_unsigned_int]
4103e4b17023SJohn Marino #define long_integer_type_node		integer_types[itk_long]
4104e4b17023SJohn Marino #define long_unsigned_type_node		integer_types[itk_unsigned_long]
4105e4b17023SJohn Marino #define long_long_integer_type_node	integer_types[itk_long_long]
4106e4b17023SJohn Marino #define long_long_unsigned_type_node	integer_types[itk_unsigned_long_long]
4107e4b17023SJohn Marino #define int128_integer_type_node	integer_types[itk_int128]
4108e4b17023SJohn Marino #define int128_unsigned_type_node	integer_types[itk_unsigned_int128]
4109e4b17023SJohn Marino 
4110e4b17023SJohn Marino /* A pointer-to-function member type looks like:
4111e4b17023SJohn Marino 
4112e4b17023SJohn Marino      struct {
4113e4b17023SJohn Marino        __P __pfn;
4114e4b17023SJohn Marino        ptrdiff_t __delta;
4115e4b17023SJohn Marino      };
4116e4b17023SJohn Marino 
4117e4b17023SJohn Marino    If __pfn is NULL, it is a NULL pointer-to-member-function.
4118e4b17023SJohn Marino 
4119e4b17023SJohn Marino    (Because the vtable is always the first thing in the object, we
4120e4b17023SJohn Marino    don't need its offset.)  If the function is virtual, then PFN is
4121e4b17023SJohn Marino    one plus twice the index into the vtable; otherwise, it is just a
4122e4b17023SJohn Marino    pointer to the function.
4123e4b17023SJohn Marino 
4124e4b17023SJohn Marino    Unfortunately, using the lowest bit of PFN doesn't work in
4125e4b17023SJohn Marino    architectures that don't impose alignment requirements on function
4126e4b17023SJohn Marino    addresses, or that use the lowest bit to tell one ISA from another,
4127e4b17023SJohn Marino    for example.  For such architectures, we use the lowest bit of
4128e4b17023SJohn Marino    DELTA instead of the lowest bit of the PFN, and DELTA will be
4129e4b17023SJohn Marino    multiplied by 2.  */
4130e4b17023SJohn Marino 
4131e4b17023SJohn Marino enum ptrmemfunc_vbit_where_t
4132e4b17023SJohn Marino {
4133e4b17023SJohn Marino   ptrmemfunc_vbit_in_pfn,
4134e4b17023SJohn Marino   ptrmemfunc_vbit_in_delta
4135e4b17023SJohn Marino };
4136e4b17023SJohn Marino 
4137e4b17023SJohn Marino #define NULL_TREE (tree) NULL
4138e4b17023SJohn Marino 
4139e4b17023SJohn Marino /* True if NODE is an erroneous expression.  */
4140e4b17023SJohn Marino 
4141e4b17023SJohn Marino #define error_operand_p(NODE)					\
4142e4b17023SJohn Marino   ((NODE) == error_mark_node					\
4143e4b17023SJohn Marino    || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node))
4144e4b17023SJohn Marino 
4145e4b17023SJohn Marino extern tree decl_assembler_name (tree);
4146e4b17023SJohn Marino extern bool decl_assembler_name_equal (tree decl, const_tree asmname);
4147e4b17023SJohn Marino extern hashval_t decl_assembler_name_hash (const_tree asmname);
4148e4b17023SJohn Marino 
4149e4b17023SJohn Marino /* Compute the number of bytes occupied by 'node'.  This routine only
4150e4b17023SJohn Marino    looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH.  */
4151e4b17023SJohn Marino 
4152e4b17023SJohn Marino extern size_t tree_size (const_tree);
4153e4b17023SJohn Marino 
4154e4b17023SJohn Marino /* Compute the number of bytes occupied by a tree with code CODE.  This
4155e4b17023SJohn Marino    function cannot be used for TREE_VEC codes, which are of variable
4156e4b17023SJohn Marino    length.  */
4157e4b17023SJohn Marino extern size_t tree_code_size (enum tree_code);
4158e4b17023SJohn Marino 
4159e4b17023SJohn Marino /* Allocate and return a new UID from the DECL_UID namespace.  */
4160e4b17023SJohn Marino extern int allocate_decl_uid (void);
4161e4b17023SJohn Marino 
4162e4b17023SJohn Marino /* Lowest level primitive for allocating a node.
4163e4b17023SJohn Marino    The TREE_CODE is the only argument.  Contents are initialized
4164e4b17023SJohn Marino    to zero except for a few of the common fields.  */
4165e4b17023SJohn Marino 
4166e4b17023SJohn Marino extern tree make_node_stat (enum tree_code MEM_STAT_DECL);
4167e4b17023SJohn Marino #define make_node(t) make_node_stat (t MEM_STAT_INFO)
4168e4b17023SJohn Marino 
4169e4b17023SJohn Marino /* Make a copy of a node, with all the same contents.  */
4170e4b17023SJohn Marino 
4171e4b17023SJohn Marino extern tree copy_node_stat (tree MEM_STAT_DECL);
4172e4b17023SJohn Marino #define copy_node(t) copy_node_stat (t MEM_STAT_INFO)
4173e4b17023SJohn Marino 
4174e4b17023SJohn Marino /* Make a copy of a chain of TREE_LIST nodes.  */
4175e4b17023SJohn Marino 
4176e4b17023SJohn Marino extern tree copy_list (tree);
4177e4b17023SJohn Marino 
4178e4b17023SJohn Marino /* Make a CASE_LABEL_EXPR.  */
4179e4b17023SJohn Marino 
4180e4b17023SJohn Marino extern tree build_case_label (tree, tree, tree);
4181e4b17023SJohn Marino 
4182e4b17023SJohn Marino /* Make a BINFO.  */
4183e4b17023SJohn Marino extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
4184e4b17023SJohn Marino #define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
4185e4b17023SJohn Marino 
4186e4b17023SJohn Marino /* Make a TREE_VEC.  */
4187e4b17023SJohn Marino 
4188e4b17023SJohn Marino extern tree make_tree_vec_stat (int MEM_STAT_DECL);
4189e4b17023SJohn Marino #define make_tree_vec(t) make_tree_vec_stat (t MEM_STAT_INFO)
4190e4b17023SJohn Marino 
4191e4b17023SJohn Marino /* Return the (unique) IDENTIFIER_NODE node for a given name.
4192e4b17023SJohn Marino    The name is supplied as a char *.  */
4193e4b17023SJohn Marino 
4194e4b17023SJohn Marino extern tree get_identifier (const char *);
4195e4b17023SJohn Marino 
4196e4b17023SJohn Marino #if GCC_VERSION >= 3000
4197e4b17023SJohn Marino #define get_identifier(str) \
4198e4b17023SJohn Marino   (__builtin_constant_p (str)				\
4199e4b17023SJohn Marino     ? get_identifier_with_length ((str), strlen (str))  \
4200e4b17023SJohn Marino     : get_identifier (str))
4201e4b17023SJohn Marino #endif
4202e4b17023SJohn Marino 
4203e4b17023SJohn Marino 
4204e4b17023SJohn Marino /* Identical to get_identifier, except that the length is assumed
4205e4b17023SJohn Marino    known.  */
4206e4b17023SJohn Marino 
4207e4b17023SJohn Marino extern tree get_identifier_with_length (const char *, size_t);
4208e4b17023SJohn Marino 
4209e4b17023SJohn Marino /* If an identifier with the name TEXT (a null-terminated string) has
4210e4b17023SJohn Marino    previously been referred to, return that node; otherwise return
4211e4b17023SJohn Marino    NULL_TREE.  */
4212e4b17023SJohn Marino 
4213e4b17023SJohn Marino extern tree maybe_get_identifier (const char *);
4214e4b17023SJohn Marino 
4215e4b17023SJohn Marino /* Construct various types of nodes.  */
4216e4b17023SJohn Marino 
4217e4b17023SJohn Marino extern tree build_nt (enum tree_code, ...);
4218e4b17023SJohn Marino extern tree build_nt_call_vec (tree, VEC(tree,gc) *);
4219e4b17023SJohn Marino 
4220e4b17023SJohn Marino extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
4221e4b17023SJohn Marino #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
4222e4b17023SJohn Marino extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
4223e4b17023SJohn Marino #define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO)
4224e4b17023SJohn Marino extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
4225e4b17023SJohn Marino #define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO)
4226e4b17023SJohn Marino extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
4227e4b17023SJohn Marino #define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO)
4228e4b17023SJohn Marino extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
4229e4b17023SJohn Marino 			 tree MEM_STAT_DECL);
4230e4b17023SJohn Marino #define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
4231e4b17023SJohn Marino extern tree build5_stat (enum tree_code, tree, tree, tree, tree, tree,
4232e4b17023SJohn Marino 			 tree MEM_STAT_DECL);
4233e4b17023SJohn Marino #define build5(c,t1,t2,t3,t4,t5,t6) build5_stat (c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
4234e4b17023SJohn Marino extern tree build6_stat (enum tree_code, tree, tree, tree, tree, tree,
4235e4b17023SJohn Marino 			 tree, tree MEM_STAT_DECL);
4236e4b17023SJohn Marino #define build6(c,t1,t2,t3,t4,t5,t6,t7) \
4237e4b17023SJohn Marino   build6_stat (c,t1,t2,t3,t4,t5,t6,t7 MEM_STAT_INFO)
4238e4b17023SJohn Marino 
4239e4b17023SJohn Marino /* _loc versions of build[1-6].  */
4240e4b17023SJohn Marino 
4241e4b17023SJohn Marino static inline tree
build1_stat_loc(location_t loc,enum tree_code code,tree type,tree arg1 MEM_STAT_DECL)4242e4b17023SJohn Marino build1_stat_loc (location_t loc, enum tree_code code, tree type,
4243e4b17023SJohn Marino 		 tree arg1 MEM_STAT_DECL)
4244e4b17023SJohn Marino {
4245e4b17023SJohn Marino   tree t = build1_stat (code, type, arg1 PASS_MEM_STAT);
4246e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4247e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4248e4b17023SJohn Marino   return t;
4249e4b17023SJohn Marino }
4250e4b17023SJohn Marino #define build1_loc(l,c,t1,t2) build1_stat_loc (l,c,t1,t2 MEM_STAT_INFO)
4251e4b17023SJohn Marino 
4252e4b17023SJohn Marino static inline tree
build2_stat_loc(location_t loc,enum tree_code code,tree type,tree arg0,tree arg1 MEM_STAT_DECL)4253e4b17023SJohn Marino build2_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
4254e4b17023SJohn Marino 		 tree arg1 MEM_STAT_DECL)
4255e4b17023SJohn Marino {
4256e4b17023SJohn Marino   tree t = build2_stat (code, type, arg0, arg1 PASS_MEM_STAT);
4257e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4258e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4259e4b17023SJohn Marino   return t;
4260e4b17023SJohn Marino }
4261e4b17023SJohn Marino #define build2_loc(l,c,t1,t2,t3) build2_stat_loc (l,c,t1,t2,t3 MEM_STAT_INFO)
4262e4b17023SJohn Marino 
4263e4b17023SJohn Marino static inline tree
build3_stat_loc(location_t loc,enum tree_code code,tree type,tree arg0,tree arg1,tree arg2 MEM_STAT_DECL)4264e4b17023SJohn Marino build3_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
4265e4b17023SJohn Marino 		 tree arg1, tree arg2 MEM_STAT_DECL)
4266e4b17023SJohn Marino {
4267e4b17023SJohn Marino   tree t = build3_stat (code, type, arg0, arg1, arg2 PASS_MEM_STAT);
4268e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4269e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4270e4b17023SJohn Marino   return t;
4271e4b17023SJohn Marino }
4272e4b17023SJohn Marino #define build3_loc(l,c,t1,t2,t3,t4) \
4273e4b17023SJohn Marino   build3_stat_loc (l,c,t1,t2,t3,t4 MEM_STAT_INFO)
4274e4b17023SJohn Marino 
4275e4b17023SJohn Marino static inline tree
build4_stat_loc(location_t loc,enum tree_code code,tree type,tree arg0,tree arg1,tree arg2,tree arg3 MEM_STAT_DECL)4276e4b17023SJohn Marino build4_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
4277e4b17023SJohn Marino 		 tree arg1, tree arg2, tree arg3 MEM_STAT_DECL)
4278e4b17023SJohn Marino {
4279e4b17023SJohn Marino   tree t = build4_stat (code, type, arg0, arg1, arg2, arg3 PASS_MEM_STAT);
4280e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4281e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4282e4b17023SJohn Marino   return t;
4283e4b17023SJohn Marino }
4284e4b17023SJohn Marino #define build4_loc(l,c,t1,t2,t3,t4,t5) \
4285e4b17023SJohn Marino   build4_stat_loc (l,c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
4286e4b17023SJohn Marino 
4287e4b17023SJohn Marino static inline tree
build5_stat_loc(location_t loc,enum tree_code code,tree type,tree arg0,tree arg1,tree arg2,tree arg3,tree arg4 MEM_STAT_DECL)4288e4b17023SJohn Marino build5_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
4289e4b17023SJohn Marino 		 tree arg1, tree arg2, tree arg3, tree arg4 MEM_STAT_DECL)
4290e4b17023SJohn Marino {
4291e4b17023SJohn Marino   tree t = build5_stat (code, type, arg0, arg1, arg2, arg3,
4292e4b17023SJohn Marino 			arg4 PASS_MEM_STAT);
4293e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4294e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4295e4b17023SJohn Marino   return t;
4296e4b17023SJohn Marino }
4297e4b17023SJohn Marino #define build5_loc(l,c,t1,t2,t3,t4,t5,t6) \
4298e4b17023SJohn Marino   build5_stat_loc (l,c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
4299e4b17023SJohn Marino 
4300e4b17023SJohn Marino static inline tree
build6_stat_loc(location_t loc,enum tree_code code,tree type,tree arg0,tree arg1,tree arg2,tree arg3,tree arg4,tree arg5 MEM_STAT_DECL)4301e4b17023SJohn Marino build6_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
4302e4b17023SJohn Marino 		 tree arg1, tree arg2, tree arg3, tree arg4,
4303e4b17023SJohn Marino 		 tree arg5 MEM_STAT_DECL)
4304e4b17023SJohn Marino {
4305e4b17023SJohn Marino   tree t = build6_stat (code, type, arg0, arg1, arg2, arg3, arg4,
4306e4b17023SJohn Marino 			arg5 PASS_MEM_STAT);
4307e4b17023SJohn Marino   if (CAN_HAVE_LOCATION_P (t))
4308e4b17023SJohn Marino     SET_EXPR_LOCATION (t, loc);
4309e4b17023SJohn Marino   return t;
4310e4b17023SJohn Marino }
4311e4b17023SJohn Marino #define build6_loc(l,c,t1,t2,t3,t4,t5,t6,t7) \
4312e4b17023SJohn Marino   build6_stat_loc (l,c,t1,t2,t3,t4,t5,t6,t7 MEM_STAT_INFO)
4313e4b17023SJohn Marino 
4314e4b17023SJohn Marino extern tree build_var_debug_value_stat (tree, tree MEM_STAT_DECL);
4315e4b17023SJohn Marino #define build_var_debug_value(t1,t2) \
4316e4b17023SJohn Marino   build_var_debug_value_stat (t1,t2 MEM_STAT_INFO)
4317e4b17023SJohn Marino 
4318e4b17023SJohn Marino /* Constructs double_int from tree CST.  */
4319e4b17023SJohn Marino 
4320e4b17023SJohn Marino static inline double_int
tree_to_double_int(const_tree cst)4321e4b17023SJohn Marino tree_to_double_int (const_tree cst)
4322e4b17023SJohn Marino {
4323e4b17023SJohn Marino   return TREE_INT_CST (cst);
4324e4b17023SJohn Marino }
4325e4b17023SJohn Marino 
4326e4b17023SJohn Marino extern tree double_int_to_tree (tree, double_int);
4327e4b17023SJohn Marino extern bool double_int_fits_to_tree_p (const_tree, double_int);
4328e4b17023SJohn Marino extern tree force_fit_type_double (tree, double_int, int, bool);
4329e4b17023SJohn Marino 
4330e4b17023SJohn Marino /* Create an INT_CST node with a CST value zero extended.  */
4331e4b17023SJohn Marino 
4332e4b17023SJohn Marino static inline tree
build_int_cstu(tree type,unsigned HOST_WIDE_INT cst)4333e4b17023SJohn Marino build_int_cstu (tree type, unsigned HOST_WIDE_INT cst)
4334e4b17023SJohn Marino {
4335e4b17023SJohn Marino   return double_int_to_tree (type, uhwi_to_double_int (cst));
4336e4b17023SJohn Marino }
4337e4b17023SJohn Marino 
4338e4b17023SJohn Marino extern tree build_int_cst (tree, HOST_WIDE_INT);
4339e4b17023SJohn Marino extern tree build_int_cst_type (tree, HOST_WIDE_INT);
4340e4b17023SJohn Marino extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
4341e4b17023SJohn Marino extern tree build_vector (tree, tree);
4342e4b17023SJohn Marino extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
4343e4b17023SJohn Marino extern tree build_vector_from_val (tree, tree);
4344e4b17023SJohn Marino extern tree build_constructor (tree, VEC(constructor_elt,gc) *);
4345e4b17023SJohn Marino extern tree build_constructor_single (tree, tree, tree);
4346e4b17023SJohn Marino extern tree build_constructor_from_list (tree, tree);
4347e4b17023SJohn Marino extern tree build_real_from_int_cst (tree, const_tree);
4348e4b17023SJohn Marino extern tree build_complex (tree, tree, tree);
4349e4b17023SJohn Marino extern tree build_one_cst (tree);
4350e4b17023SJohn Marino extern tree build_zero_cst (tree);
4351e4b17023SJohn Marino extern tree build_string (int, const char *);
4352e4b17023SJohn Marino extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);
4353e4b17023SJohn Marino #define build_tree_list(t,q) build_tree_list_stat(t,q MEM_STAT_INFO)
4354e4b17023SJohn Marino extern tree build_tree_list_vec_stat (const VEC(tree,gc) * MEM_STAT_DECL);
4355e4b17023SJohn Marino #define build_tree_list_vec(v) build_tree_list_vec_stat (v MEM_STAT_INFO)
4356e4b17023SJohn Marino extern tree build_decl_stat (location_t, enum tree_code,
4357e4b17023SJohn Marino 			     tree, tree MEM_STAT_DECL);
4358e4b17023SJohn Marino extern tree build_fn_decl (const char *, tree);
4359e4b17023SJohn Marino #define build_decl(l,c,t,q) build_decl_stat (l,c,t,q MEM_STAT_INFO)
4360e4b17023SJohn Marino extern tree build_translation_unit_decl (tree);
4361e4b17023SJohn Marino extern tree build_block (tree, tree, tree, tree);
4362e4b17023SJohn Marino extern tree build_empty_stmt (location_t);
4363e4b17023SJohn Marino extern tree build_omp_clause (location_t, enum omp_clause_code);
4364e4b17023SJohn Marino 
4365e4b17023SJohn Marino extern tree build_vl_exp_stat (enum tree_code, int MEM_STAT_DECL);
4366e4b17023SJohn Marino #define build_vl_exp(c,n) build_vl_exp_stat (c,n MEM_STAT_INFO)
4367e4b17023SJohn Marino 
4368e4b17023SJohn Marino extern tree build_call_nary (tree, tree, int, ...);
4369e4b17023SJohn Marino extern tree build_call_valist (tree, tree, int, va_list);
4370e4b17023SJohn Marino #define build_call_array(T1,T2,N,T3)\
4371e4b17023SJohn Marino    build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T3)
4372e4b17023SJohn Marino extern tree build_call_array_loc (location_t, tree, tree, int, const tree *);
4373e4b17023SJohn Marino extern tree build_call_vec (tree, tree, VEC(tree,gc) *);
4374e4b17023SJohn Marino 
4375e4b17023SJohn Marino /* Construct various nodes representing data types.  */
4376e4b17023SJohn Marino 
4377e4b17023SJohn Marino extern tree make_signed_type (int);
4378e4b17023SJohn Marino extern tree make_unsigned_type (int);
4379e4b17023SJohn Marino extern tree signed_or_unsigned_type_for (int, tree);
4380e4b17023SJohn Marino extern tree signed_type_for (tree);
4381e4b17023SJohn Marino extern tree unsigned_type_for (tree);
4382e4b17023SJohn Marino extern void initialize_sizetypes (void);
4383e4b17023SJohn Marino extern void fixup_unsigned_type (tree);
4384e4b17023SJohn Marino extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool);
4385e4b17023SJohn Marino extern tree build_pointer_type (tree);
4386e4b17023SJohn Marino extern tree build_reference_type_for_mode (tree, enum machine_mode, bool);
4387e4b17023SJohn Marino extern tree build_reference_type (tree);
4388e4b17023SJohn Marino extern tree build_vector_type_for_mode (tree, enum machine_mode);
4389e4b17023SJohn Marino extern tree build_vector_type (tree innertype, int nunits);
4390e4b17023SJohn Marino extern tree build_opaque_vector_type (tree innertype, int nunits);
4391e4b17023SJohn Marino extern tree build_type_no_quals (tree);
4392e4b17023SJohn Marino extern tree build_index_type (tree);
4393e4b17023SJohn Marino extern tree build_array_type (tree, tree);
4394e4b17023SJohn Marino extern tree build_nonshared_array_type (tree, tree);
4395e4b17023SJohn Marino extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
4396e4b17023SJohn Marino extern tree build_function_type (tree, tree);
4397e4b17023SJohn Marino extern tree build_function_type_list (tree, ...);
4398e4b17023SJohn Marino extern tree build_function_decl_skip_args (tree, bitmap, bool);
4399e4b17023SJohn Marino extern tree build_varargs_function_type_list (tree, ...);
4400e4b17023SJohn Marino extern tree build_function_type_array (tree, int, tree *);
4401e4b17023SJohn Marino extern tree build_varargs_function_type_array (tree, int, tree *);
4402e4b17023SJohn Marino #define build_function_type_vec(RET, V) \
4403e4b17023SJohn Marino   build_function_type_array (RET, VEC_length (tree, V), VEC_address (tree, V))
4404e4b17023SJohn Marino #define build_varargs_function_type_vec(RET, V) \
4405e4b17023SJohn Marino   build_varargs_function_type_array (RET, VEC_length (tree, V), \
4406e4b17023SJohn Marino 				     VEC_address (tree, V))
4407e4b17023SJohn Marino extern tree build_method_type_directly (tree, tree, tree);
4408e4b17023SJohn Marino extern tree build_method_type (tree, tree);
4409e4b17023SJohn Marino extern tree build_offset_type (tree, tree);
4410e4b17023SJohn Marino extern tree build_complex_type (tree);
4411e4b17023SJohn Marino extern tree array_type_nelts (const_tree);
4412e4b17023SJohn Marino extern bool in_array_bounds_p (tree);
4413e4b17023SJohn Marino extern bool range_in_array_bounds_p (tree);
4414e4b17023SJohn Marino 
4415e4b17023SJohn Marino extern tree value_member (tree, tree);
4416e4b17023SJohn Marino extern tree purpose_member (const_tree, tree);
4417e4b17023SJohn Marino extern bool vec_member (const_tree, VEC(tree,gc) *);
4418e4b17023SJohn Marino extern tree chain_index (int, tree);
4419e4b17023SJohn Marino 
4420e4b17023SJohn Marino extern int attribute_list_equal (const_tree, const_tree);
4421e4b17023SJohn Marino extern int attribute_list_contained (const_tree, const_tree);
4422e4b17023SJohn Marino extern int tree_int_cst_equal (const_tree, const_tree);
4423e4b17023SJohn Marino extern int tree_int_cst_lt (const_tree, const_tree);
4424e4b17023SJohn Marino extern int tree_int_cst_compare (const_tree, const_tree);
4425e4b17023SJohn Marino extern int host_integerp (const_tree, int)
4426e4b17023SJohn Marino #ifndef ENABLE_TREE_CHECKING
4427e4b17023SJohn Marino   ATTRIBUTE_PURE /* host_integerp is pure only when checking is disabled.  */
4428e4b17023SJohn Marino #endif
4429e4b17023SJohn Marino   ;
4430e4b17023SJohn Marino extern HOST_WIDE_INT tree_low_cst (const_tree, int);
4431e4b17023SJohn Marino #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)
4432e4b17023SJohn Marino extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
tree_low_cst(const_tree t,int pos)4433e4b17023SJohn Marino tree_low_cst (const_tree t, int pos)
4434e4b17023SJohn Marino {
4435e4b17023SJohn Marino   gcc_assert (host_integerp (t, pos));
4436e4b17023SJohn Marino   return TREE_INT_CST_LOW (t);
4437e4b17023SJohn Marino }
4438e4b17023SJohn Marino #endif
4439e4b17023SJohn Marino extern HOST_WIDE_INT size_low_cst (const_tree);
4440e4b17023SJohn Marino extern int tree_int_cst_sgn (const_tree);
4441e4b17023SJohn Marino extern int tree_int_cst_sign_bit (const_tree);
4442e4b17023SJohn Marino extern unsigned int tree_int_cst_min_precision (tree, bool);
4443e4b17023SJohn Marino extern bool tree_expr_nonnegative_p (tree);
4444e4b17023SJohn Marino extern bool tree_expr_nonnegative_warnv_p (tree, bool *);
4445e4b17023SJohn Marino extern bool may_negate_without_overflow_p (const_tree);
4446e4b17023SJohn Marino extern tree strip_array_types (tree);
4447e4b17023SJohn Marino extern tree excess_precision_type (tree);
4448e4b17023SJohn Marino 
4449e4b17023SJohn Marino /* Construct various nodes representing fract or accum data types.  */
4450e4b17023SJohn Marino 
4451e4b17023SJohn Marino extern tree make_fract_type (int, int, int);
4452e4b17023SJohn Marino extern tree make_accum_type (int, int, int);
4453e4b17023SJohn Marino 
4454e4b17023SJohn Marino #define make_signed_fract_type(P) make_fract_type (P, 0, 0)
4455e4b17023SJohn Marino #define make_unsigned_fract_type(P) make_fract_type (P, 1, 0)
4456e4b17023SJohn Marino #define make_sat_signed_fract_type(P) make_fract_type (P, 0, 1)
4457e4b17023SJohn Marino #define make_sat_unsigned_fract_type(P) make_fract_type (P, 1, 1)
4458e4b17023SJohn Marino #define make_signed_accum_type(P) make_accum_type (P, 0, 0)
4459e4b17023SJohn Marino #define make_unsigned_accum_type(P) make_accum_type (P, 1, 0)
4460e4b17023SJohn Marino #define make_sat_signed_accum_type(P) make_accum_type (P, 0, 1)
4461e4b17023SJohn Marino #define make_sat_unsigned_accum_type(P) make_accum_type (P, 1, 1)
4462e4b17023SJohn Marino 
4463e4b17023SJohn Marino #define make_or_reuse_signed_fract_type(P) \
4464e4b17023SJohn Marino 		make_or_reuse_fract_type (P, 0, 0)
4465e4b17023SJohn Marino #define make_or_reuse_unsigned_fract_type(P) \
4466e4b17023SJohn Marino 		make_or_reuse_fract_type (P, 1, 0)
4467e4b17023SJohn Marino #define make_or_reuse_sat_signed_fract_type(P) \
4468e4b17023SJohn Marino 		make_or_reuse_fract_type (P, 0, 1)
4469e4b17023SJohn Marino #define make_or_reuse_sat_unsigned_fract_type(P) \
4470e4b17023SJohn Marino 		make_or_reuse_fract_type (P, 1, 1)
4471e4b17023SJohn Marino #define make_or_reuse_signed_accum_type(P) \
4472e4b17023SJohn Marino 		make_or_reuse_accum_type (P, 0, 0)
4473e4b17023SJohn Marino #define make_or_reuse_unsigned_accum_type(P) \
4474e4b17023SJohn Marino 		make_or_reuse_accum_type (P, 1, 0)
4475e4b17023SJohn Marino #define make_or_reuse_sat_signed_accum_type(P) \
4476e4b17023SJohn Marino 		make_or_reuse_accum_type (P, 0, 1)
4477e4b17023SJohn Marino #define make_or_reuse_sat_unsigned_accum_type(P) \
4478e4b17023SJohn Marino 		make_or_reuse_accum_type (P, 1, 1)
4479e4b17023SJohn Marino 
4480e4b17023SJohn Marino /* From expmed.c.  Since rtl.h is included after tree.h, we can't
4481e4b17023SJohn Marino    put the prototype here.  Rtl.h does declare the prototype if
4482e4b17023SJohn Marino    tree.h had been included.  */
4483e4b17023SJohn Marino 
4484e4b17023SJohn Marino extern tree make_tree (tree, rtx);
4485e4b17023SJohn Marino 
4486e4b17023SJohn Marino /* Return a type like TTYPE except that its TYPE_ATTRIBUTES
4487e4b17023SJohn Marino    is ATTRIBUTE.
4488e4b17023SJohn Marino 
4489e4b17023SJohn Marino    Such modified types already made are recorded so that duplicates
4490e4b17023SJohn Marino    are not made.  */
4491e4b17023SJohn Marino 
4492e4b17023SJohn Marino extern tree build_type_attribute_variant (tree, tree);
4493e4b17023SJohn Marino extern tree build_decl_attribute_variant (tree, tree);
4494e4b17023SJohn Marino extern tree build_type_attribute_qual_variant (tree, tree, int);
4495e4b17023SJohn Marino 
4496e4b17023SJohn Marino /* Return 0 if the attributes for two types are incompatible, 1 if they
4497e4b17023SJohn Marino    are compatible, and 2 if they are nearly compatible (which causes a
4498e4b17023SJohn Marino    warning to be generated).  */
4499e4b17023SJohn Marino extern int comp_type_attributes (const_tree, const_tree);
4500e4b17023SJohn Marino 
4501e4b17023SJohn Marino /* Structure describing an attribute and a function to handle it.  */
4502e4b17023SJohn Marino struct attribute_spec
4503e4b17023SJohn Marino {
4504e4b17023SJohn Marino   /* The name of the attribute (without any leading or trailing __),
4505e4b17023SJohn Marino      or NULL to mark the end of a table of attributes.  */
4506e4b17023SJohn Marino   const char *const name;
4507e4b17023SJohn Marino   /* The minimum length of the list of arguments of the attribute.  */
4508e4b17023SJohn Marino   const int min_length;
4509e4b17023SJohn Marino   /* The maximum length of the list of arguments of the attribute
4510e4b17023SJohn Marino      (-1 for no maximum).  */
4511e4b17023SJohn Marino   const int max_length;
4512e4b17023SJohn Marino   /* Whether this attribute requires a DECL.  If it does, it will be passed
4513e4b17023SJohn Marino      from types of DECLs, function return types and array element types to
4514e4b17023SJohn Marino      the DECLs, function types and array types respectively; but when
4515e4b17023SJohn Marino      applied to a type in any other circumstances, it will be ignored with
4516e4b17023SJohn Marino      a warning.  (If greater control is desired for a given attribute,
4517e4b17023SJohn Marino      this should be false, and the flags argument to the handler may be
4518e4b17023SJohn Marino      used to gain greater control in that case.)  */
4519e4b17023SJohn Marino   const bool decl_required;
4520e4b17023SJohn Marino   /* Whether this attribute requires a type.  If it does, it will be passed
4521e4b17023SJohn Marino      from a DECL to the type of that DECL.  */
4522e4b17023SJohn Marino   const bool type_required;
4523e4b17023SJohn Marino   /* Whether this attribute requires a function (or method) type.  If it does,
4524e4b17023SJohn Marino      it will be passed from a function pointer type to the target type,
4525e4b17023SJohn Marino      and from a function return type (which is not itself a function
4526e4b17023SJohn Marino      pointer type) to the function type.  */
4527e4b17023SJohn Marino   const bool function_type_required;
4528e4b17023SJohn Marino   /* Function to handle this attribute.  NODE points to the node to which
4529e4b17023SJohn Marino      the attribute is to be applied.  If a DECL, it should be modified in
4530e4b17023SJohn Marino      place; if a TYPE, a copy should be created.  NAME is the name of the
4531e4b17023SJohn Marino      attribute (possibly with leading or trailing __).  ARGS is the TREE_LIST
4532e4b17023SJohn Marino      of the arguments (which may be NULL).  FLAGS gives further information
4533e4b17023SJohn Marino      about the context of the attribute.  Afterwards, the attributes will
4534e4b17023SJohn Marino      be added to the DECL_ATTRIBUTES or TYPE_ATTRIBUTES, as appropriate,
4535e4b17023SJohn Marino      unless *NO_ADD_ATTRS is set to true (which should be done on error,
4536e4b17023SJohn Marino      as well as in any other cases when the attributes should not be added
4537e4b17023SJohn Marino      to the DECL or TYPE).  Depending on FLAGS, any attributes to be
4538e4b17023SJohn Marino      applied to another type or DECL later may be returned;
4539e4b17023SJohn Marino      otherwise the return value should be NULL_TREE.  This pointer may be
4540e4b17023SJohn Marino      NULL if no special handling is required beyond the checks implied
4541e4b17023SJohn Marino      by the rest of this structure.  */
4542e4b17023SJohn Marino   tree (*const handler) (tree *node, tree name, tree args,
4543e4b17023SJohn Marino 				 int flags, bool *no_add_attrs);
4544e4b17023SJohn Marino   /* Specifies if attribute affects type's identity.  */
4545e4b17023SJohn Marino   const bool affects_type_identity;
4546e4b17023SJohn Marino };
4547e4b17023SJohn Marino 
4548e4b17023SJohn Marino /* Flags that may be passed in the third argument of decl_attributes, and
4549e4b17023SJohn Marino    to handler functions for attributes.  */
4550e4b17023SJohn Marino enum attribute_flags
4551e4b17023SJohn Marino {
4552e4b17023SJohn Marino   /* The type passed in is the type of a DECL, and any attributes that
4553e4b17023SJohn Marino      should be passed in again to be applied to the DECL rather than the
4554e4b17023SJohn Marino      type should be returned.  */
4555e4b17023SJohn Marino   ATTR_FLAG_DECL_NEXT = 1,
4556e4b17023SJohn Marino   /* The type passed in is a function return type, and any attributes that
4557e4b17023SJohn Marino      should be passed in again to be applied to the function type rather
4558e4b17023SJohn Marino      than the return type should be returned.  */
4559e4b17023SJohn Marino   ATTR_FLAG_FUNCTION_NEXT = 2,
4560e4b17023SJohn Marino   /* The type passed in is an array element type, and any attributes that
4561e4b17023SJohn Marino      should be passed in again to be applied to the array type rather
4562e4b17023SJohn Marino      than the element type should be returned.  */
4563e4b17023SJohn Marino   ATTR_FLAG_ARRAY_NEXT = 4,
4564e4b17023SJohn Marino   /* The type passed in is a structure, union or enumeration type being
4565e4b17023SJohn Marino      created, and should be modified in place.  */
4566e4b17023SJohn Marino   ATTR_FLAG_TYPE_IN_PLACE = 8,
4567e4b17023SJohn Marino   /* The attributes are being applied by default to a library function whose
4568e4b17023SJohn Marino      name indicates known behavior, and should be silently ignored if they
4569e4b17023SJohn Marino      are not in fact compatible with the function type.  */
4570e4b17023SJohn Marino   ATTR_FLAG_BUILT_IN = 16
4571e4b17023SJohn Marino };
4572e4b17023SJohn Marino 
4573e4b17023SJohn Marino /* Default versions of target-overridable functions.  */
4574e4b17023SJohn Marino 
4575e4b17023SJohn Marino extern tree merge_decl_attributes (tree, tree);
4576e4b17023SJohn Marino extern tree merge_type_attributes (tree, tree);
4577e4b17023SJohn Marino 
4578e4b17023SJohn Marino /* This function is a private implementation detail of lookup_attribute()
4579e4b17023SJohn Marino    and you should never call it directly.  */
4580e4b17023SJohn Marino extern tree private_lookup_attribute (const char *, size_t, tree);
4581e4b17023SJohn Marino 
4582e4b17023SJohn Marino /* Given an attribute name ATTR_NAME and a list of attributes LIST,
4583e4b17023SJohn Marino    return a pointer to the attribute's list element if the attribute
4584e4b17023SJohn Marino    is part of the list, or NULL_TREE if not found.  If the attribute
4585e4b17023SJohn Marino    appears more than once, this only returns the first occurrence; the
4586e4b17023SJohn Marino    TREE_CHAIN of the return value should be passed back in if further
4587e4b17023SJohn Marino    occurrences are wanted.  ATTR_NAME must be in the form 'text' (not
4588e4b17023SJohn Marino    '__text__').  */
4589e4b17023SJohn Marino 
4590e4b17023SJohn Marino static inline tree
lookup_attribute(const char * attr_name,tree list)4591e4b17023SJohn Marino lookup_attribute (const char *attr_name, tree list)
4592e4b17023SJohn Marino {
4593e4b17023SJohn Marino   gcc_checking_assert (attr_name[0] != '_');
4594e4b17023SJohn Marino   /* In most cases, list is NULL_TREE.  */
4595e4b17023SJohn Marino   if (list == NULL_TREE)
4596e4b17023SJohn Marino     return NULL_TREE;
4597e4b17023SJohn Marino   else
4598e4b17023SJohn Marino     /* Do the strlen() before calling the out-of-line implementation.
4599e4b17023SJohn Marino        In most cases attr_name is a string constant, and the compiler
4600e4b17023SJohn Marino        will optimize the strlen() away.  */
4601e4b17023SJohn Marino     return private_lookup_attribute (attr_name, strlen (attr_name), list);
4602e4b17023SJohn Marino }
4603e4b17023SJohn Marino 
4604e4b17023SJohn Marino /* This function is a private implementation detail of
4605e4b17023SJohn Marino    is_attribute_p() and you should never call it directly.  */
4606e4b17023SJohn Marino extern bool private_is_attribute_p (const char *, size_t, const_tree);
4607e4b17023SJohn Marino 
4608e4b17023SJohn Marino /* Given an identifier node IDENT and a string ATTR_NAME, return true
4609e4b17023SJohn Marino    if the identifier node is a valid attribute name for the string.
4610e4b17023SJohn Marino    ATTR_NAME must be in the form 'text' (not '__text__').  IDENT could
4611e4b17023SJohn Marino    be the identifier for 'text' or for '__text__'.  */
4612e4b17023SJohn Marino 
4613e4b17023SJohn Marino static inline bool
is_attribute_p(const char * attr_name,const_tree ident)4614e4b17023SJohn Marino is_attribute_p (const char *attr_name, const_tree ident)
4615e4b17023SJohn Marino {
4616e4b17023SJohn Marino   gcc_checking_assert (attr_name[0] != '_');
4617e4b17023SJohn Marino   /* Do the strlen() before calling the out-of-line implementation.
4618e4b17023SJohn Marino      In most cases attr_name is a string constant, and the compiler
4619e4b17023SJohn Marino      will optimize the strlen() away.  */
4620e4b17023SJohn Marino   return private_is_attribute_p (attr_name, strlen (attr_name), ident);
4621e4b17023SJohn Marino }
4622e4b17023SJohn Marino 
4623e4b17023SJohn Marino /* Remove any instances of attribute ATTR_NAME in LIST and return the
4624e4b17023SJohn Marino    modified list.  ATTR_NAME must be in the form 'text' (not
4625e4b17023SJohn Marino    '__text__').  */
4626e4b17023SJohn Marino 
4627e4b17023SJohn Marino extern tree remove_attribute (const char *, tree);
4628e4b17023SJohn Marino 
4629e4b17023SJohn Marino /* Given two attributes lists, return a list of their union.  */
4630e4b17023SJohn Marino 
4631e4b17023SJohn Marino extern tree merge_attributes (tree, tree);
4632e4b17023SJohn Marino 
4633e4b17023SJohn Marino #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
4634e4b17023SJohn Marino /* Given two Windows decl attributes lists, possibly including
4635e4b17023SJohn Marino    dllimport, return a list of their union .  */
4636e4b17023SJohn Marino extern tree merge_dllimport_decl_attributes (tree, tree);
4637e4b17023SJohn Marino 
4638e4b17023SJohn Marino /* Handle a "dllimport" or "dllexport" attribute.  */
4639e4b17023SJohn Marino extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
4640e4b17023SJohn Marino #endif
4641e4b17023SJohn Marino 
4642e4b17023SJohn Marino /* Check whether CAND is suitable to be returned from get_qualified_type
4643e4b17023SJohn Marino    (BASE, TYPE_QUALS).  */
4644e4b17023SJohn Marino 
4645e4b17023SJohn Marino extern bool check_qualified_type (const_tree, const_tree, int);
4646e4b17023SJohn Marino 
4647e4b17023SJohn Marino /* Return a version of the TYPE, qualified as indicated by the
4648e4b17023SJohn Marino    TYPE_QUALS, if one exists.  If no qualified version exists yet,
4649e4b17023SJohn Marino    return NULL_TREE.  */
4650e4b17023SJohn Marino 
4651e4b17023SJohn Marino extern tree get_qualified_type (tree, int);
4652e4b17023SJohn Marino 
4653e4b17023SJohn Marino /* Like get_qualified_type, but creates the type if it does not
4654e4b17023SJohn Marino    exist.  This function never returns NULL_TREE.  */
4655e4b17023SJohn Marino 
4656e4b17023SJohn Marino extern tree build_qualified_type (tree, int);
4657e4b17023SJohn Marino 
4658e4b17023SJohn Marino /* Create a variant of type T with alignment ALIGN.  */
4659e4b17023SJohn Marino 
4660e4b17023SJohn Marino extern tree build_aligned_type (tree, unsigned int);
4661e4b17023SJohn Marino 
4662e4b17023SJohn Marino /* Like build_qualified_type, but only deals with the `const' and
4663e4b17023SJohn Marino    `volatile' qualifiers.  This interface is retained for backwards
4664e4b17023SJohn Marino    compatibility with the various front-ends; new code should use
4665e4b17023SJohn Marino    build_qualified_type instead.  */
4666e4b17023SJohn Marino 
4667e4b17023SJohn Marino #define build_type_variant(TYPE, CONST_P, VOLATILE_P)			\
4668e4b17023SJohn Marino   build_qualified_type ((TYPE),						\
4669e4b17023SJohn Marino 			((CONST_P) ? TYPE_QUAL_CONST : 0)		\
4670e4b17023SJohn Marino 			| ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
4671e4b17023SJohn Marino 
4672e4b17023SJohn Marino /* Make a copy of a type node.  */
4673e4b17023SJohn Marino 
4674e4b17023SJohn Marino extern tree build_distinct_type_copy (tree);
4675e4b17023SJohn Marino extern tree build_variant_type_copy (tree);
4676e4b17023SJohn Marino 
4677e4b17023SJohn Marino /* Finish up a builtin RECORD_TYPE. Give it a name and provide its
4678e4b17023SJohn Marino    fields. Optionally specify an alignment, and then lay it out.  */
4679e4b17023SJohn Marino 
4680e4b17023SJohn Marino extern void finish_builtin_struct (tree, const char *,
4681e4b17023SJohn Marino 							 tree, tree);
4682e4b17023SJohn Marino 
4683e4b17023SJohn Marino /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
4684e4b17023SJohn Marino    TYPE_ALIGN and TYPE_MODE fields.  If called more than once on one
4685e4b17023SJohn Marino    node, does nothing except for the first time.  */
4686e4b17023SJohn Marino 
4687e4b17023SJohn Marino extern void layout_type (tree);
4688e4b17023SJohn Marino 
4689e4b17023SJohn Marino /* These functions allow a front-end to perform a manual layout of a
4690e4b17023SJohn Marino    RECORD_TYPE.  (For instance, if the placement of subsequent fields
4691e4b17023SJohn Marino    depends on the placement of fields so far.)  Begin by calling
4692e4b17023SJohn Marino    start_record_layout.  Then, call place_field for each of the
4693e4b17023SJohn Marino    fields.  Then, call finish_record_layout.  See layout_type for the
4694e4b17023SJohn Marino    default way in which these functions are used.  */
4695e4b17023SJohn Marino 
4696e4b17023SJohn Marino typedef struct record_layout_info_s
4697e4b17023SJohn Marino {
4698e4b17023SJohn Marino   /* The RECORD_TYPE that we are laying out.  */
4699e4b17023SJohn Marino   tree t;
4700e4b17023SJohn Marino   /* The offset into the record so far, in bytes, not including bits in
4701e4b17023SJohn Marino      BITPOS.  */
4702e4b17023SJohn Marino   tree offset;
4703e4b17023SJohn Marino   /* The last known alignment of SIZE.  */
4704e4b17023SJohn Marino   unsigned int offset_align;
4705e4b17023SJohn Marino   /* The bit position within the last OFFSET_ALIGN bits, in bits.  */
4706e4b17023SJohn Marino   tree bitpos;
4707e4b17023SJohn Marino   /* The alignment of the record so far, in bits.  */
4708e4b17023SJohn Marino   unsigned int record_align;
4709e4b17023SJohn Marino   /* The alignment of the record so far, ignoring #pragma pack and
4710e4b17023SJohn Marino      __attribute__ ((packed)), in bits.  */
4711e4b17023SJohn Marino   unsigned int unpacked_align;
4712e4b17023SJohn Marino   /* The previous field layed out.  */
4713e4b17023SJohn Marino   tree prev_field;
4714e4b17023SJohn Marino   /* The static variables (i.e., class variables, as opposed to
4715e4b17023SJohn Marino      instance variables) encountered in T.  */
4716e4b17023SJohn Marino   VEC(tree,gc) *pending_statics;
4717e4b17023SJohn Marino   /* Bits remaining in the current alignment group */
4718e4b17023SJohn Marino   int remaining_in_alignment;
4719e4b17023SJohn Marino   /* True if we've seen a packed field that didn't have normal
4720e4b17023SJohn Marino      alignment anyway.  */
4721e4b17023SJohn Marino   int packed_maybe_necessary;
4722e4b17023SJohn Marino } *record_layout_info;
4723e4b17023SJohn Marino 
4724e4b17023SJohn Marino extern record_layout_info start_record_layout (tree);
4725e4b17023SJohn Marino extern tree bit_from_pos (tree, tree);
4726e4b17023SJohn Marino extern tree byte_from_pos (tree, tree);
4727e4b17023SJohn Marino extern void pos_from_bit (tree *, tree *, unsigned int, tree);
4728e4b17023SJohn Marino extern void normalize_offset (tree *, tree *, unsigned int);
4729e4b17023SJohn Marino extern tree rli_size_unit_so_far (record_layout_info);
4730e4b17023SJohn Marino extern tree rli_size_so_far (record_layout_info);
4731e4b17023SJohn Marino extern void normalize_rli (record_layout_info);
4732e4b17023SJohn Marino extern void place_field (record_layout_info, tree);
4733e4b17023SJohn Marino extern void compute_record_mode (tree);
4734e4b17023SJohn Marino extern void finish_record_layout (record_layout_info, int);
4735e4b17023SJohn Marino 
4736e4b17023SJohn Marino /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
4737e4b17023SJohn Marino    return a canonicalized ..._TYPE node, so that duplicates are not made.
4738e4b17023SJohn Marino    How the hash code is computed is up to the caller, as long as any two
4739e4b17023SJohn Marino    callers that could hash identical-looking type nodes agree.  */
4740e4b17023SJohn Marino 
4741e4b17023SJohn Marino extern tree type_hash_canon (unsigned int, tree);
4742e4b17023SJohn Marino 
4743e4b17023SJohn Marino /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
4744e4b17023SJohn Marino    calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
4745e4b17023SJohn Marino    fields.  Call this only once for any given decl node.
4746e4b17023SJohn Marino 
4747e4b17023SJohn Marino    Second argument is the boundary that this field can be assumed to
4748e4b17023SJohn Marino    be starting at (in bits).  Zero means it can be assumed aligned
4749e4b17023SJohn Marino    on any boundary that may be needed.  */
4750e4b17023SJohn Marino 
4751e4b17023SJohn Marino extern void layout_decl (tree, unsigned);
4752e4b17023SJohn Marino 
4753e4b17023SJohn Marino /* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
4754e4b17023SJohn Marino    a previous call to layout_decl and calls it again.  */
4755e4b17023SJohn Marino 
4756e4b17023SJohn Marino extern void relayout_decl (tree);
4757e4b17023SJohn Marino 
4758e4b17023SJohn Marino /* Return the mode for data of a given size SIZE and mode class CLASS.
4759e4b17023SJohn Marino    If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
4760e4b17023SJohn Marino    The value is BLKmode if no other mode is found.  This is like
4761e4b17023SJohn Marino    mode_for_size, but is passed a tree.  */
4762e4b17023SJohn Marino 
4763e4b17023SJohn Marino extern enum machine_mode mode_for_size_tree (const_tree, enum mode_class, int);
4764e4b17023SJohn Marino 
4765e4b17023SJohn Marino /* Return an expr equal to X but certainly not valid as an lvalue.  */
4766e4b17023SJohn Marino 
4767e4b17023SJohn Marino #define non_lvalue(T) non_lvalue_loc (UNKNOWN_LOCATION, T)
4768e4b17023SJohn Marino extern tree non_lvalue_loc (location_t, tree);
4769e4b17023SJohn Marino 
4770e4b17023SJohn Marino extern tree convert (tree, tree);
4771e4b17023SJohn Marino extern unsigned int expr_align (const_tree);
4772e4b17023SJohn Marino extern tree expr_first (tree);
4773e4b17023SJohn Marino extern tree expr_last (tree);
4774e4b17023SJohn Marino extern tree size_in_bytes (const_tree);
4775e4b17023SJohn Marino extern HOST_WIDE_INT int_size_in_bytes (const_tree);
4776e4b17023SJohn Marino extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
4777e4b17023SJohn Marino extern tree tree_expr_size (const_tree);
4778e4b17023SJohn Marino extern tree bit_position (const_tree);
4779e4b17023SJohn Marino extern HOST_WIDE_INT int_bit_position (const_tree);
4780e4b17023SJohn Marino extern tree byte_position (const_tree);
4781e4b17023SJohn Marino extern HOST_WIDE_INT int_byte_position (const_tree);
4782e4b17023SJohn Marino 
4783e4b17023SJohn Marino /* Define data structures, macros, and functions for handling sizes
4784e4b17023SJohn Marino    and the various types used to represent sizes.  */
4785e4b17023SJohn Marino 
4786e4b17023SJohn Marino enum size_type_kind
4787e4b17023SJohn Marino {
4788e4b17023SJohn Marino   SIZETYPE,		/* Normal representation of sizes in bytes.  */
4789e4b17023SJohn Marino   SSIZETYPE,		/* Signed representation of sizes in bytes.  */
4790e4b17023SJohn Marino   BITSIZETYPE,		/* Normal representation of sizes in bits.  */
4791e4b17023SJohn Marino   SBITSIZETYPE,		/* Signed representation of sizes in bits.  */
4792e4b17023SJohn Marino   TYPE_KIND_LAST};
4793e4b17023SJohn Marino 
4794e4b17023SJohn Marino extern GTY(()) tree sizetype_tab[(int) TYPE_KIND_LAST];
4795e4b17023SJohn Marino 
4796e4b17023SJohn Marino #define sizetype sizetype_tab[(int) SIZETYPE]
4797e4b17023SJohn Marino #define bitsizetype sizetype_tab[(int) BITSIZETYPE]
4798e4b17023SJohn Marino #define ssizetype sizetype_tab[(int) SSIZETYPE]
4799e4b17023SJohn Marino #define sbitsizetype sizetype_tab[(int) SBITSIZETYPE]
4800e4b17023SJohn Marino 
4801e4b17023SJohn Marino extern tree size_int_kind (HOST_WIDE_INT, enum size_type_kind);
4802e4b17023SJohn Marino #define size_binop(CODE,T1,T2)\
4803e4b17023SJohn Marino    size_binop_loc (UNKNOWN_LOCATION, CODE, T1, T2)
4804e4b17023SJohn Marino extern tree size_binop_loc (location_t, enum tree_code, tree, tree);
4805e4b17023SJohn Marino #define size_diffop(T1,T2)\
4806e4b17023SJohn Marino    size_diffop_loc (UNKNOWN_LOCATION, T1, T2)
4807e4b17023SJohn Marino extern tree size_diffop_loc (location_t, tree, tree);
4808e4b17023SJohn Marino 
4809e4b17023SJohn Marino #define size_int(L) size_int_kind (L, SIZETYPE)
4810e4b17023SJohn Marino #define ssize_int(L) size_int_kind (L, SSIZETYPE)
4811e4b17023SJohn Marino #define bitsize_int(L) size_int_kind (L, BITSIZETYPE)
4812e4b17023SJohn Marino #define sbitsize_int(L) size_int_kind (L, SBITSIZETYPE)
4813e4b17023SJohn Marino 
4814e4b17023SJohn Marino #define round_up(T,N) round_up_loc (UNKNOWN_LOCATION, T, N)
4815e4b17023SJohn Marino extern tree round_up_loc (location_t, tree, int);
4816e4b17023SJohn Marino #define round_down(T,N) round_down_loc (UNKNOWN_LOCATION, T, N)
4817e4b17023SJohn Marino extern tree round_down_loc (location_t, tree, int);
4818e4b17023SJohn Marino extern void finalize_size_functions (void);
4819e4b17023SJohn Marino 
4820e4b17023SJohn Marino /* Type for sizes of data-type.  */
4821e4b17023SJohn Marino 
4822e4b17023SJohn Marino #define BITS_PER_UNIT_LOG \
4823e4b17023SJohn Marino   ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
4824e4b17023SJohn Marino    + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
4825e4b17023SJohn Marino    + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
4826e4b17023SJohn Marino 
4827e4b17023SJohn Marino /* If nonzero, an upper limit on alignment of structure fields, in bits,  */
4828e4b17023SJohn Marino extern unsigned int maximum_field_alignment;
4829e4b17023SJohn Marino 
4830e4b17023SJohn Marino /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
4831e4b17023SJohn Marino    by making the last node in X point to Y.
4832e4b17023SJohn Marino    Returns X, except if X is 0 returns Y.  */
4833e4b17023SJohn Marino 
4834e4b17023SJohn Marino extern tree chainon (tree, tree);
4835e4b17023SJohn Marino 
4836e4b17023SJohn Marino /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN.  */
4837e4b17023SJohn Marino 
4838e4b17023SJohn Marino extern tree tree_cons_stat (tree, tree, tree MEM_STAT_DECL);
4839e4b17023SJohn Marino #define tree_cons(t,q,w) tree_cons_stat (t,q,w MEM_STAT_INFO)
4840e4b17023SJohn Marino 
4841e4b17023SJohn Marino /* Return the last tree node in a chain.  */
4842e4b17023SJohn Marino 
4843e4b17023SJohn Marino extern tree tree_last (tree);
4844e4b17023SJohn Marino 
4845e4b17023SJohn Marino /* Reverse the order of elements in a chain, and return the new head.  */
4846e4b17023SJohn Marino 
4847e4b17023SJohn Marino extern tree nreverse (tree);
4848e4b17023SJohn Marino 
4849e4b17023SJohn Marino /* Returns the length of a chain of nodes
4850e4b17023SJohn Marino    (number of chain pointers to follow before reaching a null pointer).  */
4851e4b17023SJohn Marino 
4852e4b17023SJohn Marino extern int list_length (const_tree);
4853e4b17023SJohn Marino 
4854e4b17023SJohn Marino /* Returns the number of FIELD_DECLs in a type.  */
4855e4b17023SJohn Marino 
4856e4b17023SJohn Marino extern int fields_length (const_tree);
4857e4b17023SJohn Marino 
4858e4b17023SJohn Marino /* Returns the first FIELD_DECL in a type.  */
4859e4b17023SJohn Marino 
4860e4b17023SJohn Marino extern tree first_field (const_tree);
4861e4b17023SJohn Marino 
4862e4b17023SJohn Marino /* Given an initializer INIT, return TRUE if INIT is zero or some
4863e4b17023SJohn Marino    aggregate of zeros.  Otherwise return FALSE.  */
4864e4b17023SJohn Marino 
4865e4b17023SJohn Marino extern bool initializer_zerop (const_tree);
4866e4b17023SJohn Marino 
4867e4b17023SJohn Marino /* Given a CONSTRUCTOR CTOR, return the element values as a vector.  */
4868e4b17023SJohn Marino 
4869e4b17023SJohn Marino extern VEC(tree,gc) *ctor_to_vec (tree);
4870e4b17023SJohn Marino 
4871e4b17023SJohn Marino extern bool categorize_ctor_elements (const_tree, HOST_WIDE_INT *,
4872e4b17023SJohn Marino 				      HOST_WIDE_INT *, bool *);
4873e4b17023SJohn Marino 
4874e4b17023SJohn Marino extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
4875e4b17023SJohn Marino 
4876e4b17023SJohn Marino /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0.  */
4877e4b17023SJohn Marino 
4878e4b17023SJohn Marino extern int integer_zerop (const_tree);
4879e4b17023SJohn Marino 
4880e4b17023SJohn Marino /* integer_onep (tree x) is nonzero if X is an integer constant of value 1.  */
4881e4b17023SJohn Marino 
4882e4b17023SJohn Marino extern int integer_onep (const_tree);
4883e4b17023SJohn Marino 
4884e4b17023SJohn Marino /* integer_all_onesp (tree x) is nonzero if X is an integer constant
4885e4b17023SJohn Marino    all of whose significant bits are 1.  */
4886e4b17023SJohn Marino 
4887e4b17023SJohn Marino extern int integer_all_onesp (const_tree);
4888e4b17023SJohn Marino 
4889e4b17023SJohn Marino /* integer_pow2p (tree x) is nonzero is X is an integer constant with
4890e4b17023SJohn Marino    exactly one bit 1.  */
4891e4b17023SJohn Marino 
4892e4b17023SJohn Marino extern int integer_pow2p (const_tree);
4893e4b17023SJohn Marino 
4894e4b17023SJohn Marino /* integer_nonzerop (tree x) is nonzero if X is an integer constant
4895e4b17023SJohn Marino    with a nonzero value.  */
4896e4b17023SJohn Marino 
4897e4b17023SJohn Marino extern int integer_nonzerop (const_tree);
4898e4b17023SJohn Marino 
4899e4b17023SJohn Marino extern bool cst_and_fits_in_hwi (const_tree);
4900e4b17023SJohn Marino extern tree num_ending_zeros (const_tree);
4901e4b17023SJohn Marino 
4902e4b17023SJohn Marino /* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
4903e4b17023SJohn Marino    value 0.  */
4904e4b17023SJohn Marino 
4905e4b17023SJohn Marino extern int fixed_zerop (const_tree);
4906e4b17023SJohn Marino 
4907e4b17023SJohn Marino /* staticp (tree x) is nonzero if X is a reference to data allocated
4908e4b17023SJohn Marino    at a fixed address in memory.  Returns the outermost data.  */
4909e4b17023SJohn Marino 
4910e4b17023SJohn Marino extern tree staticp (tree);
4911e4b17023SJohn Marino 
4912e4b17023SJohn Marino /* save_expr (EXP) returns an expression equivalent to EXP
4913e4b17023SJohn Marino    but it can be used multiple times within context CTX
4914e4b17023SJohn Marino    and only evaluate EXP once.  */
4915e4b17023SJohn Marino 
4916e4b17023SJohn Marino extern tree save_expr (tree);
4917e4b17023SJohn Marino 
4918e4b17023SJohn Marino /* Look inside EXPR and into any simple arithmetic operations.  Return
4919e4b17023SJohn Marino    the innermost non-arithmetic node.  */
4920e4b17023SJohn Marino 
4921e4b17023SJohn Marino extern tree skip_simple_arithmetic (tree);
4922e4b17023SJohn Marino 
4923e4b17023SJohn Marino /* Return which tree structure is used by T.  */
4924e4b17023SJohn Marino 
4925e4b17023SJohn Marino enum tree_node_structure_enum tree_node_structure (const_tree);
4926e4b17023SJohn Marino 
4927e4b17023SJohn Marino /* Return true if EXP contains a PLACEHOLDER_EXPR, i.e. if it represents a
4928e4b17023SJohn Marino    size or offset that depends on a field within a record.  */
4929e4b17023SJohn Marino 
4930e4b17023SJohn Marino extern bool contains_placeholder_p (const_tree);
4931e4b17023SJohn Marino 
4932e4b17023SJohn Marino /* This macro calls the above function but short-circuits the common
4933e4b17023SJohn Marino    case of a constant to save time.  Also check for null.  */
4934e4b17023SJohn Marino 
4935e4b17023SJohn Marino #define CONTAINS_PLACEHOLDER_P(EXP) \
4936e4b17023SJohn Marino   ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
4937e4b17023SJohn Marino 
4938e4b17023SJohn Marino /* Return true if any part of the structure of TYPE involves a PLACEHOLDER_EXPR
4939e4b17023SJohn Marino    directly.  This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and
4940e4b17023SJohn Marino    field positions.  */
4941e4b17023SJohn Marino 
4942e4b17023SJohn Marino extern bool type_contains_placeholder_p (tree);
4943e4b17023SJohn Marino 
4944e4b17023SJohn Marino /* Given a tree EXP, find all occurences of references to fields
4945e4b17023SJohn Marino    in a PLACEHOLDER_EXPR and place them in vector REFS without
4946e4b17023SJohn Marino    duplicates.  Also record VAR_DECLs and CONST_DECLs.  Note that
4947e4b17023SJohn Marino    we assume here that EXP contains only arithmetic expressions
4948e4b17023SJohn Marino    or CALL_EXPRs with PLACEHOLDER_EXPRs occurring only in their
4949e4b17023SJohn Marino    argument list.  */
4950e4b17023SJohn Marino 
4951e4b17023SJohn Marino extern void find_placeholder_in_expr (tree, VEC (tree, heap) **);
4952e4b17023SJohn Marino 
4953e4b17023SJohn Marino /* This macro calls the above function but short-circuits the common
4954e4b17023SJohn Marino    case of a constant to save time and also checks for NULL.  */
4955e4b17023SJohn Marino 
4956e4b17023SJohn Marino #define FIND_PLACEHOLDER_IN_EXPR(EXP, V) \
4957e4b17023SJohn Marino do {					 \
4958e4b17023SJohn Marino   if((EXP) && !TREE_CONSTANT (EXP))	 \
4959e4b17023SJohn Marino     find_placeholder_in_expr (EXP, V);	 \
4960e4b17023SJohn Marino } while (0)
4961e4b17023SJohn Marino 
4962e4b17023SJohn Marino /* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
4963e4b17023SJohn Marino    return a tree with all occurrences of references to F in a
4964e4b17023SJohn Marino    PLACEHOLDER_EXPR replaced by R.  Also handle VAR_DECLs and
4965e4b17023SJohn Marino    CONST_DECLs.  Note that we assume here that EXP contains only
4966e4b17023SJohn Marino    arithmetic expressions or CALL_EXPRs with PLACEHOLDER_EXPRs
4967e4b17023SJohn Marino    occurring only in their argument list.  */
4968e4b17023SJohn Marino 
4969e4b17023SJohn Marino extern tree substitute_in_expr (tree, tree, tree);
4970e4b17023SJohn Marino 
4971e4b17023SJohn Marino /* This macro calls the above function but short-circuits the common
4972e4b17023SJohn Marino    case of a constant to save time and also checks for NULL.  */
4973e4b17023SJohn Marino 
4974e4b17023SJohn Marino #define SUBSTITUTE_IN_EXPR(EXP, F, R) \
4975e4b17023SJohn Marino   ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) : substitute_in_expr (EXP, F, R))
4976e4b17023SJohn Marino 
4977e4b17023SJohn Marino /* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
4978e4b17023SJohn Marino    for it within OBJ, a tree that is an object or a chain of references.  */
4979e4b17023SJohn Marino 
4980e4b17023SJohn Marino extern tree substitute_placeholder_in_expr (tree, tree);
4981e4b17023SJohn Marino 
4982e4b17023SJohn Marino /* This macro calls the above function but short-circuits the common
4983e4b17023SJohn Marino    case of a constant to save time and also checks for NULL.  */
4984e4b17023SJohn Marino 
4985e4b17023SJohn Marino #define SUBSTITUTE_PLACEHOLDER_IN_EXPR(EXP, OBJ) \
4986e4b17023SJohn Marino   ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP)	\
4987e4b17023SJohn Marino    : substitute_placeholder_in_expr (EXP, OBJ))
4988e4b17023SJohn Marino 
4989e4b17023SJohn Marino /* variable_size (EXP) is like save_expr (EXP) except that it
4990e4b17023SJohn Marino    is for the special case of something that is part of a
4991e4b17023SJohn Marino    variable size for a data type.  It makes special arrangements
4992e4b17023SJohn Marino    to compute the value at the right time when the data type
4993e4b17023SJohn Marino    belongs to a function parameter.  */
4994e4b17023SJohn Marino 
4995e4b17023SJohn Marino extern tree variable_size (tree);
4996e4b17023SJohn Marino 
4997e4b17023SJohn Marino /* stabilize_reference (EXP) returns a reference equivalent to EXP
4998e4b17023SJohn Marino    but it can be used multiple times
4999e4b17023SJohn Marino    and only evaluate the subexpressions once.  */
5000e4b17023SJohn Marino 
5001e4b17023SJohn Marino extern tree stabilize_reference (tree);
5002e4b17023SJohn Marino 
5003e4b17023SJohn Marino /* Subroutine of stabilize_reference; this is called for subtrees of
5004e4b17023SJohn Marino    references.  Any expression with side-effects must be put in a SAVE_EXPR
5005e4b17023SJohn Marino    to ensure that it is only evaluated once.  */
5006e4b17023SJohn Marino 
5007e4b17023SJohn Marino extern tree stabilize_reference_1 (tree);
5008e4b17023SJohn Marino 
5009e4b17023SJohn Marino /* Return EXP, stripped of any conversions to wider types
5010e4b17023SJohn Marino    in such a way that the result of converting to type FOR_TYPE
5011e4b17023SJohn Marino    is the same as if EXP were converted to FOR_TYPE.
5012e4b17023SJohn Marino    If FOR_TYPE is 0, it signifies EXP's type.  */
5013e4b17023SJohn Marino 
5014e4b17023SJohn Marino extern tree get_unwidened (tree, tree);
5015e4b17023SJohn Marino 
5016e4b17023SJohn Marino /* Return OP or a simpler expression for a narrower value
5017e4b17023SJohn Marino    which can be sign-extended or zero-extended to give back OP.
5018e4b17023SJohn Marino    Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
5019e4b17023SJohn Marino    or 0 if the value should be sign-extended.  */
5020e4b17023SJohn Marino 
5021e4b17023SJohn Marino extern tree get_narrower (tree, int *);
5022e4b17023SJohn Marino 
5023e4b17023SJohn Marino /* Return true if T is an expression that get_inner_reference handles.  */
5024e4b17023SJohn Marino 
5025e4b17023SJohn Marino static inline bool
handled_component_p(const_tree t)5026e4b17023SJohn Marino handled_component_p (const_tree t)
5027e4b17023SJohn Marino {
5028e4b17023SJohn Marino   switch (TREE_CODE (t))
5029e4b17023SJohn Marino     {
5030e4b17023SJohn Marino     case BIT_FIELD_REF:
5031e4b17023SJohn Marino     case COMPONENT_REF:
5032e4b17023SJohn Marino     case ARRAY_REF:
5033e4b17023SJohn Marino     case ARRAY_RANGE_REF:
5034e4b17023SJohn Marino     case VIEW_CONVERT_EXPR:
5035e4b17023SJohn Marino     case REALPART_EXPR:
5036e4b17023SJohn Marino     case IMAGPART_EXPR:
5037e4b17023SJohn Marino       return true;
5038e4b17023SJohn Marino 
5039e4b17023SJohn Marino     default:
5040e4b17023SJohn Marino       return false;
5041e4b17023SJohn Marino     }
5042e4b17023SJohn Marino }
5043e4b17023SJohn Marino 
5044e4b17023SJohn Marino /* Given an expression EXP that is a handled_component_p,
5045e4b17023SJohn Marino    look for the ultimate containing object, which is returned and specify
5046e4b17023SJohn Marino    the access position and size.  */
5047e4b17023SJohn Marino 
5048e4b17023SJohn Marino extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
5049e4b17023SJohn Marino 				 tree *, enum machine_mode *, int *, int *,
5050e4b17023SJohn Marino 				 bool);
5051e4b17023SJohn Marino 
5052e4b17023SJohn Marino /* Given an expression EXP that may be a COMPONENT_REF, an ARRAY_REF or an
5053e4b17023SJohn Marino    ARRAY_RANGE_REF, look for whether EXP or any nested component-refs within
5054e4b17023SJohn Marino    EXP is marked as PACKED.  */
5055e4b17023SJohn Marino 
5056e4b17023SJohn Marino extern bool contains_packed_reference (const_tree exp);
5057e4b17023SJohn Marino 
5058e4b17023SJohn Marino /* Return a tree of sizetype representing the size, in bytes, of the element
5059e4b17023SJohn Marino    of EXP, an ARRAY_REF or an ARRAY_RANGE_REF.  */
5060e4b17023SJohn Marino 
5061e4b17023SJohn Marino extern tree array_ref_element_size (tree);
5062e4b17023SJohn Marino 
5063e4b17023SJohn Marino /* Return a tree representing the lower bound of the array mentioned in
5064e4b17023SJohn Marino    EXP, an ARRAY_REF or an ARRAY_RANGE_REF.  */
5065e4b17023SJohn Marino 
5066e4b17023SJohn Marino extern tree array_ref_low_bound (tree);
5067e4b17023SJohn Marino 
5068e4b17023SJohn Marino /* Return a tree representing the upper bound of the array mentioned in
5069e4b17023SJohn Marino    EXP, an ARRAY_REF or an ARRAY_RANGE_REF.  */
5070e4b17023SJohn Marino 
5071e4b17023SJohn Marino extern tree array_ref_up_bound (tree);
5072e4b17023SJohn Marino 
5073e4b17023SJohn Marino /* Return a tree representing the offset, in bytes, of the field referenced
5074e4b17023SJohn Marino    by EXP.  This does not include any offset in DECL_FIELD_BIT_OFFSET.  */
5075e4b17023SJohn Marino 
5076e4b17023SJohn Marino extern tree component_ref_field_offset (tree);
5077e4b17023SJohn Marino 
5078e4b17023SJohn Marino /* Given a DECL or TYPE, return the scope in which it was declared, or
5079e4b17023SJohn Marino    NUL_TREE if there is no containing scope.  */
5080e4b17023SJohn Marino 
5081e4b17023SJohn Marino extern tree get_containing_scope (const_tree);
5082e4b17023SJohn Marino 
5083e4b17023SJohn Marino /* Return the FUNCTION_DECL which provides this _DECL with its context,
5084e4b17023SJohn Marino    or zero if none.  */
5085e4b17023SJohn Marino extern tree decl_function_context (const_tree);
5086e4b17023SJohn Marino 
5087e4b17023SJohn Marino /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
5088e4b17023SJohn Marino    this _DECL with its context, or zero if none.  */
5089e4b17023SJohn Marino extern tree decl_type_context (const_tree);
5090e4b17023SJohn Marino 
5091e4b17023SJohn Marino /* Return 1 if EXPR is the real constant zero.  */
5092e4b17023SJohn Marino extern int real_zerop (const_tree);
5093e4b17023SJohn Marino 
5094e4b17023SJohn Marino /* Declare commonly used variables for tree structure.  */
5095e4b17023SJohn Marino 
5096e4b17023SJohn Marino /* Nonzero means lvalues are limited to those valid in pedantic ANSI C.
5097e4b17023SJohn Marino    Zero means allow extended lvalues.  */
5098e4b17023SJohn Marino 
5099e4b17023SJohn Marino extern int pedantic_lvalues;
5100e4b17023SJohn Marino 
5101e4b17023SJohn Marino /* Points to the FUNCTION_DECL of the function whose body we are reading.  */
5102e4b17023SJohn Marino 
5103e4b17023SJohn Marino extern GTY(()) tree current_function_decl;
5104e4b17023SJohn Marino 
5105e4b17023SJohn Marino /* Nonzero means a FUNC_BEGIN label was emitted.  */
5106e4b17023SJohn Marino extern GTY(()) const char * current_function_func_begin_label;
5107e4b17023SJohn Marino 
5108e4b17023SJohn Marino /* Iterator for going through the function arguments.  */
5109e4b17023SJohn Marino typedef struct {
5110e4b17023SJohn Marino   tree next;			/* TREE_LIST pointing to the next argument */
5111e4b17023SJohn Marino } function_args_iterator;
5112e4b17023SJohn Marino 
5113e4b17023SJohn Marino /* Initialize the iterator I with arguments from function FNDECL  */
5114e4b17023SJohn Marino 
5115e4b17023SJohn Marino static inline void
function_args_iter_init(function_args_iterator * i,const_tree fntype)5116e4b17023SJohn Marino function_args_iter_init (function_args_iterator *i, const_tree fntype)
5117e4b17023SJohn Marino {
5118e4b17023SJohn Marino   i->next = TYPE_ARG_TYPES (fntype);
5119e4b17023SJohn Marino }
5120e4b17023SJohn Marino 
5121e4b17023SJohn Marino /* Return a pointer that holds the next argument if there are more arguments to
5122e4b17023SJohn Marino    handle, otherwise return NULL.  */
5123e4b17023SJohn Marino 
5124e4b17023SJohn Marino static inline tree *
function_args_iter_cond_ptr(function_args_iterator * i)5125e4b17023SJohn Marino function_args_iter_cond_ptr (function_args_iterator *i)
5126e4b17023SJohn Marino {
5127e4b17023SJohn Marino   return (i->next) ? &TREE_VALUE (i->next) : NULL;
5128e4b17023SJohn Marino }
5129e4b17023SJohn Marino 
5130e4b17023SJohn Marino /* Return the next argument if there are more arguments to handle, otherwise
5131e4b17023SJohn Marino    return NULL.  */
5132e4b17023SJohn Marino 
5133e4b17023SJohn Marino static inline tree
function_args_iter_cond(function_args_iterator * i)5134e4b17023SJohn Marino function_args_iter_cond (function_args_iterator *i)
5135e4b17023SJohn Marino {
5136e4b17023SJohn Marino   return (i->next) ? TREE_VALUE (i->next) : NULL_TREE;
5137e4b17023SJohn Marino }
5138e4b17023SJohn Marino 
5139e4b17023SJohn Marino /* Advance to the next argument.  */
5140e4b17023SJohn Marino static inline void
function_args_iter_next(function_args_iterator * i)5141e4b17023SJohn Marino function_args_iter_next (function_args_iterator *i)
5142e4b17023SJohn Marino {
5143e4b17023SJohn Marino   gcc_assert (i->next != NULL_TREE);
5144e4b17023SJohn Marino   i->next = TREE_CHAIN (i->next);
5145e4b17023SJohn Marino }
5146e4b17023SJohn Marino 
5147e4b17023SJohn Marino /* We set BLOCK_SOURCE_LOCATION only to inlined function entry points.  */
5148e4b17023SJohn Marino 
5149e4b17023SJohn Marino static inline bool
inlined_function_outer_scope_p(const_tree block)5150e4b17023SJohn Marino inlined_function_outer_scope_p (const_tree block)
5151e4b17023SJohn Marino {
5152e4b17023SJohn Marino  return BLOCK_SOURCE_LOCATION (block) != UNKNOWN_LOCATION;
5153e4b17023SJohn Marino }
5154e4b17023SJohn Marino 
5155e4b17023SJohn Marino /* Loop over all function arguments of FNTYPE.  In each iteration, PTR is set
5156e4b17023SJohn Marino    to point to the next tree element.  ITER is an instance of
5157e4b17023SJohn Marino    function_args_iterator used to iterate the arguments.  */
5158e4b17023SJohn Marino #define FOREACH_FUNCTION_ARGS_PTR(FNTYPE, PTR, ITER)			\
5159e4b17023SJohn Marino   for (function_args_iter_init (&(ITER), (FNTYPE));			\
5160e4b17023SJohn Marino        (PTR = function_args_iter_cond_ptr (&(ITER))) != NULL;		\
5161e4b17023SJohn Marino        function_args_iter_next (&(ITER)))
5162e4b17023SJohn Marino 
5163e4b17023SJohn Marino /* Loop over all function arguments of FNTYPE.  In each iteration, TREE is set
5164e4b17023SJohn Marino    to the next tree element.  ITER is an instance of function_args_iterator
5165e4b17023SJohn Marino    used to iterate the arguments.  */
5166e4b17023SJohn Marino #define FOREACH_FUNCTION_ARGS(FNTYPE, TREE, ITER)			\
5167e4b17023SJohn Marino   for (function_args_iter_init (&(ITER), (FNTYPE));			\
5168e4b17023SJohn Marino        (TREE = function_args_iter_cond (&(ITER))) != NULL_TREE;		\
5169e4b17023SJohn Marino        function_args_iter_next (&(ITER)))
5170e4b17023SJohn Marino 
5171e4b17023SJohn Marino 
5172e4b17023SJohn Marino 
5173e4b17023SJohn Marino /* In tree.c */
5174e4b17023SJohn Marino extern unsigned crc32_string (unsigned, const char *);
5175e4b17023SJohn Marino extern unsigned crc32_byte (unsigned, char);
5176e4b17023SJohn Marino extern void clean_symbol_name (char *);
5177e4b17023SJohn Marino extern tree get_file_function_name (const char *);
5178e4b17023SJohn Marino extern tree get_callee_fndecl (const_tree);
5179e4b17023SJohn Marino extern int type_num_arguments (const_tree);
5180e4b17023SJohn Marino extern bool associative_tree_code (enum tree_code);
5181e4b17023SJohn Marino extern bool commutative_tree_code (enum tree_code);
5182e4b17023SJohn Marino extern bool commutative_ternary_tree_code (enum tree_code);
5183e4b17023SJohn Marino extern tree upper_bound_in_type (tree, tree);
5184e4b17023SJohn Marino extern tree lower_bound_in_type (tree, tree);
5185e4b17023SJohn Marino extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
5186e4b17023SJohn Marino extern tree create_artificial_label (location_t);
5187e4b17023SJohn Marino extern const char *get_name (tree);
5188e4b17023SJohn Marino extern bool stdarg_p (const_tree);
5189e4b17023SJohn Marino extern bool prototype_p (tree);
5190e4b17023SJohn Marino extern bool is_typedef_decl (tree x);
5191e4b17023SJohn Marino extern bool typedef_variant_p (tree);
5192e4b17023SJohn Marino extern bool auto_var_in_fn_p (const_tree, const_tree);
5193e4b17023SJohn Marino extern tree build_low_bits_mask (tree, unsigned);
5194e4b17023SJohn Marino extern tree tree_strip_nop_conversions (tree);
5195e4b17023SJohn Marino extern tree tree_strip_sign_nop_conversions (tree);
5196e4b17023SJohn Marino extern const_tree strip_invariant_refs (const_tree);
5197e4b17023SJohn Marino extern tree lhd_gcc_personality (void);
5198e4b17023SJohn Marino extern void assign_assembler_name_if_neeeded (tree);
5199e4b17023SJohn Marino extern void warn_deprecated_use (tree, tree);
5200e4b17023SJohn Marino 
5201e4b17023SJohn Marino 
5202e4b17023SJohn Marino /* In cgraph.c */
5203e4b17023SJohn Marino extern void change_decl_assembler_name (tree, tree);
5204e4b17023SJohn Marino 
5205e4b17023SJohn Marino /* In gimplify.c */
5206e4b17023SJohn Marino extern tree unshare_expr (tree);
5207e4b17023SJohn Marino 
5208e4b17023SJohn Marino /* In stmt.c */
5209e4b17023SJohn Marino 
5210e4b17023SJohn Marino extern void expand_expr_stmt (tree);
5211e4b17023SJohn Marino extern int warn_if_unused_value (const_tree, location_t);
5212e4b17023SJohn Marino extern void expand_label (tree);
5213e4b17023SJohn Marino extern void expand_goto (tree);
5214e4b17023SJohn Marino 
5215e4b17023SJohn Marino extern rtx expand_stack_save (void);
5216e4b17023SJohn Marino extern void expand_stack_restore (tree);
5217e4b17023SJohn Marino extern void expand_return (tree);
5218e4b17023SJohn Marino 
5219e4b17023SJohn Marino /* In tree-eh.c */
5220e4b17023SJohn Marino extern void using_eh_for_cleanups (void);
5221e4b17023SJohn Marino 
5222e4b17023SJohn Marino /* Compare and hash for any structure which begins with a canonical
5223e4b17023SJohn Marino    pointer.  Assumes all pointers are interchangeable, which is sort
5224e4b17023SJohn Marino    of already assumed by gcc elsewhere IIRC.  */
5225e4b17023SJohn Marino 
5226e4b17023SJohn Marino static inline int
struct_ptr_eq(const void * a,const void * b)5227e4b17023SJohn Marino struct_ptr_eq (const void *a, const void *b)
5228e4b17023SJohn Marino {
5229e4b17023SJohn Marino   const void * const * x = (const void * const *) a;
5230e4b17023SJohn Marino   const void * const * y = (const void * const *) b;
5231e4b17023SJohn Marino   return *x == *y;
5232e4b17023SJohn Marino }
5233e4b17023SJohn Marino 
5234e4b17023SJohn Marino static inline hashval_t
struct_ptr_hash(const void * a)5235e4b17023SJohn Marino struct_ptr_hash (const void *a)
5236e4b17023SJohn Marino {
5237e4b17023SJohn Marino   const void * const * x = (const void * const *) a;
5238e4b17023SJohn Marino   return (intptr_t)*x >> 4;
5239e4b17023SJohn Marino }
5240e4b17023SJohn Marino 
5241e4b17023SJohn Marino /* In fold-const.c */
5242e4b17023SJohn Marino 
5243e4b17023SJohn Marino /* Non-zero if we are folding constants inside an initializer; zero
5244e4b17023SJohn Marino    otherwise.  */
5245e4b17023SJohn Marino extern int folding_initializer;
5246e4b17023SJohn Marino 
5247e4b17023SJohn Marino /* Convert between trees and native memory representation.  */
5248e4b17023SJohn Marino extern int native_encode_expr (const_tree, unsigned char *, int);
5249e4b17023SJohn Marino extern tree native_interpret_expr (tree, const unsigned char *, int);
5250e4b17023SJohn Marino 
5251e4b17023SJohn Marino /* Fold constants as much as possible in an expression.
5252e4b17023SJohn Marino    Returns the simplified expression.
5253e4b17023SJohn Marino    Acts only on the top level of the expression;
5254e4b17023SJohn Marino    if the argument itself cannot be simplified, its
5255e4b17023SJohn Marino    subexpressions are not changed.  */
5256e4b17023SJohn Marino 
5257e4b17023SJohn Marino extern tree fold (tree);
5258e4b17023SJohn Marino #define fold_unary(CODE,T1,T2)\
5259e4b17023SJohn Marino    fold_unary_loc (UNKNOWN_LOCATION, CODE, T1, T2)
5260e4b17023SJohn Marino extern tree fold_unary_loc (location_t, enum tree_code, tree, tree);
5261e4b17023SJohn Marino #define fold_unary_ignore_overflow(CODE,T1,T2)\
5262e4b17023SJohn Marino    fold_unary_ignore_overflow_loc (UNKNOWN_LOCATION, CODE, T1, T2)
5263e4b17023SJohn Marino extern tree fold_unary_ignore_overflow_loc (location_t, enum tree_code, tree, tree);
5264e4b17023SJohn Marino #define fold_binary(CODE,T1,T2,T3)\
5265e4b17023SJohn Marino    fold_binary_loc (UNKNOWN_LOCATION, CODE, T1, T2, T3)
5266e4b17023SJohn Marino extern tree fold_binary_loc (location_t, enum tree_code, tree, tree, tree);
5267e4b17023SJohn Marino #define fold_ternary(CODE,T1,T2,T3,T4)\
5268e4b17023SJohn Marino    fold_ternary_loc (UNKNOWN_LOCATION, CODE, T1, T2, T3, T4)
5269e4b17023SJohn Marino extern tree fold_ternary_loc (location_t, enum tree_code, tree, tree, tree, tree);
5270e4b17023SJohn Marino #define fold_build1(c,t1,t2)\
5271e4b17023SJohn Marino    fold_build1_stat_loc (UNKNOWN_LOCATION, c, t1, t2 MEM_STAT_INFO)
5272e4b17023SJohn Marino #define fold_build1_loc(l,c,t1,t2)\
5273e4b17023SJohn Marino    fold_build1_stat_loc (l, c, t1, t2 MEM_STAT_INFO)
5274e4b17023SJohn Marino extern tree fold_build1_stat_loc (location_t, enum tree_code, tree,
5275e4b17023SJohn Marino 				  tree MEM_STAT_DECL);
5276e4b17023SJohn Marino #define fold_build2(c,t1,t2,t3)\
5277e4b17023SJohn Marino    fold_build2_stat_loc (UNKNOWN_LOCATION, c, t1, t2, t3 MEM_STAT_INFO)
5278e4b17023SJohn Marino #define fold_build2_loc(l,c,t1,t2,t3)\
5279e4b17023SJohn Marino    fold_build2_stat_loc (l, c, t1, t2, t3 MEM_STAT_INFO)
5280e4b17023SJohn Marino extern tree fold_build2_stat_loc (location_t, enum tree_code, tree, tree,
5281e4b17023SJohn Marino 				  tree MEM_STAT_DECL);
5282e4b17023SJohn Marino #define fold_build3(c,t1,t2,t3,t4)\
5283e4b17023SJohn Marino    fold_build3_stat_loc (UNKNOWN_LOCATION, c, t1, t2, t3, t4 MEM_STAT_INFO)
5284e4b17023SJohn Marino #define fold_build3_loc(l,c,t1,t2,t3,t4)\
5285e4b17023SJohn Marino    fold_build3_stat_loc (l, c, t1, t2, t3, t4 MEM_STAT_INFO)
5286e4b17023SJohn Marino extern tree fold_build3_stat_loc (location_t, enum tree_code, tree, tree, tree,
5287e4b17023SJohn Marino 				  tree MEM_STAT_DECL);
5288e4b17023SJohn Marino extern tree fold_build1_initializer_loc (location_t, enum tree_code, tree, tree);
5289e4b17023SJohn Marino extern tree fold_build2_initializer_loc (location_t, enum tree_code, tree, tree, tree);
5290e4b17023SJohn Marino extern tree fold_build3_initializer_loc (location_t, enum tree_code, tree, tree, tree, tree);
5291e4b17023SJohn Marino #define fold_build_call_array(T1,T2,N,T4)\
5292e4b17023SJohn Marino    fold_build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T4)
5293e4b17023SJohn Marino extern tree fold_build_call_array_loc (location_t, tree, tree, int, tree *);
5294e4b17023SJohn Marino #define fold_build_call_array_initializer(T1,T2,N,T4)\
5295e4b17023SJohn Marino    fold_build_call_array_initializer_loc (UNKNOWN_LOCATION, T1, T2, N, T4)
5296e4b17023SJohn Marino extern tree fold_build_call_array_initializer_loc (location_t, tree, tree, int, tree *);
5297e4b17023SJohn Marino extern bool fold_convertible_p (const_tree, const_tree);
5298e4b17023SJohn Marino #define fold_convert(T1,T2)\
5299e4b17023SJohn Marino    fold_convert_loc(UNKNOWN_LOCATION, T1, T2)
5300e4b17023SJohn Marino extern tree fold_convert_loc (location_t, tree, tree);
5301e4b17023SJohn Marino extern tree fold_single_bit_test (location_t, enum tree_code, tree, tree, tree);
5302e4b17023SJohn Marino extern tree fold_ignored_result (tree);
5303e4b17023SJohn Marino extern tree fold_abs_const (tree, tree);
5304e4b17023SJohn Marino extern tree fold_indirect_ref_1 (location_t, tree, tree);
5305e4b17023SJohn Marino extern void fold_defer_overflow_warnings (void);
5306e4b17023SJohn Marino extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
5307e4b17023SJohn Marino extern void fold_undefer_and_ignore_overflow_warnings (void);
5308e4b17023SJohn Marino extern bool fold_deferring_overflow_warnings_p (void);
5309e4b17023SJohn Marino extern tree fold_fma (location_t, tree, tree, tree, tree);
5310e4b17023SJohn Marino 
5311e4b17023SJohn Marino enum operand_equal_flag
5312e4b17023SJohn Marino {
5313e4b17023SJohn Marino   OEP_ONLY_CONST = 1,
5314e4b17023SJohn Marino   OEP_PURE_SAME = 2,
5315e4b17023SJohn Marino   OEP_CONSTANT_ADDRESS_OF = 4
5316e4b17023SJohn Marino };
5317e4b17023SJohn Marino 
5318e4b17023SJohn Marino extern int operand_equal_p (const_tree, const_tree, unsigned int);
5319e4b17023SJohn Marino extern int multiple_of_p (tree, const_tree, const_tree);
5320e4b17023SJohn Marino #define omit_one_operand(T1,T2,T3)\
5321e4b17023SJohn Marino    omit_one_operand_loc (UNKNOWN_LOCATION, T1, T2, T3)
5322e4b17023SJohn Marino extern tree omit_one_operand_loc (location_t, tree, tree, tree);
5323e4b17023SJohn Marino #define omit_two_operands(T1,T2,T3,T4)\
5324e4b17023SJohn Marino    omit_two_operands_loc (UNKNOWN_LOCATION, T1, T2, T3, T4)
5325e4b17023SJohn Marino extern tree omit_two_operands_loc (location_t, tree, tree, tree, tree);
5326e4b17023SJohn Marino #define invert_truthvalue(T)\
5327e4b17023SJohn Marino    invert_truthvalue_loc(UNKNOWN_LOCATION, T)
5328e4b17023SJohn Marino extern tree invert_truthvalue_loc (location_t, tree);
5329e4b17023SJohn Marino extern tree fold_truth_not_expr (location_t, tree);
5330e4b17023SJohn Marino extern tree fold_unary_to_constant (enum tree_code, tree, tree);
5331e4b17023SJohn Marino extern tree fold_binary_to_constant (enum tree_code, tree, tree, tree);
5332e4b17023SJohn Marino extern tree fold_read_from_constant_string (tree);
5333e4b17023SJohn Marino extern tree int_const_binop (enum tree_code, const_tree, const_tree);
5334e4b17023SJohn Marino #define build_fold_addr_expr(T)\
5335e4b17023SJohn Marino         build_fold_addr_expr_loc (UNKNOWN_LOCATION, (T))
5336e4b17023SJohn Marino extern tree build_fold_addr_expr_loc (location_t, tree);
5337e4b17023SJohn Marino #define build_fold_addr_expr_with_type(T,TYPE)\
5338e4b17023SJohn Marino         build_fold_addr_expr_with_type_loc (UNKNOWN_LOCATION, (T), TYPE)
5339e4b17023SJohn Marino extern tree build_fold_addr_expr_with_type_loc (location_t, tree, tree);
5340e4b17023SJohn Marino extern tree fold_build_cleanup_point_expr (tree type, tree expr);
5341e4b17023SJohn Marino extern tree fold_strip_sign_ops (tree);
5342e4b17023SJohn Marino #define build_fold_indirect_ref(T)\
5343e4b17023SJohn Marino         build_fold_indirect_ref_loc (UNKNOWN_LOCATION, T)
5344e4b17023SJohn Marino extern tree build_fold_indirect_ref_loc (location_t, tree);
5345e4b17023SJohn Marino #define fold_indirect_ref(T)\
5346e4b17023SJohn Marino         fold_indirect_ref_loc (UNKNOWN_LOCATION, T)
5347e4b17023SJohn Marino extern tree fold_indirect_ref_loc (location_t, tree);
5348e4b17023SJohn Marino extern tree build_simple_mem_ref_loc (location_t, tree);
5349e4b17023SJohn Marino #define build_simple_mem_ref(T)\
5350e4b17023SJohn Marino 	build_simple_mem_ref_loc (UNKNOWN_LOCATION, T)
5351e4b17023SJohn Marino extern double_int mem_ref_offset (const_tree);
5352e4b17023SJohn Marino extern tree reference_alias_ptr_type (const_tree);
5353e4b17023SJohn Marino extern tree build_invariant_address (tree, tree, HOST_WIDE_INT);
5354e4b17023SJohn Marino extern tree constant_boolean_node (bool, tree);
5355e4b17023SJohn Marino extern tree div_if_zero_remainder (enum tree_code, const_tree, const_tree);
5356e4b17023SJohn Marino 
5357e4b17023SJohn Marino extern bool tree_swap_operands_p (const_tree, const_tree, bool);
5358e4b17023SJohn Marino extern enum tree_code swap_tree_comparison (enum tree_code);
5359e4b17023SJohn Marino 
5360e4b17023SJohn Marino extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
5361e4b17023SJohn Marino extern enum tree_code invert_tree_comparison (enum tree_code, bool);
5362e4b17023SJohn Marino 
5363e4b17023SJohn Marino extern bool tree_expr_nonzero_p (tree);
5364e4b17023SJohn Marino extern bool tree_unary_nonzero_warnv_p (enum tree_code, tree, tree, bool *);
5365e4b17023SJohn Marino extern bool tree_binary_nonzero_warnv_p (enum tree_code, tree, tree, tree op1,
5366e4b17023SJohn Marino                                          bool *);
5367e4b17023SJohn Marino extern bool tree_single_nonzero_warnv_p (tree, bool *);
5368e4b17023SJohn Marino extern bool tree_unary_nonnegative_warnv_p (enum tree_code, tree, tree, bool *);
5369e4b17023SJohn Marino extern bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree,
5370e4b17023SJohn Marino                                              bool *);
5371e4b17023SJohn Marino extern bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
5372e4b17023SJohn Marino extern bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
5373e4b17023SJohn Marino extern bool tree_call_nonnegative_warnv_p (tree, tree, tree, tree, bool *);
5374e4b17023SJohn Marino 
5375e4b17023SJohn Marino extern bool tree_expr_nonzero_warnv_p (tree, bool *);
5376e4b17023SJohn Marino 
5377e4b17023SJohn Marino extern bool fold_real_zero_addition_p (const_tree, const_tree, int);
5378e4b17023SJohn Marino extern tree combine_comparisons (location_t, enum tree_code, enum tree_code,
5379e4b17023SJohn Marino 				 enum tree_code, tree, tree, tree);
5380e4b17023SJohn Marino extern void debug_fold_checksum (const_tree);
5381e4b17023SJohn Marino 
5382e4b17023SJohn Marino /* Return nonzero if CODE is a tree code that represents a truth value.  */
5383e4b17023SJohn Marino static inline bool
truth_value_p(enum tree_code code)5384e4b17023SJohn Marino truth_value_p (enum tree_code code)
5385e4b17023SJohn Marino {
5386e4b17023SJohn Marino   return (TREE_CODE_CLASS (code) == tcc_comparison
5387e4b17023SJohn Marino 	  || code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
5388e4b17023SJohn Marino 	  || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
5389e4b17023SJohn Marino 	  || code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
5390e4b17023SJohn Marino }
5391e4b17023SJohn Marino 
5392e4b17023SJohn Marino /* Return whether TYPE is a type suitable for an offset for
5393e4b17023SJohn Marino    a POINTER_PLUS_EXPR.  */
5394e4b17023SJohn Marino static inline bool
ptrofftype_p(tree type)5395e4b17023SJohn Marino ptrofftype_p (tree type)
5396e4b17023SJohn Marino {
5397e4b17023SJohn Marino   return (INTEGRAL_TYPE_P (type)
5398e4b17023SJohn Marino 	  && TYPE_PRECISION (type) == TYPE_PRECISION (sizetype)
5399e4b17023SJohn Marino 	  && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));
5400e4b17023SJohn Marino }
5401e4b17023SJohn Marino 
5402e4b17023SJohn Marino /* Return OFF converted to a pointer offset type suitable as offset for
5403e4b17023SJohn Marino    POINTER_PLUS_EXPR.  Use location LOC for this conversion.  */
5404e4b17023SJohn Marino static inline tree
convert_to_ptrofftype_loc(location_t loc,tree off)5405e4b17023SJohn Marino convert_to_ptrofftype_loc (location_t loc, tree off)
5406e4b17023SJohn Marino {
5407e4b17023SJohn Marino   return fold_convert_loc (loc, sizetype, off);
5408e4b17023SJohn Marino }
5409e4b17023SJohn Marino #define convert_to_ptrofftype(t) convert_to_ptrofftype_loc (UNKNOWN_LOCATION, t)
5410e4b17023SJohn Marino 
5411e4b17023SJohn Marino /* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.  */
5412e4b17023SJohn Marino static inline tree
fold_build_pointer_plus_loc(location_t loc,tree ptr,tree off)5413e4b17023SJohn Marino fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)
5414e4b17023SJohn Marino {
5415e4b17023SJohn Marino   return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
5416e4b17023SJohn Marino 			  ptr, fold_convert_loc (loc, sizetype, off));
5417e4b17023SJohn Marino }
5418e4b17023SJohn Marino #define fold_build_pointer_plus(p,o) \
5419e4b17023SJohn Marino 	fold_build_pointer_plus_loc (UNKNOWN_LOCATION, p, o)
5420e4b17023SJohn Marino 
5421e4b17023SJohn Marino /* Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.  */
5422e4b17023SJohn Marino static inline tree
fold_build_pointer_plus_hwi_loc(location_t loc,tree ptr,HOST_WIDE_INT off)5423e4b17023SJohn Marino fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
5424e4b17023SJohn Marino {
5425e4b17023SJohn Marino   return fold_build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (ptr),
5426e4b17023SJohn Marino 			  ptr, size_int (off));
5427e4b17023SJohn Marino }
5428e4b17023SJohn Marino #define fold_build_pointer_plus_hwi(p,o) \
5429e4b17023SJohn Marino 	fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
5430e4b17023SJohn Marino 
5431e4b17023SJohn Marino /* In builtins.c */
5432e4b17023SJohn Marino extern bool avoid_folding_inline_builtin (tree);
5433e4b17023SJohn Marino extern tree fold_call_expr (location_t, tree, bool);
5434e4b17023SJohn Marino extern tree fold_builtin_fputs (location_t, tree, tree, bool, bool, tree);
5435e4b17023SJohn Marino extern tree fold_builtin_strcpy (location_t, tree, tree, tree, tree);
5436e4b17023SJohn Marino extern tree fold_builtin_strncpy (location_t, tree, tree, tree, tree, tree);
5437e4b17023SJohn Marino extern tree fold_builtin_memory_chk (location_t, tree, tree, tree, tree, tree, tree, bool,
5438e4b17023SJohn Marino 				     enum built_in_function);
5439e4b17023SJohn Marino extern tree fold_builtin_stxcpy_chk (location_t, tree, tree, tree, tree, tree, bool,
5440e4b17023SJohn Marino 				     enum built_in_function);
5441e4b17023SJohn Marino extern tree fold_builtin_stxncpy_chk (location_t, tree, tree, tree, tree, tree, bool,
5442e4b17023SJohn Marino 				      enum built_in_function);
5443e4b17023SJohn Marino extern tree fold_builtin_snprintf_chk (location_t, tree, tree, enum built_in_function);
5444e4b17023SJohn Marino extern bool fold_builtin_next_arg (tree, bool);
5445e4b17023SJohn Marino extern enum built_in_function builtin_mathfn_code (const_tree);
5446e4b17023SJohn Marino extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
5447e4b17023SJohn Marino extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
5448e4b17023SJohn Marino extern tree build_call_expr_loc_vec (location_t, tree, VEC(tree,gc) *);
5449e4b17023SJohn Marino extern tree build_call_expr_loc (location_t, tree, int, ...);
5450e4b17023SJohn Marino extern tree build_call_expr (tree, int, ...);
5451e4b17023SJohn Marino extern tree mathfn_built_in (tree, enum built_in_function fn);
5452e4b17023SJohn Marino extern tree c_strlen (tree, int);
5453e4b17023SJohn Marino extern tree std_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
5454e4b17023SJohn Marino extern tree build_va_arg_indirect_ref (tree);
5455e4b17023SJohn Marino extern tree build_string_literal (int, const char *);
5456e4b17023SJohn Marino extern bool validate_arglist (const_tree, ...);
5457e4b17023SJohn Marino extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
5458e4b17023SJohn Marino extern bool is_builtin_fn (tree);
5459e4b17023SJohn Marino extern unsigned int get_object_alignment_1 (tree, unsigned HOST_WIDE_INT *);
5460e4b17023SJohn Marino extern unsigned int get_object_alignment (tree);
5461e4b17023SJohn Marino extern unsigned int get_object_or_type_alignment (tree);
5462e4b17023SJohn Marino extern unsigned int get_pointer_alignment_1 (tree, unsigned HOST_WIDE_INT *);
5463e4b17023SJohn Marino extern unsigned int get_pointer_alignment (tree);
5464e4b17023SJohn Marino extern tree fold_call_stmt (gimple, bool);
5465e4b17023SJohn Marino extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
5466e4b17023SJohn Marino extern tree make_range (tree, int *, tree *, tree *, bool *);
5467e4b17023SJohn Marino extern tree make_range_step (location_t, enum tree_code, tree, tree, tree,
5468e4b17023SJohn Marino 			     tree *, tree *, int *, bool *);
5469e4b17023SJohn Marino extern tree build_range_check (location_t, tree, tree, int, tree, tree);
5470e4b17023SJohn Marino extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
5471e4b17023SJohn Marino 			  tree, tree);
5472e4b17023SJohn Marino extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
5473e4b17023SJohn Marino extern bool is_simple_builtin (tree);
5474e4b17023SJohn Marino extern bool is_inexpensive_builtin (tree);
5475e4b17023SJohn Marino 
5476e4b17023SJohn Marino /* In convert.c */
5477e4b17023SJohn Marino extern tree strip_float_extensions (tree);
5478e4b17023SJohn Marino 
5479e4b17023SJohn Marino /* In tree.c */
5480e4b17023SJohn Marino extern int really_constant_p (const_tree);
5481e4b17023SJohn Marino extern bool decl_address_invariant_p (const_tree);
5482e4b17023SJohn Marino extern bool decl_address_ip_invariant_p (const_tree);
5483e4b17023SJohn Marino extern bool int_fits_type_p (const_tree, const_tree);
5484e4b17023SJohn Marino #ifndef GENERATOR_FILE
5485e4b17023SJohn Marino extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
5486e4b17023SJohn Marino #endif
5487e4b17023SJohn Marino extern bool variably_modified_type_p (tree, tree);
5488e4b17023SJohn Marino extern int tree_log2 (const_tree);
5489e4b17023SJohn Marino extern int tree_floor_log2 (const_tree);
5490e4b17023SJohn Marino extern int simple_cst_equal (const_tree, const_tree);
5491e4b17023SJohn Marino extern hashval_t iterative_hash_expr (const_tree, hashval_t);
5492e4b17023SJohn Marino extern hashval_t iterative_hash_exprs_commutative (const_tree,
5493e4b17023SJohn Marino                                                    const_tree, hashval_t);
5494e4b17023SJohn Marino extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t);
5495e4b17023SJohn Marino extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t);
5496e4b17023SJohn Marino extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t);
5497e4b17023SJohn Marino extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
5498e4b17023SJohn Marino extern int type_list_equal (const_tree, const_tree);
5499e4b17023SJohn Marino extern int chain_member (const_tree, const_tree);
5500e4b17023SJohn Marino extern tree type_hash_lookup (unsigned int, tree);
5501e4b17023SJohn Marino extern void type_hash_add (unsigned int, tree);
5502e4b17023SJohn Marino extern int simple_cst_list_equal (const_tree, const_tree);
5503e4b17023SJohn Marino extern void dump_tree_statistics (void);
5504e4b17023SJohn Marino extern void recompute_tree_invariant_for_addr_expr (tree);
5505e4b17023SJohn Marino extern bool needs_to_live_in_memory (const_tree);
5506e4b17023SJohn Marino extern tree reconstruct_complex_type (tree, tree);
5507e4b17023SJohn Marino 
5508e4b17023SJohn Marino extern int real_onep (const_tree);
5509e4b17023SJohn Marino extern int real_twop (const_tree);
5510e4b17023SJohn Marino extern int real_minus_onep (const_tree);
5511e4b17023SJohn Marino extern void init_ttree (void);
5512e4b17023SJohn Marino extern void build_common_tree_nodes (bool, bool);
5513e4b17023SJohn Marino extern void build_common_builtin_nodes (void);
5514e4b17023SJohn Marino extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
5515e4b17023SJohn Marino extern tree build_range_type (tree, tree, tree);
5516e4b17023SJohn Marino extern tree build_nonshared_range_type (tree, tree, tree);
5517e4b17023SJohn Marino extern bool subrange_type_for_debug_p (const_tree, tree *, tree *);
5518e4b17023SJohn Marino extern HOST_WIDE_INT int_cst_value (const_tree);
5519e4b17023SJohn Marino extern HOST_WIDEST_INT widest_int_cst_value (const_tree);
5520e4b17023SJohn Marino 
5521e4b17023SJohn Marino extern tree *tree_block (tree);
5522e4b17023SJohn Marino extern location_t *block_nonartificial_location (tree);
5523e4b17023SJohn Marino extern location_t tree_nonartificial_location (tree);
5524e4b17023SJohn Marino 
5525e4b17023SJohn Marino extern tree block_ultimate_origin (const_tree);
5526e4b17023SJohn Marino 
5527e4b17023SJohn Marino extern tree get_binfo_at_offset (tree, HOST_WIDE_INT, tree);
5528e4b17023SJohn Marino 
5529e4b17023SJohn Marino /* In tree-nested.c */
5530e4b17023SJohn Marino extern tree build_addr (tree, tree);
5531e4b17023SJohn Marino 
5532e4b17023SJohn Marino /* In function.c */
5533e4b17023SJohn Marino extern void expand_main_function (void);
5534e4b17023SJohn Marino extern void expand_function_end (void);
5535e4b17023SJohn Marino extern void expand_function_start (tree);
5536e4b17023SJohn Marino extern void stack_protect_prologue (void);
5537e4b17023SJohn Marino extern void stack_protect_epilogue (void);
5538e4b17023SJohn Marino extern void init_dummy_function_start (void);
5539e4b17023SJohn Marino extern void expand_dummy_function_end (void);
5540e4b17023SJohn Marino extern unsigned int init_function_for_compilation (void);
5541e4b17023SJohn Marino extern void allocate_struct_function (tree, bool);
5542e4b17023SJohn Marino extern void push_struct_function (tree fndecl);
5543e4b17023SJohn Marino extern void init_function_start (tree);
5544e4b17023SJohn Marino extern bool use_register_for_decl (const_tree);
5545e4b17023SJohn Marino extern void generate_setjmp_warnings (void);
5546e4b17023SJohn Marino extern void init_temp_slots (void);
5547e4b17023SJohn Marino extern void free_temp_slots (void);
5548e4b17023SJohn Marino extern void pop_temp_slots (void);
5549e4b17023SJohn Marino extern void push_temp_slots (void);
5550e4b17023SJohn Marino extern void preserve_temp_slots (rtx);
5551e4b17023SJohn Marino extern int aggregate_value_p (const_tree, const_tree);
5552e4b17023SJohn Marino extern void push_function_context (void);
5553e4b17023SJohn Marino extern void pop_function_context (void);
5554e4b17023SJohn Marino extern gimple_seq gimplify_parameters (void);
5555e4b17023SJohn Marino 
5556e4b17023SJohn Marino /* In print-rtl.c */
5557e4b17023SJohn Marino #ifdef BUFSIZ
5558e4b17023SJohn Marino extern void print_rtl (FILE *, const_rtx);
5559e4b17023SJohn Marino #endif
5560e4b17023SJohn Marino 
5561e4b17023SJohn Marino /* In print-tree.c */
5562e4b17023SJohn Marino extern void debug_tree (tree);
5563e4b17023SJohn Marino extern void debug_vec_tree (VEC(tree,gc) *);
5564e4b17023SJohn Marino #ifdef BUFSIZ
5565e4b17023SJohn Marino extern void dump_addr (FILE*, const char *, const void *);
5566e4b17023SJohn Marino extern void print_node (FILE *, const char *, tree, int);
5567e4b17023SJohn Marino extern void print_vec_tree (FILE *, const char *, VEC(tree,gc) *, int);
5568e4b17023SJohn Marino extern void print_node_brief (FILE *, const char *, const_tree, int);
5569e4b17023SJohn Marino extern void indent_to (FILE *, int);
5570e4b17023SJohn Marino #endif
5571e4b17023SJohn Marino 
5572e4b17023SJohn Marino /* In tree-inline.c:  */
5573e4b17023SJohn Marino extern bool debug_find_tree (tree, tree);
5574e4b17023SJohn Marino /* This is in tree-inline.c since the routine uses
5575e4b17023SJohn Marino    data structures from the inliner.  */
5576e4b17023SJohn Marino extern tree unsave_expr_now (tree);
5577e4b17023SJohn Marino extern tree build_duplicate_type (tree);
5578e4b17023SJohn Marino 
5579e4b17023SJohn Marino /* In calls.c */
5580e4b17023SJohn Marino 
5581e4b17023SJohn Marino /* Nonzero if this is a call to a function whose return value depends
5582e4b17023SJohn Marino    solely on its arguments, has no side effects, and does not read
5583e4b17023SJohn Marino    global memory.  This corresponds to TREE_READONLY for function
5584e4b17023SJohn Marino    decls.  */
5585e4b17023SJohn Marino #define ECF_CONST		  (1 << 0)
5586e4b17023SJohn Marino /* Nonzero if this is a call to "pure" function (like const function,
5587e4b17023SJohn Marino    but may read memory.  This corresponds to DECL_PURE_P for function
5588e4b17023SJohn Marino    decls.  */
5589e4b17023SJohn Marino #define ECF_PURE		  (1 << 1)
5590e4b17023SJohn Marino /* Nonzero if this is ECF_CONST or ECF_PURE but cannot be proven to no
5591e4b17023SJohn Marino    infinite loop.  This corresponds to DECL_LOOPING_CONST_OR_PURE_P
5592e4b17023SJohn Marino    for function decls.*/
5593e4b17023SJohn Marino #define ECF_LOOPING_CONST_OR_PURE (1 << 2)
5594e4b17023SJohn Marino /* Nonzero if this call will never return.  */
5595e4b17023SJohn Marino #define ECF_NORETURN		  (1 << 3)
5596e4b17023SJohn Marino /* Nonzero if this is a call to malloc or a related function.  */
5597e4b17023SJohn Marino #define ECF_MALLOC		  (1 << 4)
5598e4b17023SJohn Marino /* Nonzero if it is plausible that this is a call to alloca.  */
5599e4b17023SJohn Marino #define ECF_MAY_BE_ALLOCA	  (1 << 5)
5600e4b17023SJohn Marino /* Nonzero if this is a call to a function that won't throw an exception.  */
5601e4b17023SJohn Marino #define ECF_NOTHROW		  (1 << 6)
5602e4b17023SJohn Marino /* Nonzero if this is a call to setjmp or a related function.  */
5603e4b17023SJohn Marino #define ECF_RETURNS_TWICE	  (1 << 7)
5604e4b17023SJohn Marino /* Nonzero if this call replaces the current stack frame.  */
5605e4b17023SJohn Marino #define ECF_SIBCALL		  (1 << 8)
5606e4b17023SJohn Marino /* Function does not read or write memory (but may have side effects, so
5607e4b17023SJohn Marino    it does not necessarily fit ECF_CONST).  */
5608e4b17023SJohn Marino #define ECF_NOVOPS		  (1 << 9)
5609e4b17023SJohn Marino /* The function does not lead to calls within current function unit.  */
5610e4b17023SJohn Marino #define ECF_LEAF		  (1 << 10)
5611e4b17023SJohn Marino /* Nonzero if this call does not affect transactions.  */
5612e4b17023SJohn Marino #define ECF_TM_PURE		  (1 << 11)
5613e4b17023SJohn Marino /* Nonzero if this call is into the transaction runtime library.  */
5614e4b17023SJohn Marino #define ECF_TM_BUILTIN		  (1 << 12)
5615e4b17023SJohn Marino 
5616e4b17023SJohn Marino extern int flags_from_decl_or_type (const_tree);
5617e4b17023SJohn Marino extern int call_expr_flags (const_tree);
5618e4b17023SJohn Marino 
5619e4b17023SJohn Marino /* Call argument flags.  */
5620e4b17023SJohn Marino 
5621e4b17023SJohn Marino /* Nonzero if the argument is not dereferenced recursively, thus only
5622e4b17023SJohn Marino    directly reachable memory is read or written.  */
5623e4b17023SJohn Marino #define EAF_DIRECT		(1 << 0)
5624e4b17023SJohn Marino /* Nonzero if memory reached by the argument is not clobbered.  */
5625e4b17023SJohn Marino #define EAF_NOCLOBBER		(1 << 1)
5626e4b17023SJohn Marino /* Nonzero if the argument does not escape.  */
5627e4b17023SJohn Marino #define EAF_NOESCAPE		(1 << 2)
5628e4b17023SJohn Marino /* Nonzero if the argument is not used by the function.  */
5629e4b17023SJohn Marino #define EAF_UNUSED		(1 << 3)
5630e4b17023SJohn Marino 
5631e4b17023SJohn Marino /* Call return flags.  */
5632e4b17023SJohn Marino 
5633e4b17023SJohn Marino /* Mask for the argument number that is returned.  Lower two bits of
5634e4b17023SJohn Marino    the return flags, encodes argument slots zero to three.  */
5635e4b17023SJohn Marino #define ERF_RETURN_ARG_MASK	(3)
5636e4b17023SJohn Marino /* Nonzero if the return value is equal to the argument number
5637e4b17023SJohn Marino    flags & ERF_RETURN_ARG_MASK.  */
5638e4b17023SJohn Marino #define ERF_RETURNS_ARG		(1 << 2)
5639e4b17023SJohn Marino /* Nonzero if the return value does not alias with anything.  Functions
5640e4b17023SJohn Marino    with the malloc attribute have this set on their return value.  */
5641e4b17023SJohn Marino #define ERF_NOALIAS		(1 << 3)
5642e4b17023SJohn Marino 
5643e4b17023SJohn Marino extern int setjmp_call_p (const_tree);
5644e4b17023SJohn Marino extern bool gimple_alloca_call_p (const_gimple);
5645e4b17023SJohn Marino extern bool alloca_call_p (const_tree);
5646e4b17023SJohn Marino extern bool must_pass_in_stack_var_size (enum machine_mode, const_tree);
5647e4b17023SJohn Marino extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree);
5648e4b17023SJohn Marino 
5649e4b17023SJohn Marino /* In attribs.c.  */
5650e4b17023SJohn Marino 
5651e4b17023SJohn Marino extern const struct attribute_spec *lookup_attribute_spec (const_tree);
5652e4b17023SJohn Marino 
5653e4b17023SJohn Marino extern void init_attributes (void);
5654e4b17023SJohn Marino 
5655e4b17023SJohn Marino /* Process the attributes listed in ATTRIBUTES and install them in *NODE,
5656e4b17023SJohn Marino    which is either a DECL (including a TYPE_DECL) or a TYPE.  If a DECL,
5657e4b17023SJohn Marino    it should be modified in place; if a TYPE, a copy should be created
5658e4b17023SJohn Marino    unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS.  FLAGS gives further
5659e4b17023SJohn Marino    information, in the form of a bitwise OR of flags in enum attribute_flags
5660e4b17023SJohn Marino    from tree.h.  Depending on these flags, some attributes may be
5661e4b17023SJohn Marino    returned to be applied at a later stage (for example, to apply
5662e4b17023SJohn Marino    a decl attribute to the declaration rather than to its type).  */
5663e4b17023SJohn Marino extern tree decl_attributes (tree *, tree, int);
5664e4b17023SJohn Marino 
5665e4b17023SJohn Marino extern void apply_tm_attr (tree, tree);
5666e4b17023SJohn Marino 
5667e4b17023SJohn Marino /* In integrate.c */
5668e4b17023SJohn Marino extern void set_decl_abstract_flags (tree, int);
5669e4b17023SJohn Marino extern void set_decl_origin_self (tree);
5670e4b17023SJohn Marino 
5671e4b17023SJohn Marino /* In stor-layout.c */
5672e4b17023SJohn Marino extern void set_min_and_max_values_for_integral_type (tree, int, bool);
5673e4b17023SJohn Marino extern void fixup_signed_type (tree);
5674e4b17023SJohn Marino extern void internal_reference_types (void);
5675e4b17023SJohn Marino extern unsigned int update_alignment_for_field (record_layout_info, tree,
5676e4b17023SJohn Marino                                                 unsigned int);
5677e4b17023SJohn Marino /* varasm.c */
5678e4b17023SJohn Marino extern tree tree_output_constant_def (tree);
5679e4b17023SJohn Marino extern void make_decl_rtl (tree);
5680e4b17023SJohn Marino extern rtx make_decl_rtl_for_debug (tree);
5681e4b17023SJohn Marino extern void make_decl_one_only (tree, tree);
5682e4b17023SJohn Marino extern int supports_one_only (void);
5683e4b17023SJohn Marino extern void resolve_unique_section (tree, int, int);
5684e4b17023SJohn Marino extern void mark_referenced (tree);
5685e4b17023SJohn Marino extern void mark_decl_referenced (tree);
5686e4b17023SJohn Marino extern void notice_global_symbol (tree);
5687e4b17023SJohn Marino extern void set_user_assembler_name (tree, const char *);
5688e4b17023SJohn Marino extern void process_pending_assemble_externals (void);
5689e4b17023SJohn Marino extern void finish_aliases_1 (void);
5690e4b17023SJohn Marino extern void finish_aliases_2 (void);
5691e4b17023SJohn Marino extern void remove_unreachable_alias_pairs (void);
5692e4b17023SJohn Marino extern bool decl_replaceable_p (tree);
5693e4b17023SJohn Marino extern bool decl_binds_to_current_def_p (tree);
5694e4b17023SJohn Marino 
5695e4b17023SJohn Marino /* Derived type for use by compute_visible_aliases and callers.  A symbol
5696e4b17023SJohn Marino    alias set is a pointer set into which we enter IDENTIFIER_NODES bearing
5697e4b17023SJohn Marino    the canonicalised assembler-level symbol names corresponding to decls
5698e4b17023SJohn Marino    and their aliases.  */
5699e4b17023SJohn Marino typedef struct pointer_set_t symbol_alias_set_t;
5700e4b17023SJohn Marino 
5701e4b17023SJohn Marino extern void symbol_alias_set_destroy (symbol_alias_set_t *);
5702e4b17023SJohn Marino extern int symbol_alias_set_contains (const symbol_alias_set_t *, tree);
5703e4b17023SJohn Marino extern symbol_alias_set_t * propagate_aliases_backward (bool (*)
5704e4b17023SJohn Marino 							 (tree, tree, void *),
5705e4b17023SJohn Marino 							void *);
5706e4b17023SJohn Marino 
5707e4b17023SJohn Marino /* In stmt.c */
5708e4b17023SJohn Marino extern void expand_computed_goto (tree);
5709e4b17023SJohn Marino extern bool parse_output_constraint (const char **, int, int, int,
5710e4b17023SJohn Marino 				     bool *, bool *, bool *);
5711e4b17023SJohn Marino extern bool parse_input_constraint (const char **, int, int, int, int,
5712e4b17023SJohn Marino 				    const char * const *, bool *, bool *);
5713e4b17023SJohn Marino extern void expand_asm_stmt (gimple);
5714e4b17023SJohn Marino extern tree resolve_asm_operand_names (tree, tree, tree, tree);
5715e4b17023SJohn Marino extern bool expand_switch_using_bit_tests_p (tree, tree, unsigned int,
5716e4b17023SJohn Marino 					     unsigned int);
5717e4b17023SJohn Marino extern void expand_case (gimple);
5718e4b17023SJohn Marino extern void expand_decl (tree);
5719e4b17023SJohn Marino #ifdef HARD_CONST
5720e4b17023SJohn Marino /* Silly ifdef to avoid having all includers depend on hard-reg-set.h.  */
5721e4b17023SJohn Marino extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
5722e4b17023SJohn Marino #endif
5723e4b17023SJohn Marino 
5724e4b17023SJohn Marino 
5725e4b17023SJohn Marino /* In tree-inline.c  */
5726e4b17023SJohn Marino 
5727e4b17023SJohn Marino /* The type of a set of already-visited pointers.  Functions for creating
5728e4b17023SJohn Marino    and manipulating it are declared in pointer-set.h */
5729e4b17023SJohn Marino struct pointer_set_t;
5730e4b17023SJohn Marino 
5731e4b17023SJohn Marino /* The type of a callback function for walking over tree structure.  */
5732e4b17023SJohn Marino 
5733e4b17023SJohn Marino typedef tree (*walk_tree_fn) (tree *, int *, void *);
5734e4b17023SJohn Marino 
5735e4b17023SJohn Marino /* The type of a callback function that represents a custom walk_tree.  */
5736e4b17023SJohn Marino 
5737e4b17023SJohn Marino typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
5738e4b17023SJohn Marino 			      void *, struct pointer_set_t*);
5739e4b17023SJohn Marino 
5740e4b17023SJohn Marino extern tree walk_tree_1 (tree*, walk_tree_fn, void*, struct pointer_set_t*,
5741e4b17023SJohn Marino 			 walk_tree_lh);
5742e4b17023SJohn Marino extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
5743e4b17023SJohn Marino 					    walk_tree_lh);
5744e4b17023SJohn Marino #define walk_tree(a,b,c,d) \
5745e4b17023SJohn Marino 	walk_tree_1 (a, b, c, d, NULL)
5746e4b17023SJohn Marino #define walk_tree_without_duplicates(a,b,c) \
5747e4b17023SJohn Marino 	walk_tree_without_duplicates_1 (a, b, c, NULL)
5748e4b17023SJohn Marino 
5749e4b17023SJohn Marino /* In emit-rtl.c */
5750e4b17023SJohn Marino /* Assign the RTX to declaration.  */
5751e4b17023SJohn Marino 
5752e4b17023SJohn Marino extern void set_decl_rtl (tree, rtx);
5753e4b17023SJohn Marino extern void set_decl_incoming_rtl (tree, rtx, bool);
5754e4b17023SJohn Marino 
5755e4b17023SJohn Marino /* Enum and arrays used for tree allocation stats.
5756e4b17023SJohn Marino    Keep in sync with tree.c:tree_node_kind_names.  */
5757e4b17023SJohn Marino typedef enum
5758e4b17023SJohn Marino {
5759e4b17023SJohn Marino   d_kind,
5760e4b17023SJohn Marino   t_kind,
5761e4b17023SJohn Marino   b_kind,
5762e4b17023SJohn Marino   s_kind,
5763e4b17023SJohn Marino   r_kind,
5764e4b17023SJohn Marino   e_kind,
5765e4b17023SJohn Marino   c_kind,
5766e4b17023SJohn Marino   id_kind,
5767e4b17023SJohn Marino   vec_kind,
5768e4b17023SJohn Marino   binfo_kind,
5769e4b17023SJohn Marino   ssa_name_kind,
5770e4b17023SJohn Marino   constr_kind,
5771e4b17023SJohn Marino   x_kind,
5772e4b17023SJohn Marino   lang_decl,
5773e4b17023SJohn Marino   lang_type,
5774e4b17023SJohn Marino   omp_clause_kind,
5775e4b17023SJohn Marino   all_kinds
5776e4b17023SJohn Marino } tree_node_kind;
5777e4b17023SJohn Marino 
5778e4b17023SJohn Marino extern int tree_node_counts[];
5779e4b17023SJohn Marino extern int tree_node_sizes[];
5780e4b17023SJohn Marino 
5781e4b17023SJohn Marino /* True if we are in gimple form and the actions of the folders need to
5782e4b17023SJohn Marino    be restricted.  False if we are not in gimple form and folding is not
5783e4b17023SJohn Marino    restricted to creating gimple expressions.  */
5784e4b17023SJohn Marino extern bool in_gimple_form;
5785e4b17023SJohn Marino 
5786e4b17023SJohn Marino /* In gimple.c.  */
5787e4b17023SJohn Marino extern tree get_base_address (tree t);
5788e4b17023SJohn Marino extern void mark_addressable (tree);
5789e4b17023SJohn Marino 
5790e4b17023SJohn Marino /* In tree.c.  */
5791e4b17023SJohn Marino 
5792e4b17023SJohn Marino struct GTY(()) tree_map_base {
5793e4b17023SJohn Marino   tree from;
5794e4b17023SJohn Marino };
5795e4b17023SJohn Marino 
5796e4b17023SJohn Marino extern int tree_map_base_eq (const void *, const void *);
5797e4b17023SJohn Marino extern unsigned int tree_map_base_hash (const void *);
5798e4b17023SJohn Marino extern int tree_map_base_marked_p (const void *);
5799e4b17023SJohn Marino extern bool list_equal_p (const_tree, const_tree);
5800e4b17023SJohn Marino 
5801e4b17023SJohn Marino /* Map from a tree to another tree.  */
5802e4b17023SJohn Marino 
5803e4b17023SJohn Marino struct GTY(()) tree_map {
5804e4b17023SJohn Marino   struct tree_map_base base;
5805e4b17023SJohn Marino   unsigned int hash;
5806e4b17023SJohn Marino   tree to;
5807e4b17023SJohn Marino };
5808e4b17023SJohn Marino 
5809e4b17023SJohn Marino #define tree_map_eq tree_map_base_eq
5810e4b17023SJohn Marino extern unsigned int tree_map_hash (const void *);
5811e4b17023SJohn Marino #define tree_map_marked_p tree_map_base_marked_p
5812e4b17023SJohn Marino 
5813e4b17023SJohn Marino /* Map from a decl tree to another tree.  */
5814e4b17023SJohn Marino 
5815e4b17023SJohn Marino struct GTY(()) tree_decl_map {
5816e4b17023SJohn Marino   struct tree_map_base base;
5817e4b17023SJohn Marino   tree to;
5818e4b17023SJohn Marino };
5819e4b17023SJohn Marino 
5820e4b17023SJohn Marino #define tree_decl_map_eq tree_map_base_eq
5821e4b17023SJohn Marino extern unsigned int tree_decl_map_hash (const void *);
5822e4b17023SJohn Marino #define tree_decl_map_marked_p tree_map_base_marked_p
5823e4b17023SJohn Marino 
5824e4b17023SJohn Marino /* Map from a tree to an int.  */
5825e4b17023SJohn Marino 
5826e4b17023SJohn Marino struct GTY(()) tree_int_map {
5827e4b17023SJohn Marino   struct tree_map_base base;
5828e4b17023SJohn Marino   unsigned int to;
5829e4b17023SJohn Marino };
5830e4b17023SJohn Marino 
5831e4b17023SJohn Marino #define tree_int_map_eq tree_map_base_eq
5832e4b17023SJohn Marino #define tree_int_map_hash tree_map_base_hash
5833e4b17023SJohn Marino #define tree_int_map_marked_p tree_map_base_marked_p
5834e4b17023SJohn Marino 
5835e4b17023SJohn Marino /* Map from a tree to initialization/finalization priorities.  */
5836e4b17023SJohn Marino 
5837e4b17023SJohn Marino struct GTY(()) tree_priority_map {
5838e4b17023SJohn Marino   struct tree_map_base base;
5839e4b17023SJohn Marino   priority_type init;
5840e4b17023SJohn Marino   priority_type fini;
5841e4b17023SJohn Marino };
5842e4b17023SJohn Marino 
5843e4b17023SJohn Marino #define tree_priority_map_eq tree_map_base_eq
5844e4b17023SJohn Marino #define tree_priority_map_hash tree_map_base_hash
5845e4b17023SJohn Marino #define tree_priority_map_marked_p tree_map_base_marked_p
5846e4b17023SJohn Marino 
5847e4b17023SJohn Marino /* Map from a decl tree to a tree vector.  */
5848e4b17023SJohn Marino 
5849e4b17023SJohn Marino struct GTY(()) tree_vec_map {
5850e4b17023SJohn Marino   struct tree_map_base base;
5851e4b17023SJohn Marino   VEC(tree,gc) *to;
5852e4b17023SJohn Marino };
5853e4b17023SJohn Marino 
5854e4b17023SJohn Marino #define tree_vec_map_eq tree_map_base_eq
5855e4b17023SJohn Marino #define tree_vec_map_hash tree_decl_map_hash
5856e4b17023SJohn Marino #define tree_vec_map_marked_p tree_map_base_marked_p
5857e4b17023SJohn Marino 
5858e4b17023SJohn Marino /* In tree-ssa.c */
5859e4b17023SJohn Marino 
5860e4b17023SJohn Marino tree target_for_debug_bind (tree);
5861e4b17023SJohn Marino 
5862e4b17023SJohn Marino /* In tree-ssa-address.c.  */
5863e4b17023SJohn Marino extern tree tree_mem_ref_addr (tree, tree);
5864e4b17023SJohn Marino extern void copy_mem_ref_info (tree, tree);
5865e4b17023SJohn Marino extern void copy_ref_info (tree, tree);
5866e4b17023SJohn Marino 
5867e4b17023SJohn Marino /* In tree-vrp.c */
5868e4b17023SJohn Marino extern bool ssa_name_nonnegative_p (const_tree);
5869e4b17023SJohn Marino 
5870e4b17023SJohn Marino /* In tree-object-size.c.  */
5871e4b17023SJohn Marino extern void init_object_sizes (void);
5872e4b17023SJohn Marino extern void fini_object_sizes (void);
5873e4b17023SJohn Marino extern unsigned HOST_WIDE_INT compute_builtin_object_size (tree, int);
5874e4b17023SJohn Marino 
5875e4b17023SJohn Marino /* In expr.c.  */
5876e4b17023SJohn Marino extern unsigned HOST_WIDE_INT highest_pow2_factor (const_tree);
5877e4b17023SJohn Marino extern tree build_personality_function (const char *);
5878e4b17023SJohn Marino 
5879e4b17023SJohn Marino /* In trans-mem.c.  */
5880e4b17023SJohn Marino extern tree build_tm_abort_call (location_t, bool);
5881e4b17023SJohn Marino extern bool is_tm_safe (const_tree);
5882e4b17023SJohn Marino extern bool is_tm_pure (const_tree);
5883e4b17023SJohn Marino extern bool is_tm_may_cancel_outer (tree);
5884e4b17023SJohn Marino extern bool is_tm_ending_fndecl (tree);
5885e4b17023SJohn Marino extern void record_tm_replacement (tree, tree);
5886e4b17023SJohn Marino extern void tm_malloc_replacement (tree);
5887e4b17023SJohn Marino 
5888e4b17023SJohn Marino static inline bool
is_tm_safe_or_pure(const_tree x)5889e4b17023SJohn Marino is_tm_safe_or_pure (const_tree x)
5890e4b17023SJohn Marino {
5891e4b17023SJohn Marino   return is_tm_safe (x) || is_tm_pure (x);
5892e4b17023SJohn Marino }
5893e4b17023SJohn Marino 
5894e4b17023SJohn Marino /* In tree-inline.c.  */
5895e4b17023SJohn Marino 
5896e4b17023SJohn Marino void init_inline_once (void);
5897e4b17023SJohn Marino 
5898e4b17023SJohn Marino /* Compute the number of operands in an expression node NODE.  For
5899e4b17023SJohn Marino    tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
5900e4b17023SJohn Marino    otherwise it is looked up from the node's code.  */
5901e4b17023SJohn Marino static inline int
tree_operand_length(const_tree node)5902e4b17023SJohn Marino tree_operand_length (const_tree node)
5903e4b17023SJohn Marino {
5904e4b17023SJohn Marino   if (VL_EXP_CLASS_P (node))
5905e4b17023SJohn Marino     return VL_EXP_OPERAND_LENGTH (node);
5906e4b17023SJohn Marino   else
5907e4b17023SJohn Marino     return TREE_CODE_LENGTH (TREE_CODE (node));
5908e4b17023SJohn Marino }
5909e4b17023SJohn Marino 
5910e4b17023SJohn Marino /* Abstract iterators for CALL_EXPRs.  These static inline definitions
5911e4b17023SJohn Marino    have to go towards the end of tree.h so that union tree_node is fully
5912e4b17023SJohn Marino    defined by this point.  */
5913e4b17023SJohn Marino 
5914e4b17023SJohn Marino /* Structure containing iterator state.  */
5915e4b17023SJohn Marino typedef struct call_expr_arg_iterator_d {
5916e4b17023SJohn Marino   tree t;	/* the call_expr */
5917e4b17023SJohn Marino   int n;	/* argument count */
5918e4b17023SJohn Marino   int i;	/* next argument index */
5919e4b17023SJohn Marino } call_expr_arg_iterator;
5920e4b17023SJohn Marino 
5921e4b17023SJohn Marino typedef struct const_call_expr_arg_iterator_d {
5922e4b17023SJohn Marino   const_tree t;	/* the call_expr */
5923e4b17023SJohn Marino   int n;	/* argument count */
5924e4b17023SJohn Marino   int i;	/* next argument index */
5925e4b17023SJohn Marino } const_call_expr_arg_iterator;
5926e4b17023SJohn Marino 
5927e4b17023SJohn Marino /* Initialize the abstract argument list iterator object ITER with the
5928e4b17023SJohn Marino    arguments from CALL_EXPR node EXP.  */
5929e4b17023SJohn Marino static inline void
init_call_expr_arg_iterator(tree exp,call_expr_arg_iterator * iter)5930e4b17023SJohn Marino init_call_expr_arg_iterator (tree exp, call_expr_arg_iterator *iter)
5931e4b17023SJohn Marino {
5932e4b17023SJohn Marino   iter->t = exp;
5933e4b17023SJohn Marino   iter->n = call_expr_nargs (exp);
5934e4b17023SJohn Marino   iter->i = 0;
5935e4b17023SJohn Marino }
5936e4b17023SJohn Marino 
5937e4b17023SJohn Marino static inline void
init_const_call_expr_arg_iterator(const_tree exp,const_call_expr_arg_iterator * iter)5938e4b17023SJohn Marino init_const_call_expr_arg_iterator (const_tree exp, const_call_expr_arg_iterator *iter)
5939e4b17023SJohn Marino {
5940e4b17023SJohn Marino   iter->t = exp;
5941e4b17023SJohn Marino   iter->n = call_expr_nargs (exp);
5942e4b17023SJohn Marino   iter->i = 0;
5943e4b17023SJohn Marino }
5944e4b17023SJohn Marino 
5945e4b17023SJohn Marino /* Return the next argument from abstract argument list iterator object ITER,
5946e4b17023SJohn Marino    and advance its state.  Return NULL_TREE if there are no more arguments.  */
5947e4b17023SJohn Marino static inline tree
next_call_expr_arg(call_expr_arg_iterator * iter)5948e4b17023SJohn Marino next_call_expr_arg (call_expr_arg_iterator *iter)
5949e4b17023SJohn Marino {
5950e4b17023SJohn Marino   tree result;
5951e4b17023SJohn Marino   if (iter->i >= iter->n)
5952e4b17023SJohn Marino     return NULL_TREE;
5953e4b17023SJohn Marino   result = CALL_EXPR_ARG (iter->t, iter->i);
5954e4b17023SJohn Marino   iter->i++;
5955e4b17023SJohn Marino   return result;
5956e4b17023SJohn Marino }
5957e4b17023SJohn Marino 
5958e4b17023SJohn Marino static inline const_tree
next_const_call_expr_arg(const_call_expr_arg_iterator * iter)5959e4b17023SJohn Marino next_const_call_expr_arg (const_call_expr_arg_iterator *iter)
5960e4b17023SJohn Marino {
5961e4b17023SJohn Marino   const_tree result;
5962e4b17023SJohn Marino   if (iter->i >= iter->n)
5963e4b17023SJohn Marino     return NULL_TREE;
5964e4b17023SJohn Marino   result = CALL_EXPR_ARG (iter->t, iter->i);
5965e4b17023SJohn Marino   iter->i++;
5966e4b17023SJohn Marino   return result;
5967e4b17023SJohn Marino }
5968e4b17023SJohn Marino 
5969e4b17023SJohn Marino /* Initialize the abstract argument list iterator object ITER, then advance
5970e4b17023SJohn Marino    past and return the first argument.  Useful in for expressions, e.g.
5971e4b17023SJohn Marino      for (arg = first_call_expr_arg (exp, &iter); arg;
5972e4b17023SJohn Marino           arg = next_call_expr_arg (&iter))   */
5973e4b17023SJohn Marino static inline tree
first_call_expr_arg(tree exp,call_expr_arg_iterator * iter)5974e4b17023SJohn Marino first_call_expr_arg (tree exp, call_expr_arg_iterator *iter)
5975e4b17023SJohn Marino {
5976e4b17023SJohn Marino   init_call_expr_arg_iterator (exp, iter);
5977e4b17023SJohn Marino   return next_call_expr_arg (iter);
5978e4b17023SJohn Marino }
5979e4b17023SJohn Marino 
5980e4b17023SJohn Marino static inline const_tree
first_const_call_expr_arg(const_tree exp,const_call_expr_arg_iterator * iter)5981e4b17023SJohn Marino first_const_call_expr_arg (const_tree exp, const_call_expr_arg_iterator *iter)
5982e4b17023SJohn Marino {
5983e4b17023SJohn Marino   init_const_call_expr_arg_iterator (exp, iter);
5984e4b17023SJohn Marino   return next_const_call_expr_arg (iter);
5985e4b17023SJohn Marino }
5986e4b17023SJohn Marino 
5987e4b17023SJohn Marino /* Test whether there are more arguments in abstract argument list iterator
5988e4b17023SJohn Marino    ITER, without changing its state.  */
5989e4b17023SJohn Marino static inline bool
more_call_expr_args_p(const call_expr_arg_iterator * iter)5990e4b17023SJohn Marino more_call_expr_args_p (const call_expr_arg_iterator *iter)
5991e4b17023SJohn Marino {
5992e4b17023SJohn Marino   return (iter->i < iter->n);
5993e4b17023SJohn Marino }
5994e4b17023SJohn Marino 
5995e4b17023SJohn Marino static inline bool
more_const_call_expr_args_p(const const_call_expr_arg_iterator * iter)5996e4b17023SJohn Marino more_const_call_expr_args_p (const const_call_expr_arg_iterator *iter)
5997e4b17023SJohn Marino {
5998e4b17023SJohn Marino   return (iter->i < iter->n);
5999e4b17023SJohn Marino }
6000e4b17023SJohn Marino 
6001e4b17023SJohn Marino /* Iterate through each argument ARG of CALL_EXPR CALL, using variable ITER
6002e4b17023SJohn Marino    (of type call_expr_arg_iterator) to hold the iteration state.  */
6003e4b17023SJohn Marino #define FOR_EACH_CALL_EXPR_ARG(arg, iter, call)			\
6004e4b17023SJohn Marino   for ((arg) = first_call_expr_arg ((call), &(iter)); (arg);	\
6005e4b17023SJohn Marino        (arg) = next_call_expr_arg (&(iter)))
6006e4b17023SJohn Marino 
6007e4b17023SJohn Marino #define FOR_EACH_CONST_CALL_EXPR_ARG(arg, iter, call)			\
6008e4b17023SJohn Marino   for ((arg) = first_const_call_expr_arg ((call), &(iter)); (arg);	\
6009e4b17023SJohn Marino        (arg) = next_const_call_expr_arg (&(iter)))
6010e4b17023SJohn Marino 
6011e4b17023SJohn Marino /* Return true if tree node T is a language-specific node.  */
6012e4b17023SJohn Marino static inline bool
is_lang_specific(tree t)6013e4b17023SJohn Marino is_lang_specific (tree t)
6014e4b17023SJohn Marino {
6015e4b17023SJohn Marino   return TREE_CODE (t) == LANG_TYPE || TREE_CODE (t) >= NUM_TREE_CODES;
6016e4b17023SJohn Marino }
6017e4b17023SJohn Marino 
6018e4b17023SJohn Marino /* In gimple-low.c.  */
6019e4b17023SJohn Marino extern bool block_may_fallthru (const_tree);
6020e4b17023SJohn Marino 
6021e4b17023SJohn Marino 
6022e4b17023SJohn Marino /* Functional interface to the builtin functions.  */
6023e4b17023SJohn Marino 
6024e4b17023SJohn Marino /* The builtin_info structure holds the FUNCTION_DECL of the standard builtin
6025e4b17023SJohn Marino    function, and a flag that says if the function is available implicitly, or
6026e4b17023SJohn Marino    whether the user has to code explicit calls to __builtin_<xxx>.  */
6027e4b17023SJohn Marino 
6028e4b17023SJohn Marino typedef struct GTY(()) builtin_info_type_d {
6029e4b17023SJohn Marino   tree decl[(int)END_BUILTINS];
6030e4b17023SJohn Marino   bool implicit_p[(int)END_BUILTINS];
6031e4b17023SJohn Marino } builtin_info_type;
6032e4b17023SJohn Marino 
6033e4b17023SJohn Marino extern GTY(()) builtin_info_type builtin_info;
6034e4b17023SJohn Marino 
6035e4b17023SJohn Marino /* Valid builtin number.  */
6036e4b17023SJohn Marino #define BUILTIN_VALID_P(FNCODE) \
6037e4b17023SJohn Marino   (IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1))
6038e4b17023SJohn Marino 
6039e4b17023SJohn Marino /* Return the tree node for an explicit standard builtin function or NULL.  */
6040e4b17023SJohn Marino static inline tree
builtin_decl_explicit(enum built_in_function fncode)6041e4b17023SJohn Marino builtin_decl_explicit (enum built_in_function fncode)
6042e4b17023SJohn Marino {
6043e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode));
6044e4b17023SJohn Marino 
6045e4b17023SJohn Marino   return builtin_info.decl[(size_t)fncode];
6046e4b17023SJohn Marino }
6047e4b17023SJohn Marino 
6048e4b17023SJohn Marino /* Return the tree node for an implicit builtin function or NULL.  */
6049e4b17023SJohn Marino static inline tree
builtin_decl_implicit(enum built_in_function fncode)6050e4b17023SJohn Marino builtin_decl_implicit (enum built_in_function fncode)
6051e4b17023SJohn Marino {
6052e4b17023SJohn Marino   size_t uns_fncode = (size_t)fncode;
6053e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode));
6054e4b17023SJohn Marino 
6055e4b17023SJohn Marino   if (!builtin_info.implicit_p[uns_fncode])
6056e4b17023SJohn Marino     return NULL_TREE;
6057e4b17023SJohn Marino 
6058e4b17023SJohn Marino   return builtin_info.decl[uns_fncode];
6059e4b17023SJohn Marino }
6060e4b17023SJohn Marino 
6061e4b17023SJohn Marino /* Set explicit builtin function nodes and whether it is an implicit
6062e4b17023SJohn Marino    function.  */
6063e4b17023SJohn Marino 
6064e4b17023SJohn Marino static inline void
set_builtin_decl(enum built_in_function fncode,tree decl,bool implicit_p)6065e4b17023SJohn Marino set_builtin_decl (enum built_in_function fncode, tree decl, bool implicit_p)
6066e4b17023SJohn Marino {
6067e4b17023SJohn Marino   size_t ufncode = (size_t)fncode;
6068e4b17023SJohn Marino 
6069e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode)
6070e4b17023SJohn Marino 		       && (decl != NULL_TREE || !implicit_p));
6071e4b17023SJohn Marino 
6072e4b17023SJohn Marino   builtin_info.decl[ufncode] = decl;
6073e4b17023SJohn Marino   builtin_info.implicit_p[ufncode] = implicit_p;
6074e4b17023SJohn Marino }
6075e4b17023SJohn Marino 
6076e4b17023SJohn Marino /* Set the implicit flag for a builtin function.  */
6077e4b17023SJohn Marino 
6078e4b17023SJohn Marino static inline void
set_builtin_decl_implicit_p(enum built_in_function fncode,bool implicit_p)6079e4b17023SJohn Marino set_builtin_decl_implicit_p (enum built_in_function fncode, bool implicit_p)
6080e4b17023SJohn Marino {
6081e4b17023SJohn Marino   size_t uns_fncode = (size_t)fncode;
6082e4b17023SJohn Marino 
6083e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode)
6084e4b17023SJohn Marino 		       && builtin_info.decl[uns_fncode] != NULL_TREE);
6085e4b17023SJohn Marino 
6086e4b17023SJohn Marino   builtin_info.implicit_p[uns_fncode] = implicit_p;
6087e4b17023SJohn Marino }
6088e4b17023SJohn Marino 
6089e4b17023SJohn Marino /* Return whether the standard builtin function can be used as an explicit
6090e4b17023SJohn Marino    function.  */
6091e4b17023SJohn Marino 
6092e4b17023SJohn Marino static inline bool
builtin_decl_explicit_p(enum built_in_function fncode)6093e4b17023SJohn Marino builtin_decl_explicit_p (enum built_in_function fncode)
6094e4b17023SJohn Marino {
6095e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode));
6096e4b17023SJohn Marino   return (builtin_info.decl[(size_t)fncode] != NULL_TREE);
6097e4b17023SJohn Marino }
6098e4b17023SJohn Marino 
6099e4b17023SJohn Marino /* Return whether the standard builtin function can be used implicitly.  */
6100e4b17023SJohn Marino 
6101e4b17023SJohn Marino static inline bool
builtin_decl_implicit_p(enum built_in_function fncode)6102e4b17023SJohn Marino builtin_decl_implicit_p (enum built_in_function fncode)
6103e4b17023SJohn Marino {
6104e4b17023SJohn Marino   size_t uns_fncode = (size_t)fncode;
6105e4b17023SJohn Marino 
6106e4b17023SJohn Marino   gcc_checking_assert (BUILTIN_VALID_P (fncode));
6107e4b17023SJohn Marino   return (builtin_info.decl[uns_fncode] != NULL_TREE
6108e4b17023SJohn Marino 	  && builtin_info.implicit_p[uns_fncode]);
6109e4b17023SJohn Marino }
6110e4b17023SJohn Marino 
6111e4b17023SJohn Marino #endif  /* GCC_TREE_H  */
6112