Line data Source code
1 : /* Definitions for the ubiquitous 'tree' type for GNU compilers.
2 : Copyright (C) 1989-2026 Free Software Foundation, Inc.
3 :
4 : This file is part of GCC.
5 :
6 : GCC is free software; you can redistribute it and/or modify it under
7 : the terms of the GNU General Public License as published by the Free
8 : Software Foundation; either version 3, or (at your option) any later
9 : version.
10 :
11 : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : for more details.
15 :
16 : You should have received a copy of the GNU General Public License
17 : along with GCC; see the file COPYING3. If not see
18 : <http://www.gnu.org/licenses/>. */
19 :
20 : #ifndef GCC_TREE_H
21 : #define GCC_TREE_H
22 :
23 : #include "tree-core.h"
24 : #include "coretypes.h"
25 : #include "options.h"
26 : #include "vec.h"
27 : #include "stdbackport/expectedfwd"
28 :
29 : /* Convert a target-independent built-in function code to a combined_fn. */
30 :
31 : inline combined_fn
32 : as_combined_fn (built_in_function fn)
33 : {
34 : return combined_fn (int (fn));
35 : }
36 :
37 : /* Convert an internal function code to a combined_fn. */
38 :
39 : inline combined_fn
40 79362591 : as_combined_fn (internal_fn fn)
41 : {
42 78961622 : return combined_fn (int (fn) + int (END_BUILTINS));
43 : }
44 :
45 : /* Return true if CODE is a target-independent built-in function. */
46 :
47 : inline bool
48 3524 : builtin_fn_p (combined_fn code)
49 : {
50 3524 : return int (code) < int (END_BUILTINS);
51 : }
52 :
53 : /* Return the target-independent built-in function represented by CODE.
54 : Only valid if builtin_fn_p (CODE). */
55 :
56 : inline built_in_function
57 : as_builtin_fn (combined_fn code)
58 : {
59 13437787 : gcc_checking_assert (builtin_fn_p (code));
60 : return built_in_function (int (code));
61 : }
62 :
63 : /* Return true if CODE is an internal function. */
64 :
65 : inline bool
66 74000271 : internal_fn_p (combined_fn code)
67 : {
68 35125603 : return int (code) >= int (END_BUILTINS);
69 : }
70 :
71 : /* Return the internal function represented by CODE. Only valid if
72 : internal_fn_p (CODE). */
73 :
74 : inline internal_fn
75 24823878 : as_internal_fn (combined_fn code)
76 : {
77 24834554 : gcc_checking_assert (internal_fn_p (code));
78 24823878 : return internal_fn (int (code) - int (END_BUILTINS));
79 : }
80 :
81 : /* Helper to transparently allow tree codes and builtin function codes
82 : exist in one storage entity. */
83 : class code_helper
84 : {
85 : public:
86 1553388298 : code_helper () {}
87 3415711351 : code_helper (tree_code code) : rep ((int) code) {}
88 48398490 : code_helper (combined_fn fn) : rep (-(int) fn) {}
89 66661077 : code_helper (internal_fn fn) : rep (-(int) as_combined_fn (fn)) {}
90 332794336 : explicit operator tree_code () const { return (tree_code) rep; }
91 12780582 : explicit operator combined_fn () const { return (combined_fn) -rep; }
92 : explicit operator internal_fn () const;
93 : explicit operator built_in_function () const;
94 955871804 : bool is_tree_code () const { return rep > 0; }
95 2544966 : bool is_fn_code () const { return rep < 0; }
96 : bool is_internal_fn () const;
97 : bool is_builtin_fn () const;
98 702248236 : int get_rep () const { return rep; }
99 : tree_code safe_as_tree_code () const;
100 : combined_fn safe_as_fn_code () const;
101 482 : bool operator== (const code_helper &other) { return rep == other.rep; }
102 102490617 : bool operator!= (const code_helper &other) { return rep != other.rep; }
103 151105847 : bool operator== (tree_code c) { return rep == code_helper (c).rep; }
104 123120959 : bool operator!= (tree_code c) { return rep != code_helper (c).rep; }
105 :
106 : private:
107 : int rep;
108 : };
109 :
110 : /* Helper function that returns the tree_code representation of THIS
111 : code_helper if it is a tree_code and MAX_TREE_CODES otherwise. This is
112 : useful when passing a code_helper to a tree_code only check. */
113 :
114 : inline tree_code
115 1432715 : code_helper::safe_as_tree_code () const
116 : {
117 1394358 : return is_tree_code () ? (tree_code) *this : MAX_TREE_CODES;
118 : }
119 :
120 : /* Helper function that returns the combined_fn representation of THIS
121 : code_helper if it is a fn_code and CFN_LAST otherwise. This is useful when
122 : passing a code_helper to a combined_fn only check. */
123 :
124 : inline combined_fn
125 : code_helper::safe_as_fn_code () const {
126 : return is_fn_code () ? (combined_fn) *this : CFN_LAST;
127 : }
128 :
129 3348045 : inline code_helper::operator internal_fn () const
130 : {
131 3348045 : return as_internal_fn (combined_fn (*this));
132 : }
133 :
134 : inline code_helper::operator built_in_function () const
135 : {
136 : return as_builtin_fn (combined_fn (*this));
137 : }
138 :
139 : inline bool
140 670271083 : code_helper::is_internal_fn () const
141 : {
142 670267183 : return is_fn_code () && internal_fn_p (combined_fn (*this));
143 : }
144 :
145 : inline bool
146 : code_helper::is_builtin_fn () const
147 : {
148 : return is_fn_code () && builtin_fn_p (combined_fn (*this));
149 : }
150 :
151 : /* Macros for initializing `tree_contains_struct'. */
152 : #define MARK_TS_BASE(C) \
153 : (tree_contains_struct[C][TS_BASE] = true)
154 :
155 : #define MARK_TS_TYPED(C) \
156 : (MARK_TS_BASE (C), \
157 : tree_contains_struct[C][TS_TYPED] = true)
158 :
159 : #define MARK_TS_COMMON(C) \
160 : (MARK_TS_TYPED (C), \
161 : tree_contains_struct[C][TS_COMMON] = true)
162 :
163 : #define MARK_TS_TYPE_COMMON(C) \
164 : (MARK_TS_COMMON (C), \
165 : tree_contains_struct[C][TS_TYPE_COMMON] = true)
166 :
167 : #define MARK_TS_TYPE_WITH_LANG_SPECIFIC(C) \
168 : (MARK_TS_TYPE_COMMON (C), \
169 : tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = true)
170 :
171 : #define MARK_TS_TYPE_NON_COMMON(C) \
172 : (MARK_TS_TYPE_WITH_LANG_SPECIFIC (C), \
173 : tree_contains_struct[C][TS_TYPE_NON_COMMON] = true) \
174 :
175 : #define MARK_TS_DECL_MINIMAL(C) \
176 : (MARK_TS_COMMON (C), \
177 : tree_contains_struct[C][TS_DECL_MINIMAL] = true)
178 :
179 : #define MARK_TS_DECL_COMMON(C) \
180 : (MARK_TS_DECL_MINIMAL (C), \
181 : tree_contains_struct[C][TS_DECL_COMMON] = true)
182 :
183 : #define MARK_TS_DECL_WRTL(C) \
184 : (MARK_TS_DECL_COMMON (C), \
185 : tree_contains_struct[C][TS_DECL_WRTL] = true)
186 :
187 : #define MARK_TS_DECL_WITH_VIS(C) \
188 : (MARK_TS_DECL_WRTL (C), \
189 : tree_contains_struct[C][TS_DECL_WITH_VIS] = true)
190 :
191 : #define MARK_TS_DECL_NON_COMMON(C) \
192 : (MARK_TS_DECL_WITH_VIS (C), \
193 : tree_contains_struct[C][TS_DECL_NON_COMMON] = true)
194 :
195 : #define MARK_TS_EXP(C) \
196 : (MARK_TS_TYPED (C), \
197 : tree_contains_struct[C][TS_EXP] = true)
198 :
199 : /* Returns the string representing CLASS. */
200 :
201 : #define TREE_CODE_CLASS_STRING(CLASS)\
202 : tree_code_class_strings[(int) (CLASS)]
203 :
204 : #if __cpp_inline_variables < 201606L
205 : #define TREE_CODE_CLASS(CODE) \
206 : tree_code_type_tmpl <0>::tree_code_type[(int) (CODE)]
207 : #else
208 : #define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
209 : #endif
210 :
211 : /* Nonzero if NODE represents an exceptional code. */
212 :
213 : #define EXCEPTIONAL_CLASS_P(NODE)\
214 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_exceptional)
215 :
216 : /* Nonzero if NODE represents a constant. */
217 :
218 : #define CONSTANT_CLASS_P(NODE)\
219 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_constant)
220 :
221 : /* Nonzero if NODE represents a constant, or is a location wrapper
222 : around such a node. */
223 :
224 : #define CONSTANT_CLASS_OR_WRAPPER_P(NODE)\
225 : (CONSTANT_CLASS_P (tree_strip_any_location_wrapper (NODE)))
226 :
227 : /* Nonzero if NODE represents a type. */
228 :
229 : #define TYPE_P(NODE)\
230 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_type)
231 :
232 : /* Nonzero if NODE represents a declaration. */
233 :
234 : #define DECL_P(NODE)\
235 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_declaration)
236 :
237 : /* True if NODE designates a variable declaration. */
238 : #define VAR_P(NODE) \
239 : (TREE_CODE (NODE) == VAR_DECL)
240 :
241 : /* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL. */
242 :
243 : #define VAR_OR_FUNCTION_DECL_P(DECL)\
244 : (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL)
245 :
246 : /* Nonzero if NODE represents a INDIRECT_REF. Keep these checks in
247 : ascending code order. */
248 :
249 : #define INDIRECT_REF_P(NODE)\
250 : (TREE_CODE (NODE) == INDIRECT_REF)
251 :
252 : /* Nonzero if NODE represents a reference. */
253 :
254 : #define REFERENCE_CLASS_P(NODE)\
255 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_reference)
256 :
257 : /* Nonzero if NODE represents a comparison. */
258 :
259 : #define COMPARISON_CLASS_P(NODE)\
260 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_comparison)
261 :
262 : /* Nonzero if NODE represents a unary arithmetic expression. */
263 :
264 : #define UNARY_CLASS_P(NODE)\
265 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_unary)
266 :
267 : /* Nonzero if NODE represents a binary arithmetic expression. */
268 :
269 : #define BINARY_CLASS_P(NODE)\
270 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_binary)
271 :
272 : /* Nonzero if NODE represents a statement expression. */
273 :
274 : #define STATEMENT_CLASS_P(NODE)\
275 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_statement)
276 :
277 : /* Nonzero if NODE represents a function call-like expression with a
278 : variable-length operand vector. */
279 :
280 : #define VL_EXP_CLASS_P(NODE)\
281 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_vl_exp)
282 :
283 : /* Nonzero if NODE represents any other expression. */
284 :
285 : #define EXPRESSION_CLASS_P(NODE)\
286 : (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_expression)
287 :
288 : /* Returns nonzero iff NODE represents a type or declaration. */
289 :
290 : #define IS_TYPE_OR_DECL_P(NODE)\
291 : (TYPE_P (NODE) || DECL_P (NODE))
292 :
293 : /* Returns nonzero iff CLASS is the tree-code class of an
294 : expression. */
295 :
296 : #define IS_EXPR_CODE_CLASS(CLASS)\
297 : ((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
298 :
299 : /* Returns nonzero iff NODE is an expression of some kind. */
300 :
301 : #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
302 :
303 : #if __cpp_inline_variables < 201606L
304 : #define TREE_CODE_LENGTH(CODE) \
305 : tree_code_length_tmpl <0>::tree_code_length[(int) (CODE)]
306 : #else
307 : #define TREE_CODE_LENGTH(CODE) tree_code_length[(int) (CODE)]
308 : #endif
309 :
310 :
311 : /* Helper macros for math builtins. */
312 :
313 : #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
314 : #define CASE_FLT_FN_FLOATN_NX(FN) \
315 : case FN##F16: case FN##F32: case FN##F64: case FN##F128: \
316 : case FN##F32X: case FN##F64X: case FN##F128X
317 : #define CASE_FLT_FN_REENT(FN) case FN##_R: case FN##F_R: case FN##L_R
318 : #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL: case FN##IMAX
319 :
320 : #define NULL_TREE (tree) NULL
321 :
322 : /* Define accessors for the fields that all tree nodes have
323 : (though some fields are not used for all kinds of nodes). */
324 :
325 : /* The tree-code says what kind of node it is.
326 : Codes are defined in tree.def. */
327 : #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
328 : #define TREE_SET_CODE(NODE, VALUE) ((NODE)->base.code = (VALUE))
329 :
330 : /* When checking is enabled, errors will be generated if a tree node
331 : is accessed incorrectly. The macros die with a fatal error. */
332 : #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
333 :
334 : #define TREE_CHECK(T, CODE) \
335 : (tree_check ((T), __FILE__, __LINE__, __FUNCTION__, (CODE)))
336 :
337 : #define TREE_NOT_CHECK(T, CODE) \
338 : (tree_not_check ((T), __FILE__, __LINE__, __FUNCTION__, (CODE)))
339 :
340 : #define TREE_CHECK2(T, CODE1, CODE2) \
341 : (tree_check2 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2)))
342 :
343 : #define TREE_NOT_CHECK2(T, CODE1, CODE2) \
344 : (tree_not_check2 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2)))
345 :
346 : #define TREE_CHECK3(T, CODE1, CODE2, CODE3) \
347 : (tree_check3 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2), (CODE3)))
348 :
349 : #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) \
350 : (tree_not_check3 ((T), __FILE__, __LINE__, __FUNCTION__, \
351 : (CODE1), (CODE2), (CODE3)))
352 :
353 : #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) \
354 : (tree_check4 ((T), __FILE__, __LINE__, __FUNCTION__, \
355 : (CODE1), (CODE2), (CODE3), (CODE4)))
356 :
357 : #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) \
358 : (tree_not_check4 ((T), __FILE__, __LINE__, __FUNCTION__, \
359 : (CODE1), (CODE2), (CODE3), (CODE4)))
360 :
361 : #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) \
362 : (tree_check5 ((T), __FILE__, __LINE__, __FUNCTION__, \
363 : (CODE1), (CODE2), (CODE3), (CODE4), (CODE5)))
364 :
365 : #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) \
366 : (tree_not_check5 ((T), __FILE__, __LINE__, __FUNCTION__, \
367 : (CODE1), (CODE2), (CODE3), (CODE4), (CODE5)))
368 :
369 : #define TREE_CHECK6(T, CODE1, CODE2, CODE3, CODE4, CODE5, CODE6) \
370 : (tree_check6 ((T), __FILE__, __LINE__, __FUNCTION__, \
371 : (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), (CODE6)))
372 :
373 : #define TREE_NOT_CHECK6(T, CODE1, CODE2, CODE3, CODE4, CODE5, CODE6) \
374 : (tree_not_check6 ((T), __FILE__, __LINE__, __FUNCTION__, \
375 : (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), (CODE6)))
376 :
377 : #define CONTAINS_STRUCT_CHECK(T, STRUCT) \
378 : (contains_struct_check ((T), (STRUCT), __FILE__, __LINE__, __FUNCTION__))
379 :
380 : #define TREE_CLASS_CHECK(T, CLASS) \
381 : (tree_class_check ((T), (CLASS), __FILE__, __LINE__, __FUNCTION__))
382 :
383 : #define TREE_RANGE_CHECK(T, CODE1, CODE2) \
384 : (tree_range_check ((T), (CODE1), (CODE2), __FILE__, __LINE__, __FUNCTION__))
385 :
386 : #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) \
387 : (omp_clause_subcode_check ((T), (CODE), __FILE__, __LINE__, __FUNCTION__))
388 :
389 : #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) \
390 : (omp_clause_range_check ((T), (CODE1), (CODE2), \
391 : __FILE__, __LINE__, __FUNCTION__))
392 :
393 : /* These checks have to be special cased. */
394 : #define EXPR_CHECK(T) \
395 : (expr_check ((T), __FILE__, __LINE__, __FUNCTION__))
396 :
397 : /* These checks have to be special cased. */
398 : #define NON_TYPE_CHECK(T) \
399 : (non_type_check ((T), __FILE__, __LINE__, __FUNCTION__))
400 :
401 : /* These checks have to be special cased. */
402 : #define ANY_INTEGRAL_TYPE_CHECK(T) \
403 : (any_integral_type_check ((T), __FILE__, __LINE__, __FUNCTION__))
404 :
405 : #define TREE_INT_CST_ELT_CHECK(T, I) \
406 : (*tree_int_cst_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))
407 :
408 : #define TREE_VEC_ELT_CHECK(T, I) \
409 : (*(const_cast<tree *> ( \
410 : tree_vec_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))))
411 :
412 : #define OMP_CLAUSE_ELT_CHECK(T, I) \
413 : (*(omp_clause_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__)))
414 :
415 : /* Special checks for TREE_OPERANDs. */
416 : #define TREE_OPERAND_CHECK(T, I) \
417 : (*(const_cast<tree *> ( \
418 : tree_operand_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))))
419 :
420 : #define TREE_OPERAND_CHECK_CODE(T, CODE, I) \
421 : (*(tree_operand_check_code ((T), (CODE), (I), \
422 : __FILE__, __LINE__, __FUNCTION__)))
423 :
424 : /* Nodes are chained together for many purposes.
425 : Types are chained together to record them for being output to the debugger
426 : (see the function `chain_type').
427 : Decls in the same scope are chained together to record the contents
428 : of the scope.
429 : Statement nodes for successive statements used to be chained together.
430 : Often lists of things are represented by TREE_LIST nodes that
431 : are chained together. */
432 :
433 : #define TREE_CHAIN(NODE) \
434 : (CONTAINS_STRUCT_CHECK (NODE, TS_COMMON)->common.chain)
435 :
436 : /* In all nodes that are expressions, this is the data type of the expression.
437 : In POINTER_TYPE nodes, this is the type that the pointer points to.
438 : In ARRAY_TYPE nodes, this is the type of the elements.
439 : In VECTOR_TYPE nodes, this is the type of the elements. */
440 : #define TREE_TYPE(NODE) \
441 : (CONTAINS_STRUCT_CHECK (NODE, TS_TYPED)->typed.type)
442 :
443 : extern void tree_contains_struct_check_failed (const_tree,
444 : const enum tree_node_structure_enum,
445 : const char *, int, const char *)
446 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
447 :
448 : extern void tree_check_failed (const_tree, const char *, int, const char *,
449 : ...) ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
450 : extern void tree_not_check_failed (const_tree, const char *, int, const char *,
451 : ...) ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
452 : extern void tree_class_check_failed (const_tree, const enum tree_code_class,
453 : const char *, int, const char *)
454 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
455 : extern void tree_range_check_failed (const_tree, const char *, int,
456 : const char *, enum tree_code,
457 : enum tree_code)
458 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
459 : extern void tree_not_class_check_failed (const_tree,
460 : const enum tree_code_class,
461 : const char *, int, const char *)
462 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
463 : extern void tree_int_cst_elt_check_failed (int, int, const char *,
464 : int, const char *)
465 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
466 : extern void tree_vec_elt_check_failed (int, int, const char *,
467 : int, const char *)
468 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
469 : extern void phi_node_elt_check_failed (int, int, const char *,
470 : int, const char *)
471 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
472 : extern void tree_operand_check_failed (int, const_tree,
473 : const char *, int, const char *)
474 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
475 : extern void omp_clause_check_failed (const_tree, const char *, int,
476 : const char *, enum omp_clause_code)
477 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
478 : extern void omp_clause_operand_check_failed (int, const_tree, const char *,
479 : int, const char *)
480 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
481 : extern void omp_clause_range_check_failed (const_tree, const char *, int,
482 : const char *, enum omp_clause_code,
483 : enum omp_clause_code)
484 : ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
485 :
486 : #else /* not ENABLE_TREE_CHECKING, or not gcc */
487 :
488 : #define CONTAINS_STRUCT_CHECK(T, ENUM) (T)
489 : #define TREE_CHECK(T, CODE) (T)
490 : #define TREE_NOT_CHECK(T, CODE) (T)
491 : #define TREE_CHECK2(T, CODE1, CODE2) (T)
492 : #define TREE_NOT_CHECK2(T, CODE1, CODE2) (T)
493 : #define TREE_CHECK3(T, CODE1, CODE2, CODE3) (T)
494 : #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) (T)
495 : #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
496 : #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
497 : #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
498 : #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
499 : #define TREE_CHECK6(T, CODE1, CODE2, CODE3, CODE4, CODE5, CODE6) (T)
500 : #define TREE_NOT_CHECK6(T, CODE1, CODE2, CODE3, CODE4, CODE5, CODE6) (T)
501 : #define TREE_CLASS_CHECK(T, CODE) (T)
502 : #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
503 : #define EXPR_CHECK(T) (T)
504 : #define NON_TYPE_CHECK(T) (T)
505 : #define TREE_INT_CST_ELT_CHECK(T, I) ((T)->int_cst.val[I])
506 : #define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
507 : #define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
508 : #define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
509 : #define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
510 : #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
511 : #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
512 : #define ANY_INTEGRAL_TYPE_CHECK(T) (T)
513 :
514 : #define TREE_CHAIN(NODE) ((NODE)->common.chain)
515 : #define TREE_TYPE(NODE) ((NODE)->typed.type)
516 :
517 : #endif
518 :
519 : #define TREE_BLOCK(NODE) (tree_block (NODE))
520 : #define TREE_SET_BLOCK(T, B) (tree_set_block ((T), (B)))
521 :
522 : #include "tree-check.h"
523 :
524 : #define TYPE_CHECK(T) TREE_CLASS_CHECK (T, tcc_type)
525 : #define DECL_MINIMAL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
526 : #define DECL_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
527 : #define DECL_WRTL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
528 : #define DECL_WITH_VIS_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
529 : #define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON)
530 : #define CST_CHECK(T) TREE_CLASS_CHECK (T, tcc_constant)
531 : #define STMT_CHECK(T) TREE_CLASS_CHECK (T, tcc_statement)
532 : #define VL_EXP_CHECK(T) TREE_CLASS_CHECK (T, tcc_vl_exp)
533 : #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
534 : #define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
535 :
536 : #define RECORD_OR_UNION_CHECK(T) \
537 : TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
538 : #define NOT_RECORD_OR_UNION_CHECK(T) \
539 : TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
540 : #define ARRAY_OR_INTEGER_TYPE_CHECK(T) \
541 : TREE_CHECK2 (T, ARRAY_TYPE, INTEGER_TYPE)
542 :
543 : #define NUMERICAL_TYPE_CHECK(T) \
544 : TREE_CHECK6 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \
545 : FIXED_POINT_TYPE, BITINT_TYPE)
546 :
547 : /* Here is how primitive or already-canonicalized types' hash codes
548 : are made. */
549 : #define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
550 :
551 : /* A simple hash function for an arbitrary tree node. This must not be
552 : used in hash tables which are saved to a PCH. */
553 : #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
554 :
555 : /* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */
556 : #define CONVERT_EXPR_CODE_P(CODE) \
557 : ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
558 :
559 : /* Similarly, but accept an expression instead of a tree code. */
560 : #define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
561 :
562 : /* Generate case for NOP_EXPR, CONVERT_EXPR. */
563 :
564 : #define CASE_CONVERT \
565 : case NOP_EXPR: \
566 : case CONVERT_EXPR
567 :
568 : /* Given an expression as a tree, strip any conversion that generates
569 : no instruction. Accepts both tree and const_tree arguments since
570 : we are not modifying the tree itself. */
571 :
572 : #define STRIP_NOPS(EXP) \
573 : (EXP) = tree_strip_nop_conversions (const_cast<tree> (EXP))
574 :
575 : /* Like STRIP_NOPS, but don't let the signedness change either. */
576 :
577 : #define STRIP_SIGN_NOPS(EXP) \
578 : (EXP) = tree_strip_sign_nop_conversions (const_cast<tree> (EXP))
579 :
580 : /* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */
581 :
582 : #define STRIP_TYPE_NOPS(EXP) \
583 : while ((CONVERT_EXPR_P (EXP) \
584 : || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
585 : && TREE_OPERAND (EXP, 0) != error_mark_node \
586 : && (TREE_TYPE (EXP) \
587 : == TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
588 : (EXP) = TREE_OPERAND (EXP, 0)
589 :
590 : /* Remove unnecessary type conversions according to
591 : tree_ssa_useless_type_conversion. */
592 :
593 : #define STRIP_USELESS_TYPE_CONVERSION(EXP) \
594 : (EXP) = tree_ssa_strip_useless_type_conversions (EXP)
595 :
596 : /* Remove any VIEW_CONVERT_EXPR or NON_LVALUE_EXPR that's purely
597 : in use to provide a location_t. */
598 :
599 : #define STRIP_ANY_LOCATION_WRAPPER(EXP) \
600 : (EXP) = tree_strip_any_location_wrapper (const_cast<tree> (EXP))
601 :
602 : /* Nonzero if TYPE represents a vector type. */
603 :
604 : #define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
605 :
606 : /* Nonzero if TYPE represents a vector of booleans. */
607 :
608 : #define VECTOR_BOOLEAN_TYPE_P(TYPE) \
609 : (TREE_CODE (TYPE) == VECTOR_TYPE \
610 : && TREE_CODE (TREE_TYPE (TYPE)) == BOOLEAN_TYPE)
611 :
612 : /* Nonzero if TYPE represents an integral type. Note that we do not
613 : include COMPLEX types here. Keep these checks in ascending code
614 : order. */
615 :
616 : #define INTEGRAL_TYPE_P(TYPE) \
617 : (TREE_CODE (TYPE) == ENUMERAL_TYPE \
618 : || TREE_CODE (TYPE) == BOOLEAN_TYPE \
619 : || TREE_CODE (TYPE) == INTEGER_TYPE \
620 : || TREE_CODE (TYPE) == BITINT_TYPE)
621 :
622 : /* Nonzero if TYPE represents an integral type (non-boolean). */
623 :
624 : #define INTEGRAL_NB_TYPE_P(TYPE) \
625 : (TREE_CODE (TYPE) == ENUMERAL_TYPE \
626 : || TREE_CODE (TYPE) == INTEGER_TYPE \
627 : || TREE_CODE (TYPE) == BITINT_TYPE)
628 :
629 : /* Nonzero if TYPE represents an integral type, including complex
630 : and vector integer types. */
631 :
632 : #define ANY_INTEGRAL_TYPE_P(TYPE) \
633 : (INTEGRAL_TYPE_P (TYPE) \
634 : || ((TREE_CODE (TYPE) == COMPLEX_TYPE \
635 : || VECTOR_TYPE_P (TYPE)) \
636 : && INTEGRAL_TYPE_P (TREE_TYPE (TYPE))))
637 :
638 : /* Nonzero if TYPE is bit-precise integer type or enumeral type
639 : with bit-precise integer type as underlying type. */
640 :
641 : #define BITINT_TYPE_P(TYPE) \
642 : (TREE_CODE (TYPE) == BITINT_TYPE \
643 : || (TREE_CODE (TYPE) == ENUMERAL_TYPE \
644 : && TREE_TYPE (TYPE) \
645 : && TREE_CODE (TREE_TYPE (TYPE)) == BITINT_TYPE))
646 :
647 : /* Nonzero if TYPE represents a non-saturating fixed-point type. */
648 :
649 : #define NON_SAT_FIXED_POINT_TYPE_P(TYPE) \
650 : (TREE_CODE (TYPE) == FIXED_POINT_TYPE && !TYPE_SATURATING (TYPE))
651 :
652 : /* Nonzero if TYPE represents a saturating fixed-point type. */
653 :
654 : #define SAT_FIXED_POINT_TYPE_P(TYPE) \
655 : (TREE_CODE (TYPE) == FIXED_POINT_TYPE && TYPE_SATURATING (TYPE))
656 :
657 : /* Nonzero if TYPE represents a fixed-point type. */
658 :
659 : #define FIXED_POINT_TYPE_P(TYPE) (TREE_CODE (TYPE) == FIXED_POINT_TYPE)
660 :
661 : /* Nonzero if TYPE represents a scalar floating-point type. */
662 :
663 : #define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
664 :
665 : /* Nonzero if TYPE represents a complex floating-point type. */
666 :
667 : #define COMPLEX_FLOAT_TYPE_P(TYPE) \
668 : (TREE_CODE (TYPE) == COMPLEX_TYPE \
669 : && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
670 :
671 : /* Nonzero if TYPE represents a vector integer type. */
672 :
673 : #define VECTOR_INTEGER_TYPE_P(TYPE) \
674 : (VECTOR_TYPE_P (TYPE) \
675 : && TREE_CODE (TREE_TYPE (TYPE)) == INTEGER_TYPE)
676 :
677 :
678 : /* Nonzero if TYPE represents a vector floating-point type. */
679 :
680 : #define VECTOR_FLOAT_TYPE_P(TYPE) \
681 : (VECTOR_TYPE_P (TYPE) \
682 : && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
683 :
684 : /* Nonzero if TYPE represents a floating-point type, including complex
685 : and vector floating-point types. The vector and complex check does
686 : not use the previous two macros to enable early folding. */
687 :
688 : #define FLOAT_TYPE_P(TYPE) \
689 : (SCALAR_FLOAT_TYPE_P (TYPE) \
690 : || ((TREE_CODE (TYPE) == COMPLEX_TYPE \
691 : || VECTOR_TYPE_P (TYPE)) \
692 : && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE))))
693 :
694 : /* Nonzero if TYPE represents a decimal floating-point type. */
695 : #define DECIMAL_FLOAT_TYPE_P(TYPE) \
696 : (SCALAR_FLOAT_TYPE_P (TYPE) \
697 : && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TYPE)))
698 :
699 : /* Nonzero if TYPE is a record or union type. */
700 : #define RECORD_OR_UNION_TYPE_P(TYPE) \
701 : (TREE_CODE (TYPE) == RECORD_TYPE \
702 : || TREE_CODE (TYPE) == UNION_TYPE \
703 : || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
704 :
705 : /* Nonzero if TYPE represents an aggregate (multi-component) type.
706 : Keep these checks in ascending code order. */
707 :
708 : #define AGGREGATE_TYPE_P(TYPE) \
709 : (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
710 :
711 : /* Nonzero if TYPE represents a pointer or reference type.
712 : (It should be renamed to INDIRECT_TYPE_P.) Keep these checks in
713 : ascending code order. */
714 :
715 : #define POINTER_TYPE_P(TYPE) \
716 : (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
717 :
718 : /* Nonzero if TYPE represents a pointer to function. */
719 : #define FUNCTION_POINTER_TYPE_P(TYPE) \
720 : (POINTER_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
721 :
722 : /* Nonzero if this type is a complete type. */
723 : #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
724 :
725 : /* Nonzero if this type is the (possibly qualified) void type. */
726 : #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
727 :
728 : /* Nonzero if this type is complete or is cv void. */
729 : #define COMPLETE_OR_VOID_TYPE_P(NODE) \
730 : (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE))
731 :
732 : /* Nonzero if this type is complete or is an array with unspecified bound. */
733 : #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \
734 : (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : (NODE)))
735 :
736 : #define FUNC_OR_METHOD_TYPE_P(NODE) \
737 : (TREE_CODE (NODE) == FUNCTION_TYPE || TREE_CODE (NODE) == METHOD_TYPE)
738 :
739 : #define OPAQUE_TYPE_P(NODE) \
740 : (TREE_CODE (NODE) == OPAQUE_TYPE)
741 :
742 : /* Define many boolean fields that all tree nodes have. */
743 :
744 : /* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address
745 : of this is needed. So it cannot be in a register.
746 : In a FUNCTION_DECL it has no meaning.
747 : In LABEL_DECL nodes, it means a goto for this label has been seen
748 : from a place outside all binding contours that restore stack levels.
749 : In an artificial SSA_NAME that points to a stack partition with at least
750 : two variables, it means that at least one variable has TREE_ADDRESSABLE.
751 : In ..._TYPE nodes, it means that objects of this type must be fully
752 : addressable. This means that pieces of this object cannot go into
753 : register parameters, for example. If this a function type, this
754 : means that the value must be returned in memory.
755 : In CONSTRUCTOR nodes, it means object constructed must be in memory.
756 : In IDENTIFIER_NODEs, this means that some extern decl for this name
757 : had its address taken. That matters for inline functions.
758 : In a STMT_EXPR, it means we want the result of the enclosed expression. */
759 : #define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
760 :
761 : /* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
762 : exit of a function. Calls for which this is true are candidates for tail
763 : call optimizations. */
764 : #define CALL_EXPR_TAILCALL(NODE) \
765 : (CALL_EXPR_CHECK (NODE)->base.addressable_flag)
766 :
767 : /* Set on a CALL_EXPR if the call has been marked as requiring tail call
768 : optimization for correctness. */
769 : #define CALL_EXPR_MUST_TAIL_CALL(NODE) \
770 : (CALL_EXPR_CHECK (NODE)->base.static_flag)
771 :
772 : /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
773 : CASE_LOW operand has been processed. */
774 : #define CASE_LOW_SEEN(NODE) \
775 : (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag)
776 :
777 : #define PREDICT_EXPR_OUTCOME(NODE) \
778 : ((enum prediction) (PREDICT_EXPR_CHECK (NODE)->base.addressable_flag))
779 : #define SET_PREDICT_EXPR_OUTCOME(NODE, OUTCOME) \
780 : (PREDICT_EXPR_CHECK (NODE)->base.addressable_flag = (int) OUTCOME)
781 : #define PREDICT_EXPR_PREDICTOR(NODE) \
782 : ((enum br_predictor)tree_to_shwi (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0)))
783 :
784 : /* In a VAR_DECL, nonzero means allocate static storage.
785 : In a FUNCTION_DECL, nonzero if function has been defined.
786 : In a CONSTRUCTOR, nonzero means allocate static storage. */
787 : #define TREE_STATIC(NODE) ((NODE)->base.static_flag)
788 :
789 : /* In an ADDR_EXPR, nonzero means do not use a trampoline. */
790 : #define TREE_NO_TRAMPOLINE(NODE) (ADDR_EXPR_CHECK (NODE)->base.static_flag)
791 :
792 : /* In a TARGET_EXPR or WITH_CLEANUP_EXPR, means that the pertinent cleanup
793 : should only be executed if an exception is thrown, not on normal exit
794 : of its scope. */
795 : #define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
796 :
797 : /* In a TRY_CATCH_EXPR, means that the handler should be considered a
798 : separate cleanup in honor_protect_cleanup_actions. */
799 : #define TRY_CATCH_IS_CLEANUP(NODE) \
800 : (TRY_CATCH_EXPR_CHECK (NODE)->base.static_flag)
801 :
802 : /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
803 : CASE_HIGH operand has been processed. */
804 : #define CASE_HIGH_SEEN(NODE) \
805 : (CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
806 :
807 : /* Used to mark scoped enums. */
808 : #define ENUM_IS_SCOPED(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.static_flag)
809 :
810 : /* Determines whether an ENUMERAL_TYPE has defined the list of constants. */
811 : #define ENUM_IS_OPAQUE(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.private_flag)
812 :
813 : /* Determines whether a VIEW_CONVERT_EXPR node is used to create const
814 : qualified variant of its first operand (used by C++ contracts). */
815 : #define CONST_WRAPPER_P(NODE) \
816 : (TREE_CHECK (NODE, VIEW_CONVERT_EXPR)->base.private_flag)
817 :
818 : /* In an expr node (usually a conversion) this means the node was made
819 : implicitly and should not lead to any sort of warning. In a decl node,
820 : warnings concerning the decl should be suppressed. This is used at
821 : least for used-before-set warnings, and it set after one warning is
822 : emitted. */
823 : #define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
824 :
825 : /* Nonzero if we should warn about the change in empty class parameter
826 : passing ABI in this TU. */
827 : #define TRANSLATION_UNIT_WARN_EMPTY_P(NODE) \
828 : (TRANSLATION_UNIT_DECL_CHECK (NODE)->decl_common.decl_flag_0)
829 :
830 : /* Nonzero if this type is "empty" according to the particular psABI. */
831 : #define TYPE_EMPTY_P(NODE) (TYPE_CHECK (NODE)->type_common.empty_flag)
832 :
833 : /* Used to indicate that this TYPE represents a compiler-generated entity. */
834 : #define TYPE_ARTIFICIAL(NODE) (TYPE_CHECK (NODE)->base.nowarning_flag)
835 :
836 : /* True if the type is indivisible at the source level, i.e. if its
837 : component parts cannot be accessed directly. This is used to suppress
838 : normal GNU extensions for target-specific vector types. */
839 : #define TYPE_INDIVISIBLE_P(NODE) (TYPE_CHECK (NODE)->type_common.indivisible_p)
840 :
841 : /* True if this is a stdarg function with no named arguments (C23
842 : (...) prototype, where arguments can be accessed with va_start and
843 : va_arg), as opposed to an unprototyped function. */
844 : #define TYPE_NO_NAMED_ARGS_STDARG_P(NODE) \
845 : (FUNC_OR_METHOD_CHECK (NODE)->type_common.no_named_args_stdarg_p)
846 :
847 : /* True if this RECORD_TYPE or UNION_TYPE includes a flexible array member
848 : as the last field recursively. */
849 : #define TYPE_INCLUDES_FLEXARRAY(NODE) \
850 : (RECORD_OR_UNION_CHECK (NODE)->type_common.no_named_args_stdarg_p)
851 :
852 : /* In an IDENTIFIER_NODE, this means that assemble_name was called with
853 : this string as an argument. */
854 : #define TREE_SYMBOL_REFERENCED(NODE) \
855 : (IDENTIFIER_NODE_CHECK (NODE)->base.static_flag)
856 :
857 : /* Nonzero in a pointer or reference type means the data pointed to
858 : by this type can alias anything. */
859 : #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
860 : (PTR_OR_REF_CHECK (NODE)->base.static_flag)
861 :
862 : /* In an INTEGER_CST, REAL_CST, or COMPLEX_CST, this means
863 : there was an overflow in folding. */
864 :
865 : #define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)
866 :
867 : /* TREE_OVERFLOW can only be true for EXPR of CONSTANT_CLASS_P. */
868 :
869 : #define TREE_OVERFLOW_P(EXPR) \
870 : (CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
871 :
872 : /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
873 : nonzero means name is to be accessible from outside this translation unit.
874 : In an IDENTIFIER_NODE, nonzero means an external declaration
875 : accessible from outside this translation unit was previously seen
876 : for this name in an inner scope. */
877 : #define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
878 :
879 : /* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
880 : of cached values, or is something else. */
881 : #define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK (NODE)->base.public_flag)
882 :
883 : /* In a SAVE_EXPR, indicates that the original expression has already
884 : been substituted with a VAR_DECL that contains the value. */
885 : #define SAVE_EXPR_RESOLVED_P(NODE) \
886 : (SAVE_EXPR_CHECK (NODE)->base.public_flag)
887 :
888 : /* Set on a CALL_EXPR if this stdarg call should be passed the argument
889 : pack. */
890 : #define CALL_EXPR_VA_ARG_PACK(NODE) \
891 : (CALL_EXPR_CHECK (NODE)->base.public_flag)
892 :
893 : /* In any expression, decl, or constant, nonzero means it has side effects or
894 : reevaluation of the whole expression could produce a different value.
895 : This is set if any subexpression is a function call, a side effect or a
896 : reference to a volatile variable. In a ..._DECL, this is set only if the
897 : declaration said `volatile'. This will never be set for a constant. */
898 : #define TREE_SIDE_EFFECTS(NODE) \
899 : (NON_TYPE_CHECK (NODE)->base.side_effects_flag)
900 :
901 : /* In a LABEL_DECL, nonzero means this label had its address taken
902 : and therefore can never be deleted and is a jump target for
903 : computed gotos. */
904 : #define FORCED_LABEL(NODE) (LABEL_DECL_CHECK (NODE)->base.side_effects_flag)
905 :
906 : /* Whether a case or a user-defined label is allowed to fall through to.
907 : This is used to implement -Wimplicit-fallthrough. */
908 : #define FALLTHROUGH_LABEL_P(NODE) \
909 : (LABEL_DECL_CHECK (NODE)->base.private_flag)
910 :
911 : /* Set on the artificial label created for break; stmt from a switch.
912 : This is used to implement -Wimplicit-fallthrough. */
913 : #define SWITCH_BREAK_LABEL_P(NODE) \
914 : (LABEL_DECL_CHECK (NODE)->base.protected_flag)
915 :
916 : /* Set on label that is known not to be jumped to, it can be only
917 : reached by falling through from previous statements.
918 : This is used to implement -Wimplicit-fallthrough. */
919 : #define UNUSED_LABEL_P(NODE) \
920 : (LABEL_DECL_CHECK (NODE)->base.default_def_flag)
921 :
922 : /* Label used to goto around artificial .DEFERRED_INIT code for
923 : C++ -ftrivial-auto-var-init= purposes with a goto around it.
924 : VACUOUS_INIT_LABEL_P flag is used on the lab LABEL_DECL in:
925 : goto lab;
926 : lab1:
927 : v1 = .DEFERRED_INIT (...);
928 : v2 = .DEFERRED_INIT (...);
929 : lab2:
930 : v3 = .DEFERRED_INIT (...);
931 : lab: */
932 : #define VACUOUS_INIT_LABEL_P(NODE) \
933 : (LABEL_DECL_CHECK (NODE)->base.nothrow_flag)
934 :
935 : /* Nonzero means this expression is volatile in the C sense:
936 : its address should be of type `volatile WHATEVER *'.
937 : In other words, the declared item is volatile qualified.
938 : This is used in _DECL nodes and _REF nodes.
939 : On a FUNCTION_DECL node, this means the function does not
940 : return normally. This is the same effect as setting
941 : the attribute noreturn on the function in C.
942 :
943 : In a ..._TYPE node, means this type is volatile-qualified.
944 : But use TYPE_VOLATILE instead of this macro when the node is a type,
945 : because eventually we may make that a different bit.
946 :
947 : If this bit is set in an expression, so is TREE_SIDE_EFFECTS. */
948 : #define TREE_THIS_VOLATILE(NODE) ((NODE)->base.volatile_flag)
949 :
950 : /* Nonzero means this node will not trap. In an INDIRECT_REF, means
951 : accessing the memory pointed to won't generate a trap. However,
952 : this only applies to an object when used appropriately: it doesn't
953 : mean that writing a READONLY mem won't trap.
954 :
955 : In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
956 : (or slice of the array) always belongs to the range of the array.
957 : I.e. that the access will not trap, provided that the access to
958 : the base to the array will not trap. */
959 : #define TREE_THIS_NOTRAP(NODE) \
960 : (TREE_CHECK5 (NODE, INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF, \
961 : ARRAY_RANGE_REF)->base.nothrow_flag)
962 :
963 : /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
964 : nonzero means it may not be the lhs of an assignment.
965 : Nonzero in a FUNCTION_DECL means this function should be treated
966 : as "const" function (can only read its arguments). */
967 : #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
968 :
969 : /* Value of expression is constant. Always on in all ..._CST nodes. May
970 : also appear in an expression or decl where the value is constant. */
971 : #define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->base.constant_flag)
972 :
973 : /* Nonzero if NODE, a type, has had its sizes gimplified. */
974 : #define TYPE_SIZES_GIMPLIFIED(NODE) \
975 : (TYPE_CHECK (NODE)->base.constant_flag)
976 :
977 : /* In a decl (most significantly a FIELD_DECL), means an unsigned field. */
978 : #define DECL_UNSIGNED(NODE) \
979 : (DECL_COMMON_CHECK (NODE)->base.u.bits.unsigned_flag)
980 :
981 : /* In integral and pointer types, means an unsigned type. */
982 : #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.u.bits.unsigned_flag)
983 :
984 : /* Same as TYPE_UNSIGNED but converted to SIGNOP. */
985 : #define TYPE_SIGN(NODE) ((signop) TYPE_UNSIGNED (NODE))
986 :
987 : /* True if overflow wraps around for the given integral or pointer type. That
988 : is, TYPE_MAX + 1 == TYPE_MIN. */
989 : #define TYPE_OVERFLOW_WRAPS(TYPE) \
990 : (POINTER_TYPE_P (TYPE) \
991 : ? flag_wrapv_pointer \
992 : : (ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag \
993 : || flag_wrapv))
994 :
995 : /* True if overflow is undefined for the given integral or pointer type.
996 : We may optimize on the assumption that values in the type never overflow. */
997 : #define TYPE_OVERFLOW_UNDEFINED(TYPE) \
998 : (POINTER_TYPE_P (TYPE) \
999 : ? !flag_wrapv_pointer \
1000 : : (!ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag \
1001 : && !flag_wrapv && !flag_trapv))
1002 :
1003 : /* True if overflow for the given integral type should issue a
1004 : trap. */
1005 : #define TYPE_OVERFLOW_TRAPS(TYPE) \
1006 : (!ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag && flag_trapv)
1007 :
1008 : /* True if an overflow is to be preserved for sanitization. */
1009 : #define TYPE_OVERFLOW_SANITIZED(TYPE) \
1010 : (ANY_INTEGRAL_TYPE_P (TYPE) \
1011 : && !TYPE_OVERFLOW_WRAPS (TYPE) \
1012 : && (flag_sanitize & SANITIZE_SI_OVERFLOW))
1013 :
1014 : /* Nonzero in a VAR_DECL or STRING_CST means assembler code has been written.
1015 : Nonzero in a FUNCTION_DECL means that the function has been compiled.
1016 : This is interesting in an inline function, since it might not need
1017 : to be compiled separately.
1018 : Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ENUMERAL_TYPE
1019 : or TYPE_DECL if the debugging info for the type has been written.
1020 : In a BLOCK node, nonzero if reorder_blocks has already seen this block.
1021 : In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
1022 : PHI node. */
1023 : #define TREE_ASM_WRITTEN(NODE) ((NODE)->base.asm_written_flag)
1024 :
1025 : /* Nonzero in a _DECL if the name is used in its scope.
1026 : Nonzero in an expr node means inhibit warning if value is unused.
1027 : In IDENTIFIER_NODEs, this means that some extern decl for this name
1028 : was used.
1029 : In a BLOCK, this means that the block contains variables that are used. */
1030 : #define TREE_USED(NODE) ((NODE)->base.used_flag)
1031 :
1032 : /* In a FUNCTION_DECL, nonzero means a call to the function cannot
1033 : throw an exception. In a CALL_EXPR, nonzero means the call cannot
1034 : throw. We can't easily check the node type here as the C++
1035 : frontend also uses this flag (for AGGR_INIT_EXPR). */
1036 : #define TREE_NOTHROW(NODE) ((NODE)->base.nothrow_flag)
1037 :
1038 : /* In a CALL_EXPR, means that it's safe to use the target of the call
1039 : expansion as the return slot for a call that returns in memory. */
1040 : #define CALL_EXPR_RETURN_SLOT_OPT(NODE) \
1041 : (CALL_EXPR_CHECK (NODE)->base.private_flag)
1042 :
1043 : /* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that it is
1044 : passed by invisible reference (and the TREE_TYPE is a pointer to the true
1045 : type). */
1046 : #define DECL_BY_REFERENCE(NODE) \
1047 : (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
1048 : RESULT_DECL)->decl_common.decl_by_reference_flag)
1049 :
1050 : /* In VAR_DECL and PARM_DECL, set when the decl has been used except for
1051 : being set. */
1052 : #define DECL_READ_P(NODE) \
1053 : (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_read_flag)
1054 :
1055 : /* In VAR_DECL or RESULT_DECL, set when significant code movement precludes
1056 : attempting to share the stack slot with some other variable. */
1057 : #define DECL_NONSHAREABLE(NODE) \
1058 : (TREE_CHECK2 (NODE, VAR_DECL, \
1059 : RESULT_DECL)->decl_common.decl_nonshareable_flag)
1060 :
1061 : /* In a PARM_DECL, set for Fortran hidden string length arguments that some
1062 : buggy callers don't pass to the callee. */
1063 : #define DECL_HIDDEN_STRING_LENGTH(NODE) \
1064 : (TREE_CHECK (NODE, PARM_DECL)->decl_common.decl_nonshareable_flag)
1065 :
1066 : /* In a CALL_EXPR, means that the call is the jump from a thunk to the
1067 : thunked-to function. Be careful to avoid using this macro when one of the
1068 : next two applies instead. */
1069 : #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->base.protected_flag)
1070 :
1071 : /* In a CALL_EXPR, if the function being called is BUILT_IN_ALLOCA, means that
1072 : it has been built for the declaration of a variable-sized object and, if the
1073 : function being called is BUILT_IN_MEMCPY, means that it has been built for
1074 : the assignment of a variable-sized object. */
1075 : #define CALL_ALLOCA_FOR_VAR_P(NODE) \
1076 : (CALL_EXPR_CHECK (NODE)->base.protected_flag)
1077 :
1078 : /* In a CALL_EXPR, if the function being called is DECL_IS_OPERATOR_NEW_P or
1079 : DECL_IS_OPERATOR_DELETE_P, true for allocator calls from C++ new or delete
1080 : expressions. Not set for C++20 destroying delete operators. */
1081 : #define CALL_FROM_NEW_OR_DELETE_P(NODE) \
1082 : (CALL_EXPR_CHECK (NODE)->base.protected_flag)
1083 :
1084 : /* Used in classes in C++. */
1085 : #define TREE_PRIVATE(NODE) ((NODE)->base.private_flag)
1086 : /* Used in classes in C++. */
1087 : #define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
1088 :
1089 : /* True if reference type NODE is a C++ rvalue reference. */
1090 : #define TYPE_REF_IS_RVALUE(NODE) \
1091 : (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
1092 :
1093 : /* Nonzero in a _DECL if the use of the name is defined as a
1094 : deprecated feature by __attribute__((deprecated)). */
1095 : #define TREE_DEPRECATED(NODE) \
1096 : ((NODE)->base.deprecated_flag)
1097 :
1098 : /* Nonzero in a _DECL if the use of the name is defined as an
1099 : unavailable feature by __attribute__((unavailable)). */
1100 : #define TREE_UNAVAILABLE(NODE) \
1101 : ((NODE)->base.u.bits.unavailable_flag)
1102 :
1103 : /* Nonzero indicates an IDENTIFIER_NODE that names an anonymous
1104 : aggregate, (as created by anon_aggr_name_format). */
1105 : #define IDENTIFIER_ANON_P(NODE) \
1106 : (IDENTIFIER_NODE_CHECK (NODE)->base.private_flag)
1107 :
1108 : /* Nonzero indicates an IDENTIFIER_NODE that names an internal label.
1109 : The prefix used to generate the label can be found on the TREE_CHAIN. */
1110 : #define IDENTIFIER_INTERNAL_P(NODE) \
1111 : (IDENTIFIER_NODE_CHECK (NODE)->base.volatile_flag)
1112 :
1113 : /* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
1114 : uses are to be substituted for uses of the TREE_CHAINed identifier. */
1115 : #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
1116 : (IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
1117 :
1118 : /* In an aggregate type, indicates that the scalar fields of the type are
1119 : stored in reverse order from the target order. This effectively
1120 : toggles BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN within the type. */
1121 : #define TYPE_REVERSE_STORAGE_ORDER(NODE) \
1122 : (TREE_CHECK4 (NODE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ARRAY_TYPE)->base.u.bits.saturating_flag)
1123 :
1124 : /* In a non-aggregate type, indicates a saturating type. */
1125 : #define TYPE_SATURATING(NODE) \
1126 : (TREE_NOT_CHECK4 (NODE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ARRAY_TYPE)->base.u.bits.saturating_flag)
1127 :
1128 : /* In a BIT_FIELD_REF and MEM_REF, indicates that the reference is to a group
1129 : of bits stored in reverse order from the target order. This effectively
1130 : toggles both BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN for the reference.
1131 :
1132 : The overall strategy is to preserve the invariant that every scalar in
1133 : memory is associated with a single storage order, i.e. all accesses to
1134 : this scalar are done with the same storage order. This invariant makes
1135 : it possible to factor out the storage order in most transformations, as
1136 : only the address and/or the value (in target order) matter for them.
1137 : But, of course, the storage order must be preserved when the accesses
1138 : themselves are rewritten or transformed. */
1139 : #define REF_REVERSE_STORAGE_ORDER(NODE) \
1140 : (TREE_CHECK2 (NODE, BIT_FIELD_REF, MEM_REF)->base.default_def_flag)
1141 :
1142 : /* In an ADDR_EXPR, indicates that this is a pointer to nested function
1143 : represented by a descriptor instead of a trampoline. */
1144 : #define FUNC_ADDR_BY_DESCRIPTOR(NODE) \
1145 : (TREE_CHECK (NODE, ADDR_EXPR)->base.default_def_flag)
1146 :
1147 : /* In a CALL_EXPR, indicates that this is an indirect call for which
1148 : pointers to nested function are descriptors instead of trampolines. */
1149 : #define CALL_EXPR_BY_DESCRIPTOR(NODE) \
1150 : (TREE_CHECK (NODE, CALL_EXPR)->base.default_def_flag)
1151 :
1152 : /* These flags are available for each language front end to use internally. */
1153 : #define TREE_LANG_FLAG_0(NODE) \
1154 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_0)
1155 : #define TREE_LANG_FLAG_1(NODE) \
1156 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_1)
1157 : #define TREE_LANG_FLAG_2(NODE) \
1158 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_2)
1159 : #define TREE_LANG_FLAG_3(NODE) \
1160 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_3)
1161 : #define TREE_LANG_FLAG_4(NODE) \
1162 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_4)
1163 : #define TREE_LANG_FLAG_5(NODE) \
1164 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_5)
1165 : #define TREE_LANG_FLAG_6(NODE) \
1166 : (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_6)
1167 :
1168 : /* Define additional fields and accessors for nodes representing constants. */
1169 :
1170 : #define TREE_INT_CST_NUNITS(NODE) \
1171 : (INTEGER_CST_CHECK (NODE)->base.u.int_length.unextended)
1172 : #define TREE_INT_CST_EXT_NUNITS(NODE) \
1173 : (INTEGER_CST_CHECK (NODE)->base.u.int_length.extended)
1174 : #define TREE_INT_CST_ELT(NODE, I) TREE_INT_CST_ELT_CHECK (NODE, I)
1175 : #define TREE_INT_CST_LOW(NODE) \
1176 : ((unsigned HOST_WIDE_INT) TREE_INT_CST_ELT (NODE, 0))
1177 :
1178 : /* Return true if NODE is a POLY_INT_CST. This is only ever true on
1179 : targets with variable-sized modes. */
1180 : #define POLY_INT_CST_P(NODE) \
1181 : (NUM_POLY_INT_COEFFS > 1 && TREE_CODE (NODE) == POLY_INT_CST)
1182 :
1183 : /* In a POLY_INT_CST node. */
1184 : #define POLY_INT_CST_COEFF(NODE, I) \
1185 : (POLY_INT_CST_CHECK (NODE)->poly_int_cst.coeffs[I])
1186 :
1187 : #define TREE_REAL_CST_PTR(NODE) (&REAL_CST_CHECK (NODE)->real_cst.value)
1188 : #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
1189 :
1190 : #define TREE_FIXED_CST_PTR(NODE) \
1191 : (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
1192 : #define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
1193 :
1194 : /* In a STRING_CST */
1195 : /* In C terms, this is sizeof, not strlen. */
1196 : #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
1197 : #define TREE_STRING_POINTER(NODE) \
1198 : ((const char *)(STRING_CST_CHECK (NODE)->string.str))
1199 :
1200 : /* In a RAW_DATA_CST */
1201 : #define RAW_DATA_LENGTH(NODE) \
1202 : (RAW_DATA_CST_CHECK (NODE)->raw_data_cst.length)
1203 : #define RAW_DATA_POINTER(NODE) \
1204 : (RAW_DATA_CST_CHECK (NODE)->raw_data_cst.str)
1205 : #define RAW_DATA_OWNER(NODE) \
1206 : (RAW_DATA_CST_CHECK (NODE)->raw_data_cst.owner)
1207 : #define RAW_DATA_UCHAR_ELT(NODE, I) \
1208 : (((const unsigned char *) RAW_DATA_POINTER (NODE))[I])
1209 : #define RAW_DATA_SCHAR_ELT(NODE, I) \
1210 : (((const signed char *) RAW_DATA_POINTER (NODE))[I])
1211 :
1212 : /* In a COMPLEX_CST node. */
1213 : #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
1214 : #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
1215 :
1216 : /* In a VECTOR_CST node. See generic.texi for details. */
1217 : #define VECTOR_CST_NELTS(NODE) (TYPE_VECTOR_SUBPARTS (TREE_TYPE (NODE)))
1218 : #define VECTOR_CST_ELT(NODE,IDX) vector_cst_elt (NODE, IDX)
1219 :
1220 : #define VECTOR_CST_LOG2_NPATTERNS(NODE) \
1221 : (VECTOR_CST_CHECK (NODE)->base.u.vector_cst.log2_npatterns)
1222 : #define VECTOR_CST_NPATTERNS(NODE) \
1223 : (1U << VECTOR_CST_LOG2_NPATTERNS (NODE))
1224 : #define VECTOR_CST_NELTS_PER_PATTERN(NODE) \
1225 : (VECTOR_CST_CHECK (NODE)->base.u.vector_cst.nelts_per_pattern)
1226 : #define VECTOR_CST_DUPLICATE_P(NODE) \
1227 : (VECTOR_CST_NELTS_PER_PATTERN (NODE) == 1)
1228 : #define VECTOR_CST_STEPPED_P(NODE) \
1229 : (VECTOR_CST_NELTS_PER_PATTERN (NODE) == 3)
1230 : #define VECTOR_CST_ENCODED_ELTS(NODE) \
1231 : (VECTOR_CST_CHECK (NODE)->vector.elts)
1232 : #define VECTOR_CST_ENCODED_ELT(NODE, ELT) \
1233 : (VECTOR_CST_CHECK (NODE)->vector.elts[ELT])
1234 :
1235 : /* Define fields and accessors for some special-purpose tree nodes. */
1236 :
1237 : /* Unlike STRING_CST, in C terms this is strlen, not sizeof. */
1238 : #define IDENTIFIER_LENGTH(NODE) \
1239 : (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len)
1240 : #define IDENTIFIER_POINTER(NODE) \
1241 : ((const char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str)
1242 : #define IDENTIFIER_HASH_VALUE(NODE) \
1243 : (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.hash_value)
1244 :
1245 : /* Translate a hash table identifier pointer to a tree_identifier
1246 : pointer, and vice versa. */
1247 :
1248 : #define HT_IDENT_TO_GCC_IDENT(NODE) \
1249 : ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
1250 : #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
1251 :
1252 : /* In a TREE_LIST node. */
1253 : #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
1254 : #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
1255 :
1256 : /* In TREE_VALUE of an attribute this means the attribute is never equal to
1257 : different attribute with the same name and value and that the attribute
1258 : is order sensitive, the order of attributes with this flag on their
1259 : TREE_VALUE should be preserved. */
1260 : #define ATTR_UNIQUE_VALUE_P(NODE) (TREE_LIST_CHECK (NODE)->base.protected_flag)
1261 :
1262 : /* In a TREE_VEC node. */
1263 : #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->base.u.length)
1264 : #define TREE_VEC_BEGIN(NODE) (&TREE_VEC_CHECK (NODE)->vec.a[0])
1265 : #define TREE_VEC_END(NODE) \
1266 : ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->base.u.length]))
1267 :
1268 : #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
1269 :
1270 : /* In a CONSTRUCTOR node. */
1271 : #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
1272 : #define CONSTRUCTOR_ELT(NODE,IDX) \
1273 : (&(*CONSTRUCTOR_ELTS (NODE))[IDX])
1274 : #define CONSTRUCTOR_NELTS(NODE) \
1275 : (vec_safe_length (CONSTRUCTOR_ELTS (NODE)))
1276 : #define CONSTRUCTOR_NO_CLEARING(NODE) \
1277 : (CONSTRUCTOR_CHECK (NODE)->base.public_flag)
1278 : /* True if even padding bits should be zeroed during initialization. */
1279 : #define CONSTRUCTOR_ZERO_PADDING_BITS(NODE) \
1280 : (CONSTRUCTOR_CHECK (NODE)->base.default_def_flag)
1281 :
1282 : /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
1283 : value of each element (stored within VAL). IX must be a scratch variable
1284 : of unsigned integer type. */
1285 : #define FOR_EACH_CONSTRUCTOR_VALUE(V, IX, VAL) \
1286 : for (IX = 0; (IX >= vec_safe_length (V)) \
1287 : ? false \
1288 : : ((VAL = (*(V))[IX].value), \
1289 : true); \
1290 : (IX)++)
1291 :
1292 : /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding both
1293 : the value of each element (stored within VAL) and its index (stored
1294 : within INDEX). IX must be a scratch variable of unsigned integer type. */
1295 : #define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
1296 : for (IX = 0; (IX >= vec_safe_length (V)) \
1297 : ? false \
1298 : : (((void) (VAL = (*V)[IX].value)), \
1299 : (INDEX = (*V)[IX].index), \
1300 : true); \
1301 : (IX)++)
1302 :
1303 : /* Append a new constructor element to V, with the specified INDEX and VAL. */
1304 : #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
1305 : do { \
1306 : constructor_elt _ce___ = {INDEX, VALUE}; \
1307 : vec_safe_push ((V), _ce___); \
1308 : } while (0)
1309 :
1310 : /* True if NODE, a FIELD_DECL, is to be processed as a bitfield for
1311 : constructor output purposes. */
1312 : #define CONSTRUCTOR_BITFIELD_P(NODE) \
1313 : (DECL_BIT_FIELD (FIELD_DECL_CHECK (NODE)) \
1314 : && (DECL_MODE (NODE) != BLKmode \
1315 : || TREE_CODE (TREE_TYPE (NODE)) == BITINT_TYPE))
1316 :
1317 : /* True if NODE is a clobber right hand side, an expression of indeterminate
1318 : value that clobbers the LHS in a copy instruction. We use a volatile
1319 : empty CONSTRUCTOR for this, as it matches most of the necessary semantic.
1320 : In particular the volatile flag causes us to not prematurely remove
1321 : such clobber instructions. */
1322 : #define TREE_CLOBBER_P(NODE) \
1323 : (TREE_CODE (NODE) == CONSTRUCTOR && TREE_THIS_VOLATILE (NODE))
1324 :
1325 : /* Return the clobber_kind of a CLOBBER CONSTRUCTOR. */
1326 : #define CLOBBER_KIND(NODE) \
1327 : (CONSTRUCTOR_CHECK (NODE)->base.u.bits.address_space)
1328 :
1329 : /* Define fields and accessors for some nodes that represent expressions. */
1330 :
1331 : /* Nonzero if NODE is an empty statement (NOP_EXPR <0>). */
1332 : #define IS_EMPTY_STMT(NODE) (TREE_CODE (NODE) == NOP_EXPR \
1333 : && VOID_TYPE_P (TREE_TYPE (NODE)) \
1334 : && integer_zerop (TREE_OPERAND (NODE, 0)))
1335 :
1336 : /* In ordinary expression nodes. */
1337 : #define TREE_OPERAND_LENGTH(NODE) tree_operand_length (NODE)
1338 : #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
1339 :
1340 : /* In a tcc_vl_exp node, operand 0 is an INT_CST node holding the operand
1341 : length. Its value includes the length operand itself; that is,
1342 : the minimum valid length is 1.
1343 : Note that we have to bypass the use of TREE_OPERAND to access
1344 : that field to avoid infinite recursion in expanding the macros. */
1345 : #define VL_EXP_OPERAND_LENGTH(NODE) \
1346 : ((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
1347 :
1348 : /* Nonzero if gimple_debug_nonbind_marker_p() may possibly hold. */
1349 : #define MAY_HAVE_DEBUG_MARKER_STMTS debug_nonbind_markers_p
1350 : /* Nonzero if gimple_debug_bind_p() (and thus
1351 : gimple_debug_source_bind_p()) may possibly hold. */
1352 : #define MAY_HAVE_DEBUG_BIND_STMTS flag_var_tracking_assignments
1353 : /* Nonzero if is_gimple_debug() may possibly hold. */
1354 : #define MAY_HAVE_DEBUG_STMTS \
1355 : (MAY_HAVE_DEBUG_MARKER_STMTS || MAY_HAVE_DEBUG_BIND_STMTS)
1356 :
1357 : /* In a LOOP_EXPR node. */
1358 : #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
1359 :
1360 : /* The source location of this expression. Non-tree_exp nodes such as
1361 : decls and constants can be shared among multiple locations, so
1362 : return nothing. */
1363 : #define EXPR_LOCATION(NODE) \
1364 : (CAN_HAVE_LOCATION_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
1365 : #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
1366 : #define EXPR_HAS_LOCATION(NODE) (LOCATION_LOCUS (EXPR_LOCATION (NODE)) \
1367 : != UNKNOWN_LOCATION)
1368 : /* The location to be used in a diagnostic about this expression. Do not
1369 : use this macro if the location will be assigned to other expressions. */
1370 : #define EXPR_LOC_OR_LOC(NODE, LOCUS) (EXPR_HAS_LOCATION (NODE) \
1371 : ? (NODE)->exp.locus : (LOCUS))
1372 : #define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
1373 : #define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
1374 :
1375 : #define CAN_HAVE_RANGE_P(NODE) (CAN_HAVE_LOCATION_P (NODE))
1376 : #define EXPR_LOCATION_RANGE(NODE) (get_expr_source_range (EXPR_CHECK ((NODE))))
1377 :
1378 : #define EXPR_HAS_RANGE(NODE) \
1379 : (CAN_HAVE_RANGE_P (NODE) \
1380 : ? EXPR_LOCATION_RANGE (NODE).m_start != UNKNOWN_LOCATION \
1381 : : false)
1382 :
1383 : /* True if a tree is an expression or statement that can have a
1384 : location. */
1385 : #define CAN_HAVE_LOCATION_P(NODE) ((NODE) && EXPR_P (NODE))
1386 :
1387 : inline source_range
1388 265762871 : get_expr_source_range (tree expr)
1389 : {
1390 265762871 : location_t loc = EXPR_LOCATION (expr);
1391 265762871 : return get_range_from_loc (line_table, loc);
1392 : }
1393 :
1394 : extern void protected_set_expr_location (tree, location_t);
1395 : extern void protected_set_expr_location_if_unset (tree, location_t);
1396 : ATTRIBUTE_WARN_UNUSED_RESULT
1397 : extern tree protected_set_expr_location_unshare (tree, location_t);
1398 :
1399 : WARN_UNUSED_RESULT extern tree maybe_wrap_with_location (tree, location_t);
1400 :
1401 : extern int suppress_location_wrappers;
1402 :
1403 : /* A class for suppressing the creation of location wrappers.
1404 : Location wrappers will not be created during the lifetime
1405 : of an instance of this class. */
1406 :
1407 : class auto_suppress_location_wrappers
1408 : {
1409 : public:
1410 1387915695 : auto_suppress_location_wrappers () { ++suppress_location_wrappers; }
1411 26088 : ~auto_suppress_location_wrappers () { --suppress_location_wrappers; }
1412 : };
1413 :
1414 : /* In a TARGET_EXPR node. */
1415 : #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
1416 : #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 1)
1417 : #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 2)
1418 : /* Don't elide the initialization of TARGET_EXPR_SLOT for this TARGET_EXPR
1419 : on rhs of MODIFY_EXPR. */
1420 : #define TARGET_EXPR_NO_ELIDE(NODE) (TARGET_EXPR_CHECK (NODE)->base.private_flag)
1421 :
1422 : /* DECL_EXPR accessor. This gives access to the DECL associated with
1423 : the given declaration statement. */
1424 : #define DECL_EXPR_DECL(NODE) TREE_OPERAND (DECL_EXPR_CHECK (NODE), 0)
1425 :
1426 : #define EXIT_EXPR_COND(NODE) TREE_OPERAND (EXIT_EXPR_CHECK (NODE), 0)
1427 :
1428 : /* COMPOUND_LITERAL_EXPR accessors. */
1429 : #define COMPOUND_LITERAL_EXPR_DECL_EXPR(NODE) \
1430 : TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0)
1431 : #define COMPOUND_LITERAL_EXPR_DECL(NODE) \
1432 : DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_EXPR (NODE))
1433 :
1434 : /* SWITCH_EXPR accessors. These give access to the condition and body. */
1435 : #define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 0)
1436 : #define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 1)
1437 : /* True if there are case labels for all possible values of SWITCH_COND, either
1438 : because there is a default: case label or because the case label ranges cover
1439 : all values. */
1440 : #define SWITCH_ALL_CASES_P(NODE) (SWITCH_EXPR_CHECK (NODE)->base.private_flag)
1441 :
1442 : /* CASE_LABEL_EXPR accessors. These give access to the high and low values
1443 : of a case label, respectively. */
1444 : #define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
1445 : #define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
1446 : #define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
1447 : #define CASE_CHAIN(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 3)
1448 :
1449 : /* The operands of a TARGET_MEM_REF. Operands 0 and 1 have to match
1450 : corresponding MEM_REF operands. */
1451 : #define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
1452 : #define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
1453 : #define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
1454 : #define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
1455 : #define TMR_INDEX2(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
1456 :
1457 : #define MR_DEPENDENCE_CLIQUE(NODE) \
1458 : (TREE_CHECK2 (NODE, MEM_REF, TARGET_MEM_REF)->base.u.dependence_info.clique)
1459 : #define MR_DEPENDENCE_BASE(NODE) \
1460 : (TREE_CHECK2 (NODE, MEM_REF, TARGET_MEM_REF)->base.u.dependence_info.base)
1461 :
1462 : /* The operands of a BIND_EXPR. */
1463 : #define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
1464 : #define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
1465 : #define BIND_EXPR_BLOCK(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 2))
1466 :
1467 : /* GOTO_EXPR accessor. This gives access to the label associated with
1468 : a goto statement. */
1469 : #define GOTO_DESTINATION(NODE) TREE_OPERAND (GOTO_EXPR_CHECK (NODE), 0)
1470 :
1471 : /* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the
1472 : instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and
1473 : ASM_CLOBBERS represent the outputs, inputs, and clobbers for the
1474 : statement. */
1475 : #define ASM_STRING(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 0)
1476 : #define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 1)
1477 : #define ASM_INPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
1478 : #define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
1479 : #define ASM_LABELS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
1480 : /* Nonzero if the asm is a basic asm, zero if it is an extended asm.
1481 : Basic asms use a plain ASM_INPUT insn pattern whereas extended asms
1482 : use an ASM_OPERANDS insn pattern. */
1483 : #define ASM_BASIC_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
1484 : #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
1485 : /* Nonzero if we want to consider this asm as minimum length and cost
1486 : for inlining decisions. */
1487 : #define ASM_INLINE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.protected_flag)
1488 :
1489 : /* COND_EXPR accessors. */
1490 : #define COND_EXPR_COND(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 0))
1491 : #define COND_EXPR_THEN(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 1))
1492 : #define COND_EXPR_ELSE(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 2))
1493 :
1494 : /* Accessors for the chains of recurrences. */
1495 : #define CHREC_LEFT(NODE) TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 0)
1496 : #define CHREC_RIGHT(NODE) TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 1)
1497 : #define CHREC_VARIABLE(NODE) POLYNOMIAL_CHREC_CHECK (NODE)->base.u.chrec_var
1498 : /* Nonzero if this chrec doesn't overflow (i.e., nonwrapping). */
1499 : #define CHREC_NOWRAP(NODE) POLYNOMIAL_CHREC_CHECK (NODE)->base.nothrow_flag
1500 :
1501 : /* LABEL_EXPR accessor. This gives access to the label associated with
1502 : the given label expression. */
1503 : #define LABEL_EXPR_LABEL(NODE) TREE_OPERAND (LABEL_EXPR_CHECK (NODE), 0)
1504 :
1505 : /* CATCH_EXPR accessors. */
1506 : #define CATCH_TYPES(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
1507 : #define CATCH_BODY(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
1508 :
1509 : /* EH_FILTER_EXPR accessors. */
1510 : #define EH_FILTER_TYPES(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 0)
1511 : #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1)
1512 :
1513 : /* OBJ_TYPE_REF accessors. */
1514 : #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0)
1515 : #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1)
1516 : #define OBJ_TYPE_REF_TOKEN(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 2)
1517 :
1518 : /* CALL_EXPR accessors. */
1519 : #define CALL_EXPR_FN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 1)
1520 : #define CALL_EXPR_STATIC_CHAIN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 2)
1521 : #define CALL_EXPR_ARG(NODE, I) TREE_OPERAND (CALL_EXPR_CHECK (NODE), (I) + 3)
1522 : #define call_expr_nargs(NODE) (VL_EXP_OPERAND_LENGTH (NODE) - 3)
1523 : #define CALL_EXPR_IFN(NODE) (CALL_EXPR_CHECK (NODE)->base.u.ifn)
1524 :
1525 : /* CALL_EXPR_ARGP returns a pointer to the argument vector for NODE.
1526 : We can't use &CALL_EXPR_ARG (NODE, 0) because that will complain if
1527 : the argument count is zero when checking is enabled. Instead, do
1528 : the pointer arithmetic to advance past the 3 fixed operands in a
1529 : CALL_EXPR. That produces a valid pointer to just past the end of the
1530 : operand array, even if it's not valid to dereference it. */
1531 : #define CALL_EXPR_ARGP(NODE) \
1532 : (&(TREE_OPERAND (CALL_EXPR_CHECK (NODE), 0)) + 3)
1533 :
1534 : /* TM directives and accessors. */
1535 : #define TRANSACTION_EXPR_BODY(NODE) \
1536 : TREE_OPERAND (TRANSACTION_EXPR_CHECK (NODE), 0)
1537 : #define TRANSACTION_EXPR_OUTER(NODE) \
1538 : (TRANSACTION_EXPR_CHECK (NODE)->base.static_flag)
1539 : #define TRANSACTION_EXPR_RELAXED(NODE) \
1540 : (TRANSACTION_EXPR_CHECK (NODE)->base.public_flag)
1541 :
1542 : /* OpenMP and OpenACC directive and clause accessors. */
1543 :
1544 : /* Generic accessors for OMP nodes that keep the body as operand 0, and clauses
1545 : as operand 1. */
1546 : #define OMP_BODY(NODE) \
1547 : TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_MASTER), 0)
1548 : #define OMP_CLAUSES(NODE) \
1549 : TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_SCAN), 1)
1550 :
1551 : /* Generic accessors for OMP nodes that keep clauses as operand 0. */
1552 : #define OMP_STANDALONE_CLAUSES(NODE) \
1553 : TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_CACHE, OMP_TARGET_EXIT_DATA), 0)
1554 :
1555 : #define OACC_DATA_BODY(NODE) \
1556 : TREE_OPERAND (OACC_DATA_CHECK (NODE), 0)
1557 : #define OACC_DATA_CLAUSES(NODE) \
1558 : TREE_OPERAND (OACC_DATA_CHECK (NODE), 1)
1559 :
1560 : #define OACC_HOST_DATA_BODY(NODE) \
1561 : TREE_OPERAND (OACC_HOST_DATA_CHECK (NODE), 0)
1562 : #define OACC_HOST_DATA_CLAUSES(NODE) \
1563 : TREE_OPERAND (OACC_HOST_DATA_CHECK (NODE), 1)
1564 :
1565 : #define OACC_CACHE_CLAUSES(NODE) \
1566 : TREE_OPERAND (OACC_CACHE_CHECK (NODE), 0)
1567 :
1568 : #define OACC_DECLARE_CLAUSES(NODE) \
1569 : TREE_OPERAND (OACC_DECLARE_CHECK (NODE), 0)
1570 :
1571 : #define OACC_ENTER_DATA_CLAUSES(NODE) \
1572 : TREE_OPERAND (OACC_ENTER_DATA_CHECK (NODE), 0)
1573 :
1574 : #define OACC_EXIT_DATA_CLAUSES(NODE) \
1575 : TREE_OPERAND (OACC_EXIT_DATA_CHECK (NODE), 0)
1576 :
1577 : #define OACC_UPDATE_CLAUSES(NODE) \
1578 : TREE_OPERAND (OACC_UPDATE_CHECK (NODE), 0)
1579 :
1580 : #define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
1581 : #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
1582 :
1583 : #define OMP_TASK_BODY(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 0)
1584 : #define OMP_TASK_CLAUSES(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 1)
1585 :
1586 : #define OMP_TASKREG_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK)
1587 : #define OMP_TASKREG_BODY(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0)
1588 : #define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1)
1589 :
1590 : #define OMP_LOOPING_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_FOR, OACC_LOOP)
1591 : #define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 0)
1592 : #define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 1)
1593 : #define OMP_FOR_INIT(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 2)
1594 : #define OMP_FOR_COND(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 3)
1595 : #define OMP_FOR_INCR(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 4)
1596 : #define OMP_FOR_PRE_BODY(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 5)
1597 : #define OMP_FOR_ORIG_DECLS(NODE) TREE_OPERAND (OMP_LOOPING_CHECK (NODE), 6)
1598 :
1599 : #define OMP_INTEROP_CLAUSES(NODE)\
1600 : TREE_OPERAND (OMP_INTEROP_CHECK (NODE), 0)
1601 :
1602 : #define OMP_LOOPXFORM_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_TILE, OMP_UNROLL)
1603 : #define OMP_LOOPXFORM_LOWERED(NODE) \
1604 : (OMP_LOOPXFORM_CHECK (NODE)->base.public_flag)
1605 :
1606 : #define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
1607 : #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
1608 :
1609 : #define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
1610 :
1611 : #define OMP_STRUCTURED_BLOCK_BODY(NODE) \
1612 : TREE_OPERAND (OMP_STRUCTURED_BLOCK_CHECK (NODE), 0)
1613 :
1614 : #define OMP_SINGLE_BODY(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 0)
1615 : #define OMP_SINGLE_CLAUSES(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 1)
1616 :
1617 : #define OMP_SCOPE_BODY(NODE) TREE_OPERAND (OMP_SCOPE_CHECK (NODE), 0)
1618 : #define OMP_SCOPE_CLAUSES(NODE) TREE_OPERAND (OMP_SCOPE_CHECK (NODE), 1)
1619 :
1620 : #define OMP_MASTER_BODY(NODE) TREE_OPERAND (OMP_MASTER_CHECK (NODE), 0)
1621 :
1622 : #define OMP_MASKED_BODY(NODE) TREE_OPERAND (OMP_MASKED_CHECK (NODE), 0)
1623 : #define OMP_MASKED_CLAUSES(NODE) TREE_OPERAND (OMP_MASKED_CHECK (NODE), 1)
1624 :
1625 : #define OMP_TASKGROUP_BODY(NODE) TREE_OPERAND (OMP_TASKGROUP_CHECK (NODE), 0)
1626 : #define OMP_TASKGROUP_CLAUSES(NODE) \
1627 : TREE_OPERAND (OMP_TASKGROUP_CHECK (NODE), 1)
1628 :
1629 : #define OMP_ORDERED_BODY(NODE) TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 0)
1630 : #define OMP_ORDERED_CLAUSES(NODE) TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 1)
1631 :
1632 : #define OMP_CRITICAL_BODY(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 0)
1633 : #define OMP_CRITICAL_CLAUSES(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 1)
1634 : #define OMP_CRITICAL_NAME(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 2)
1635 :
1636 : #define OMP_TEAMS_BODY(NODE) TREE_OPERAND (OMP_TEAMS_CHECK (NODE), 0)
1637 : #define OMP_TEAMS_CLAUSES(NODE) TREE_OPERAND (OMP_TEAMS_CHECK (NODE), 1)
1638 :
1639 : #define OMP_TARGET_DATA_BODY(NODE) \
1640 : TREE_OPERAND (OMP_TARGET_DATA_CHECK (NODE), 0)
1641 : #define OMP_TARGET_DATA_CLAUSES(NODE)\
1642 : TREE_OPERAND (OMP_TARGET_DATA_CHECK (NODE), 1)
1643 :
1644 : #define OMP_TARGET_BODY(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 0)
1645 : #define OMP_TARGET_CLAUSES(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 1)
1646 :
1647 : #define OMP_TARGET_UPDATE_CLAUSES(NODE)\
1648 : TREE_OPERAND (OMP_TARGET_UPDATE_CHECK (NODE), 0)
1649 :
1650 : #define OMP_TARGET_ENTER_DATA_CLAUSES(NODE)\
1651 : TREE_OPERAND (OMP_TARGET_ENTER_DATA_CHECK (NODE), 0)
1652 :
1653 : #define OMP_TARGET_EXIT_DATA_CLAUSES(NODE)\
1654 : TREE_OPERAND (OMP_TARGET_EXIT_DATA_CHECK (NODE), 0)
1655 :
1656 : #define OMP_METADIRECTIVE_VARIANTS(NODE) \
1657 : TREE_OPERAND (OMP_METADIRECTIVE_CHECK (NODE), 0)
1658 :
1659 : #define OMP_METADIRECTIVE_VARIANT_SELECTOR(v) \
1660 : TREE_PURPOSE (v)
1661 : #define OMP_METADIRECTIVE_VARIANT_DIRECTIVE(v) \
1662 : TREE_PURPOSE (TREE_VALUE (v))
1663 : #define OMP_METADIRECTIVE_VARIANT_BODY(v) \
1664 : TREE_VALUE (TREE_VALUE (v))
1665 :
1666 : #define OMP_DECLARE_MAPPER_ID(NODE) \
1667 : TREE_OPERAND (OMP_DECLARE_MAPPER_CHECK (NODE), 0)
1668 : #define OMP_DECLARE_MAPPER_DECL(NODE) \
1669 : TREE_OPERAND (OMP_DECLARE_MAPPER_CHECK (NODE), 1)
1670 : #define OMP_DECLARE_MAPPER_CLAUSES(NODE) \
1671 : TREE_OPERAND (OMP_DECLARE_MAPPER_CHECK (NODE), 2)
1672 :
1673 : #define OMP_SCAN_BODY(NODE) TREE_OPERAND (OMP_SCAN_CHECK (NODE), 0)
1674 : #define OMP_SCAN_CLAUSES(NODE) TREE_OPERAND (OMP_SCAN_CHECK (NODE), 1)
1675 :
1676 : #define OMP_DISPATCH_BODY(NODE) TREE_OPERAND (OMP_DISPATCH_CHECK (NODE), 0)
1677 : #define OMP_DISPATCH_CLAUSES(NODE) TREE_OPERAND (OMP_DISPATCH_CHECK (NODE), 1)
1678 :
1679 : #define OMP_CLAUSE_SIZE(NODE) \
1680 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
1681 : OMP_CLAUSE_FROM, \
1682 : OMP_CLAUSE__CACHE_), 1)
1683 :
1684 : #define OMP_CLAUSE_CHAIN(NODE) TREE_CHAIN (OMP_CLAUSE_CHECK (NODE))
1685 : #define OMP_CLAUSE_DECL(NODE) \
1686 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
1687 : OMP_CLAUSE_PRIVATE, \
1688 : OMP_CLAUSE__SCANTEMP_), 0)
1689 : #define OMP_CLAUSE_HAS_LOCATION(NODE) \
1690 : (LOCATION_LOCUS ((OMP_CLAUSE_CHECK (NODE))->omp_clause.locus) \
1691 : != UNKNOWN_LOCATION)
1692 : #define OMP_CLAUSE_LOCATION(NODE) (OMP_CLAUSE_CHECK (NODE))->omp_clause.locus
1693 :
1694 : #define OMP_CLAUSE_HAS_ITERATORS(NODE) \
1695 : ((OMP_CLAUSE_CODE (NODE) == OMP_CLAUSE_FROM \
1696 : || OMP_CLAUSE_CODE (NODE) == OMP_CLAUSE_TO \
1697 : || OMP_CLAUSE_CODE (NODE) == OMP_CLAUSE_MAP) \
1698 : && OMP_CLAUSE_ITERATORS (NODE))
1699 : #define OMP_CLAUSE_ITERATORS(NODE) \
1700 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
1701 : OMP_CLAUSE_FROM, \
1702 : OMP_CLAUSE_MAP), 2)
1703 :
1704 : /* An iterator modifier on a clause is represented as a vector.
1705 : Unexpanded iterators produced by the front-end parsers have 6
1706 : elements; after expansion, they have 10. See also the
1707 : make_omp_iterator and make_expanded_omp_iterator constructors
1708 : below. */
1709 : #define OMP_ITERATOR_VAR(NODE) TREE_VEC_ELT (NODE, 0)
1710 : #define OMP_ITERATOR_BEGIN(NODE) TREE_VEC_ELT (NODE, 1)
1711 : #define OMP_ITERATOR_END(NODE) TREE_VEC_ELT (NODE, 2)
1712 : #define OMP_ITERATOR_STEP(NODE) TREE_VEC_ELT (NODE, 3)
1713 : #define OMP_ITERATOR_ORIG_STEP(NODE) TREE_VEC_ELT (NODE, 4)
1714 : #define OMP_ITERATOR_BLOCK(NODE) TREE_VEC_ELT (NODE, 5)
1715 : #define OMP_ITERATOR_LABEL(NODE) TREE_VEC_ELT (NODE, 6)
1716 : #define OMP_ITERATOR_INDEX(NODE) TREE_VEC_ELT (NODE, 7)
1717 : #define OMP_ITERATOR_ELEMS(NODE) TREE_VEC_ELT (NODE, 8)
1718 : #define OMP_ITERATOR_COUNT(NODE) TREE_VEC_ELT (NODE, 9)
1719 :
1720 : #define OMP_ITERATOR_EXPANDED_P(NODE) (TREE_VEC_LENGTH (NODE) > 6)
1721 :
1722 : /* True on OMP_FOR and other OpenMP/OpenACC looping constructs if the loop nest
1723 : is non-rectangular. */
1724 : #define OMP_FOR_NON_RECTANGULAR(NODE) \
1725 : (OMP_LOOPING_CHECK (NODE)->base.private_flag)
1726 :
1727 : /* True on an OMP_SECTION statement that was the last lexical member.
1728 : This status is meaningful in the implementation of lastprivate. */
1729 : #define OMP_SECTION_LAST(NODE) \
1730 : (OMP_SECTION_CHECK (NODE)->base.private_flag)
1731 :
1732 : /* True on an OMP_PARALLEL statement if it represents an explicit
1733 : combined parallel work-sharing constructs. */
1734 : #define OMP_PARALLEL_COMBINED(NODE) \
1735 : (OMP_PARALLEL_CHECK (NODE)->base.private_flag)
1736 :
1737 : /* True on an OMP_TEAMS statement if it represents an explicit
1738 : combined teams distribute constructs. */
1739 : #define OMP_TEAMS_COMBINED(NODE) \
1740 : (OMP_TEAMS_CHECK (NODE)->base.private_flag)
1741 :
1742 : /* True on an OMP_TARGET statement if it represents explicit
1743 : combined target teams, target parallel or target simd constructs. */
1744 : #define OMP_TARGET_COMBINED(NODE) \
1745 : (OMP_TARGET_CHECK (NODE)->base.private_flag)
1746 :
1747 : /* True on an OMP_MASTER statement if it represents an explicit
1748 : combined master constructs. */
1749 : #define OMP_MASTER_COMBINED(NODE) \
1750 : (OMP_MASTER_CHECK (NODE)->base.private_flag)
1751 :
1752 : /* True on an OMP_MASKED statement if it represents an explicit
1753 : combined masked constructs. */
1754 : #define OMP_MASKED_COMBINED(NODE) \
1755 : (OMP_MASKED_CHECK (NODE)->base.private_flag)
1756 :
1757 : /* Memory order for OMP_ATOMIC*. */
1758 : #define OMP_ATOMIC_MEMORY_ORDER(NODE) \
1759 : (TREE_RANGE_CHECK (NODE, OMP_ATOMIC, \
1760 : OMP_ATOMIC_CAPTURE_NEW)->base.u.omp_atomic_memory_order)
1761 :
1762 : /* Weak clause on OMP_ATOMIC*. */
1763 : #define OMP_ATOMIC_WEAK(NODE) \
1764 : (TREE_RANGE_CHECK (NODE, OMP_ATOMIC, \
1765 : OMP_ATOMIC_CAPTURE_NEW)->base.public_flag)
1766 :
1767 : /* True on a PRIVATE clause if its decl is kept around for debugging
1768 : information only and its DECL_VALUE_EXPR is supposed to point
1769 : to what it has been remapped to. */
1770 : #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
1771 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE)->base.public_flag)
1772 :
1773 : /* True on a PRIVATE clause if ctor needs access to outer region's
1774 : variable. */
1775 : #define OMP_CLAUSE_PRIVATE_OUTER_REF(NODE) \
1776 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
1777 :
1778 : /* True if a PRIVATE clause is for a C++ class IV on taskloop construct
1779 : (thus should be private on the outer taskloop and firstprivate on
1780 : task). */
1781 : #define OMP_CLAUSE_PRIVATE_TASKLOOP_IV(NODE) \
1782 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
1783 :
1784 : /* True on a FIRSTPRIVATE clause if it has been added implicitly. */
1785 : #define OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT(NODE) \
1786 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FIRSTPRIVATE)->base.public_flag)
1787 :
1788 : /* True on a FIRSTPRIVATE clause if only the reference and not what it refers
1789 : to should be firstprivatized. */
1790 : #define OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE(NODE) \
1791 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FIRSTPRIVATE))
1792 :
1793 : /* True on a FIRSTPRIVATE clause with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT also
1794 : set if target construct is the only one that accepts the clause. */
1795 : #define OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET(NODE) \
1796 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FIRSTPRIVATE))
1797 :
1798 : /* True on a LASTPRIVATE clause if a FIRSTPRIVATE clause for the same
1799 : decl is present in the chain. */
1800 : #define OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE(NODE) \
1801 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE)->base.public_flag)
1802 : #define OMP_CLAUSE_LASTPRIVATE_STMT(NODE) \
1803 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
1804 : OMP_CLAUSE_LASTPRIVATE),\
1805 : 1)
1806 : #define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \
1807 : (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
1808 :
1809 : /* True if a LASTPRIVATE clause is for a C++ class IV on taskloop or
1810 : loop construct (thus should be lastprivate on the outer taskloop and
1811 : firstprivate on task for the taskloop construct and carefully handled
1812 : for loop construct). */
1813 : #define OMP_CLAUSE_LASTPRIVATE_LOOP_IV(NODE) \
1814 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE))
1815 :
1816 : /* True if a LASTPRIVATE clause has CONDITIONAL: modifier. */
1817 : #define OMP_CLAUSE_LASTPRIVATE_CONDITIONAL(NODE) \
1818 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE))
1819 :
1820 : /* True on a SHARED clause if a FIRSTPRIVATE clause for the same
1821 : decl is present in the chain (this can happen only for taskloop
1822 : with FIRSTPRIVATE/LASTPRIVATE on it originally. */
1823 : #define OMP_CLAUSE_SHARED_FIRSTPRIVATE(NODE) \
1824 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SHARED)->base.public_flag)
1825 :
1826 : /* True on a SHARED clause if a scalar is not modified in the body and
1827 : thus could be optimized as firstprivate. */
1828 : #define OMP_CLAUSE_SHARED_READONLY(NODE) \
1829 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SHARED))
1830 :
1831 : #define OMP_CLAUSE_IF_MODIFIER(NODE) \
1832 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF)->omp_clause.subcode.if_modifier)
1833 :
1834 : #define OMP_CLAUSE_FINAL_EXPR(NODE) \
1835 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FINAL), 0)
1836 : #define OMP_CLAUSE_IF_EXPR(NODE) \
1837 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
1838 : #define OMP_CLAUSE_SELF_EXPR(NODE) \
1839 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SELF), 0)
1840 : #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \
1841 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0)
1842 : #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \
1843 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE), 0)
1844 : #define OMP_CLAUSE_NUM_TASKS_EXPR(NODE) \
1845 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TASKS), 0)
1846 : #define OMP_CLAUSE_HINT_EXPR(NODE) \
1847 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_HINT), 0)
1848 : #define OMP_CLAUSE_FILTER_EXPR(NODE) \
1849 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FILTER), 0)
1850 : #define OMP_CLAUSE_PARTIAL_EXPR(NODE) \
1851 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PARTIAL), 0)
1852 : #define OMP_CLAUSE_SIZES_LIST(NODE) \
1853 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SIZES), 0)
1854 : #define OMP_CLAUSE_NOVARIANTS_EXPR(NODE) \
1855 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NOVARIANTS), 0)
1856 : #define OMP_CLAUSE_NOCONTEXT_EXPR(NODE) \
1857 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NOCONTEXT), 0)
1858 :
1859 : #define OMP_CLAUSE_GRAINSIZE_EXPR(NODE) \
1860 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GRAINSIZE),0)
1861 :
1862 : #define OMP_CLAUSE_PRIORITY_EXPR(NODE) \
1863 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIORITY),0)
1864 :
1865 : #define OMP_CLAUSE_GRAINSIZE_STRICT(NODE) \
1866 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GRAINSIZE))
1867 : #define OMP_CLAUSE_NUM_TASKS_STRICT(NODE) \
1868 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TASKS))
1869 : #define OMP_CLAUSE_NUM_THREADS_STRICT(NODE) \
1870 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS))
1871 : #define OMP_CLAUSE_THREAD_LIMIT_STRICT(NODE) \
1872 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_THREAD_LIMIT))
1873 : #define OMP_CLAUSE_NUM_TEAMS_DIMS(NODE) \
1874 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TEAMS))
1875 : #define OMP_CLAUSE_NUM_THREADS_DIMS(NODE) \
1876 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS))
1877 : #define OMP_CLAUSE_THREAD_LIMIT_DIMS(NODE) \
1878 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_THREAD_LIMIT))
1879 :
1880 : /* OpenACC clause expressions */
1881 : #define OMP_CLAUSE_EXPR(NODE, CLAUSE) \
1882 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, CLAUSE), 0)
1883 : #define OMP_CLAUSE_GANG_EXPR(NODE) \
1884 : OMP_CLAUSE_OPERAND ( \
1885 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GANG), 0)
1886 : #define OMP_CLAUSE_GANG_STATIC_EXPR(NODE) \
1887 : OMP_CLAUSE_OPERAND ( \
1888 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GANG), 1)
1889 : #define OMP_CLAUSE_ASYNC_EXPR(NODE) \
1890 : OMP_CLAUSE_OPERAND ( \
1891 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ASYNC), 0)
1892 : #define OMP_CLAUSE_WAIT_EXPR(NODE) \
1893 : OMP_CLAUSE_OPERAND ( \
1894 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WAIT), 0)
1895 : #define OMP_CLAUSE_VECTOR_EXPR(NODE) \
1896 : OMP_CLAUSE_OPERAND ( \
1897 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_VECTOR), 0)
1898 : #define OMP_CLAUSE_WORKER_EXPR(NODE) \
1899 : OMP_CLAUSE_OPERAND ( \
1900 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WORKER), 0)
1901 : #define OMP_CLAUSE_NUM_GANGS_EXPR(NODE) \
1902 : OMP_CLAUSE_OPERAND ( \
1903 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_GANGS), 0)
1904 : #define OMP_CLAUSE_NUM_WORKERS_EXPR(NODE) \
1905 : OMP_CLAUSE_OPERAND ( \
1906 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_WORKERS), 0)
1907 : #define OMP_CLAUSE_VECTOR_LENGTH_EXPR(NODE) \
1908 : OMP_CLAUSE_OPERAND ( \
1909 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_VECTOR_LENGTH), 0)
1910 :
1911 : #define OMP_CLAUSE_DEPEND_KIND(NODE) \
1912 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEPEND)->omp_clause.subcode.depend_kind)
1913 :
1914 : #define OMP_CLAUSE_DOACROSS_KIND(NODE) \
1915 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DOACROSS)->omp_clause.subcode.doacross_kind)
1916 :
1917 : #define OMP_CLAUSE_DOACROSS_SINK_NEGATIVE(NODE) \
1918 : TREE_PUBLIC (TREE_LIST_CHECK (NODE))
1919 :
1920 : /* True if DOACROSS clause is spelled as DEPEND. */
1921 : #define OMP_CLAUSE_DOACROSS_DEPEND(NODE) \
1922 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DOACROSS))
1923 :
1924 : /* If the string passed to the 'message' clause is not null terminated,
1925 : OMP_CLAUSE_MESSAGE_LEN must be set. */
1926 : #define OMP_CLAUSE_MESSAGE_EXPR(NODE) \
1927 : OMP_CLAUSE_OPERAND ( \
1928 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MESSAGE), 0)
1929 : #define OMP_CLAUSE_MESSAGE_LEN(NODE) \
1930 : OMP_CLAUSE_OPERAND ( \
1931 : OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MESSAGE), 1)
1932 : #define OMP_CLAUSE_MESSAGE_SEVERITY_WARN(NODE) \
1933 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MESSAGE)->base.public_flag)
1934 :
1935 : #define OMP_CLAUSE_MAP_KIND(NODE) \
1936 : ((enum gomp_map_kind) OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->omp_clause.subcode.map_kind)
1937 : #define OMP_CLAUSE_SET_MAP_KIND(NODE, MAP_KIND) \
1938 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->omp_clause.subcode.map_kind \
1939 : = (unsigned int) (MAP_KIND))
1940 :
1941 : #define OMP_CLAUSE_MOTION_PRESENT(NODE) \
1942 : (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_FROM, OMP_CLAUSE_TO)->base.deprecated_flag)
1943 :
1944 : #define OMP_CLAUSE_INIT_TARGET(NODE) \
1945 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_INIT)->base.public_flag)
1946 : #define OMP_CLAUSE_INIT_TARGETSYNC(NODE) \
1947 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_INIT)->base.deprecated_flag)
1948 : #define OMP_CLAUSE_INIT_PREFER_TYPE(NODE) \
1949 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
1950 : OMP_CLAUSE_INIT, \
1951 : OMP_CLAUSE_INIT), 1)
1952 :
1953 : /* Nonzero if this map clause is for array (rather than pointer) based array
1954 : section with zero bias. Both the non-decl OMP_CLAUSE_MAP and corresponding
1955 : OMP_CLAUSE_MAP with GOMP_MAP_POINTER are marked with this flag. */
1956 : #define OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION(NODE) \
1957 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.public_flag)
1958 : /* Nonzero if this is a mapped array section, that might need special
1959 : treatment if OMP_CLAUSE_SIZE is zero. */
1960 : #define OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION(NODE) \
1961 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1962 : /* Nonzero if this map clause is for an OpenACC compute construct's reduction
1963 : variable or OpenMP map clause mentioned also in in_reduction clause on the
1964 : same construct. */
1965 : #define OMP_CLAUSE_MAP_IN_REDUCTION(NODE) \
1966 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1967 : /* Nonzero on map clauses added implicitly for reduction clauses on combined
1968 : or composite constructs. They shall be removed if there is an explicit
1969 : map clause. */
1970 : #define OMP_CLAUSE_MAP_IMPLICIT(NODE) \
1971 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.default_def_flag)
1972 : /* Nonzero if this map clause is to be indicated to the runtime as 'implicit',
1973 : due to being created through implicit data-mapping rules in the middle-end.
1974 : NOTE: this is different than OMP_CLAUSE_MAP_IMPLICIT. */
1975 : #define OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P(NODE) \
1976 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.deprecated_flag)
1977 : /* Nonzero for an attach/detach node whose decl was explicitly mapped on the
1978 : same directive. */
1979 : #define OMP_CLAUSE_ATTACHMENT_MAPPING_ERASED(NODE) \
1980 : TREE_STATIC (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1981 : /* Nonzero if this is a release/delete node which refers to a (Fortran) array
1982 : descriptor. */
1983 : #define OMP_CLAUSE_RELEASE_DESCRIPTOR(NODE) \
1984 : TREE_NOTHROW (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1985 :
1986 : /* Flag that 'OMP_CLAUSE_DECL (NODE)' is to be made addressable during OMP
1987 : lowering. */
1988 : #define OMP_CLAUSE_MAP_DECL_MAKE_ADDRESSABLE(NODE) \
1989 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.addressable_flag)
1990 :
1991 : /* Nonzero if OpenACC 'readonly' modifier set, used for 'copyin'. */
1992 : #define OMP_CLAUSE_MAP_READONLY(NODE) \
1993 : TREE_READONLY (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1994 :
1995 : /* Nonzero if the size (or bias) is not known by the front end and needs to be
1996 : adjusted in the middle end. */
1997 : #define OMP_CLAUSE_MAP_SIZE_NEEDS_ADJUSTMENT(NODE) \
1998 : TREE_CONSTANT (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
1999 :
2000 : /* Nonzero on a map clause that is only used internally by the gimplifier and
2001 : can thus be removed at the end of the GIMPLE pass. */
2002 : #define OMP_CLAUSE_MAP_GIMPLE_ONLY(NODE) \
2003 : TREE_USED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP))
2004 :
2005 : /* Same as above, for use in OpenACC cache directives. */
2006 : #define OMP_CLAUSE__CACHE__READONLY(NODE) \
2007 : TREE_READONLY (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__CACHE_))
2008 :
2009 : /* True on an OMP_CLAUSE_USE_DEVICE_PTR with an OpenACC 'if_present'
2010 : clause. */
2011 : #define OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT(NODE) \
2012 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_USE_DEVICE_PTR)->base.public_flag)
2013 :
2014 : #define OMP_CLAUSE_PROC_BIND_KIND(NODE) \
2015 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PROC_BIND)->omp_clause.subcode.proc_bind_kind)
2016 :
2017 : #define OMP_CLAUSE_DEVICE_TYPE_KIND(NODE) \
2018 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEVICE_TYPE)->omp_clause.subcode.device_type_kind)
2019 :
2020 : #define OMP_CLAUSE_INDIRECT_EXPR(NODE) \
2021 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_INDIRECT), 0)
2022 :
2023 :
2024 : /* True if there is a device clause with a device-modifier 'ancestor'. */
2025 : #define OMP_CLAUSE_DEVICE_ANCESTOR(NODE) \
2026 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEVICE)->base.public_flag)
2027 :
2028 : #define OMP_CLAUSE_COLLAPSE_EXPR(NODE) \
2029 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 0)
2030 : #define OMP_CLAUSE_COLLAPSE_ITERVAR(NODE) \
2031 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 1)
2032 : #define OMP_CLAUSE_COLLAPSE_COUNT(NODE) \
2033 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 2)
2034 :
2035 : #define OMP_CLAUSE_ORDERED_EXPR(NODE) \
2036 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ORDERED), 0)
2037 :
2038 : /* True on an OMP_CLAUSE_ORDERED if stand-alone ordered construct is nested
2039 : inside of work-sharing loop the clause is on. */
2040 : #define OMP_CLAUSE_ORDERED_DOACROSS(NODE) \
2041 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ORDERED)->base.public_flag)
2042 :
2043 : /* True for unconstrained modifier on order(concurrent) clause. */
2044 : #define OMP_CLAUSE_ORDER_UNCONSTRAINED(NODE) \
2045 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ORDER)->base.public_flag)
2046 : /* True for reproducible modifier on order(concurrent) clause. */
2047 : #define OMP_CLAUSE_ORDER_REPRODUCIBLE(NODE) \
2048 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ORDER))
2049 :
2050 : #define OMP_CLAUSE_REDUCTION_CODE(NODE) \
2051 : (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2052 : OMP_CLAUSE_IN_REDUCTION)->omp_clause.subcode.reduction_code)
2053 : #define OMP_CLAUSE_REDUCTION_INIT(NODE) \
2054 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2055 : OMP_CLAUSE_IN_REDUCTION), 1)
2056 : #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
2057 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2058 : OMP_CLAUSE_IN_REDUCTION), 2)
2059 : #define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \
2060 : (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
2061 : #define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \
2062 : (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge
2063 : #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
2064 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2065 : OMP_CLAUSE_IN_REDUCTION), 3)
2066 : #define OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER(NODE) \
2067 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2068 : OMP_CLAUSE_IN_REDUCTION), 4)
2069 :
2070 : /* True if a REDUCTION clause may reference the original list item (omp_orig)
2071 : in its OMP_CLAUSE_REDUCTION_{,GIMPLE_}INIT. */
2072 : #define OMP_CLAUSE_REDUCTION_OMP_ORIG_REF(NODE) \
2073 : (OMP_CLAUSE_RANGE_CHECK (NODE, OMP_CLAUSE_REDUCTION, \
2074 : OMP_CLAUSE_IN_REDUCTION)->base.public_flag)
2075 :
2076 : /* True if a REDUCTION clause has task reduction-modifier. */
2077 : #define OMP_CLAUSE_REDUCTION_TASK(NODE) \
2078 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION))
2079 :
2080 : /* True if a REDUCTION clause has inscan reduction-modifier. */
2081 : #define OMP_CLAUSE_REDUCTION_INSCAN(NODE) \
2082 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION))
2083 :
2084 : /* True if a LINEAR clause doesn't need copy in. True for iterator vars which
2085 : are always initialized inside of the loop construct, false otherwise. */
2086 : #define OMP_CLAUSE_LINEAR_NO_COPYIN(NODE) \
2087 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->base.public_flag)
2088 :
2089 : /* True if a LINEAR clause doesn't need copy out. True for iterator vars which
2090 : are declared inside of the simd construct. */
2091 : #define OMP_CLAUSE_LINEAR_NO_COPYOUT(NODE) \
2092 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR))
2093 :
2094 : /* True if a LINEAR clause has a stride that is variable. */
2095 : #define OMP_CLAUSE_LINEAR_VARIABLE_STRIDE(NODE) \
2096 : TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR))
2097 :
2098 : /* True for a LINEAR clause with old style modifier syntax
2099 : linear(modifier(list)) or linear(modifier(list):step). */
2100 : #define OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER(NODE) \
2101 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->base.addressable_flag)
2102 :
2103 : /* True if a LINEAR clause is for an array or allocatable variable that
2104 : needs special handling by the frontend. */
2105 : #define OMP_CLAUSE_LINEAR_ARRAY(NODE) \
2106 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->base.deprecated_flag)
2107 :
2108 : #define OMP_CLAUSE_LINEAR_STEP(NODE) \
2109 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR), 1)
2110 :
2111 : #define OMP_CLAUSE_LINEAR_STMT(NODE) \
2112 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR), 2)
2113 :
2114 : #define OMP_CLAUSE_LINEAR_GIMPLE_SEQ(NODE) \
2115 : (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
2116 :
2117 : #define OMP_CLAUSE_LINEAR_KIND(NODE) \
2118 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->omp_clause.subcode.linear_kind)
2119 :
2120 : #define OMP_CLAUSE_ALIGNED_ALIGNMENT(NODE) \
2121 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALIGNED), 1)
2122 :
2123 : #define OMP_CLAUSE_ALLOCATE_ALLOCATOR(NODE) \
2124 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALLOCATE), 1)
2125 :
2126 : #define OMP_CLAUSE_ALLOCATE_ALIGN(NODE) \
2127 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALLOCATE), 2)
2128 :
2129 : /* True if an ALLOCATE clause was present on a combined or composite
2130 : construct and the code for splitting the clauses has already performed
2131 : checking if the listed variable has explicit privatization on the
2132 : construct. */
2133 : #define OMP_CLAUSE_ALLOCATE_COMBINED(NODE) \
2134 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALLOCATE)->base.public_flag)
2135 :
2136 : #define OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR(NODE) \
2137 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_USES_ALLOCATORS), 0)
2138 :
2139 : #define OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE(NODE) \
2140 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_USES_ALLOCATORS), 1)
2141 :
2142 : #define OMP_CLAUSE_USES_ALLOCATORS_TRAITS(NODE) \
2143 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_USES_ALLOCATORS), 2)
2144 :
2145 : #define OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR(NODE) \
2146 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TEAMS), 0)
2147 :
2148 : #define OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR(NODE) \
2149 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TEAMS), 1)
2150 :
2151 : #define OMP_CLAUSE_THREAD_LIMIT_EXPR(NODE) \
2152 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
2153 : OMP_CLAUSE_THREAD_LIMIT), 0)
2154 :
2155 : #define OMP_CLAUSE_DEVICE_ID(NODE) \
2156 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEVICE), 0)
2157 :
2158 : #define OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR(NODE) \
2159 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
2160 : OMP_CLAUSE_DIST_SCHEDULE), 0)
2161 :
2162 : #define OMP_CLAUSE_SAFELEN_EXPR(NODE) \
2163 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SAFELEN), 0)
2164 :
2165 : #define OMP_CLAUSE_SIMDLEN_EXPR(NODE) \
2166 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SIMDLEN), 0)
2167 :
2168 : #define OMP_CLAUSE_SIMDLEN_TYPE(NODE) \
2169 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SIMDLEN), 1)
2170 :
2171 : #define OMP_CLAUSE_SIMDLEN_DIVISOR(NODE) \
2172 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SIMDLEN), 2)
2173 :
2174 : #define OMP_CLAUSE__SIMDUID__DECL(NODE) \
2175 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__SIMDUID_), 0)
2176 :
2177 : #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
2178 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
2179 :
2180 : /* True if a SCHEDULE clause has the simd modifier on it. */
2181 : #define OMP_CLAUSE_SCHEDULE_SIMD(NODE) \
2182 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->base.public_flag)
2183 :
2184 : #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
2185 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
2186 :
2187 : #define OMP_CLAUSE_DEFAULTMAP_KIND(NODE) \
2188 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULTMAP)->omp_clause.subcode.defaultmap_kind)
2189 : #define OMP_CLAUSE_DEFAULTMAP_CATEGORY(NODE) \
2190 : ((enum omp_clause_defaultmap_kind) \
2191 : (OMP_CLAUSE_DEFAULTMAP_KIND (NODE) & OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK))
2192 : #define OMP_CLAUSE_DEFAULTMAP_BEHAVIOR(NODE) \
2193 : ((enum omp_clause_defaultmap_kind) \
2194 : (OMP_CLAUSE_DEFAULTMAP_KIND (NODE) & OMP_CLAUSE_DEFAULTMAP_MASK))
2195 : #define OMP_CLAUSE_DEFAULTMAP_SET_KIND(NODE, BEHAVIOR, CATEGORY) \
2196 : (OMP_CLAUSE_DEFAULTMAP_KIND (NODE) \
2197 : = (enum omp_clause_defaultmap_kind) (CATEGORY | BEHAVIOR))
2198 :
2199 : #define OMP_CLAUSE_BIND_KIND(NODE) \
2200 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_BIND)->omp_clause.subcode.bind_kind)
2201 :
2202 : #define OMP_CLAUSE_DYN_GROUPPRIVATE_EXPR(NODE) \
2203 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DYN_GROUPPRIVATE), 0)
2204 : #define OMP_CLAUSE_DYN_GROUPPRIVATE_KIND(NODE) \
2205 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DYN_GROUPPRIVATE)->omp_clause.subcode.fallback_kind)
2206 :
2207 : /* True if ENTER clause is spelled as TO. */
2208 : #define OMP_CLAUSE_ENTER_TO(NODE) \
2209 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ENTER)->base.public_flag)
2210 :
2211 : #define OMP_CLAUSE_TILE_LIST(NODE) \
2212 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_TILE), 0)
2213 : #define OMP_CLAUSE_TILE_ITERVAR(NODE) \
2214 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_TILE), 1)
2215 : #define OMP_CLAUSE_TILE_COUNT(NODE) \
2216 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_TILE), 2)
2217 :
2218 : /* _CONDTEMP_ holding temporary with iteration count. */
2219 : #define OMP_CLAUSE__CONDTEMP__ITER(NODE) \
2220 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__CONDTEMP_)->base.public_flag)
2221 :
2222 : /* _SCANTEMP_ holding temporary with pointer to thread's local array;
2223 : allocation. */
2224 : #define OMP_CLAUSE__SCANTEMP__ALLOC(NODE) \
2225 : (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__SCANTEMP_)->base.public_flag)
2226 :
2227 : /* _SCANTEMP_ holding temporary with a control variable for deallocation;
2228 : one boolean_type_node for test whether alloca was used, another one
2229 : to pass to __builtin_stack_restore or free. */
2230 : #define OMP_CLAUSE__SCANTEMP__CONTROL(NODE) \
2231 : TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__SCANTEMP_))
2232 :
2233 : /* OpenMP OMP_NEXT_VARIANT accessors. */
2234 : #define OMP_NEXT_VARIANT_INDEX(NODE) \
2235 : TREE_OPERAND (OMP_NEXT_VARIANT_CHECK (NODE), 0)
2236 : #define OMP_NEXT_VARIANT_STATE(NODE) \
2237 : TREE_OPERAND (OMP_NEXT_VARIANT_CHECK (NODE), 1)
2238 :
2239 : /* OpenMP OMP_TARGET_DEVICE_MATCHES accessors. */
2240 : #define OMP_TARGET_DEVICE_MATCHES_SELECTOR(NODE) \
2241 : TREE_OPERAND (OMP_TARGET_DEVICE_MATCHES_CHECK (NODE), 0)
2242 : #define OMP_TARGET_DEVICE_MATCHES_PROPERTIES(NODE) \
2243 : TREE_OPERAND (OMP_TARGET_DEVICE_MATCHES_CHECK (NODE), 1)
2244 :
2245 : #define OMP_CLAUSE__MAPPER_BINDING__ID(NODE) \
2246 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
2247 : OMP_CLAUSE__MAPPER_BINDING_), 0)
2248 :
2249 : #define OMP_CLAUSE__MAPPER_BINDING__DECL(NODE) \
2250 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
2251 : OMP_CLAUSE__MAPPER_BINDING_), 1)
2252 :
2253 : #define OMP_CLAUSE__MAPPER_BINDING__MAPPER(NODE) \
2254 : OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
2255 : OMP_CLAUSE__MAPPER_BINDING_), 2)
2256 :
2257 : /* SSA_NAME accessors. */
2258 :
2259 : /* Whether SSA_NAME NODE is a virtual operand. This simply caches the
2260 : information in the underlying SSA_NAME_VAR for efficiency. */
2261 : #define SSA_NAME_IS_VIRTUAL_OPERAND(NODE) \
2262 : SSA_NAME_CHECK (NODE)->base.public_flag
2263 :
2264 : /* Returns the IDENTIFIER_NODE giving the SSA name a name or NULL_TREE
2265 : if there is no name associated with it. */
2266 : #define SSA_NAME_IDENTIFIER(NODE) \
2267 : (SSA_NAME_CHECK (NODE)->ssa_name.var != NULL_TREE \
2268 : ? (TREE_CODE ((NODE)->ssa_name.var) == IDENTIFIER_NODE \
2269 : ? (NODE)->ssa_name.var \
2270 : : DECL_NAME ((NODE)->ssa_name.var)) \
2271 : : NULL_TREE)
2272 :
2273 : /* Returns the variable being referenced. This can be NULL_TREE for
2274 : temporaries not associated with any user variable.
2275 : Once released, this is the only field that can be relied upon. */
2276 : #define SSA_NAME_VAR(NODE) \
2277 : (SSA_NAME_CHECK (NODE)->ssa_name.var == NULL_TREE \
2278 : || TREE_CODE ((NODE)->ssa_name.var) == IDENTIFIER_NODE \
2279 : ? NULL_TREE : (NODE)->ssa_name.var)
2280 :
2281 : #define SET_SSA_NAME_VAR_OR_IDENTIFIER(NODE,VAR) \
2282 : do \
2283 : { \
2284 : tree var_ = (VAR); \
2285 : SSA_NAME_CHECK (NODE)->ssa_name.var = var_; \
2286 : SSA_NAME_IS_VIRTUAL_OPERAND (NODE) \
2287 : = (var_ \
2288 : && TREE_CODE (var_) == VAR_DECL \
2289 : && VAR_DECL_IS_VIRTUAL_OPERAND (var_)); \
2290 : } \
2291 : while (0)
2292 :
2293 : /* Returns the statement which defines this SSA name. */
2294 : #define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
2295 :
2296 : /* Returns the SSA version number of this SSA name. Note that in
2297 : tree SSA, version numbers are not per variable and may be recycled. */
2298 : #define SSA_NAME_VERSION(NODE) SSA_NAME_CHECK (NODE)->base.u.version
2299 :
2300 : /* Nonzero if this SSA name occurs in an abnormal PHI. SSA_NAMES are
2301 : never output, so we can safely use the ASM_WRITTEN_FLAG for this
2302 : status bit. */
2303 : #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
2304 : SSA_NAME_CHECK (NODE)->base.asm_written_flag
2305 :
2306 : /* Nonzero if this SSA_NAME expression is currently on the free list of
2307 : SSA_NAMES. Using NOTHROW_FLAG seems reasonably safe since throwing
2308 : has no meaning for an SSA_NAME. */
2309 : #define SSA_NAME_IN_FREE_LIST(NODE) \
2310 : SSA_NAME_CHECK (NODE)->base.nothrow_flag
2311 :
2312 : /* Nonzero if this SSA_NAME is the default definition for the
2313 : underlying symbol. A default SSA name is created for symbol S if
2314 : the very first reference to S in the function is a read operation.
2315 : Default definitions are always created by an empty statement and
2316 : belong to no basic block. */
2317 : #define SSA_NAME_IS_DEFAULT_DEF(NODE) \
2318 : SSA_NAME_CHECK (NODE)->base.default_def_flag
2319 :
2320 : /* Nonzero if this SSA_NAME is known to point to memory that may not
2321 : be written to. This is set for default defs of function parameters
2322 : that have a corresponding r or R specification in the functions
2323 : fn spec attribute. This is used by alias analysis. */
2324 : #define SSA_NAME_POINTS_TO_READONLY_MEMORY(NODE) \
2325 : SSA_NAME_CHECK (NODE)->base.deprecated_flag
2326 :
2327 : /* Value range info for an SSA_NAME, of any type. */
2328 : #define SSA_NAME_RANGE_INFO(N) \
2329 : SSA_NAME_CHECK (N)->ssa_name.range_info
2330 :
2331 : /* Return the immediate_use information for an SSA_NAME. */
2332 : #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
2333 :
2334 : #define OMP_CLAUSE_CODE(NODE) \
2335 : (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
2336 :
2337 : #define OMP_CLAUSE_SET_CODE(NODE, CODE) \
2338 : ((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
2339 :
2340 : #define OMP_CLAUSE_OPERAND(NODE, I) \
2341 : OMP_CLAUSE_ELT_CHECK (NODE, I)
2342 :
2343 : /* True if the clause decl NODE contains an OpenMP iterator. */
2344 : #define OMP_ITERATOR_DECL_P(NODE) \
2345 : (TREE_CODE (NODE) == TREE_LIST \
2346 : && TREE_PURPOSE (NODE) \
2347 : && TREE_CODE (TREE_PURPOSE (NODE)) == TREE_VEC)
2348 :
2349 : /* In a BLOCK (scope) node:
2350 : Variables declared in the scope NODE. */
2351 : #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
2352 : #define BLOCK_NONLOCALIZED_VARS(NODE) \
2353 : (BLOCK_CHECK (NODE)->block.nonlocalized_vars)
2354 : #define BLOCK_NUM_NONLOCALIZED_VARS(NODE) \
2355 : vec_safe_length (BLOCK_NONLOCALIZED_VARS (NODE))
2356 : #define BLOCK_NONLOCALIZED_VAR(NODE,N) (*BLOCK_NONLOCALIZED_VARS (NODE))[N]
2357 : /* A chain of BLOCKs (scopes) nested within the scope NODE. */
2358 : #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
2359 : /* The scope enclosing the scope NODE, or FUNCTION_DECL for the "outermost"
2360 : function scope. Inlined functions are chained by this so that given
2361 : expression E and its TREE_BLOCK(E) B, BLOCK_SUPERCONTEXT(B) is the scope
2362 : in which E has been made or into which E has been inlined. */
2363 : #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
2364 : /* Points to the next scope at the same level of nesting as scope NODE. */
2365 : #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain)
2366 : /* A BLOCK, or FUNCTION_DECL of the function from which a block has been
2367 : inlined. In a scope immediately enclosing an inlined leaf expression,
2368 : points to the outermost scope into which it has been inlined (thus
2369 : bypassing all intermediate BLOCK_SUPERCONTEXTs). */
2370 : #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
2371 : #define BLOCK_ORIGIN(NODE) \
2372 : (BLOCK_ABSTRACT_ORIGIN(NODE) ? BLOCK_ABSTRACT_ORIGIN(NODE) : (NODE))
2373 : #define BLOCK_DIE(NODE) (BLOCK_CHECK (NODE)->block.die)
2374 :
2375 : /* True if BLOCK has the same ranges as its BLOCK_SUPERCONTEXT. */
2376 : #define BLOCK_SAME_RANGE(NODE) (BLOCK_CHECK (NODE)->base.u.bits.nameless_flag)
2377 :
2378 : /* True if BLOCK appears in cold section. */
2379 : #define BLOCK_IN_COLD_SECTION_P(NODE) \
2380 : (BLOCK_CHECK (NODE)->base.u.bits.atomic_flag)
2381 :
2382 : /* An index number for this block. These values are not guaranteed to
2383 : be unique across functions -- whether or not they are depends on
2384 : the debugging output format in use. */
2385 : #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
2386 :
2387 : /* If block reordering splits a lexical block into discontiguous
2388 : address ranges, we'll make a copy of the original block.
2389 :
2390 : Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN.
2391 : In that case, we have one source block that has been replicated
2392 : (through inlining or unrolling) into many logical blocks, and that
2393 : these logical blocks have different physical variables in them.
2394 :
2395 : In this case, we have one logical block split into several
2396 : non-contiguous address ranges. Most debug formats can't actually
2397 : represent this idea directly, so we fake it by creating multiple
2398 : logical blocks with the same variables in them. However, for those
2399 : that do support non-contiguous regions, these allow the original
2400 : logical block to be reconstructed, along with the set of address
2401 : ranges.
2402 :
2403 : One of the logical block fragments is arbitrarily chosen to be
2404 : the ORIGIN. The other fragments will point to the origin via
2405 : BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer
2406 : be null. The list of fragments will be chained through
2407 : BLOCK_FRAGMENT_CHAIN from the origin. */
2408 :
2409 : #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
2410 : #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
2411 :
2412 : /* For an inlined function, this gives the location where it was called
2413 : from. This is only set in the top level block, which corresponds to the
2414 : inlined function scope. This is used in the debug output routines. */
2415 :
2416 : #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
2417 :
2418 : /* This gives the location of the end of the block, useful to attach
2419 : code implicitly generated for outgoing paths. */
2420 :
2421 : #define BLOCK_SOURCE_END_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.end_locus)
2422 :
2423 : /* Define fields and accessors for nodes representing data types. */
2424 :
2425 : /* See tree.def for documentation of the use of these fields.
2426 : Look at the documentation of the various ..._TYPE tree codes.
2427 :
2428 : Note that the type.values, type.minval, and type.maxval fields are
2429 : overloaded and used for different macros in different kinds of types.
2430 : Each macro must check to ensure the tree node is of the proper kind of
2431 : type. Note also that some of the front-ends also overload these fields,
2432 : so they must be checked as well. */
2433 :
2434 : #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type_common.uid)
2435 : /* Type size in bits as a tree expression. Need not be constant and may
2436 : be greater than TYPE_SIZE for a C++ FIELD_DECL representing a base
2437 : class subobject with its own virtual base classes (which are laid out
2438 : separately). */
2439 : #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type_common.size)
2440 : /* Likewise, type size in bytes. */
2441 : #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type_common.size_unit)
2442 : #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type_common.pointer_to)
2443 : #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type_common.reference_to)
2444 : #define TYPE_PRECISION(NODE) \
2445 : (TREE_NOT_CHECK (TYPE_CHECK (NODE), VECTOR_TYPE)->type_common.precision)
2446 : #define TYPE_PRECISION_RAW(NODE) (TYPE_CHECK (NODE)->type_common.precision)
2447 : #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type_common.name)
2448 : #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.next_variant)
2449 : #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.main_variant)
2450 : #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type_common.context)
2451 :
2452 : #define TYPE_MODE_RAW(NODE) (TYPE_CHECK (NODE)->type_common.mode)
2453 : #define TYPE_MODE(NODE) \
2454 : (VECTOR_TYPE_P (TYPE_CHECK (NODE)) \
2455 : ? vector_type_mode (NODE) : (NODE)->type_common.mode)
2456 : #define SCALAR_TYPE_MODE(NODE) \
2457 : (as_a <scalar_mode> (TYPE_CHECK (NODE)->type_common.mode))
2458 : #define SCALAR_INT_TYPE_MODE(NODE) \
2459 : (as_a <scalar_int_mode> (TYPE_CHECK (NODE)->type_common.mode))
2460 : #define SCALAR_FLOAT_TYPE_MODE(NODE) \
2461 : (as_a <scalar_float_mode> (TYPE_CHECK (NODE)->type_common.mode))
2462 : #define SET_TYPE_MODE(NODE, MODE) \
2463 : (TYPE_CHECK (NODE)->type_common.mode = (MODE))
2464 :
2465 : extern unsigned int element_precision (const_tree);
2466 : extern machine_mode element_mode (const_tree);
2467 : extern machine_mode vector_type_mode (const_tree);
2468 : extern unsigned int vector_element_bits (const_tree);
2469 : extern tree vector_element_bits_tree (const_tree);
2470 :
2471 : /* The "canonical" type for this type node, which is used by frontends to
2472 : compare the type for equality with another type. If two types are
2473 : equal (based on the semantics of the language), then they will have
2474 : equivalent TYPE_CANONICAL entries.
2475 :
2476 : As a special case, if TYPE_CANONICAL is NULL_TREE, and thus
2477 : TYPE_STRUCTURAL_EQUALITY_P is true, then it cannot
2478 : be used for comparison against other types. Instead, the type is
2479 : said to require structural equality checks, described in
2480 : TYPE_STRUCTURAL_EQUALITY_P.
2481 :
2482 : For unqualified aggregate and function types the middle-end relies on
2483 : TYPE_CANONICAL to tell whether two variables can be assigned
2484 : to each other without a conversion. The middle-end also makes sure
2485 : to assign the same alias-sets to the type partition with equal
2486 : TYPE_CANONICAL of their unqualified variants. */
2487 : #define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type_common.canonical)
2488 : /* Indicates that the type node requires structural equality
2489 : checks. The compiler will need to look at the composition of the
2490 : type to determine whether it is equal to another type, rather than
2491 : just comparing canonical type pointers. For instance, we would need
2492 : to look at the return and parameter types of a FUNCTION_TYPE
2493 : node. */
2494 : #define TYPE_STRUCTURAL_EQUALITY_P(NODE) (TYPE_CANONICAL (NODE) == NULL_TREE)
2495 : /* Sets the TYPE_CANONICAL field to NULL_TREE, indicating that the
2496 : type node requires structural equality. */
2497 : #define SET_TYPE_STRUCTURAL_EQUALITY(NODE) (TYPE_CANONICAL (NODE) = NULL_TREE)
2498 :
2499 : #define TYPE_IBIT(NODE) (GET_MODE_IBIT (TYPE_MODE (NODE)))
2500 : #define TYPE_FBIT(NODE) (GET_MODE_FBIT (TYPE_MODE (NODE)))
2501 :
2502 : /* The (language-specific) typed-based alias set for this type.
2503 : Objects whose TYPE_ALIAS_SETs are different cannot alias each
2504 : other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
2505 : assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
2506 : type can alias objects of any type. */
2507 : #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type_common.alias_set)
2508 :
2509 : /* Nonzero iff the typed-based alias set for this type has been
2510 : calculated. */
2511 : #define TYPE_ALIAS_SET_KNOWN_P(NODE) \
2512 : (TYPE_CHECK (NODE)->type_common.alias_set != -1)
2513 :
2514 : /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
2515 : to this type. */
2516 : #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
2517 :
2518 : /* Raw access to the alignment field. */
2519 : #define TYPE_ALIGN_RAW(NODE) \
2520 : (TYPE_CHECK (NODE)->type_common.align)
2521 :
2522 : /* The alignment necessary for objects of this type.
2523 : The value is an int, measured in bits and must be a power of two.
2524 : We support also an "alignment" of zero. */
2525 : #define TYPE_ALIGN(NODE) \
2526 : (TYPE_ALIGN_RAW (NODE) \
2527 : ? ((unsigned)1) << (TYPE_ALIGN_RAW(NODE) - 1) : 0)
2528 :
2529 : /* Specify that TYPE_ALIGN(NODE) is X. */
2530 : #define SET_TYPE_ALIGN(NODE, X) \
2531 : (TYPE_CHECK (NODE)->type_common.align = ffs_hwi (X))
2532 :
2533 : /* 1 if the alignment for this type was requested by "aligned" attribute,
2534 : 0 if it is the default for this type. */
2535 : #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->base.u.bits.user_align)
2536 :
2537 : /* The alignment for NODE, in bytes. */
2538 : #define TYPE_ALIGN_UNIT(NODE) (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
2539 :
2540 : /* The minimum alignment necessary for objects of this type without
2541 : warning. The value is an int, measured in bits. */
2542 : #define TYPE_WARN_IF_NOT_ALIGN_RAW(NODE) \
2543 : (TYPE_CHECK (NODE)->type_common.warn_if_not_align)
2544 : #define TYPE_WARN_IF_NOT_ALIGN(NODE) \
2545 : (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) \
2546 : ? ((unsigned)1) << (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) - 1) : 0)
2547 :
2548 : /* Specify that TYPE_WARN_IF_NOT_ALIGN(NODE) is X. */
2549 : #define SET_TYPE_WARN_IF_NOT_ALIGN(NODE, X) \
2550 : (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) = ffs_hwi (X))
2551 :
2552 : /* If your language allows you to declare types, and you want debug info
2553 : for them, then you need to generate corresponding TYPE_DECL nodes.
2554 : These "stub" TYPE_DECL nodes have no name, and simply point at the
2555 : type node. You then set the TYPE_STUB_DECL field of the type node
2556 : to point back at the TYPE_DECL node. This allows the debug routines
2557 : to know that the two nodes represent the same type, so that we only
2558 : get one debug info record for them. */
2559 : #define TYPE_STUB_DECL(NODE) (TREE_CHAIN (TYPE_CHECK (NODE)))
2560 :
2561 : /* In a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ARRAY_TYPE, it means
2562 : the type has BLKmode only because it lacks the alignment required for
2563 : its size. */
2564 : #define TYPE_NO_FORCE_BLK(NODE) \
2565 : (TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
2566 :
2567 : /* Nonzero in a type considered volatile as a whole. */
2568 : #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
2569 :
2570 : /* Nonzero in a type considered atomic as a whole. */
2571 : #define TYPE_ATOMIC(NODE) (TYPE_CHECK (NODE)->base.u.bits.atomic_flag)
2572 :
2573 : /* Means this type is const-qualified. */
2574 : #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
2575 :
2576 : /* If nonzero, this type is `restrict'-qualified, in the C sense of
2577 : the term. */
2578 : #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type_common.restrict_flag)
2579 :
2580 : /* If nonzero, type's name shouldn't be emitted into debug info. */
2581 : #define TYPE_NAMELESS(NODE) (TYPE_CHECK (NODE)->base.u.bits.nameless_flag)
2582 :
2583 : /* The address space the type is in. */
2584 : #define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.u.bits.address_space)
2585 :
2586 : /* A qualifier set is the aggregate of all qualifiers on a given type. It
2587 : consists of the 'const', 'volatile', 'restrict', and 'atomic' qualification,
2588 : which are all either present or absent, and an address space qualifier,
2589 : which is always present (but possibly ADDR_SPACE_GENERIC). */
2590 :
2591 : struct qualifier_set
2592 : {
2593 : /* Construct an empty qualifier set with the generic address space. Such a
2594 : qualifier set corresponds to unqualified types.
2595 :
2596 : This constructor is guaranteed to be trivial, so that it is possible to
2597 : initialize an empty qualifier set in a given location using a zeroing
2598 : 'memset'.
2599 :
2600 : This is currently relied on for 'c_declarator' and 'cp_declarator', which
2601 : are initialized via 'memset', and which store qualifier sets in unions.
2602 :
2603 : Note that this means that a declaration like:
2604 :
2605 : qualifier_set qs;
2606 :
2607 : ... leaves 'qs' uninitialized. Always specify an initializer, like so:
2608 :
2609 : qualifier_set qs {}; */
2610 : qualifier_set () = default;
2611 :
2612 : /* Construct a qualifier set containing the qualifiers CV_QUALS and the
2613 : generic address space. */
2614 : constexpr
2615 1867733803 : qualifier_set (cv_qualifier cv_quals)
2616 3756685222 : : m_cv_quals {cv_quals}
2617 3756685222 : , m_addr_space {ADDR_SPACE_GENERIC}
2618 : {}
2619 :
2620 : /* Construct a qualifier set containing the qualifiers CV_QUALS and the
2621 : address space AS. */
2622 : constexpr
2623 68999012660 : qualifier_set (cv_qualifier cv_quals, addr_space_t as)
2624 450807634 : : m_cv_quals {cv_quals}
2625 451692435 : , m_addr_space {as}
2626 : {}
2627 :
2628 : /* Add QUAL to this qualifier set. */
2629 : constexpr void
2630 34250034 : add (cv_qualifier qual)
2631 : {
2632 34250034 : m_cv_quals |= qual;
2633 : }
2634 :
2635 : /* Remove QUAL from this qualifier set. */
2636 : constexpr void
2637 49219 : remove (cv_qualifier qual)
2638 : {
2639 49154 : m_cv_quals &= ~qual;
2640 : }
2641 :
2642 : /* Set the address space of this qualifier set to AS. */
2643 : constexpr void
2644 2293608 : set_as (addr_space_t as)
2645 : {
2646 3096520 : this->m_addr_space = as;
2647 : }
2648 :
2649 : /* Returns a new qualifier set, with QUAL added (as with 'add'). */
2650 : WARN_UNUSED_RESULT constexpr qualifier_set
2651 34250034 : with (cv_qualifier qual) const
2652 : {
2653 34250034 : auto ret = *this;
2654 34250034 : ret.add (qual);
2655 34250034 : return ret;
2656 : }
2657 :
2658 : /* Returns a new qualifier set, with QUAL removed (as with 'remove'). */
2659 : WARN_UNUSED_RESULT constexpr qualifier_set
2660 49216 : without (cv_qualifier qual) const
2661 : {
2662 49216 : auto ret = *this;
2663 49200 : ret.remove (qual);
2664 49200 : return ret;
2665 : }
2666 :
2667 : /* Return this qualifier set, with address space set to AS. */
2668 : WARN_UNUSED_RESULT constexpr qualifier_set
2669 33 : with_as (addr_space_t as) const
2670 : {
2671 33 : auto ret = *this;
2672 33 : ret.set_as (as);
2673 33 : return ret;
2674 : }
2675 :
2676 : /* Get CV qualifiers of this qualifier set.
2677 :
2678 : Using this getter alone is usually a mistake; most of the time, where
2679 : there is a qualifier_set, there should be handling for all its components,
2680 : rather than just one of them. Prefer using 'split' at least once in a
2681 : given hunk. */
2682 : constexpr cv_qualifier
2683 10615432493 : cv_quals () const
2684 169387360 : { return m_cv_quals; }
2685 :
2686 : /* Get address space qualifier of this qualifier set.
2687 :
2688 : Using this getter alone is usually a mistake; most of the time, where
2689 : there is a qualifier_set, there should be handling for all its components,
2690 : rather than just one of them. Prefer using 'split' at least once in a
2691 : given hunk. */
2692 : constexpr addr_space_t
2693 5568835838 : addr_space () const
2694 285408223 : { return m_addr_space; }
2695 :
2696 : /* Return all qualifiers both in this qualifier set and in OTHER_CV. */
2697 : WARN_UNUSED_RESULT constexpr cv_qualifier
2698 739188279 : intersect (cv_qualifier other_cv) const
2699 646016543 : { return cv_quals () & other_cv; }
2700 :
2701 : /* Return true iff any of OTHER_CV are contained in THIS. */
2702 : constexpr bool
2703 852248737 : has (cv_qualifier other_cv) const
2704 508971133 : { return intersect (other_cv); }
2705 :
2706 : /* Get the symmetric difference of this qualifier set with CV-qualifiers
2707 : QUAL. Of course, as QUAL lacks an address space, the address space of
2708 : this qualifier set is preserved. */
2709 : WARN_UNUSED_RESULT constexpr qualifier_set
2710 : symmetric_difference (cv_qualifier qual) const
2711 : {
2712 : return {cv_quals () ^ qual, addr_space ()};
2713 : }
2714 :
2715 : bool superset_of (qualifier_set subset, bool nop_only = false) const;
2716 :
2717 : enum class merge_error : unsigned char
2718 : {
2719 : /* The address spaces of the to-be-merged qualifier sets were disjoint,
2720 : i.e. neither contained the other. */
2721 : disjoint_address_spaces,
2722 :
2723 : /* The to-be-merged qualifier sets differed in TYPE_QUAL_ATOMIC. */
2724 : atomic_mismatch,
2725 : };
2726 :
2727 : gcc::expected<qualifier_set, merge_error>
2728 : merge (qualifier_set other, bool strict_addr_space = false) const;
2729 :
2730 : enum class join_error : unsigned char
2731 : {
2732 : /* The joined qualifier set would've contained two address space
2733 : qualifiers. */
2734 : double_addr_space,
2735 : };
2736 :
2737 : gcc::expected<qualifier_set, join_error> join (qualifier_set other) const;
2738 :
2739 : friend constexpr bool
2740 12824035716 : operator== (const qualifier_set &a, const qualifier_set &b)
2741 : {
2742 12824035716 : return ((a.cv_quals () == b.cv_quals ())
2743 12790086477 : && (a.addr_space () == b.addr_space ()));
2744 : }
2745 :
2746 : friend constexpr bool
2747 1107717338 : operator!= (const qualifier_set &a, const qualifier_set &b)
2748 : {
2749 2211542701 : return !(a == b);
2750 : }
2751 :
2752 : /* Split this qualifier set into its constituent parts. Useful where you
2753 : need to make sure you've handled all the components of a qualifier
2754 : set. */
2755 :
2756 : constexpr std::pair<cv_qualifier, addr_space_t>
2757 67239540348 : split () const
2758 67239540348 : { return std::make_pair (cv_quals (), addr_space ()); }
2759 :
2760 : /* True iff this qualifier set is different to {ADDR_SPACE_GENERIC} (i.e. if
2761 : it is syntactically non-empty). */
2762 : constexpr bool
2763 407257738 : nonempty_p () const
2764 1618927238 : { return *this != qualifier_set {}; }
2765 :
2766 : /* Shorthand for 'nonempty_p', for use in conditions. */
2767 : explicit constexpr
2768 223215284 : operator bool () const
2769 1323953384 : { return nonempty_p (); }
2770 :
2771 : /* Dump the contents of this qualifier set to stderr. */
2772 : void debug () const;
2773 :
2774 : private:
2775 : cv_qualifier m_cv_quals;
2776 : addr_space_t m_addr_space;
2777 : };
2778 : static_assert (std::is_trivially_copyable<qualifier_set>::value, "");
2779 : static_assert (std::is_trivially_destructible<qualifier_set>::value, "");
2780 : static_assert (std::is_trivially_default_constructible<qualifier_set>::value,
2781 : "");
2782 : static_assert ((qualifier_set {}
2783 : == qualifier_set {TYPE_UNQUALIFIED,
2784 : ADDR_SPACE_GENERIC}),
2785 : "We want the trivial default constructor to create a "
2786 : "syntactically-empty qualifier set");
2787 :
2788 : /* Operators & and &= are intentionally omitted, as they permit losing
2789 : information too easily, and silently changed the meaning of existing code.
2790 : Use 'superset_of', 'intersect' and 'has' instead. */
2791 :
2792 : /* For OR (union) and XOR (mutual difference) operations, we could keep an
2793 : address space, ergo we must return qualifier_sets. */
2794 :
2795 : constexpr qualifier_set
2796 34250034 : operator| (qualifier_set qs, cv_qualifier cvs)
2797 : {
2798 34250034 : return qs.with (cvs);
2799 : }
2800 :
2801 : constexpr qualifier_set
2802 : operator| (cv_qualifier cvs, qualifier_set qs)
2803 : {
2804 : return qs.with (cvs);
2805 : }
2806 :
2807 : constexpr qualifier_set
2808 : operator^ (qualifier_set qs, cv_qualifier cvs)
2809 : {
2810 : return qs.symmetric_difference (cvs);
2811 : }
2812 :
2813 : constexpr qualifier_set
2814 : operator^ (cv_qualifier cvs, qualifier_set qs)
2815 : {
2816 : return qs.symmetric_difference (cvs);
2817 : }
2818 :
2819 : constexpr qualifier_set &
2820 34249800 : operator|= (qualifier_set &qs, cv_qualifier quals)
2821 : {
2822 34249800 : return qs = qs | quals;
2823 : }
2824 : constexpr qualifier_set &
2825 : operator^= (qualifier_set &qs, cv_qualifier quals)
2826 : {
2827 : return qs = qs ^ quals;
2828 : }
2829 :
2830 : /* The same as TYPE_QUALS without the address space qualifications. */
2831 : #define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
2832 : (cv_qualifier ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
2833 : | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
2834 : | (TYPE_ATOMIC (NODE) * TYPE_QUAL_ATOMIC) \
2835 : | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
2836 :
2837 : /* The set of type qualifiers for this type. */
2838 : #define TYPE_QUALS(NODE) \
2839 : (qualifier_set {(TYPE_QUALS_NO_ADDR_SPACE (NODE)), (TYPE_ADDR_SPACE (NODE))})
2840 :
2841 : /* The same as TYPE_QUALS without the address space and atomic
2842 : qualifications. */
2843 : #define TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC(NODE) \
2844 : (cv_qualifier ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
2845 : | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
2846 : | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
2847 :
2848 : /* These flags are available for each language front end to use internally. */
2849 : #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)
2850 : #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_1)
2851 : #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_2)
2852 : #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_3)
2853 : #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_4)
2854 : #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_5)
2855 : #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_6)
2856 : #define TYPE_LANG_FLAG_7(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_7)
2857 :
2858 : /* Used to keep track of visited nodes in tree traversals. This is set to
2859 : 0 by copy_node and make_node. */
2860 : #define TREE_VISITED(NODE) ((NODE)->base.visited)
2861 :
2862 : /* If set in an ARRAY_TYPE, indicates a string type (for languages
2863 : that distinguish string from array of char).
2864 : If set in a INTEGER_TYPE, indicates a character type. */
2865 : #define TYPE_STRING_FLAG(NODE) \
2866 : (ARRAY_OR_INTEGER_TYPE_CHECK (NODE)->type_common.string_flag)
2867 :
2868 : /* If set for RECORD_TYPE or UNION_TYPE it indicates that the type conforms
2869 : to the C++ one definition rule. This is used for LTO canonical type
2870 : computation. */
2871 : #define TYPE_CXX_ODR_P(NODE) \
2872 : (RECORD_OR_UNION_CHECK (NODE)->type_common.string_flag)
2873 :
2874 : /* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
2875 : about missing conversions to other vector types of the same size. */
2876 : #define TYPE_VECTOR_OPAQUE(NODE) \
2877 : (VECTOR_TYPE_CHECK (NODE)->base.default_def_flag)
2878 :
2879 : /* Indicates that objects of this type must be initialized by calling a
2880 : function when they are created. */
2881 : #define TYPE_NEEDS_CONSTRUCTING(NODE) \
2882 : (TYPE_CHECK (NODE)->type_common.needs_constructing_flag)
2883 :
2884 : /* Indicates that a UNION_TYPE object should be passed the same way that
2885 : the first union alternative would be passed, or that a RECORD_TYPE
2886 : object should be passed the same way that the first (and only) member
2887 : would be passed. */
2888 : #define TYPE_TRANSPARENT_AGGR(NODE) \
2889 : (RECORD_OR_UNION_CHECK (NODE)->type_common.transparent_aggr_flag)
2890 :
2891 : /* For an ARRAY_TYPE, indicates that it is not permitted to take the
2892 : address of a component of the type. This is the counterpart of
2893 : DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
2894 : #define TYPE_NONALIASED_COMPONENT(NODE) \
2895 : (ARRAY_TYPE_CHECK (NODE)->type_common.transparent_aggr_flag)
2896 :
2897 : /* For an ARRAY_TYPE, a RECORD_TYPE, a UNION_TYPE or a QUAL_UNION_TYPE
2898 : whether the array is typeless storage or the type contains a member
2899 : with this flag set. Such types are exempt from type-based alias
2900 : analysis. For ARRAY_TYPEs with AGGREGATE_TYPE_P element types
2901 : the flag should be inherited from the element type, can change
2902 : when type is finalized and because of that should not be used in
2903 : type hashing. For ARRAY_TYPEs with non-AGGREGATE_TYPE_P element types
2904 : the flag should not be changed after the array is created and should
2905 : be used in type hashing. */
2906 : #define TYPE_TYPELESS_STORAGE(NODE) \
2907 : (TREE_CHECK4 (NODE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, \
2908 : ARRAY_TYPE)->type_common.typeless_storage)
2909 :
2910 : /* Indicated that objects of this type should be laid out in as
2911 : compact a way as possible. */
2912 : #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->base.u.bits.packed_flag)
2913 :
2914 : /* Used by type_contains_placeholder_p to avoid recomputation.
2915 : Values are: 0 (unknown), 1 (false), 2 (true). Never access
2916 : this field directly. */
2917 : #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
2918 : (TYPE_CHECK (NODE)->type_common.contains_placeholder_bits)
2919 :
2920 : /* Nonzero if RECORD_TYPE represents a final derivation of class. */
2921 : #define TYPE_FINAL_P(NODE) \
2922 : (RECORD_OR_UNION_CHECK (NODE)->base.default_def_flag)
2923 :
2924 : /* The debug output functions use the symtab union field to store
2925 : information specific to the debugging format. The different debug
2926 : output hooks store different types in the union field. These three
2927 : macros are used to access different fields in the union. The debug
2928 : hooks are responsible for consistently using only a specific
2929 : macro. */
2930 :
2931 : /* Symtab field as an integer. Used by stabs generator in dbxout.cc to
2932 : hold the type's number in the generated stabs. */
2933 : #define TYPE_SYMTAB_ADDRESS(NODE) \
2934 : (TYPE_CHECK (NODE)->type_common.symtab.address)
2935 :
2936 : /* Symtab field as a pointer to a DWARF DIE. Used by DWARF generator
2937 : in dwarf2out.cc to point to the DIE generated for the type. */
2938 : #define TYPE_SYMTAB_DIE(NODE) \
2939 : (TYPE_CHECK (NODE)->type_common.symtab.die)
2940 :
2941 : /* The garbage collector needs to know the interpretation of the
2942 : symtab field. These constants represent the different types in the
2943 : union. */
2944 :
2945 : #define TYPE_SYMTAB_IS_ADDRESS (0)
2946 : #define TYPE_SYMTAB_IS_DIE (1)
2947 :
2948 : #define TYPE_LANG_SPECIFIC(NODE) \
2949 : (TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
2950 :
2951 : #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type_non_common.values)
2952 : #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type_non_common.values)
2953 : #define TYPE_FIELDS(NODE) \
2954 : (RECORD_OR_UNION_CHECK (NODE)->type_non_common.values)
2955 : #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK (NODE)->type_non_common.values)
2956 : #define TYPE_ARG_TYPES(NODE) \
2957 : (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.values)
2958 : #define TYPE_VALUES_RAW(NODE) (TYPE_CHECK (NODE)->type_non_common.values)
2959 :
2960 : #define TYPE_MIN_VALUE(NODE) \
2961 : (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.minval)
2962 : #define TYPE_NEXT_PTR_TO(NODE) \
2963 : (POINTER_TYPE_CHECK (NODE)->type_non_common.minval)
2964 : #define TYPE_NEXT_REF_TO(NODE) \
2965 : (REFERENCE_TYPE_CHECK (NODE)->type_non_common.minval)
2966 : #define TYPE_VFIELD(NODE) \
2967 : (RECORD_OR_UNION_CHECK (NODE)->type_non_common.minval)
2968 : #define TYPE_MIN_VALUE_RAW(NODE) (TYPE_CHECK (NODE)->type_non_common.minval)
2969 :
2970 : #define TYPE_MAX_VALUE(NODE) \
2971 : (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.maxval)
2972 : #define TYPE_METHOD_BASETYPE(NODE) \
2973 : (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.maxval)
2974 : #define TYPE_OFFSET_BASETYPE(NODE) \
2975 : (OFFSET_TYPE_CHECK (NODE)->type_non_common.maxval)
2976 : /* If non-NULL, this is an upper bound of the size (in bytes) of an
2977 : object of the given ARRAY_TYPE_NON_COMMON. This allows temporaries to be
2978 : allocated. */
2979 : #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
2980 : (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type_non_common.maxval)
2981 : #define TYPE_MAX_VALUE_RAW(NODE) (TYPE_CHECK (NODE)->type_non_common.maxval)
2982 : /* For record and union types, information about this type, as a base type
2983 : for itself. */
2984 : #define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK (NODE)->type_non_common.maxval)
2985 :
2986 : /* For types, used in a language-dependent way. */
2987 : #define TYPE_LANG_SLOT_1(NODE) \
2988 : (TYPE_CHECK (NODE)->type_non_common.lang_1)
2989 :
2990 : /* Define accessor macros for information about type inheritance
2991 : and basetypes.
2992 :
2993 : A "basetype" means a particular usage of a data type for inheritance
2994 : in another type. Each such basetype usage has its own "binfo"
2995 : object to describe it. The binfo object is a TREE_VEC node.
2996 :
2997 : Inheritance is represented by the binfo nodes allocated for a
2998 : given type. For example, given types C and D, such that D is
2999 : inherited by C, 3 binfo nodes will be allocated: one for describing
3000 : the binfo properties of C, similarly one for D, and one for
3001 : describing the binfo properties of D as a base type for C.
3002 : Thus, given a pointer to class C, one can get a pointer to the binfo
3003 : of D acting as a basetype for C by looking at C's binfo's basetypes. */
3004 :
3005 : /* BINFO specific flags. */
3006 :
3007 : /* Nonzero means that the derivation chain is via a `virtual' declaration. */
3008 : #define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->base.static_flag)
3009 :
3010 : /* Flags for language dependent use. */
3011 : #define BINFO_FLAG_0(NODE) TREE_LANG_FLAG_0 (TREE_BINFO_CHECK (NODE))
3012 : #define BINFO_FLAG_1(NODE) TREE_LANG_FLAG_1 (TREE_BINFO_CHECK (NODE))
3013 : #define BINFO_FLAG_2(NODE) TREE_LANG_FLAG_2 (TREE_BINFO_CHECK (NODE))
3014 : #define BINFO_FLAG_3(NODE) TREE_LANG_FLAG_3 (TREE_BINFO_CHECK (NODE))
3015 : #define BINFO_FLAG_4(NODE) TREE_LANG_FLAG_4 (TREE_BINFO_CHECK (NODE))
3016 : #define BINFO_FLAG_5(NODE) TREE_LANG_FLAG_5 (TREE_BINFO_CHECK (NODE))
3017 : #define BINFO_FLAG_6(NODE) TREE_LANG_FLAG_6 (TREE_BINFO_CHECK (NODE))
3018 :
3019 : /* The actual data type node being inherited in this basetype. */
3020 : #define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK (NODE))
3021 :
3022 : /* The offset where this basetype appears in its containing type.
3023 : BINFO_OFFSET slot holds the offset (in bytes)
3024 : from the base of the complete object to the base of the part of the
3025 : object that is allocated on behalf of this `type'.
3026 : This is always 0 except when there is multiple inheritance. */
3027 :
3028 : #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK (NODE)->binfo.offset)
3029 : #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
3030 :
3031 : /* The virtual function table belonging to this basetype. Virtual
3032 : function tables provide a mechanism for run-time method dispatching.
3033 : The entries of a virtual function table are language-dependent. */
3034 :
3035 : #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtable)
3036 :
3037 : /* The virtual functions in the virtual function table. This is
3038 : a TREE_LIST that is used as an initial approximation for building
3039 : a virtual function table for this basetype. */
3040 : #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK (NODE)->binfo.virtuals)
3041 :
3042 : /* A vector of binfos for the direct basetypes inherited by this
3043 : basetype.
3044 :
3045 : If this basetype describes type D as inherited in C, and if the
3046 : basetypes of D are E and F, then this vector contains binfos for
3047 : inheritance of E and F by C. */
3048 : #define BINFO_BASE_BINFOS(NODE) (&TREE_BINFO_CHECK (NODE)->binfo.base_binfos)
3049 :
3050 : /* The number of basetypes for NODE. */
3051 : #define BINFO_N_BASE_BINFOS(NODE) (BINFO_BASE_BINFOS (NODE)->length ())
3052 :
3053 : /* Accessor macro to get to the Nth base binfo of this binfo. */
3054 : #define BINFO_BASE_BINFO(NODE,N) \
3055 : ((*BINFO_BASE_BINFOS (NODE))[(N)])
3056 : #define BINFO_BASE_ITERATE(NODE,N,B) \
3057 : (BINFO_BASE_BINFOS (NODE)->iterate ((N), &(B)))
3058 : #define BINFO_BASE_APPEND(NODE,T) \
3059 : (BINFO_BASE_BINFOS (NODE)->quick_push ((T)))
3060 :
3061 : /* For a BINFO record describing a virtual base class, i.e., one where
3062 : TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
3063 : base. The actual contents are language-dependent. In the C++
3064 : front-end this field is an INTEGER_CST giving an offset into the
3065 : vtable where the offset to the virtual base can be found. */
3066 : #define BINFO_VPTR_FIELD(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vptr_field)
3067 :
3068 : /* Indicates the accesses this binfo has to its bases. The values are
3069 : access_public_node, access_protected_node or access_private_node.
3070 : If this vector is not present, public access is implied. If present,
3071 : the vector should have BINFO_N_BASE_BINFOS or larger length. Elements
3072 : beyond BINFO_N_BASE_BINFOS are base attributes instead of the
3073 : access_p*_node values for base with index IDX at IDX + BINFO_N_BASE_BINFOS
3074 : index. If that is beyond the length of the vector, no attributes for
3075 : that base is implied. */
3076 : #define BINFO_BASE_ACCESSES(NODE) \
3077 : (TREE_BINFO_CHECK (NODE)->binfo.base_accesses)
3078 :
3079 : #define BINFO_BASE_ACCESS(NODE,N) \
3080 : (*BINFO_BASE_ACCESSES (NODE))[(N)]
3081 : #define BINFO_BASE_ACCESS_APPEND(NODE,T) \
3082 : BINFO_BASE_ACCESSES (NODE)->quick_push ((T))
3083 :
3084 : /* The index in the VTT where this subobject's sub-VTT can be found.
3085 : NULL_TREE if there is no sub-VTT. */
3086 : #define BINFO_SUBVTT_INDEX(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtt_subvtt)
3087 :
3088 : /* The index in the VTT where the vptr for this subobject can be
3089 : found. NULL_TREE if there is no secondary vptr in the VTT. */
3090 : #define BINFO_VPTR_INDEX(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtt_vptr)
3091 :
3092 : /* The BINFO_INHERITANCE_CHAIN points at the binfo for the base
3093 : inheriting this base for non-virtual bases. For virtual bases it
3094 : points either to the binfo for which this is a primary binfo, or to
3095 : the binfo of the most derived type. */
3096 : #define BINFO_INHERITANCE_CHAIN(NODE) \
3097 : (TREE_BINFO_CHECK (NODE)->binfo.inheritance)
3098 :
3099 :
3100 : /* Define fields and accessors for nodes representing declared names. */
3101 :
3102 : /* Nonzero if DECL represents an SSA name or a variable that can possibly
3103 : have an associated SSA name. */
3104 : #define SSA_VAR_P(DECL) \
3105 : (TREE_CODE (DECL) == VAR_DECL \
3106 : || TREE_CODE (DECL) == PARM_DECL \
3107 : || TREE_CODE (DECL) == RESULT_DECL \
3108 : || TREE_CODE (DECL) == SSA_NAME)
3109 :
3110 :
3111 : #define DECL_CHAIN(NODE) (TREE_CHAIN (DECL_MINIMAL_CHECK (NODE)))
3112 :
3113 : /* This is the name of the object as written by the user.
3114 : It is an IDENTIFIER_NODE. */
3115 : #define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name)
3116 :
3117 : /* The IDENTIFIER_NODE associated with the TYPE_NAME field. */
3118 : #define TYPE_IDENTIFIER(NODE) \
3119 : (TYPE_NAME (NODE) && DECL_P (TYPE_NAME (NODE)) \
3120 : ? DECL_NAME (TYPE_NAME (NODE)) : TYPE_NAME (NODE))
3121 :
3122 : /* Every ..._DECL node gets a unique number. */
3123 : #define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
3124 :
3125 : /* DEBUG_EXPR_DECLs get negative UID numbers, to catch erroneous
3126 : uses. */
3127 : #define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
3128 :
3129 : /* Every ..._DECL node gets a unique number that stays the same even
3130 : when the decl is copied by the inliner once it is set. */
3131 : #define DECL_PT_UID(NODE) \
3132 : (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid == -1u \
3133 : ? (NODE)->decl_minimal.uid : (NODE)->decl_common.pt_uid)
3134 : /* Initialize the ..._DECL node pt-uid to the decls uid. */
3135 : #define SET_DECL_PT_UID(NODE, UID) \
3136 : (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid = (UID))
3137 : /* Whether the ..._DECL node pt-uid has been initialized and thus needs to
3138 : be preserved when copyin the decl. */
3139 : #define DECL_PT_UID_SET_P(NODE) \
3140 : (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid != -1u)
3141 :
3142 : /* These two fields describe where in the source code the declaration
3143 : was. If the declaration appears in several places (as for a C
3144 : function that is declared first and then defined later), this
3145 : information should refer to the definition. */
3146 : #define DECL_SOURCE_LOCATION(NODE) \
3147 : (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
3148 : #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
3149 : #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
3150 : #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
3151 : /* This decl was created by a front-end or back-end rather than by
3152 : user code, and has not been explicitly declared by the user -- when
3153 : that happens the source location is updated to the user's
3154 : source. This includes decls with no location (!). */
3155 : #define DECL_IS_UNDECLARED_BUILTIN(DECL) \
3156 : (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
3157 :
3158 : /* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
3159 : QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
3160 : PARM_DECL, FUNCTION_DECL, LABEL_DECL, RESULT_DECL, and CONST_DECL
3161 : nodes, this points to either the FUNCTION_DECL for the containing
3162 : function, the RECORD_TYPE or UNION_TYPE for the containing type, or
3163 : NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
3164 : scope". In particular, for VAR_DECLs which are virtual table pointers
3165 : (they have DECL_VIRTUAL set), we use DECL_CONTEXT to determine the type
3166 : they belong to. */
3167 : #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
3168 : #define DECL_FIELD_CONTEXT(NODE) \
3169 : (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
3170 :
3171 : /* If nonzero, decl's name shouldn't be emitted into debug info. */
3172 : #define DECL_NAMELESS(NODE) (DECL_MINIMAL_CHECK (NODE)->base.u.bits.nameless_flag)
3173 :
3174 : /* For any sort of a ..._DECL node, this points to the original (abstract)
3175 : decl node which this decl is an inlined/cloned instance of, or else it
3176 : is NULL indicating that this decl is not an instance of some other decl.
3177 :
3178 : The C front-end also uses this in a nested declaration of an inline
3179 : function, to point back to the definition. */
3180 : #define DECL_ABSTRACT_ORIGIN(NODE) \
3181 : (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
3182 :
3183 : /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
3184 : origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */
3185 : #define DECL_ORIGIN(NODE) \
3186 : (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE))
3187 :
3188 : /* Nonzero for any sort of ..._DECL node means this decl node represents an
3189 : inline instance of some original (abstract) decl from an inline function;
3190 : suppress any warnings about shadowing some other variable. FUNCTION_DECL
3191 : nodes can also have their abstract origin set to themselves. */
3192 : #define DECL_FROM_INLINE(NODE) \
3193 : (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
3194 : && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
3195 :
3196 : /* In a DECL this is the field where attributes are stored. */
3197 : #define DECL_ATTRIBUTES(NODE) \
3198 : (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
3199 :
3200 : /* For a FUNCTION_DECL, holds the tree of BINDINGs.
3201 : For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
3202 : For a VAR_DECL, holds the initial value.
3203 : For a PARM_DECL, used for DECL_ARG_TYPE--default
3204 : values for parameters are encoded in the type of the function,
3205 : not in the PARM_DECL slot.
3206 : For a FIELD_DECL, this is used for enumeration values and the C
3207 : frontend uses it for temporarily storing bitwidth of bitfields.
3208 :
3209 : ??? Need to figure out some way to check this isn't a PARM_DECL. */
3210 : #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial)
3211 :
3212 : /* Holds the size of the datum, in bits, as a tree expression.
3213 : Need not be constant and may be null. May be less than TYPE_SIZE
3214 : for a C++ FIELD_DECL representing a base class subobject with its
3215 : own virtual base classes (which are laid out separately). */
3216 : #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
3217 : /* Likewise for the size in bytes. */
3218 : #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
3219 : #define DECL_ALIGN_RAW(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
3220 : /* Returns the alignment required for the datum, in bits. It must
3221 : be a power of two, but an "alignment" of zero is supported
3222 : (e.g. as "uninitialized" sentinel). */
3223 : #define DECL_ALIGN(NODE) \
3224 : (DECL_ALIGN_RAW (NODE) \
3225 : ? ((unsigned)1) << (DECL_ALIGN_RAW (NODE) - 1) : 0)
3226 : /* Specify that DECL_ALIGN(NODE) is X. */
3227 : #define SET_DECL_ALIGN(NODE, X) \
3228 : (DECL_ALIGN_RAW (NODE) = ffs_hwi (X))
3229 :
3230 : /* The minimum alignment necessary for the datum, in bits, without
3231 : warning. */
3232 : #define DECL_WARN_IF_NOT_ALIGN_RAW(NODE) \
3233 : (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align)
3234 : #define DECL_WARN_IF_NOT_ALIGN(NODE) \
3235 : (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) \
3236 : ? ((unsigned)1) << (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) - 1) : 0)
3237 :
3238 : /* Specify that DECL_WARN_IF_NOT_ALIGN(NODE) is X. */
3239 : #define SET_DECL_WARN_IF_NOT_ALIGN(NODE, X) \
3240 : (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) = ffs_hwi (X))
3241 :
3242 : /* The alignment of NODE, in bytes. */
3243 : #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
3244 : /* Set if the alignment of this DECL has been set by the user, for
3245 : example with an 'aligned' attribute. */
3246 : #define DECL_USER_ALIGN(NODE) \
3247 : (DECL_COMMON_CHECK (NODE)->base.u.bits.user_align)
3248 : /* Holds the machine mode corresponding to the declaration of a variable or
3249 : field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
3250 : FIELD_DECL. */
3251 : #define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
3252 : #define SET_DECL_MODE(NODE, MODE) \
3253 : (DECL_COMMON_CHECK (NODE)->decl_common.mode = (MODE))
3254 :
3255 : /* For FUNCTION_DECL, if it is built-in, this identifies which built-in
3256 : operation it is. This is only intended for low-level accesses;
3257 : normally DECL_FUNCTION_CODE, DECL_FE_FUNCTION_CODE or DECL_MD_FUNCTION
3258 : should be used instead. */
3259 : #define DECL_UNCHECKED_FUNCTION_CODE(NODE) \
3260 : (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code)
3261 :
3262 : /* Test if FCODE is a function code for an alloca operation. */
3263 : #define ALLOCA_FUNCTION_CODE_P(FCODE) \
3264 : ((FCODE) == BUILT_IN_ALLOCA \
3265 : || (FCODE) == BUILT_IN_ALLOCA_WITH_ALIGN \
3266 : || (FCODE) == BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX)
3267 :
3268 : /* Generate case for an alloca operation. */
3269 : #define CASE_BUILT_IN_ALLOCA \
3270 : case BUILT_IN_ALLOCA: \
3271 : case BUILT_IN_ALLOCA_WITH_ALIGN: \
3272 : case BUILT_IN_ALLOCA_WITH_ALIGN_AND_MAX
3273 :
3274 : #define DECL_FUNCTION_PERSONALITY(NODE) \
3275 : (FUNCTION_DECL_CHECK (NODE)->function_decl.personality)
3276 :
3277 : /* Nonzero for a given ..._DECL node means that the name of this node should
3278 : be ignored for symbolic debug purposes. For a TYPE_DECL, this means that
3279 : the associated type should be ignored. For a FUNCTION_DECL, the body of
3280 : the function should also be ignored. */
3281 : #define DECL_IGNORED_P(NODE) \
3282 : (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
3283 :
3284 : /* Nonzero for a given ..._DECL node means that this node represents an
3285 : "abstract instance" of the given declaration (e.g. in the original
3286 : declaration of an inline function). When generating symbolic debugging
3287 : information, we mustn't try to generate any address information for nodes
3288 : marked as "abstract instances" because we don't actually generate
3289 : any code or allocate any data space for such instances. */
3290 : #define DECL_ABSTRACT_P(NODE) \
3291 : (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
3292 :
3293 : /* Language-specific decl information. */
3294 : #define DECL_LANG_SPECIFIC(NODE) \
3295 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
3296 :
3297 : /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
3298 : do not allocate storage, and refer to a definition elsewhere. Note that
3299 : this does not necessarily imply the entity represented by NODE
3300 : has no program source-level definition in this translation unit. For
3301 : example, for a FUNCTION_DECL, DECL_SAVED_TREE may be non-NULL and
3302 : DECL_EXTERNAL may be true simultaneously; that can be the case for
3303 : a C99 "extern inline" function. */
3304 : #define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_1)
3305 :
3306 : /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
3307 : For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
3308 :
3309 : For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
3310 :
3311 : Also set in some languages for variables, etc., outside the normal
3312 : lexical scope, such as class instance variables. */
3313 : #define DECL_NONLOCAL(NODE) \
3314 : (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
3315 :
3316 : /* Used in VAR_DECLs to indicate that the variable is a vtable.
3317 : Used in FIELD_DECLs for vtable pointers.
3318 : Used in FUNCTION_DECLs to indicate that the function is virtual. */
3319 : #define DECL_VIRTUAL_P(NODE) \
3320 : (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
3321 :
3322 : /* Used to indicate that this DECL represents a compiler-generated entity. */
3323 : #define DECL_ARTIFICIAL(NODE) \
3324 : (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
3325 :
3326 : /* Additional flags for language-specific uses. */
3327 : #define DECL_LANG_FLAG_0(NODE) \
3328 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
3329 : #define DECL_LANG_FLAG_1(NODE) \
3330 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
3331 : #define DECL_LANG_FLAG_2(NODE) \
3332 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
3333 : #define DECL_LANG_FLAG_3(NODE) \
3334 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
3335 : #define DECL_LANG_FLAG_4(NODE) \
3336 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
3337 : #define DECL_LANG_FLAG_5(NODE) \
3338 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
3339 : #define DECL_LANG_FLAG_6(NODE) \
3340 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
3341 : #define DECL_LANG_FLAG_7(NODE) \
3342 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
3343 : #define DECL_LANG_FLAG_8(NODE) \
3344 : (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_8)
3345 :
3346 : /* Nonzero for a scope which is equal to file scope. */
3347 : #define SCOPE_FILE_SCOPE_P(EXP) \
3348 : (! (EXP) || TREE_CODE (EXP) == TRANSLATION_UNIT_DECL)
3349 : /* Nonzero for a decl which is at file scope. */
3350 : #define DECL_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (DECL_CONTEXT (EXP))
3351 : /* Nonzero for a type which is at file scope. */
3352 : #define TYPE_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (TYPE_CONTEXT (EXP))
3353 :
3354 : /* Nonzero for a decl that is decorated using attribute used.
3355 : This indicates to compiler tools that this decl needs to be preserved. */
3356 : #define DECL_PRESERVE_P(DECL) \
3357 : DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
3358 :
3359 : /* Nonzero for a decl that is decorated with the "noinit" attribute.
3360 : decls with this attribute are placed into the ".noinit" section, so they are
3361 : not initialized by the target's startup code. */
3362 : #define DECL_NOINIT_P(DECL) \
3363 : (DECL_P (DECL) \
3364 : && (lookup_attribute ("noinit", DECL_ATTRIBUTES (DECL)) != NULL_TREE))
3365 :
3366 : /* Nonzero for a decl that is decorated with the "persistent" attribute.
3367 : decls with this attribute are placed into the ".persistent" section, so they
3368 : are not initialized by the target's startup code. */
3369 : #define DECL_PERSISTENT_P(DECL) \
3370 : (DECL_P (DECL) \
3371 : && (lookup_attribute ("persistent", DECL_ATTRIBUTES (DECL)) != NULL_TREE))
3372 :
3373 : /* For function local variables indicates that the variable
3374 : should not be treated as a GIMPLE register. In particular
3375 : this means that partial definitions can appear and the
3376 : variable cannot be written into SSA form and instead uses
3377 : virtual operands to represent the use-def dataflow. */
3378 : #define DECL_NOT_GIMPLE_REG_P(DECL) \
3379 : DECL_COMMON_CHECK (DECL)->decl_common.not_gimple_reg_flag
3380 :
3381 : extern tree decl_value_expr_lookup (tree);
3382 : extern void decl_value_expr_insert (tree, tree);
3383 :
3384 : /* In a VAR_DECL or PARM_DECL, the location at which the value may be found,
3385 : if transformations have made this more complicated than evaluating the
3386 : decl itself. */
3387 : #define DECL_HAS_VALUE_EXPR_P(NODE) \
3388 : (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, RESULT_DECL) \
3389 : ->decl_common.decl_flag_2)
3390 : #define DECL_VALUE_EXPR(NODE) \
3391 : (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
3392 : #define SET_DECL_VALUE_EXPR(NODE, VAL) \
3393 : (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
3394 :
3395 : /* Holds the RTL expression for the value of a variable or function.
3396 : This value can be evaluated lazily for functions, variables with
3397 : static storage duration, and labels. */
3398 : #define DECL_RTL(NODE) \
3399 : (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl \
3400 : ? (NODE)->decl_with_rtl.rtl \
3401 : : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl))
3402 :
3403 : /* Set the DECL_RTL for NODE to RTL. */
3404 : #define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL)
3405 :
3406 : /* Returns nonzero if NODE is a tree node that can contain RTL. */
3407 : #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
3408 :
3409 : /* Returns nonzero if the DECL_RTL for NODE has already been set. */
3410 : #define DECL_RTL_SET_P(NODE) \
3411 : (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
3412 :
3413 : /* Copy the RTL from SRC_DECL to DST_DECL. If the RTL was not set for
3414 : SRC_DECL, it will not be set for DST_DECL; this is a lazy copy. */
3415 : #define COPY_DECL_RTL(SRC_DECL, DST_DECL) \
3416 : (DECL_WRTL_CHECK (DST_DECL)->decl_with_rtl.rtl \
3417 : = DECL_WRTL_CHECK (SRC_DECL)->decl_with_rtl.rtl)
3418 :
3419 : /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */
3420 : #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
3421 :
3422 : #if (GCC_VERSION >= 2007)
3423 : #define DECL_RTL_KNOWN_SET(decl) __extension__ \
3424 : ({ tree const __d = (decl); \
3425 : gcc_checking_assert (DECL_RTL_SET_P (__d)); \
3426 : /* Dereference it so the compiler knows it can't be NULL even \
3427 : without assertion checking. */ \
3428 : &*DECL_RTL_IF_SET (__d); })
3429 : #else
3430 : #define DECL_RTL_KNOWN_SET(decl) (&*DECL_RTL_IF_SET (decl))
3431 : #endif
3432 :
3433 : /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
3434 : #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
3435 :
3436 : /* In a FIELD_DECL, this is the field position, counting in bytes, of the
3437 : DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
3438 : of the structure. */
3439 : #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset)
3440 :
3441 : /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the
3442 : field from DECL_FIELD_OFFSET. This field may be nonzero even for fields
3443 : that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
3444 : natural alignment of the field's type). */
3445 : #define DECL_FIELD_BIT_OFFSET(NODE) \
3446 : (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
3447 :
3448 : /* In a FIELD_DECL, this indicates whether the field was a bit-field and
3449 : if so, the type that was originally specified for it.
3450 : TREE_TYPE may have been modified (in finish_struct). */
3451 : #define DECL_BIT_FIELD_TYPE(NODE) \
3452 : (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
3453 :
3454 : /* In a FIELD_DECL of a RECORD_TYPE, this is a pointer to the storage
3455 : representative FIELD_DECL. */
3456 : #define DECL_BIT_FIELD_REPRESENTATIVE(NODE) \
3457 : (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
3458 :
3459 : /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
3460 : if nonzero, indicates that the field occupies the type. */
3461 : #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
3462 :
3463 : /* For FIELD_DECLs, off_align holds the number of low-order bits of
3464 : DECL_FIELD_OFFSET which are known to be always zero.
3465 : DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
3466 : has. */
3467 : #define DECL_OFFSET_ALIGN(NODE) \
3468 : (HOST_WIDE_INT_1U << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
3469 :
3470 : /* Specify that DECL_OFFSET_ALIGN(NODE) is X. */
3471 : #define SET_DECL_OFFSET_ALIGN(NODE, X) \
3472 : (FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)
3473 :
3474 : /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
3475 : which this FIELD_DECL is defined. This information is needed when
3476 : writing debugging information about vfield and vbase decls for C++. */
3477 : #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext)
3478 :
3479 : /* In a FIELD_DECL, indicates this field should be bit-packed. */
3480 : #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->base.u.bits.packed_flag)
3481 :
3482 : /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
3483 : specially. */
3484 : #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1)
3485 :
3486 : /* In a FIELD_DECL, indicates this field should be ignored for ABI decisions
3487 : like passing/returning containing struct by value.
3488 : Set for C++17 empty base artificial FIELD_DECLs as well as
3489 : empty [[no_unique_address]] non-static data members. */
3490 : #define DECL_FIELD_ABI_IGNORED(NODE) \
3491 : (!DECL_BIT_FIELD (NODE) && (NODE)->decl_common.decl_flag_0)
3492 : #define SET_DECL_FIELD_ABI_IGNORED(NODE, VAL) \
3493 : do { \
3494 : gcc_checking_assert (!DECL_BIT_FIELD (NODE)); \
3495 : FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_0 = (VAL); \
3496 : } while (0)
3497 :
3498 : /* In a FIELD_DECL, indicates C++ zero-width bitfield that used to be
3499 : removed from the IL since PR42217 until PR101539 and by that changed
3500 : the ABI on several targets. This flag is provided so that the backends
3501 : can decide on the ABI with zero-width bitfields and emit -Wpsabi
3502 : warnings. */
3503 : #define DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD(NODE) \
3504 : (DECL_BIT_FIELD (NODE) && (NODE)->decl_common.decl_flag_0)
3505 : #define SET_DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD(NODE, VAL) \
3506 : do { \
3507 : gcc_checking_assert (DECL_BIT_FIELD (NODE)); \
3508 : FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_0 = (VAL); \
3509 : } while (0)
3510 :
3511 : /* Used in a FIELD_DECL to indicate that we cannot form the address of
3512 : this component. This makes it possible for Type-Based Alias Analysis
3513 : to disambiguate accesses to this field with indirect accesses using
3514 : the field's type:
3515 :
3516 : struct S { int i; } s;
3517 : int *p;
3518 :
3519 : If the flag is set on 'i', TBAA computes that s.i and *p never conflict.
3520 :
3521 : From the implementation's viewpoint, the alias set of the type of the
3522 : field 'i' (int) will not be recorded as a subset of that of the type of
3523 : 's' (struct S) in record_component_aliases. The counterpart is that
3524 : accesses to s.i must not be given the alias set of the type of 'i'
3525 : (int) but instead directly that of the type of 's' (struct S). */
3526 : #define DECL_NONADDRESSABLE_P(NODE) \
3527 : (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
3528 :
3529 : /* Used in a FIELD_DECL to indicate that this field is padding. */
3530 : #define DECL_PADDING_P(NODE) \
3531 : (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)
3532 :
3533 : /* Used in a FIELD_DECL to indicate whether this field is not a flexible
3534 : array member. This is only valid for the last array type field of a
3535 : structure. */
3536 : #define DECL_NOT_FLEXARRAY(NODE) \
3537 : (FIELD_DECL_CHECK (NODE)->decl_common.decl_not_flexarray)
3538 :
3539 : /* A numeric unique identifier for a LABEL_DECL. The UID allocation is
3540 : dense, unique within any one function, and may be used to index arrays.
3541 : If the value is -1, then no UID has been assigned. */
3542 : #define LABEL_DECL_UID(NODE) \
3543 : (LABEL_DECL_CHECK (NODE)->label_decl.label_decl_uid)
3544 :
3545 : /* In a LABEL_DECL, the EH region number for which the label is the
3546 : post_landing_pad. */
3547 : #define EH_LANDING_PAD_NR(NODE) \
3548 : (LABEL_DECL_CHECK (NODE)->label_decl.eh_landing_pad_nr)
3549 :
3550 : /* For a PARM_DECL, records the data type used to pass the argument,
3551 : which may be different from the type seen in the program. */
3552 : #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
3553 :
3554 : /* For PARM_DECL, holds an RTL for the stack slot or register
3555 : where the data was actually passed. */
3556 : #define DECL_INCOMING_RTL(NODE) \
3557 : (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
3558 :
3559 : /* Nonzero for a given ..._DECL node means that no warnings should be
3560 : generated just because this node is unused. */
3561 : #define DECL_IN_SYSTEM_HEADER(NODE) \
3562 : (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
3563 :
3564 : /* Used to indicate that the linkage status of this DECL is not yet known,
3565 : so it should not be output now. */
3566 : #define DECL_DEFER_OUTPUT(NODE) \
3567 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
3568 :
3569 : /* In a VAR_DECL that's static,
3570 : nonzero if the space is in the text section. */
3571 : #define DECL_IN_TEXT_SECTION(NODE) \
3572 : (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
3573 :
3574 : /* In a VAR_DECL that's static,
3575 : nonzero if it belongs to the global constant pool. */
3576 : #define DECL_IN_CONSTANT_POOL(NODE) \
3577 : (VAR_DECL_CHECK (NODE)->decl_with_vis.in_constant_pool)
3578 :
3579 : /* Nonzero for a given ..._DECL node means that this node should be
3580 : put in .common, if possible. If a DECL_INITIAL is given, and it
3581 : is not error_mark_node, then the decl cannot be put in .common. */
3582 : #define DECL_COMMON(NODE) \
3583 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
3584 :
3585 : /* In a VAR_DECL, nonzero if the decl is a register variable with
3586 : an explicit asm specification. */
3587 : #define DECL_HARD_REGISTER(NODE) \
3588 : (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
3589 :
3590 : /* Used to indicate that this DECL has weak linkage. */
3591 : #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
3592 :
3593 : /* Used to indicate that the DECL is a dllimport. */
3594 : #define DECL_DLLIMPORT_P(NODE) \
3595 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
3596 :
3597 : /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
3598 : not be put out unless it is needed in this translation unit.
3599 : Entities like this are shared across translation units (like weak
3600 : entities), but are guaranteed to be generated by any translation
3601 : unit that needs them, and therefore need not be put out anywhere
3602 : where they are not needed. DECL_COMDAT is just a hint to the
3603 : back-end; it is up to front-ends which set this flag to ensure
3604 : that there will never be any harm, other than bloat, in putting out
3605 : something which is DECL_COMDAT. */
3606 : #define DECL_COMDAT(NODE) \
3607 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
3608 :
3609 : #define DECL_COMDAT_GROUP(NODE) \
3610 : decl_comdat_group (NODE)
3611 :
3612 : /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
3613 : multiple translation units should be merged. */
3614 : #define DECL_ONE_ONLY(NODE) (DECL_COMDAT_GROUP (NODE) != NULL_TREE \
3615 : && (TREE_PUBLIC (NODE) || DECL_EXTERNAL (NODE)))
3616 :
3617 : /* The name of the object as the assembler will see it (but before any
3618 : translations made by ASM_OUTPUT_LABELREF). Often this is the same
3619 : as DECL_NAME. It is an IDENTIFIER_NODE.
3620 :
3621 : ASSEMBLER_NAME of TYPE_DECLS may store global name of type used for
3622 : One Definition Rule based type merging at LTO. It is computed only for
3623 : LTO compilation and C++. */
3624 : #define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
3625 :
3626 : /* Raw accessor for DECL_ASSEMBLE_NAME. */
3627 : #define DECL_ASSEMBLER_NAME_RAW(NODE) \
3628 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name)
3629 :
3630 : /* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
3631 : This is true of all DECL nodes except FIELD_DECL. */
3632 : #define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
3633 : (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))
3634 :
3635 : /* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set. If zero,
3636 : the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
3637 : yet. */
3638 : #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
3639 : (DECL_ASSEMBLER_NAME_RAW (NODE) != NULL_TREE)
3640 :
3641 : /* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */
3642 : #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
3643 : overwrite_decl_assembler_name (NODE, NAME)
3644 :
3645 : /* Copy the DECL_ASSEMBLER_NAME from SRC_DECL to DST_DECL. Note that
3646 : if SRC_DECL's DECL_ASSEMBLER_NAME has not yet been set, using this
3647 : macro will not cause the DECL_ASSEMBLER_NAME to be set, but will
3648 : clear DECL_ASSEMBLER_NAME of DST_DECL, if it was already set. In
3649 : other words, the semantics of using this macro, are different than
3650 : saying:
3651 :
3652 : SET_DECL_ASSEMBLER_NAME(DST_DECL, DECL_ASSEMBLER_NAME (SRC_DECL))
3653 :
3654 : which will try to set the DECL_ASSEMBLER_NAME for SRC_DECL. */
3655 :
3656 : #define COPY_DECL_ASSEMBLER_NAME(SRC_DECL, DST_DECL) \
3657 : SET_DECL_ASSEMBLER_NAME (DST_DECL, DECL_ASSEMBLER_NAME_RAW (SRC_DECL))
3658 :
3659 : /* Records the section name in a section attribute. Used to pass
3660 : the name from decl_attributes to make_function_rtl and make_decl_rtl. */
3661 : #define DECL_SECTION_NAME(NODE) decl_section_name (NODE)
3662 :
3663 : /* Nonzero in a decl means that the gimplifier has seen (or placed)
3664 : this variable in a BIND_EXPR. */
3665 : #define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
3666 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
3667 :
3668 : /* Value of the decls's visibility attribute */
3669 : #define DECL_VISIBILITY(NODE) \
3670 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
3671 :
3672 : /* Nonzero means that the decl (or an enclosing scope) had its
3673 : visibility specified rather than being inferred. */
3674 : #define DECL_VISIBILITY_SPECIFIED(NODE) \
3675 : (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
3676 :
3677 : /* In a VAR_DECL, the model to use if the data should be allocated from
3678 : thread-local storage. */
3679 : #define DECL_TLS_MODEL(NODE) decl_tls_model (NODE)
3680 :
3681 : /* In a VAR_DECL, nonzero if the data should be allocated from
3682 : thread-local storage. */
3683 : #define DECL_THREAD_LOCAL_P(NODE) \
3684 : ((TREE_STATIC (NODE) || DECL_EXTERNAL (NODE)) && decl_tls_model (NODE) >= TLS_MODEL_REAL)
3685 :
3686 : /* In a non-local VAR_DECL with static storage duration, true if the
3687 : variable has an initialization priority. If false, the variable
3688 : will be initialized at the DEFAULT_INIT_PRIORITY. */
3689 : #define DECL_HAS_INIT_PRIORITY_P(NODE) \
3690 : (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
3691 :
3692 : extern tree decl_debug_expr_lookup (tree);
3693 : extern void decl_debug_expr_insert (tree, tree);
3694 :
3695 : /* For VAR_DECL, this is set to an expression that it was split from. */
3696 : #define DECL_HAS_DEBUG_EXPR_P(NODE) \
3697 : (VAR_DECL_CHECK (NODE)->decl_common.debug_expr_is_from)
3698 : #define DECL_DEBUG_EXPR(NODE) \
3699 : (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE)))
3700 :
3701 : #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
3702 : (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
3703 :
3704 : extern priority_type decl_init_priority_lookup (tree);
3705 : extern priority_type decl_fini_priority_lookup (tree);
3706 : extern void decl_init_priority_insert (tree, priority_type);
3707 : extern void decl_fini_priority_insert (tree, priority_type);
3708 :
3709 : /* For a VAR_DECL or FUNCTION_DECL the initialization priority of
3710 : NODE. */
3711 : #define DECL_INIT_PRIORITY(NODE) \
3712 : (decl_init_priority_lookup (NODE))
3713 : /* Set the initialization priority for NODE to VAL. */
3714 : #define SET_DECL_INIT_PRIORITY(NODE, VAL) \
3715 : (decl_init_priority_insert (NODE, VAL))
3716 :
3717 : /* For a FUNCTION_DECL the finalization priority of NODE. */
3718 : #define DECL_FINI_PRIORITY(NODE) \
3719 : (decl_fini_priority_lookup (NODE))
3720 : /* Set the finalization priority for NODE to VAL. */
3721 : #define SET_DECL_FINI_PRIORITY(NODE, VAL) \
3722 : (decl_fini_priority_insert (NODE, VAL))
3723 :
3724 : /* The initialization priority for entities for which no explicit
3725 : initialization priority has been specified. */
3726 : #define DEFAULT_INIT_PRIORITY 65535
3727 :
3728 : /* The maximum allowed initialization priority. */
3729 : #define MAX_INIT_PRIORITY 65535
3730 :
3731 : /* The largest priority value reserved for use by system runtime
3732 : libraries. */
3733 : #define MAX_RESERVED_INIT_PRIORITY 100
3734 :
3735 : /* In a VAR_DECL, nonzero if this is a global variable for VOPs. */
3736 : #define VAR_DECL_IS_VIRTUAL_OPERAND(NODE) \
3737 : (VAR_DECL_CHECK (NODE)->base.u.bits.saturating_flag)
3738 :
3739 : /* In a VAR_DECL, nonzero if this is a non-local frame structure. */
3740 : #define DECL_NONLOCAL_FRAME(NODE) \
3741 : (VAR_DECL_CHECK (NODE)->base.default_def_flag)
3742 :
3743 : /* In a VAR_DECL, nonzero if this variable is not aliased by any pointer. */
3744 : #define DECL_NONALIASED(NODE) \
3745 : (VAR_DECL_CHECK (NODE)->base.nothrow_flag)
3746 :
3747 : /* In a VAR_DECL, nonzero if this variable is not required to have a distinct
3748 : address from other variables with the same constant value. In other words,
3749 : consider -fmerge-all-constants to be on for this VAR_DECL. */
3750 : #define DECL_MERGEABLE(NODE) \
3751 : (VAR_DECL_CHECK (NODE)->decl_common.decl_flag_3)
3752 :
3753 : /* This field is used to reference anything in decl.result and is meant only
3754 : for use by the garbage collector. */
3755 : #define DECL_RESULT_FLD(NODE) \
3756 : (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
3757 :
3758 : /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
3759 : Before the struct containing the FUNCTION_DECL is laid out,
3760 : DECL_VINDEX may point to a FUNCTION_DECL in a base class which
3761 : is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
3762 : function. When the class is laid out, this pointer is changed
3763 : to an INTEGER_CST node which is suitable for use as an index
3764 : into the virtual function table. */
3765 : #define DECL_VINDEX(NODE) \
3766 : (FUNCTION_DECL_CHECK (NODE)->function_decl.vindex)
3767 :
3768 : /* In FUNCTION_DECL, holds the decl for the return value. */
3769 : #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
3770 :
3771 : /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
3772 : #define DECL_UNINLINABLE(NODE) \
3773 : (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
3774 :
3775 : /* In a FUNCTION_DECL, the saved representation of the body of the
3776 : entire function. */
3777 : #define DECL_SAVED_TREE(NODE) \
3778 : (FUNCTION_DECL_CHECK (NODE)->function_decl.saved_tree)
3779 :
3780 : /* Nonzero in a FUNCTION_DECL means this function should be treated
3781 : as if it were a malloc, meaning it returns a pointer that is
3782 : not an alias. */
3783 : #define DECL_IS_MALLOC(NODE) \
3784 : (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
3785 :
3786 : /* Macro for direct set and get of function_decl.decl_type. */
3787 : #define FUNCTION_DECL_DECL_TYPE(NODE) \
3788 : (NODE->function_decl.decl_type)
3789 :
3790 : /* Set decl_type of a DECL. Set it to T when SET is true, or reset
3791 : it to NONE. */
3792 :
3793 : inline void
3794 3486705 : set_function_decl_type (tree decl, function_decl_type t, bool set)
3795 : {
3796 3486705 : if (set)
3797 : {
3798 2874311 : gcc_assert (FUNCTION_DECL_DECL_TYPE (decl) == function_decl_type::NONE
3799 : || FUNCTION_DECL_DECL_TYPE (decl) == t);
3800 2874311 : FUNCTION_DECL_DECL_TYPE (decl) = t;
3801 : }
3802 554668 : else if (FUNCTION_DECL_DECL_TYPE (decl) == t)
3803 60 : FUNCTION_DECL_DECL_TYPE (decl) = function_decl_type::NONE;
3804 3083805 : }
3805 :
3806 : /* Nonzero in a FUNCTION_DECL means this function is a replaceable
3807 : function (like replaceable operators new or delete). */
3808 : #define DECL_IS_REPLACEABLE_OPERATOR(NODE)\
3809 : (FUNCTION_DECL_CHECK (NODE)->function_decl.replaceable_operator)
3810 :
3811 : /* Nonzero in a FUNCTION_DECL means this function should be treated as
3812 : C++ operator new, meaning that it returns a pointer for which we
3813 : should not use type based aliasing. */
3814 : #define DECL_IS_OPERATOR_NEW_P(NODE) \
3815 : (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) \
3816 : == function_decl_type::OPERATOR_NEW)
3817 :
3818 : #define DECL_IS_REPLACEABLE_OPERATOR_NEW_P(NODE) \
3819 : (DECL_IS_OPERATOR_NEW_P (NODE) && DECL_IS_REPLACEABLE_OPERATOR (NODE))
3820 :
3821 : #define DECL_SET_IS_OPERATOR_NEW(NODE, VAL) \
3822 : set_function_decl_type (FUNCTION_DECL_CHECK (NODE), \
3823 : function_decl_type::OPERATOR_NEW, VAL)
3824 :
3825 : /* Nonzero in a FUNCTION_DECL means this function should be treated as
3826 : C++ operator delete. */
3827 : #define DECL_IS_OPERATOR_DELETE_P(NODE) \
3828 : (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) \
3829 : == function_decl_type::OPERATOR_DELETE)
3830 :
3831 : #define DECL_SET_IS_OPERATOR_DELETE(NODE, VAL) \
3832 : set_function_decl_type (FUNCTION_DECL_CHECK (NODE), \
3833 : function_decl_type::OPERATOR_DELETE, VAL)
3834 :
3835 : /* Nonzero in a FUNCTION_DECL means this function may return more
3836 : than once. */
3837 : #define DECL_IS_RETURNS_TWICE(NODE) \
3838 : (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag)
3839 :
3840 : /* Nonzero in a FUNCTION_DECL means this function should be treated
3841 : as "pure" function (like const function, but may read global memory).
3842 : Note that being pure or const for a function is orthogonal to being
3843 : nothrow, i.e. it is valid to have DECL_PURE_P set and TREE_NOTHROW
3844 : cleared. */
3845 : #define DECL_PURE_P(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)
3846 :
3847 : /* Nonzero only if one of TREE_READONLY or DECL_PURE_P is nonzero AND
3848 : the const or pure function may not terminate. When this is nonzero
3849 : for a const or pure function, it can be dealt with by cse passes
3850 : but cannot be removed by dce passes since you are not allowed to
3851 : change an infinite looping program into one that terminates without
3852 : error. */
3853 : #define DECL_LOOPING_CONST_OR_PURE_P(NODE) \
3854 : (FUNCTION_DECL_CHECK (NODE)->function_decl.looping_const_or_pure_flag)
3855 :
3856 : /* Nonzero in a FUNCTION_DECL means this function should be treated
3857 : as "novops" function (function that does not read global memory,
3858 : but may have arbitrary side effects). */
3859 : #define DECL_IS_NOVOPS(NODE) \
3860 : (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
3861 :
3862 : /* Used in FUNCTION_DECLs to indicate that they should be run automatically
3863 : at the beginning or end of execution. */
3864 : #define DECL_STATIC_CONSTRUCTOR(NODE) \
3865 : (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag)
3866 :
3867 : #define DECL_STATIC_DESTRUCTOR(NODE) \
3868 : (FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag)
3869 :
3870 : /* Used in FUNCTION_DECLs to indicate that function entry and exit should
3871 : be instrumented with calls to support routines. */
3872 : #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \
3873 : (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit)
3874 :
3875 : /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
3876 : disabled in this function. */
3877 : #define DECL_NO_LIMIT_STACK(NODE) \
3878 : (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
3879 :
3880 : /* In a FUNCTION_DECL indicates that a static chain is needed. */
3881 : #define DECL_STATIC_CHAIN(NODE) \
3882 : (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.regdecl_flag)
3883 :
3884 : /* Nonzero for a decl that cgraph has decided should be inlined into
3885 : at least one call site. It is not meaningful to look at this
3886 : directly; always use cgraph_function_possibly_inlined_p. */
3887 : #define DECL_POSSIBLY_INLINED(DECL) \
3888 : FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
3889 :
3890 : /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
3891 : such as via the `inline' keyword in C/C++. This flag controls the linkage
3892 : semantics of 'inline' */
3893 : #define DECL_DECLARED_INLINE_P(NODE) \
3894 : (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
3895 :
3896 : /* Nonzero in a FUNCTION_DECL means this function should not get
3897 : -Winline warnings. */
3898 : #define DECL_NO_INLINE_WARNING_P(NODE) \
3899 : (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag)
3900 :
3901 : /* Nonzero if a FUNCTION_CODE is a TM load/store. */
3902 : #define BUILTIN_TM_LOAD_STORE_P(FN) \
3903 : ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
3904 :
3905 : /* Nonzero if a FUNCTION_CODE is a TM load. */
3906 : #define BUILTIN_TM_LOAD_P(FN) \
3907 : ((FN) >= BUILT_IN_TM_LOAD_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
3908 :
3909 : /* Nonzero if a FUNCTION_CODE is a TM store. */
3910 : #define BUILTIN_TM_STORE_P(FN) \
3911 : ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_STORE_WAW_LDOUBLE)
3912 :
3913 : #define CASE_BUILT_IN_TM_LOAD(FN) \
3914 : case BUILT_IN_TM_LOAD_##FN: \
3915 : case BUILT_IN_TM_LOAD_RAR_##FN: \
3916 : case BUILT_IN_TM_LOAD_RAW_##FN: \
3917 : case BUILT_IN_TM_LOAD_RFW_##FN
3918 :
3919 : #define CASE_BUILT_IN_TM_STORE(FN) \
3920 : case BUILT_IN_TM_STORE_##FN: \
3921 : case BUILT_IN_TM_STORE_WAR_##FN: \
3922 : case BUILT_IN_TM_STORE_WAW_##FN
3923 :
3924 : /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
3925 : disregarding size and cost heuristics. This is equivalent to using
3926 : the always_inline attribute without the required diagnostics if the
3927 : function cannot be inlined. */
3928 : #define DECL_DISREGARD_INLINE_LIMITS(NODE) \
3929 : (FUNCTION_DECL_CHECK (NODE)->function_decl.disregard_inline_limits)
3930 :
3931 : extern vec<tree, va_gc> **decl_debug_args_lookup (tree);
3932 : extern vec<tree, va_gc> **decl_debug_args_insert (tree);
3933 :
3934 : /* Nonzero if a FUNCTION_DECL has DEBUG arguments attached to it. */
3935 : #define DECL_HAS_DEBUG_ARGS_P(NODE) \
3936 : (FUNCTION_DECL_CHECK (NODE)->function_decl.has_debug_args_flag)
3937 :
3938 : /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
3939 : that describes the status of this function. */
3940 : #define DECL_STRUCT_FUNCTION(NODE) \
3941 : (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
3942 :
3943 : /* For a builtin function, identify which part of the compiler defined it. */
3944 : #define DECL_BUILT_IN_CLASS(NODE) \
3945 : ((built_in_class) FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class)
3946 :
3947 : /* In FUNCTION_DECL, a chain of ..._DECL nodes. */
3948 : #define DECL_ARGUMENTS(NODE) \
3949 : (FUNCTION_DECL_CHECK (NODE)->function_decl.arguments)
3950 :
3951 : /* In FUNCTION_DECL, the function specific target options to use when compiling
3952 : this function. */
3953 : #define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \
3954 : (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target)
3955 :
3956 : /* In FUNCTION_DECL, the function specific optimization options to use when
3957 : compiling this function. */
3958 : #define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \
3959 : (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization)
3960 :
3961 : /* In FUNCTION_DECL, this is set if this function has other versions generated
3962 : to support different architecture feature sets, e.g. using "target" or
3963 : "target_version" attributes. */
3964 : #define DECL_FUNCTION_VERSIONED(NODE)\
3965 : (FUNCTION_DECL_CHECK (NODE)->function_decl.versioned_function)
3966 :
3967 : /* In FUNCTION_DECL, this is set if this function is a C++ constructor.
3968 : Devirtualization machinery uses this knowledge for determining type of the
3969 : object constructed. Also we assume that constructor address is not
3970 : important. */
3971 : #define DECL_CXX_CONSTRUCTOR_P(NODE)\
3972 : (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_constructor)
3973 :
3974 : /* In FUNCTION_DECL, this is set if this function is a C++ destructor.
3975 : Devirtualization machinery uses this to track types in destruction. */
3976 : #define DECL_CXX_DESTRUCTOR_P(NODE)\
3977 : (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_destructor)
3978 :
3979 : /* In FUNCTION_DECL, this is set if this function is a lambda function. */
3980 : #define DECL_LAMBDA_FUNCTION_P(NODE) \
3981 : (FUNCTION_DECL_DECL_TYPE (FUNCTION_DECL_CHECK (NODE)) \
3982 : == function_decl_type::LAMBDA_FUNCTION)
3983 :
3984 : #define DECL_SET_LAMBDA_FUNCTION(NODE, VAL) \
3985 : set_function_decl_type (FUNCTION_DECL_CHECK (NODE), \
3986 : function_decl_type::LAMBDA_FUNCTION, VAL)
3987 :
3988 : /* In FUNCTION_DECL that represent an virtual method this is set when
3989 : the method is final. */
3990 : #define DECL_FINAL_P(NODE)\
3991 : (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.final)
3992 :
3993 : /* The source language of the translation-unit. */
3994 : #define TRANSLATION_UNIT_LANGUAGE(NODE) \
3995 : (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
3996 :
3997 : /* TRANSLATION_UNIT_DECL inherits from DECL_MINIMAL. */
3998 :
3999 : /* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
4000 : #define DECL_ORIGINAL_TYPE(NODE) \
4001 : (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
4002 :
4003 : /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
4004 : into stabs. Instead it will generate cross reference ('x') of names.
4005 : This uses the same flag as DECL_EXTERNAL. */
4006 : #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
4007 : (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_1)
4008 :
4009 : /* Getter of the imported declaration associated to the
4010 : IMPORTED_DECL node. */
4011 : #define IMPORTED_DECL_ASSOCIATED_DECL(NODE) \
4012 : (DECL_INITIAL (IMPORTED_DECL_CHECK (NODE)))
4013 :
4014 : /* Getter of the symbol declaration associated with the
4015 : NAMELIST_DECL node. */
4016 : #define NAMELIST_DECL_ASSOCIATED_DECL(NODE) \
4017 : (DECL_INITIAL (NODE))
4018 :
4019 : /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
4020 : To reduce overhead, the nodes containing the statements are not trees.
4021 : This avoids the overhead of tree_common on all linked list elements.
4022 :
4023 : Use the interface in tree-iterator.h to access this node. */
4024 :
4025 : #define STATEMENT_LIST_HEAD(NODE) \
4026 : (STATEMENT_LIST_CHECK (NODE)->stmt_list.head)
4027 : #define STATEMENT_LIST_TAIL(NODE) \
4028 : (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
4029 :
4030 : #define TREE_OPTIMIZATION(NODE) \
4031 : (OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
4032 :
4033 : #define TREE_OPTIMIZATION_OPTABS(NODE) \
4034 : (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs)
4035 :
4036 : #define TREE_OPTIMIZATION_BASE_OPTABS(NODE) \
4037 : (OPTIMIZATION_NODE_CHECK (NODE)->optimization.base_optabs)
4038 :
4039 : /* Return a tree node that encapsulates the optimization options in OPTS
4040 : and OPTS_SET. */
4041 : extern tree build_optimization_node (struct gcc_options *opts,
4042 : struct gcc_options *opts_set);
4043 :
4044 : #define TREE_TARGET_OPTION(NODE) \
4045 : (TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
4046 :
4047 : #define TREE_TARGET_GLOBALS(NODE) \
4048 : (TARGET_OPTION_NODE_CHECK (NODE)->target_option.globals)
4049 :
4050 : /* Return a tree node that encapsulates the target options in OPTS and
4051 : OPTS_SET. */
4052 : extern tree build_target_option_node (struct gcc_options *opts,
4053 : struct gcc_options *opts_set);
4054 :
4055 : extern void prepare_target_option_nodes_for_pch (void);
4056 :
4057 : #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
4058 :
4059 : inline tree
4060 >79663*10^7 : tree_check (tree __t, const char *__f, int __l, const char *__g, tree_code __c)
4061 : {
4062 >74737*10^7 : if (TREE_CODE (__t) != __c)
4063 2 : tree_check_failed (__t, __f, __l, __g, __c, 0);
4064 >67750*10^7 : return __t;
4065 : }
4066 :
4067 : inline tree
4068 >12081*10^7 : tree_not_check (tree __t, const char *__f, int __l, const char *__g,
4069 : enum tree_code __c)
4070 : {
4071 74388415011 : if (TREE_CODE (__t) == __c)
4072 0 : tree_not_check_failed (__t, __f, __l, __g, __c, 0);
4073 74277501690 : return __t;
4074 : }
4075 :
4076 : inline tree
4077 45397457178 : tree_check2 (tree __t, const char *__f, int __l, const char *__g,
4078 : enum tree_code __c1, enum tree_code __c2)
4079 : {
4080 45397457178 : if (TREE_CODE (__t) != __c1
4081 20181329917 : && TREE_CODE (__t) != __c2)
4082 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4083 45397457178 : return __t;
4084 : }
4085 :
4086 : inline tree
4087 >21626*10^7 : tree_not_check2 (tree __t, const char *__f, int __l, const char *__g,
4088 : enum tree_code __c1, enum tree_code __c2)
4089 : {
4090 >21626*10^7 : if (TREE_CODE (__t) == __c1
4091 >21626*10^7 : || TREE_CODE (__t) == __c2)
4092 0 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4093 >21626*10^7 : return __t;
4094 : }
4095 :
4096 : inline tree
4097 75485319336 : tree_check3 (tree __t, const char *__f, int __l, const char *__g,
4098 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
4099 : {
4100 75485319336 : if (TREE_CODE (__t) != __c1
4101 2553850728 : && TREE_CODE (__t) != __c2
4102 601854736 : && TREE_CODE (__t) != __c3)
4103 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4104 75485319336 : return __t;
4105 : }
4106 :
4107 : inline tree
4108 : tree_not_check3 (tree __t, const char *__f, int __l, const char *__g,
4109 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
4110 : {
4111 : if (TREE_CODE (__t) == __c1
4112 : || TREE_CODE (__t) == __c2
4113 : || TREE_CODE (__t) == __c3)
4114 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4115 : return __t;
4116 : }
4117 :
4118 : inline tree
4119 15198253082 : tree_check4 (tree __t, const char *__f, int __l, const char *__g,
4120 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4121 : enum tree_code __c4)
4122 : {
4123 15198253082 : if (TREE_CODE (__t) != __c1
4124 12936073943 : && TREE_CODE (__t) != __c2
4125 12891175000 : && TREE_CODE (__t) != __c3
4126 12875200033 : && TREE_CODE (__t) != __c4)
4127 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4128 15198253082 : return __t;
4129 : }
4130 :
4131 : inline tree
4132 860494960 : tree_not_check4 (tree __t, const char *__f, int __l, const char *__g,
4133 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4134 : enum tree_code __c4)
4135 : {
4136 860494960 : if (TREE_CODE (__t) == __c1
4137 860494960 : || TREE_CODE (__t) == __c2
4138 860494960 : || TREE_CODE (__t) == __c3
4139 860494960 : || TREE_CODE (__t) == __c4)
4140 0 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4141 860494960 : return __t;
4142 : }
4143 :
4144 : inline tree
4145 1340242255 : tree_check5 (tree __t, const char *__f, int __l, const char *__g,
4146 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4147 : enum tree_code __c4, enum tree_code __c5)
4148 : {
4149 1340242255 : if (TREE_CODE (__t) != __c1
4150 1295360396 : && TREE_CODE (__t) != __c2
4151 465716013 : && TREE_CODE (__t) != __c3
4152 363439343 : && TREE_CODE (__t) != __c4
4153 463665 : && TREE_CODE (__t) != __c5)
4154 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
4155 1340242255 : return __t;
4156 : }
4157 :
4158 : inline tree
4159 : tree_not_check5 (tree __t, const char *__f, int __l, const char *__g,
4160 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4161 : enum tree_code __c4, enum tree_code __c5)
4162 : {
4163 : if (TREE_CODE (__t) == __c1
4164 : || TREE_CODE (__t) == __c2
4165 : || TREE_CODE (__t) == __c3
4166 : || TREE_CODE (__t) == __c4
4167 : || TREE_CODE (__t) == __c5)
4168 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
4169 : return __t;
4170 : }
4171 :
4172 : inline tree
4173 9569816535 : tree_check6 (tree __t, const char *__f, int __l, const char *__g,
4174 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4175 : enum tree_code __c4, enum tree_code __c5, enum tree_code __c6)
4176 : {
4177 9569816535 : if (TREE_CODE (__t) != __c1
4178 545869271 : && TREE_CODE (__t) != __c2
4179 445729410 : && TREE_CODE (__t) != __c3
4180 111499035 : && TREE_CODE (__t) != __c4
4181 640185 : && TREE_CODE (__t) != __c5
4182 640185 : && TREE_CODE (__t) != __c6)
4183 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, __c6,
4184 : 0);
4185 9569816535 : return __t;
4186 : }
4187 :
4188 : inline tree
4189 : tree_not_check6 (tree __t, const char *__f, int __l, const char *__g,
4190 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4191 : enum tree_code __c4, enum tree_code __c5, enum tree_code __c6)
4192 : {
4193 : if (TREE_CODE (__t) == __c1
4194 : || TREE_CODE (__t) == __c2
4195 : || TREE_CODE (__t) == __c3
4196 : || TREE_CODE (__t) == __c4
4197 : || TREE_CODE (__t) == __c5
4198 : || TREE_CODE (__t) == __c6)
4199 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5,
4200 : __c6, 0);
4201 : return __t;
4202 : }
4203 :
4204 : inline tree
4205 >14769*10^8 : contains_struct_check (tree __t, const enum tree_node_structure_enum __s,
4206 : const char *__f, int __l, const char *__g)
4207 : {
4208 >14769*10^8 : if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
4209 0 : tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
4210 >14769*10^8 : return __t;
4211 : }
4212 :
4213 : inline tree
4214 >95454*10^7 : tree_class_check (tree __t, const enum tree_code_class __class,
4215 : const char *__f, int __l, const char *__g)
4216 : {
4217 >95454*10^7 : if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
4218 0 : tree_class_check_failed (__t, __class, __f, __l, __g);
4219 >95454*10^7 : return __t;
4220 : }
4221 :
4222 : inline tree
4223 4837066 : tree_range_check (tree __t,
4224 : enum tree_code __code1, enum tree_code __code2,
4225 : const char *__f, int __l, const char *__g)
4226 : {
4227 4837066 : if (TREE_CODE (__t) < __code1 || TREE_CODE (__t) > __code2)
4228 0 : tree_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4229 4837066 : return __t;
4230 : }
4231 :
4232 : inline tree
4233 7092066 : omp_clause_subcode_check (tree __t, enum omp_clause_code __code,
4234 : const char *__f, int __l, const char *__g)
4235 : {
4236 7092066 : if (TREE_CODE (__t) != OMP_CLAUSE)
4237 0 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4238 7092066 : if (__t->omp_clause.code != __code)
4239 0 : omp_clause_check_failed (__t, __f, __l, __g, __code);
4240 7092066 : return __t;
4241 : }
4242 :
4243 : inline tree
4244 5607855 : omp_clause_range_check (tree __t,
4245 : enum omp_clause_code __code1,
4246 : enum omp_clause_code __code2,
4247 : const char *__f, int __l, const char *__g)
4248 : {
4249 5607855 : if (TREE_CODE (__t) != OMP_CLAUSE)
4250 0 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4251 5607855 : if ((int) __t->omp_clause.code < (int) __code1
4252 5607855 : || (int) __t->omp_clause.code > (int) __code2)
4253 0 : omp_clause_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4254 5607855 : return __t;
4255 : }
4256 :
4257 : /* These checks have to be special cased. */
4258 :
4259 : inline tree
4260 >20352*10^7 : expr_check (tree __t, const char *__f, int __l, const char *__g)
4261 : {
4262 >20352*10^7 : char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
4263 >20352*10^7 : if (!IS_EXPR_CODE_CLASS (__c))
4264 0 : tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
4265 >20352*10^7 : return __t;
4266 : }
4267 :
4268 : /* These checks have to be special cased. */
4269 :
4270 : inline tree
4271 62341296069 : non_type_check (tree __t, const char *__f, int __l, const char *__g)
4272 : {
4273 62341296069 : if (TYPE_P (__t))
4274 0 : tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
4275 62341296069 : return __t;
4276 : }
4277 :
4278 : inline const HOST_WIDE_INT *
4279 59166426538 : tree_int_cst_elt_check (const_tree __t, int __i,
4280 : const char *__f, int __l, const char *__g)
4281 : {
4282 59166426538 : if (TREE_CODE (__t) != INTEGER_CST)
4283 0 : tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
4284 59166426538 : if (__i < 0 || __i >= __t->base.u.int_length.extended)
4285 0 : tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
4286 : __f, __l, __g);
4287 59166426538 : return &const_cast<tree> (__t)->int_cst.val[__i];
4288 : }
4289 :
4290 : inline HOST_WIDE_INT *
4291 35259287095 : tree_int_cst_elt_check (tree __t, int __i,
4292 : const char *__f, int __l, const char *__g)
4293 : {
4294 35259287095 : if (TREE_CODE (__t) != INTEGER_CST)
4295 0 : tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
4296 35259287095 : if (__i < 0 || __i >= __t->base.u.int_length.extended)
4297 0 : tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
4298 : __f, __l, __g);
4299 35259287095 : return &const_cast<tree> (__t)->int_cst.val[__i];
4300 : }
4301 :
4302 : /* Workaround -Wstrict-overflow false positive during profiledbootstrap. */
4303 :
4304 : # if GCC_VERSION >= 4006
4305 : #pragma GCC diagnostic push
4306 : #pragma GCC diagnostic ignored "-Wstrict-overflow"
4307 : #endif
4308 :
4309 : inline tree *
4310 >11466*10^7 : tree_vec_elt_check (tree __t, int __i,
4311 : const char *__f, int __l, const char *__g)
4312 : {
4313 >11466*10^7 : if (TREE_CODE (__t) != TREE_VEC)
4314 0 : tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
4315 >11466*10^7 : if (__i < 0 || __i >= __t->base.u.length)
4316 0 : tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
4317 >11466*10^7 : return &const_cast<tree> (__t)->vec.a[__i];
4318 : }
4319 :
4320 : # if GCC_VERSION >= 4006
4321 : #pragma GCC diagnostic pop
4322 : #endif
4323 :
4324 : inline tree *
4325 9511123 : omp_clause_elt_check (tree __t, int __i,
4326 : const char *__f, int __l, const char *__g)
4327 : {
4328 9511123 : if (TREE_CODE (__t) != OMP_CLAUSE)
4329 0 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4330 9511123 : if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])
4331 0 : omp_clause_operand_check_failed (__i, __t, __f, __l, __g);
4332 9511123 : return &__t->omp_clause.ops[__i];
4333 : }
4334 :
4335 : /* These checks have to be special cased. */
4336 :
4337 : inline tree
4338 3138902554 : any_integral_type_check (tree __t, const char *__f, int __l, const char *__g)
4339 : {
4340 3138902554 : if (!ANY_INTEGRAL_TYPE_P (__t))
4341 0 : tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
4342 : INTEGER_TYPE, BITINT_TYPE, 0);
4343 3138902554 : return __t;
4344 : }
4345 :
4346 : inline const_tree
4347 >15678*10^7 : tree_check (const_tree __t, const char *__f, int __l, const char *__g,
4348 : tree_code __c)
4349 : {
4350 97904079839 : if (TREE_CODE (__t) != __c)
4351 0 : tree_check_failed (__t, __f, __l, __g, __c, 0);
4352 >10072*10^7 : return __t;
4353 : }
4354 :
4355 : inline const_tree
4356 20914838443 : tree_not_check (const_tree __t, const char *__f, int __l, const char *__g,
4357 : enum tree_code __c)
4358 : {
4359 17874962125 : if (TREE_CODE (__t) == __c)
4360 0 : tree_not_check_failed (__t, __f, __l, __g, __c, 0);
4361 10113275108 : return __t;
4362 : }
4363 :
4364 : inline const_tree
4365 17092670058 : tree_check2 (const_tree __t, const char *__f, int __l, const char *__g,
4366 : enum tree_code __c1, enum tree_code __c2)
4367 : {
4368 17092670058 : if (TREE_CODE (__t) != __c1
4369 9186313071 : && TREE_CODE (__t) != __c2)
4370 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4371 17092670058 : return __t;
4372 : }
4373 :
4374 : inline const_tree
4375 3537157122 : tree_not_check2 (const_tree __t, const char *__f, int __l, const char *__g,
4376 : enum tree_code __c1, enum tree_code __c2)
4377 : {
4378 3537157122 : if (TREE_CODE (__t) == __c1
4379 3537157122 : || TREE_CODE (__t) == __c2)
4380 0 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4381 3537157122 : return __t;
4382 : }
4383 :
4384 : inline const_tree
4385 11031970885 : tree_check3 (const_tree __t, const char *__f, int __l, const char *__g,
4386 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
4387 : {
4388 11031970885 : if (TREE_CODE (__t) != __c1
4389 365590847 : && TREE_CODE (__t) != __c2
4390 150054386 : && TREE_CODE (__t) != __c3)
4391 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4392 11031970885 : return __t;
4393 : }
4394 :
4395 : inline const_tree
4396 : tree_not_check3 (const_tree __t, const char *__f, int __l, const char *__g,
4397 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
4398 : {
4399 : if (TREE_CODE (__t) == __c1
4400 : || TREE_CODE (__t) == __c2
4401 : || TREE_CODE (__t) == __c3)
4402 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4403 : return __t;
4404 : }
4405 :
4406 : inline const_tree
4407 358979089 : tree_check4 (const_tree __t, const char *__f, int __l, const char *__g,
4408 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4409 : enum tree_code __c4)
4410 : {
4411 358979089 : if (TREE_CODE (__t) != __c1
4412 21912639 : && TREE_CODE (__t) != __c2
4413 2838097 : && TREE_CODE (__t) != __c3
4414 2838097 : && TREE_CODE (__t) != __c4)
4415 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4416 358979089 : return __t;
4417 : }
4418 :
4419 : inline const_tree
4420 122508568 : tree_not_check4 (const_tree __t, const char *__f, int __l, const char *__g,
4421 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4422 : enum tree_code __c4)
4423 : {
4424 122508568 : if (TREE_CODE (__t) == __c1
4425 122508568 : || TREE_CODE (__t) == __c2
4426 122508568 : || TREE_CODE (__t) == __c3
4427 122508568 : || TREE_CODE (__t) == __c4)
4428 0 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4429 122508568 : return __t;
4430 : }
4431 :
4432 : inline const_tree
4433 : tree_check5 (const_tree __t, const char *__f, int __l, const char *__g,
4434 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4435 : enum tree_code __c4, enum tree_code __c5)
4436 : {
4437 : if (TREE_CODE (__t) != __c1
4438 : && TREE_CODE (__t) != __c2
4439 : && TREE_CODE (__t) != __c3
4440 : && TREE_CODE (__t) != __c4
4441 : && TREE_CODE (__t) != __c5)
4442 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
4443 : return __t;
4444 : }
4445 :
4446 : inline const_tree
4447 : tree_not_check5 (const_tree __t, const char *__f, int __l, const char *__g,
4448 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4449 : enum tree_code __c4, enum tree_code __c5)
4450 : {
4451 : if (TREE_CODE (__t) == __c1
4452 : || TREE_CODE (__t) == __c2
4453 : || TREE_CODE (__t) == __c3
4454 : || TREE_CODE (__t) == __c4
4455 : || TREE_CODE (__t) == __c5)
4456 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
4457 : return __t;
4458 : }
4459 :
4460 : inline const_tree
4461 730672852 : tree_check6 (const_tree __t, const char *__f, int __l, const char *__g,
4462 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4463 : enum tree_code __c4, enum tree_code __c5, enum tree_code __c6)
4464 : {
4465 730672852 : if (TREE_CODE (__t) != __c1
4466 79846634 : && TREE_CODE (__t) != __c2
4467 72495898 : && TREE_CODE (__t) != __c3
4468 3966776 : && TREE_CODE (__t) != __c4
4469 58536 : && TREE_CODE (__t) != __c5
4470 58536 : && TREE_CODE (__t) != __c6)
4471 0 : tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, __c6,
4472 : 0);
4473 730672852 : return __t;
4474 : }
4475 :
4476 : inline const_tree
4477 : tree_not_check6 (const_tree __t, const char *__f, int __l, const char *__g,
4478 : enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
4479 : enum tree_code __c4, enum tree_code __c5, enum tree_code __c6)
4480 : {
4481 : if (TREE_CODE (__t) == __c1
4482 : || TREE_CODE (__t) == __c2
4483 : || TREE_CODE (__t) == __c3
4484 : || TREE_CODE (__t) == __c4
4485 : || TREE_CODE (__t) == __c5
4486 : || TREE_CODE (__t) == __c6)
4487 : tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5,
4488 : __c6, 0);
4489 : return __t;
4490 : }
4491 :
4492 : inline const_tree
4493 >28505*10^7 : contains_struct_check (const_tree __t, const enum tree_node_structure_enum __s,
4494 : const char *__f, int __l, const char *__g)
4495 : {
4496 >28505*10^7 : if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
4497 0 : tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
4498 >28505*10^7 : return __t;
4499 : }
4500 :
4501 : inline const_tree
4502 >29259*10^7 : tree_class_check (const_tree __t, const enum tree_code_class __class,
4503 : const char *__f, int __l, const char *__g)
4504 : {
4505 >29259*10^7 : if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
4506 0 : tree_class_check_failed (__t, __class, __f, __l, __g);
4507 >29259*10^7 : return __t;
4508 : }
4509 :
4510 : inline const_tree
4511 : tree_range_check (const_tree __t,
4512 : enum tree_code __code1, enum tree_code __code2,
4513 : const char *__f, int __l, const char *__g)
4514 : {
4515 : if (TREE_CODE (__t) < __code1 || TREE_CODE (__t) > __code2)
4516 : tree_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4517 : return __t;
4518 : }
4519 :
4520 : inline const_tree
4521 : omp_clause_subcode_check (const_tree __t, enum omp_clause_code __code,
4522 : const char *__f, int __l, const char *__g)
4523 : {
4524 : if (TREE_CODE (__t) != OMP_CLAUSE)
4525 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4526 : if (__t->omp_clause.code != __code)
4527 : omp_clause_check_failed (__t, __f, __l, __g, __code);
4528 : return __t;
4529 : }
4530 :
4531 : inline const_tree
4532 : omp_clause_range_check (const_tree __t,
4533 : enum omp_clause_code __code1,
4534 : enum omp_clause_code __code2,
4535 : const char *__f, int __l, const char *__g)
4536 : {
4537 : if (TREE_CODE (__t) != OMP_CLAUSE)
4538 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4539 : if ((int) __t->omp_clause.code < (int) __code1
4540 : || (int) __t->omp_clause.code > (int) __code2)
4541 : omp_clause_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4542 : return __t;
4543 : }
4544 :
4545 : inline const_tree
4546 32870334460 : expr_check (const_tree __t, const char *__f, int __l, const char *__g)
4547 : {
4548 32870334460 : char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
4549 32870334460 : if (!IS_EXPR_CODE_CLASS (__c))
4550 0 : tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
4551 32870334460 : return __t;
4552 : }
4553 :
4554 : inline const_tree
4555 9906320339 : non_type_check (const_tree __t, const char *__f, int __l, const char *__g)
4556 : {
4557 9906320339 : if (TYPE_P (__t))
4558 0 : tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
4559 9906320339 : return __t;
4560 : }
4561 :
4562 : # if GCC_VERSION >= 4006
4563 : #pragma GCC diagnostic push
4564 : #pragma GCC diagnostic ignored "-Wstrict-overflow"
4565 : #endif
4566 :
4567 : inline const_tree *
4568 6150771264 : tree_vec_elt_check (const_tree __t, int __i,
4569 : const char *__f, int __l, const char *__g)
4570 : {
4571 6150771264 : if (TREE_CODE (__t) != TREE_VEC)
4572 0 : tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
4573 6150771264 : if (__i < 0 || __i >= __t->base.u.length)
4574 0 : tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
4575 6150771264 : return const_cast<const_tree *> (&__t->vec.a[__i]);
4576 : //return &__t->vec.a[__i];
4577 : }
4578 :
4579 : # if GCC_VERSION >= 4006
4580 : #pragma GCC diagnostic pop
4581 : #endif
4582 :
4583 : inline const_tree *
4584 : omp_clause_elt_check (const_tree __t, int __i,
4585 : const char *__f, int __l, const char *__g)
4586 : {
4587 : if (TREE_CODE (__t) != OMP_CLAUSE)
4588 : tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4589 : if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])
4590 : omp_clause_operand_check_failed (__i, __t, __f, __l, __g);
4591 : return const_cast<const_tree *> (&__t->omp_clause.ops[__i]);
4592 : }
4593 :
4594 : inline const_tree
4595 3619020 : any_integral_type_check (const_tree __t, const char *__f, int __l,
4596 : const char *__g)
4597 : {
4598 3619020 : if (!ANY_INTEGRAL_TYPE_P (__t))
4599 0 : tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
4600 : INTEGER_TYPE, BITINT_TYPE, 0);
4601 3619020 : return __t;
4602 : }
4603 :
4604 : #endif
4605 :
4606 : /* Compute the number of operands in an expression node NODE. For
4607 : tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
4608 : otherwise it is looked up from the node's code. */
4609 : inline int
4610 >26068*10^7 : tree_operand_length (const_tree node)
4611 : {
4612 >26068*10^7 : if (VL_EXP_CLASS_P (node))
4613 15654875895 : return VL_EXP_OPERAND_LENGTH (node);
4614 : else
4615 >24503*10^7 : return TREE_CODE_LENGTH (TREE_CODE (node));
4616 : }
4617 :
4618 : #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
4619 :
4620 : /* Special checks for TREE_OPERANDs. */
4621 : inline tree *
4622 >18970*10^7 : tree_operand_check (tree __t, int __i,
4623 : const char *__f, int __l, const char *__g)
4624 : {
4625 >18970*10^7 : const_tree __u = EXPR_CHECK (__t);
4626 >18970*10^7 : if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
4627 0 : tree_operand_check_failed (__i, __u, __f, __l, __g);
4628 >18970*10^7 : return &const_cast<tree> (__u)->exp.operands[__i];
4629 : }
4630 :
4631 : inline tree *
4632 456628023 : tree_operand_check_code (tree __t, enum tree_code __code, int __i,
4633 : const char *__f, int __l, const char *__g)
4634 : {
4635 456628023 : if (TREE_CODE (__t) != __code)
4636 0 : tree_check_failed (__t, __f, __l, __g, __code, 0);
4637 456628023 : if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
4638 0 : tree_operand_check_failed (__i, __t, __f, __l, __g);
4639 456628023 : return &__t->exp.operands[__i];
4640 : }
4641 :
4642 : inline const_tree *
4643 32870334443 : tree_operand_check (const_tree __t, int __i,
4644 : const char *__f, int __l, const char *__g)
4645 : {
4646 32870334443 : const_tree __u = EXPR_CHECK (__t);
4647 32870334443 : if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
4648 0 : tree_operand_check_failed (__i, __u, __f, __l, __g);
4649 32870334443 : return const_cast<const_tree *> (&__u->exp.operands[__i]);
4650 : }
4651 :
4652 : inline const_tree *
4653 72 : tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
4654 : const char *__f, int __l, const char *__g)
4655 : {
4656 72 : if (TREE_CODE (__t) != __code)
4657 0 : tree_check_failed (__t, __f, __l, __g, __code, 0);
4658 72 : if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
4659 0 : tree_operand_check_failed (__i, __t, __f, __l, __g);
4660 72 : return const_cast<const_tree *> (&__t->exp.operands[__i]);
4661 : }
4662 :
4663 : #endif
4664 :
4665 : /* True iff an identifier matches a C string. */
4666 :
4667 : inline bool
4668 4173578717 : id_equal (const_tree id, const char *str)
4669 : {
4670 4173578717 : return !strcmp (IDENTIFIER_POINTER (id), str);
4671 : }
4672 :
4673 : inline bool
4674 3718 : id_equal (const char *str, const_tree id)
4675 : {
4676 3718 : return id_equal (id, str);
4677 : }
4678 :
4679 : /* Return the number of elements in the VECTOR_TYPE given by NODE. */
4680 :
4681 : inline poly_uint64
4682 542706977 : TYPE_VECTOR_SUBPARTS (const_tree node)
4683 : {
4684 542706977 : STATIC_ASSERT (NUM_POLY_INT_COEFFS <= 2);
4685 542706977 : unsigned int precision = VECTOR_TYPE_CHECK (node)->type_common.precision;
4686 542706977 : if (NUM_POLY_INT_COEFFS == 2)
4687 : {
4688 : /* See the corresponding code in SET_TYPE_VECTOR_SUBPARTS for a
4689 : description of the encoding. */
4690 : poly_uint64 res = 0;
4691 : res.coeffs[0] = HOST_WIDE_INT_1U << (precision & 0xff);
4692 : if (precision & 0x100)
4693 : res.coeffs[1] = HOST_WIDE_INT_1U << (precision & 0xff);
4694 : return res;
4695 : }
4696 : else
4697 542706977 : return HOST_WIDE_INT_1U << precision;
4698 : }
4699 :
4700 : /* Set the number of elements in VECTOR_TYPE NODE to SUBPARTS, which must
4701 : satisfy valid_vector_subparts_p. */
4702 :
4703 : inline void
4704 71776201 : SET_TYPE_VECTOR_SUBPARTS (tree node, poly_uint64 subparts)
4705 : {
4706 71776201 : STATIC_ASSERT (NUM_POLY_INT_COEFFS <= 2);
4707 71776201 : unsigned HOST_WIDE_INT coeff0 = subparts.coeffs[0];
4708 71776201 : int index = exact_log2 (coeff0);
4709 0 : gcc_assert (index >= 0);
4710 71776201 : if (NUM_POLY_INT_COEFFS == 2)
4711 : {
4712 : /* We have two coefficients that are each in the range 1 << [0, 63],
4713 : so supporting all combinations would require 6 bits per coefficient
4714 : and 12 bits in total. Since the precision field is only 10 bits
4715 : in size, we need to be more restrictive than that.
4716 :
4717 : At present, coeff[1] is always either 0 (meaning that the number
4718 : of units is constant) or equal to coeff[0] (meaning that the number
4719 : of units is N + X * N for some target-dependent zero-based runtime
4720 : parameter X). We can therefore encode coeff[1] in a single bit.
4721 :
4722 : The most compact encoding would be to use mask 0x3f for coeff[0]
4723 : and 0x40 for coeff[1], leaving 0x380 unused. It's possible to
4724 : get slightly more efficient code on some hosts if we instead
4725 : treat the shift amount as an independent byte, so here we use
4726 : 0xff for coeff[0] and 0x100 for coeff[1]. */
4727 : unsigned HOST_WIDE_INT coeff1 = subparts.coeffs[1];
4728 : gcc_assert (coeff1 == 0 || coeff1 == coeff0);
4729 : VECTOR_TYPE_CHECK (node)->type_common.precision
4730 : = index + (coeff1 != 0 ? 0x100 : 0);
4731 : }
4732 : else
4733 71776201 : VECTOR_TYPE_CHECK (node)->type_common.precision = index;
4734 71776201 : }
4735 :
4736 : /* Return true if we can construct vector types with the given number
4737 : of subparts. */
4738 :
4739 : inline bool
4740 31069 : valid_vector_subparts_p (poly_uint64 subparts)
4741 : {
4742 31069 : unsigned HOST_WIDE_INT coeff0 = subparts.coeffs[0];
4743 8312100 : if (!pow2p_hwi (coeff0))
4744 : return false;
4745 : if (NUM_POLY_INT_COEFFS == 2)
4746 : {
4747 : unsigned HOST_WIDE_INT coeff1 = subparts.coeffs[1];
4748 : if (coeff1 != 0 && coeff1 != coeff0)
4749 : return false;
4750 : }
4751 : return true;
4752 : }
4753 :
4754 : /* Return the built-in function that DECL represents, given that it is known
4755 : to be a FUNCTION_DECL with built-in class BUILT_IN_NORMAL. */
4756 : inline built_in_function
4757 2739573656 : DECL_FUNCTION_CODE (const_tree decl)
4758 : {
4759 2739573656 : const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4760 2739573656 : gcc_checking_assert (fndecl.built_in_class == BUILT_IN_NORMAL);
4761 2739573656 : return (built_in_function) fndecl.function_code;
4762 : }
4763 :
4764 : /* Return the target-specific built-in function that DECL represents,
4765 : given that it is known to be a FUNCTION_DECL with built-in class
4766 : BUILT_IN_MD. */
4767 : inline int
4768 72800897 : DECL_MD_FUNCTION_CODE (const_tree decl)
4769 : {
4770 72800897 : const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4771 72800897 : gcc_checking_assert (fndecl.built_in_class == BUILT_IN_MD);
4772 72800897 : return fndecl.function_code;
4773 : }
4774 :
4775 : /* Return the frontend-specific built-in function that DECL represents,
4776 : given that it is known to be a FUNCTION_DECL with built-in class
4777 : BUILT_IN_FRONTEND. */
4778 : inline int
4779 4257345 : DECL_FE_FUNCTION_CODE (const_tree decl)
4780 : {
4781 4257345 : const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4782 4257345 : gcc_checking_assert (fndecl.built_in_class == BUILT_IN_FRONTEND);
4783 4257345 : return fndecl.function_code;
4784 : }
4785 :
4786 : /* Record that FUNCTION_DECL DECL represents built-in function FCODE of
4787 : class FCLASS. */
4788 : inline void
4789 885202548 : set_decl_built_in_function (tree decl, built_in_class fclass,
4790 : unsigned int fcode)
4791 : {
4792 885202548 : tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4793 885202548 : fndecl.built_in_class = fclass;
4794 885202548 : fndecl.function_code = fcode;
4795 885202548 : }
4796 :
4797 : /* Record that FUNCTION_DECL NEWDECL represents the same built-in function
4798 : as OLDDECL (or none, if OLDDECL doesn't represent a built-in function). */
4799 : inline void
4800 8112053 : copy_decl_built_in_function (tree newdecl, const_tree olddecl)
4801 : {
4802 8112053 : tree_function_decl &newfndecl = FUNCTION_DECL_CHECK (newdecl)->function_decl;
4803 8112053 : const tree_function_decl &oldfndecl
4804 8112053 : = FUNCTION_DECL_CHECK (olddecl)->function_decl;
4805 8112053 : newfndecl.built_in_class = oldfndecl.built_in_class;
4806 8112053 : newfndecl.function_code = oldfndecl.function_code;
4807 8112053 : }
4808 :
4809 : /* In NON_LVALUE_EXPR and VIEW_CONVERT_EXPR, set when this node is merely a
4810 : wrapper added to express a location_t on behalf of the node's child
4811 : (e.g. by maybe_wrap_with_location). */
4812 :
4813 : #define EXPR_LOCATION_WRAPPER_P(NODE) \
4814 : (TREE_CHECK2(NODE, NON_LVALUE_EXPR, VIEW_CONVERT_EXPR)->base.public_flag)
4815 :
4816 : /* Test if EXP is merely a wrapper node, added to express a location_t
4817 : on behalf of the node's child (e.g. by maybe_wrap_with_location). */
4818 :
4819 : inline bool
4820 86298188080 : location_wrapper_p (const_tree exp)
4821 : {
4822 : /* A wrapper node has code NON_LVALUE_EXPR or VIEW_CONVERT_EXPR, and
4823 : the flag EXPR_LOCATION_WRAPPER_P is set.
4824 : It normally has the same type as its operand, but it can have a
4825 : different one if the type of the operand has changed (e.g. when
4826 : merging duplicate decls).
4827 :
4828 : NON_LVALUE_EXPR is used for wrapping constants, apart from STRING_CST.
4829 : VIEW_CONVERT_EXPR is used for wrapping non-constants and STRING_CST. */
4830 86298188080 : if ((TREE_CODE (exp) == NON_LVALUE_EXPR
4831 85165936474 : || TREE_CODE (exp) == VIEW_CONVERT_EXPR)
4832 90532270620 : && EXPR_LOCATION_WRAPPER_P (exp))
4833 5117726461 : return true;
4834 : return false;
4835 : }
4836 :
4837 : /* Implementation of STRIP_ANY_LOCATION_WRAPPER. */
4838 :
4839 : inline tree
4840 56372712987 : tree_strip_any_location_wrapper (tree exp)
4841 : {
4842 56372712987 : if (location_wrapper_p (exp))
4843 2900276020 : return TREE_OPERAND (exp, 0);
4844 : else
4845 : return exp;
4846 : }
4847 :
4848 : #define error_mark_node global_trees[TI_ERROR_MARK]
4849 :
4850 : #define intQI_type_node global_trees[TI_INTQI_TYPE]
4851 : #define intHI_type_node global_trees[TI_INTHI_TYPE]
4852 : #define intSI_type_node global_trees[TI_INTSI_TYPE]
4853 : #define intDI_type_node global_trees[TI_INTDI_TYPE]
4854 : #define intTI_type_node global_trees[TI_INTTI_TYPE]
4855 :
4856 : #define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE]
4857 : #define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE]
4858 : #define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE]
4859 : #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
4860 : #define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
4861 :
4862 : #define atomicQI_type_node global_trees[TI_ATOMICQI_TYPE]
4863 : #define atomicHI_type_node global_trees[TI_ATOMICHI_TYPE]
4864 : #define atomicSI_type_node global_trees[TI_ATOMICSI_TYPE]
4865 : #define atomicDI_type_node global_trees[TI_ATOMICDI_TYPE]
4866 : #define atomicTI_type_node global_trees[TI_ATOMICTI_TYPE]
4867 :
4868 : #define uint16_type_node global_trees[TI_UINT16_TYPE]
4869 : #define uint32_type_node global_trees[TI_UINT32_TYPE]
4870 : #define uint64_type_node global_trees[TI_UINT64_TYPE]
4871 : #define uint128_type_node global_trees[TI_UINT128_TYPE]
4872 :
4873 : #define void_node global_trees[TI_VOID]
4874 :
4875 : #define integer_zero_node global_trees[TI_INTEGER_ZERO]
4876 : #define integer_one_node global_trees[TI_INTEGER_ONE]
4877 : #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
4878 : #define size_zero_node global_trees[TI_SIZE_ZERO]
4879 : #define size_one_node global_trees[TI_SIZE_ONE]
4880 : #define bitsize_zero_node global_trees[TI_BITSIZE_ZERO]
4881 : #define bitsize_one_node global_trees[TI_BITSIZE_ONE]
4882 : #define bitsize_unit_node global_trees[TI_BITSIZE_UNIT]
4883 :
4884 : /* Base access nodes. */
4885 : #define access_public_node global_trees[TI_PUBLIC]
4886 : #define access_protected_node global_trees[TI_PROTECTED]
4887 : #define access_private_node global_trees[TI_PRIVATE]
4888 :
4889 : #define null_pointer_node global_trees[TI_NULL_POINTER]
4890 :
4891 : #define float_type_node global_trees[TI_FLOAT_TYPE]
4892 : #define double_type_node global_trees[TI_DOUBLE_TYPE]
4893 : #define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
4894 : #define bfloat16_type_node global_trees[TI_BFLOAT16_TYPE]
4895 :
4896 : /* Nodes for particular _FloatN and _FloatNx types in sequence. */
4897 : #define FLOATN_TYPE_NODE(IDX) global_trees[TI_FLOATN_TYPE_FIRST + (IDX)]
4898 : #define FLOATN_NX_TYPE_NODE(IDX) global_trees[TI_FLOATN_NX_TYPE_FIRST + (IDX)]
4899 : #define FLOATNX_TYPE_NODE(IDX) global_trees[TI_FLOATNX_TYPE_FIRST + (IDX)]
4900 :
4901 : /* Names for individual types (code should normally iterate over all
4902 : such types; these are only for back-end use, or in contexts such as
4903 : *.def where iteration is not possible). */
4904 : #define float16_type_node global_trees[TI_FLOAT16_TYPE]
4905 : #define float32_type_node global_trees[TI_FLOAT32_TYPE]
4906 : #define float64_type_node global_trees[TI_FLOAT64_TYPE]
4907 : #define float128_type_node global_trees[TI_FLOAT128_TYPE]
4908 : #define float32x_type_node global_trees[TI_FLOAT32X_TYPE]
4909 : #define float64x_type_node global_trees[TI_FLOAT64X_TYPE]
4910 : #define float128x_type_node global_trees[TI_FLOAT128X_TYPE]
4911 :
4912 : /* Type used by certain backends for __float128, which in C++ should be
4913 : distinct type from _Float128 for backwards compatibility reasons. */
4914 : #define float128t_type_node global_trees[TI_FLOAT128T_TYPE]
4915 :
4916 : #define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
4917 : #define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
4918 : #define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
4919 : #define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
4920 :
4921 : #define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
4922 : #define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
4923 : #define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
4924 : #define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
4925 :
4926 : #define COMPLEX_FLOATN_NX_TYPE_NODE(IDX) global_trees[TI_COMPLEX_FLOATN_NX_TYPE_FIRST + (IDX)]
4927 :
4928 : #define void_type_node global_trees[TI_VOID_TYPE]
4929 : /* The C type `void *'. */
4930 : #define ptr_type_node global_trees[TI_PTR_TYPE]
4931 : /* The C type `const void *'. */
4932 : #define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
4933 : /* The C type `size_t'. */
4934 : #define size_type_node global_trees[TI_SIZE_TYPE]
4935 : #define pid_type_node global_trees[TI_PID_TYPE]
4936 : #define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
4937 : #define va_list_type_node global_trees[TI_VA_LIST_TYPE]
4938 : #define va_list_gpr_counter_field global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
4939 : #define va_list_fpr_counter_field global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
4940 : /* The C type `FILE *'. */
4941 : #define fileptr_type_node global_trees[TI_FILEPTR_TYPE]
4942 : /* The C type `const struct tm *'. */
4943 : #define const_tm_ptr_type_node global_trees[TI_CONST_TM_PTR_TYPE]
4944 : /* The C type `fenv_t *'. */
4945 : #define fenv_t_ptr_type_node global_trees[TI_FENV_T_PTR_TYPE]
4946 : #define const_fenv_t_ptr_type_node global_trees[TI_CONST_FENV_T_PTR_TYPE]
4947 : /* The C type `fexcept_t *'. */
4948 : #define fexcept_t_ptr_type_node global_trees[TI_FEXCEPT_T_PTR_TYPE]
4949 : #define const_fexcept_t_ptr_type_node global_trees[TI_CONST_FEXCEPT_T_PTR_TYPE]
4950 : #define pointer_sized_int_node global_trees[TI_POINTER_SIZED_TYPE]
4951 :
4952 : #define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
4953 : #define boolean_false_node global_trees[TI_BOOLEAN_FALSE]
4954 : #define boolean_true_node global_trees[TI_BOOLEAN_TRUE]
4955 :
4956 : /* The decimal floating point types. */
4957 : #define dfloat32_type_node global_trees[TI_DFLOAT32_TYPE]
4958 : #define dfloat64_type_node global_trees[TI_DFLOAT64_TYPE]
4959 : #define dfloat128_type_node global_trees[TI_DFLOAT128_TYPE]
4960 : #define dfloat64x_type_node global_trees[TI_DFLOAT64X_TYPE]
4961 :
4962 : /* The fixed-point types. */
4963 : #define sat_short_fract_type_node global_trees[TI_SAT_SFRACT_TYPE]
4964 : #define sat_fract_type_node global_trees[TI_SAT_FRACT_TYPE]
4965 : #define sat_long_fract_type_node global_trees[TI_SAT_LFRACT_TYPE]
4966 : #define sat_long_long_fract_type_node global_trees[TI_SAT_LLFRACT_TYPE]
4967 : #define sat_unsigned_short_fract_type_node \
4968 : global_trees[TI_SAT_USFRACT_TYPE]
4969 : #define sat_unsigned_fract_type_node global_trees[TI_SAT_UFRACT_TYPE]
4970 : #define sat_unsigned_long_fract_type_node \
4971 : global_trees[TI_SAT_ULFRACT_TYPE]
4972 : #define sat_unsigned_long_long_fract_type_node \
4973 : global_trees[TI_SAT_ULLFRACT_TYPE]
4974 : #define short_fract_type_node global_trees[TI_SFRACT_TYPE]
4975 : #define fract_type_node global_trees[TI_FRACT_TYPE]
4976 : #define long_fract_type_node global_trees[TI_LFRACT_TYPE]
4977 : #define long_long_fract_type_node global_trees[TI_LLFRACT_TYPE]
4978 : #define unsigned_short_fract_type_node global_trees[TI_USFRACT_TYPE]
4979 : #define unsigned_fract_type_node global_trees[TI_UFRACT_TYPE]
4980 : #define unsigned_long_fract_type_node global_trees[TI_ULFRACT_TYPE]
4981 : #define unsigned_long_long_fract_type_node \
4982 : global_trees[TI_ULLFRACT_TYPE]
4983 : #define sat_short_accum_type_node global_trees[TI_SAT_SACCUM_TYPE]
4984 : #define sat_accum_type_node global_trees[TI_SAT_ACCUM_TYPE]
4985 : #define sat_long_accum_type_node global_trees[TI_SAT_LACCUM_TYPE]
4986 : #define sat_long_long_accum_type_node global_trees[TI_SAT_LLACCUM_TYPE]
4987 : #define sat_unsigned_short_accum_type_node \
4988 : global_trees[TI_SAT_USACCUM_TYPE]
4989 : #define sat_unsigned_accum_type_node global_trees[TI_SAT_UACCUM_TYPE]
4990 : #define sat_unsigned_long_accum_type_node \
4991 : global_trees[TI_SAT_ULACCUM_TYPE]
4992 : #define sat_unsigned_long_long_accum_type_node \
4993 : global_trees[TI_SAT_ULLACCUM_TYPE]
4994 : #define short_accum_type_node global_trees[TI_SACCUM_TYPE]
4995 : #define accum_type_node global_trees[TI_ACCUM_TYPE]
4996 : #define long_accum_type_node global_trees[TI_LACCUM_TYPE]
4997 : #define long_long_accum_type_node global_trees[TI_LLACCUM_TYPE]
4998 : #define unsigned_short_accum_type_node global_trees[TI_USACCUM_TYPE]
4999 : #define unsigned_accum_type_node global_trees[TI_UACCUM_TYPE]
5000 : #define unsigned_long_accum_type_node global_trees[TI_ULACCUM_TYPE]
5001 : #define unsigned_long_long_accum_type_node \
5002 : global_trees[TI_ULLACCUM_TYPE]
5003 : #define qq_type_node global_trees[TI_QQ_TYPE]
5004 : #define hq_type_node global_trees[TI_HQ_TYPE]
5005 : #define sq_type_node global_trees[TI_SQ_TYPE]
5006 : #define dq_type_node global_trees[TI_DQ_TYPE]
5007 : #define tq_type_node global_trees[TI_TQ_TYPE]
5008 : #define uqq_type_node global_trees[TI_UQQ_TYPE]
5009 : #define uhq_type_node global_trees[TI_UHQ_TYPE]
5010 : #define usq_type_node global_trees[TI_USQ_TYPE]
5011 : #define udq_type_node global_trees[TI_UDQ_TYPE]
5012 : #define utq_type_node global_trees[TI_UTQ_TYPE]
5013 : #define sat_qq_type_node global_trees[TI_SAT_QQ_TYPE]
5014 : #define sat_hq_type_node global_trees[TI_SAT_HQ_TYPE]
5015 : #define sat_sq_type_node global_trees[TI_SAT_SQ_TYPE]
5016 : #define sat_dq_type_node global_trees[TI_SAT_DQ_TYPE]
5017 : #define sat_tq_type_node global_trees[TI_SAT_TQ_TYPE]
5018 : #define sat_uqq_type_node global_trees[TI_SAT_UQQ_TYPE]
5019 : #define sat_uhq_type_node global_trees[TI_SAT_UHQ_TYPE]
5020 : #define sat_usq_type_node global_trees[TI_SAT_USQ_TYPE]
5021 : #define sat_udq_type_node global_trees[TI_SAT_UDQ_TYPE]
5022 : #define sat_utq_type_node global_trees[TI_SAT_UTQ_TYPE]
5023 : #define ha_type_node global_trees[TI_HA_TYPE]
5024 : #define sa_type_node global_trees[TI_SA_TYPE]
5025 : #define da_type_node global_trees[TI_DA_TYPE]
5026 : #define ta_type_node global_trees[TI_TA_TYPE]
5027 : #define uha_type_node global_trees[TI_UHA_TYPE]
5028 : #define usa_type_node global_trees[TI_USA_TYPE]
5029 : #define uda_type_node global_trees[TI_UDA_TYPE]
5030 : #define uta_type_node global_trees[TI_UTA_TYPE]
5031 : #define sat_ha_type_node global_trees[TI_SAT_HA_TYPE]
5032 : #define sat_sa_type_node global_trees[TI_SAT_SA_TYPE]
5033 : #define sat_da_type_node global_trees[TI_SAT_DA_TYPE]
5034 : #define sat_ta_type_node global_trees[TI_SAT_TA_TYPE]
5035 : #define sat_uha_type_node global_trees[TI_SAT_UHA_TYPE]
5036 : #define sat_usa_type_node global_trees[TI_SAT_USA_TYPE]
5037 : #define sat_uda_type_node global_trees[TI_SAT_UDA_TYPE]
5038 : #define sat_uta_type_node global_trees[TI_SAT_UTA_TYPE]
5039 :
5040 : /* The node that should be placed at the end of a parameter list to
5041 : indicate that the function does not take a variable number of
5042 : arguments. The TREE_VALUE will be void_type_node and there will be
5043 : no TREE_CHAIN. Language-independent code should not assume
5044 : anything else about this node. */
5045 : #define void_list_node global_trees[TI_VOID_LIST_NODE]
5046 :
5047 : #define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
5048 : #define MAIN_NAME_P(NODE) \
5049 : (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
5050 :
5051 : /* Optimization options (OPTIMIZATION_NODE) to use for default and current
5052 : functions. */
5053 : #define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT]
5054 : #define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT]
5055 :
5056 : /* Default/current target options (TARGET_OPTION_NODE). */
5057 : #define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT]
5058 : #define target_option_current_node global_trees[TI_TARGET_OPTION_CURRENT]
5059 :
5060 : /* Default tree list option(), optimize() pragmas to be linked into the
5061 : attribute list. */
5062 : #define current_target_pragma global_trees[TI_CURRENT_TARGET_PRAGMA]
5063 : #define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
5064 :
5065 : /* SCEV analyzer global shared trees. */
5066 : #define chrec_not_analyzed_yet NULL_TREE
5067 : #define chrec_dont_know global_trees[TI_CHREC_DONT_KNOW]
5068 : #define chrec_known global_trees[TI_CHREC_KNOWN]
5069 :
5070 : #define char_type_node integer_types[itk_char]
5071 : #define signed_char_type_node integer_types[itk_signed_char]
5072 : #define unsigned_char_type_node integer_types[itk_unsigned_char]
5073 : #define short_integer_type_node integer_types[itk_short]
5074 : #define short_unsigned_type_node integer_types[itk_unsigned_short]
5075 : #define integer_type_node integer_types[itk_int]
5076 : #define unsigned_type_node integer_types[itk_unsigned_int]
5077 : #define long_integer_type_node integer_types[itk_long]
5078 : #define long_unsigned_type_node integer_types[itk_unsigned_long]
5079 : #define long_long_integer_type_node integer_types[itk_long_long]
5080 : #define long_long_unsigned_type_node integer_types[itk_unsigned_long_long]
5081 :
5082 : /* True if T is an erroneous expression. */
5083 :
5084 : inline bool
5085 30954112236 : error_operand_p (const_tree t)
5086 : {
5087 30954112236 : return (t == error_mark_node
5088 30954112236 : || (t && TREE_TYPE (t) == error_mark_node));
5089 : }
5090 :
5091 : /* Return the number of elements encoded directly in a VECTOR_CST. */
5092 :
5093 : inline unsigned int
5094 35336084 : vector_cst_encoded_nelts (const_tree t)
5095 : {
5096 35336084 : return VECTOR_CST_NPATTERNS (t) * VECTOR_CST_NELTS_PER_PATTERN (t);
5097 : }
5098 :
5099 : extern tree generate_internal_label (const char *);
5100 : extern const char *prefix_for_internal_label (tree label);
5101 : extern tree decl_assembler_name (tree);
5102 : extern void overwrite_decl_assembler_name (tree decl, tree name);
5103 : extern tree decl_comdat_group (const_tree);
5104 : extern tree decl_comdat_group_id (const_tree);
5105 : extern const char *decl_section_name (const_tree);
5106 : extern void set_decl_section_name (tree, const char *);
5107 : extern void set_decl_section_name (tree, const_tree);
5108 : extern enum tls_model decl_tls_model (const_tree);
5109 : extern void set_decl_tls_model (tree, enum tls_model);
5110 :
5111 : /* Compute the number of bytes occupied by 'node'. This routine only
5112 : looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */
5113 :
5114 : extern size_t tree_size (const_tree);
5115 :
5116 : /* Compute the number of bytes occupied by a tree with code CODE.
5117 : This function cannot be used for TREE_VEC or INTEGER_CST nodes,
5118 : which are of variable length. */
5119 : extern size_t tree_code_size (enum tree_code);
5120 :
5121 : /* Allocate and return a new UID from the DECL_UID namespace. */
5122 : extern int allocate_decl_uid (void);
5123 :
5124 : /* Lowest level primitive for allocating a node.
5125 : The TREE_CODE is the only argument. Contents are initialized
5126 : to zero except for a few of the common fields. */
5127 :
5128 : extern tree make_node (enum tree_code CXX_MEM_STAT_INFO);
5129 :
5130 : /* Free tree node. */
5131 :
5132 : extern void free_node (tree);
5133 :
5134 : /* Make a copy of a node, with all the same contents. */
5135 :
5136 : extern tree copy_node (tree CXX_MEM_STAT_INFO);
5137 :
5138 : /* Make a copy of a chain of TREE_LIST nodes. */
5139 :
5140 : extern tree copy_list (tree);
5141 :
5142 : /* Make a CASE_LABEL_EXPR. */
5143 :
5144 : extern tree build_case_label (tree, tree, tree);
5145 :
5146 : /* Make a BINFO. */
5147 : extern tree make_tree_binfo (unsigned CXX_MEM_STAT_INFO);
5148 :
5149 : /* Make an INTEGER_CST. */
5150 :
5151 : extern tree make_int_cst (int, int CXX_MEM_STAT_INFO);
5152 :
5153 : /* Make a TREE_VEC. */
5154 :
5155 : extern tree make_tree_vec (int CXX_MEM_STAT_INFO);
5156 :
5157 : /* Grow a TREE_VEC. */
5158 :
5159 : extern tree grow_tree_vec (tree v, int CXX_MEM_STAT_INFO);
5160 :
5161 : /* Treat a TREE_VEC as a range of trees, e.g.
5162 : for (tree e : tree_vec_range (v)) { ... } */
5163 :
5164 : class tree_vec_range
5165 : {
5166 : tree v;
5167 : public:
5168 6498667697 : tree_vec_range(tree v) : v(v) { }
5169 6498667697 : tree *begin() { return TREE_VEC_BEGIN (v); }
5170 6498667697 : tree *end() { return TREE_VEC_END (v); }
5171 : };
5172 :
5173 : /* Construct various types of nodes. */
5174 :
5175 : extern tree build_nt (enum tree_code, ...);
5176 : extern tree build_nt_call_vec (tree, vec<tree, va_gc> *);
5177 :
5178 : extern tree build0 (enum tree_code, tree CXX_MEM_STAT_INFO);
5179 : extern tree build1 (enum tree_code, tree, tree CXX_MEM_STAT_INFO);
5180 : extern tree build2 (enum tree_code, tree, tree, tree CXX_MEM_STAT_INFO);
5181 : extern tree build3 (enum tree_code, tree, tree, tree, tree CXX_MEM_STAT_INFO);
5182 : extern tree build4 (enum tree_code, tree, tree, tree, tree,
5183 : tree CXX_MEM_STAT_INFO);
5184 : extern tree build5 (enum tree_code, tree, tree, tree, tree, tree,
5185 : tree CXX_MEM_STAT_INFO);
5186 :
5187 : /* _loc versions of build[1-5]. */
5188 :
5189 : inline tree
5190 2865070070 : build1_loc (location_t loc, enum tree_code code, tree type,
5191 : tree arg1 CXX_MEM_STAT_INFO)
5192 : {
5193 2865070070 : tree t = build1 (code, type, arg1 PASS_MEM_STAT);
5194 2865070070 : if (CAN_HAVE_LOCATION_P (t))
5195 2865070070 : SET_EXPR_LOCATION (t, loc);
5196 2865070070 : return t;
5197 : }
5198 :
5199 : inline tree
5200 679130105 : build2_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5201 : tree arg1 CXX_MEM_STAT_INFO)
5202 : {
5203 679130105 : tree t = build2 (code, type, arg0, arg1 PASS_MEM_STAT);
5204 679130105 : if (CAN_HAVE_LOCATION_P (t))
5205 679130105 : SET_EXPR_LOCATION (t, loc);
5206 679130105 : return t;
5207 : }
5208 :
5209 : inline tree
5210 178599397 : build3_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5211 : tree arg1, tree arg2 CXX_MEM_STAT_INFO)
5212 : {
5213 178599397 : tree t = build3 (code, type, arg0, arg1, arg2 PASS_MEM_STAT);
5214 178599397 : if (CAN_HAVE_LOCATION_P (t))
5215 178599397 : SET_EXPR_LOCATION (t, loc);
5216 178599397 : return t;
5217 : }
5218 :
5219 : inline tree
5220 14234087 : build4_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5221 : tree arg1, tree arg2, tree arg3 CXX_MEM_STAT_INFO)
5222 : {
5223 14234087 : tree t = build4 (code, type, arg0, arg1, arg2, arg3 PASS_MEM_STAT);
5224 14234087 : if (CAN_HAVE_LOCATION_P (t))
5225 14234087 : SET_EXPR_LOCATION (t, loc);
5226 14234087 : return t;
5227 : }
5228 :
5229 : inline tree
5230 8875 : build5_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5231 : tree arg1, tree arg2, tree arg3, tree arg4 CXX_MEM_STAT_INFO)
5232 : {
5233 8875 : tree t = build5 (code, type, arg0, arg1, arg2, arg3,
5234 : arg4 PASS_MEM_STAT);
5235 8875 : if (CAN_HAVE_LOCATION_P (t))
5236 8875 : SET_EXPR_LOCATION (t, loc);
5237 8875 : return t;
5238 : }
5239 :
5240 : /* Constructs double_int from tree CST. */
5241 :
5242 : extern tree double_int_to_tree (tree, double_int);
5243 :
5244 : extern tree wide_int_to_tree (tree type, const poly_wide_int_ref &cst);
5245 : extern tree force_fit_type (tree, const poly_wide_int_ref &, int, bool);
5246 :
5247 : /* Create an INT_CST node with a CST value zero extended. */
5248 :
5249 : /* static inline */
5250 : extern tree build_int_cst (tree, poly_int64);
5251 : extern tree build_int_cstu (tree type, poly_uint64);
5252 : extern tree build_int_cst_type (tree, poly_int64);
5253 : extern tree make_vector (unsigned, unsigned CXX_MEM_STAT_INFO);
5254 : extern tree build_vector_from_ctor (tree, const vec<constructor_elt, va_gc> *);
5255 : extern tree build_vector_from_val (tree, tree);
5256 : extern tree build_uniform_cst (tree, tree);
5257 : extern tree build_vec_series (tree, tree, tree);
5258 : extern tree build_index_vector (tree, poly_uint64, poly_uint64);
5259 : extern tree build_vector_a_then_b (tree, unsigned int, tree, tree);
5260 : extern void recompute_constructor_flags (tree);
5261 : extern void verify_constructor_flags (tree);
5262 : extern tree build_constructor (tree, vec<constructor_elt, va_gc> * CXX_MEM_STAT_INFO);
5263 : extern tree build_constructor_single (tree, tree, tree);
5264 : extern tree build_constructor_from_list (tree, tree);
5265 : extern tree build_constructor_from_vec (tree, const vec<tree, va_gc> *);
5266 : extern tree build_constructor_va (tree, int, ...);
5267 : extern tree build_clobber (tree, enum clobber_kind = CLOBBER_UNDEF);
5268 : extern tree build_real_from_int_cst (tree, const_tree);
5269 : extern tree build_real_from_wide (tree, const wide_int_ref &, signop);
5270 : extern tree build_complex (tree, tree, tree);
5271 : extern tree build_complex_inf (tree, bool);
5272 : extern tree build_each_one_cst (tree);
5273 : extern tree build_one_cst (tree);
5274 : extern tree build_minus_one_cst (tree);
5275 : extern tree build_all_ones_cst (tree);
5276 : extern tree build_zero_cst (tree);
5277 : extern tree build_replicated_int_cst (tree, unsigned, HOST_WIDE_INT);
5278 : extern tree sign_mask_for (tree);
5279 : extern tree build_string (unsigned, const char * = NULL);
5280 : extern tree build_poly_int_cst (tree, const poly_wide_int_ref &);
5281 : extern tree build_tree_list (tree, tree CXX_MEM_STAT_INFO);
5282 : extern tree build_tree_list_vec (const vec<tree, va_gc> * CXX_MEM_STAT_INFO);
5283 : extern tree build_decl (location_t, enum tree_code,
5284 : tree, tree CXX_MEM_STAT_INFO);
5285 : extern tree build_debug_expr_decl (tree type);
5286 : extern tree build_fn_decl (const char *, tree);
5287 : extern tree build_translation_unit_decl (tree);
5288 : extern tree build_block (tree, tree, tree, tree);
5289 : extern tree build_empty_stmt (location_t);
5290 : extern tree build_omp_clause (location_t, enum omp_clause_code);
5291 :
5292 : extern tree build_vl_exp (enum tree_code, int CXX_MEM_STAT_INFO);
5293 :
5294 : extern tree build_call_valist (tree, tree, int, va_list);
5295 : extern tree build_call (tree, tree, std::initializer_list<tree>);
5296 :
5297 :
5298 : /* Build a CALL_EXPR of class tcc_vl_exp with the indicated RETURN_TYPE and
5299 : FN and a null static chain slot. NARGS is the number of call arguments
5300 : which are specified as "..." arguments. */
5301 :
5302 : template <typename ...T>
5303 275 : inline tree build_call_nary (tree return_type, tree fn, int nargs, T... args)
5304 : {
5305 275 : std::initializer_list<tree> args_ = {args...};
5306 : gcc_checking_assert (sizeof...(args) == nargs);
5307 275 : return build_call (return_type, fn, args_);
5308 : }
5309 : #define build_call_array(T1,T2,N,T3)\
5310 : build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T3)
5311 : extern tree build_call_array_loc (location_t, tree, tree, int, const tree *);
5312 : extern tree build_call_vec (tree, tree, const vec<tree, va_gc> *);
5313 : extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
5314 : extern tree build_call_expr_loc_vec (location_t, tree, vec<tree, va_gc> *);
5315 : extern tree build_call_expr_loc (location_t, tree, int, ...);
5316 : extern tree build_call_expr (tree, int, ...);
5317 : extern tree build_call_expr_internal_loc (location_t, enum internal_fn,
5318 : tree, int, ...);
5319 : extern tree build_call_expr_internal_loc_array (location_t, enum internal_fn,
5320 : tree, int, const tree *);
5321 : extern tree maybe_build_call_expr_loc (location_t, combined_fn, tree,
5322 : int, ...);
5323 : extern tree build_alloca_call_expr (tree, unsigned int, HOST_WIDE_INT);
5324 : extern tree build_string_literal (unsigned, const char * = NULL,
5325 : tree = char_type_node,
5326 : unsigned HOST_WIDE_INT = HOST_WIDE_INT_M1U);
5327 93546 : inline tree build_string_literal (const char *p)
5328 93546 : { return build_string_literal (strlen (p) + 1, p); }
5329 92512 : inline tree build_string_literal (tree t)
5330 : {
5331 92512 : return build_string_literal (IDENTIFIER_LENGTH (t) + 1,
5332 92512 : IDENTIFIER_POINTER (t));
5333 : }
5334 :
5335 : /* Construct various nodes representing data types. */
5336 :
5337 : extern tree signed_or_unsigned_type_for (int, tree);
5338 : extern tree signed_type_for (tree);
5339 : extern tree unsigned_type_for (tree);
5340 : extern bool is_truth_type_for (tree, tree);
5341 : extern bool tree_zero_one_valued_p (tree);
5342 : extern tree truth_type_for (tree);
5343 : extern tree build_pointer_type_for_mode (tree, machine_mode, bool);
5344 : extern tree build_pointer_type (tree);
5345 : extern tree build_reference_type_for_mode (tree, machine_mode, bool);
5346 : extern tree build_reference_type (tree);
5347 : extern tree build_vector_type_for_mode (tree, machine_mode);
5348 : extern tree build_vector_type (tree, poly_int64);
5349 : extern tree build_truth_vector_type_for_mode (poly_uint64, machine_mode);
5350 : extern tree build_opaque_vector_type (tree, poly_int64);
5351 : extern tree build_index_type (tree);
5352 : extern tree build_array_type_1 (tree, tree, bool, bool, bool);
5353 : extern tree build_array_type (tree, tree, bool = false);
5354 : extern tree build_nonshared_array_type (tree, tree);
5355 : extern tree build_array_type_nelts (tree, poly_uint64);
5356 : extern tree build_function_type (tree, tree, bool = false);
5357 : extern tree build_function_type_list (tree, ...);
5358 : extern tree build_varargs_function_type_list (tree, ...);
5359 : extern tree build_function_type_array (tree, int, tree *);
5360 : extern tree build_varargs_function_type_array (tree, int, tree *);
5361 : #define build_function_type_vec(RET, V) \
5362 : build_function_type_array (RET, vec_safe_length (V), vec_safe_address (V))
5363 : #define build_varargs_function_type_vec(RET, V) \
5364 : build_varargs_function_type_array (RET, vec_safe_length (V), \
5365 : vec_safe_address (V))
5366 : extern tree build_method_type_directly (tree, tree, tree);
5367 : extern tree build_method_type (tree, tree);
5368 : extern tree build_offset_type (tree, tree);
5369 : extern tree build_complex_type (tree, bool named = false);
5370 : extern tree array_type_nelts_minus_one (const_tree);
5371 : extern tree array_type_nelts_top (tree);
5372 :
5373 : extern tree value_member (tree, tree);
5374 : extern tree purpose_member (const_tree, tree);
5375 : extern bool vec_member (const_tree, vec<tree, va_gc> *);
5376 : extern tree chain_index (int, tree);
5377 :
5378 : /* Arguments may be null. */
5379 : extern bool tree_int_cst_equal (const_tree, const_tree);
5380 :
5381 : /* The following predicates are safe to call with a null argument. */
5382 : extern bool tree_fits_shwi_p (const_tree) ATTRIBUTE_PURE;
5383 : extern bool tree_fits_poly_int64_p (const_tree) ATTRIBUTE_PURE;
5384 : extern bool tree_fits_uhwi_p (const_tree) ATTRIBUTE_PURE;
5385 : extern bool tree_fits_poly_uint64_p (const_tree) ATTRIBUTE_PURE;
5386 : extern bool tree_fits_sanitize_code_type_p (const_tree) ATTRIBUTE_PURE;
5387 :
5388 :
5389 : extern HOST_WIDE_INT tree_to_shwi (const_tree)
5390 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5391 : extern poly_int64 tree_to_poly_int64 (const_tree)
5392 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5393 : extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree)
5394 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5395 : extern poly_uint64 tree_to_poly_uint64 (const_tree)
5396 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5397 : extern sanitize_code_type tree_to_sanitize_code_type (const_tree)
5398 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5399 : #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)
5400 : extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
5401 : tree_to_shwi (const_tree t)
5402 : {
5403 : gcc_assert (tree_fits_shwi_p (t));
5404 : return TREE_INT_CST_LOW (t);
5405 : }
5406 :
5407 : extern inline __attribute__ ((__gnu_inline__)) unsigned HOST_WIDE_INT
5408 : tree_to_uhwi (const_tree t)
5409 : {
5410 : gcc_assert (tree_fits_uhwi_p (t));
5411 : return TREE_INT_CST_LOW (t);
5412 : }
5413 : #if NUM_POLY_INT_COEFFS == 1
5414 : extern inline __attribute__ ((__gnu_inline__)) poly_int64
5415 : tree_to_poly_int64 (const_tree t)
5416 : {
5417 : gcc_assert (tree_fits_poly_int64_p (t));
5418 : return TREE_INT_CST_LOW (t);
5419 : }
5420 :
5421 : extern inline __attribute__ ((__gnu_inline__)) poly_uint64
5422 : tree_to_poly_uint64 (const_tree t)
5423 : {
5424 : gcc_assert (tree_fits_poly_uint64_p (t));
5425 : return TREE_INT_CST_LOW (t);
5426 : }
5427 : #endif
5428 : #endif
5429 : extern int tree_int_cst_sgn (const_tree);
5430 : extern int tree_int_cst_sign_bit (const_tree);
5431 : extern unsigned int tree_int_cst_min_precision (tree, signop);
5432 : extern tree excess_precision_type (tree);
5433 :
5434 : /* Recursively examines the array elements of TYPE, until a non-array
5435 : element type is found. */
5436 :
5437 : inline tree
5438 67287435522 : strip_array_types (tree type)
5439 : {
5440 67380808772 : while (TREE_CODE (type) == ARRAY_TYPE)
5441 93373250 : type = TREE_TYPE (type);
5442 :
5443 67287435522 : return type;
5444 : }
5445 :
5446 : /* Recursively traverse down pointer type layers to pointee type. */
5447 :
5448 : inline const_tree
5449 : strip_pointer_types (const_tree type)
5450 : {
5451 : while (POINTER_TYPE_P (type))
5452 : type = TREE_TYPE (type);
5453 :
5454 : return type;
5455 : }
5456 :
5457 : /* Description of the reason why the argument of valid_constant_size_p
5458 : is not a valid size. */
5459 : enum cst_size_error {
5460 : cst_size_ok,
5461 : cst_size_not_constant,
5462 : cst_size_negative,
5463 : cst_size_too_big,
5464 : cst_size_overflow
5465 : };
5466 :
5467 : extern bool valid_constant_size_p (const_tree, cst_size_error * = NULL);
5468 : extern tree max_object_size ();
5469 :
5470 : /* Return true if T holds a value that can be represented as a poly_int64
5471 : without loss of precision. Store the value in *VALUE if so. */
5472 :
5473 : inline bool
5474 521250259 : poly_int_tree_p (const_tree t, poly_int64 *value)
5475 : {
5476 521250259 : if (tree_fits_poly_int64_p (t))
5477 : {
5478 478771343 : *value = tree_to_poly_int64 (t);
5479 478771343 : return true;
5480 : }
5481 : return false;
5482 : }
5483 :
5484 : /* Return true if T holds a value that can be represented as a poly_uint64
5485 : without loss of precision. Store the value in *VALUE if so. */
5486 :
5487 : inline bool
5488 444446689 : poly_int_tree_p (const_tree t, poly_uint64 *value)
5489 : {
5490 444446689 : if (tree_fits_poly_uint64_p (t))
5491 : {
5492 442864408 : *value = tree_to_poly_uint64 (t);
5493 442864408 : return true;
5494 : }
5495 : return false;
5496 : }
5497 :
5498 : /* From expmed.cc. Since rtl.h is included after tree.h, we can't
5499 : put the prototype here. Rtl.h does declare the prototype if
5500 : tree.h had been included. */
5501 :
5502 : extern tree make_tree (tree, rtx);
5503 :
5504 : /* Returns true iff CAND and BASE have equivalent language-specific
5505 : qualifiers. */
5506 :
5507 : extern bool check_lang_type (const_tree cand, const_tree base);
5508 :
5509 : /* Returns true iff unqualified CAND and BASE are equivalent. */
5510 :
5511 : extern bool check_base_type (const_tree cand, const_tree base);
5512 :
5513 : /* Check whether CAND is suitable to be returned from get_qualified_type
5514 : (BASE, TYPE_QUALS). */
5515 :
5516 : extern bool check_qualified_type (const_tree, const_tree, qualifier_set);
5517 :
5518 : /* Return a version of the TYPE, qualified as indicated by the
5519 : TYPE_QUALS, if one exists. If no qualified version exists yet,
5520 : return NULL_TREE. */
5521 :
5522 : extern tree get_qualified_type (tree, qualifier_set);
5523 :
5524 : /* Like get_qualified_type, but creates the type if it does not
5525 : exist. This function never returns NULL_TREE. */
5526 :
5527 : extern tree build_qualified_type (tree, qualifier_set CXX_MEM_STAT_INFO);
5528 :
5529 : /* Create a variant of type T with alignment ALIGN. */
5530 :
5531 : extern tree build_aligned_type (tree, unsigned int);
5532 :
5533 : /* Like build_qualified_type, but only deals with the `const' and
5534 : `volatile' qualifiers. This interface is retained for backwards
5535 : compatibility with the various front-ends; new code should use
5536 : build_qualified_type instead. */
5537 :
5538 : #define build_type_variant(TYPE, CONST_P, VOLATILE_P) \
5539 : (build_qualified_type \
5540 : ((TYPE), \
5541 : (((CONST_P) ? TYPE_QUAL_CONST : TYPE_UNQUALIFIED) \
5542 : | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : TYPE_UNQUALIFIED))))
5543 :
5544 : /* Make a copy of a type node. */
5545 :
5546 : extern tree build_distinct_type_copy (tree CXX_MEM_STAT_INFO);
5547 : extern tree build_variant_type_copy (tree CXX_MEM_STAT_INFO);
5548 :
5549 : /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
5550 : return a canonicalized ..._TYPE node, so that duplicates are not made.
5551 : How the hash code is computed is up to the caller, as long as any two
5552 : callers that could hash identical-looking type nodes agree. */
5553 :
5554 : extern hashval_t type_hash_canon_hash (tree);
5555 : extern tree type_hash_canon (unsigned int, tree);
5556 :
5557 : extern tree convert (tree, tree);
5558 : extern tree size_in_bytes_loc (location_t, const_tree);
5559 : inline tree
5560 20390858 : size_in_bytes (const_tree t)
5561 : {
5562 20390858 : return size_in_bytes_loc (input_location, t);
5563 : }
5564 :
5565 : extern HOST_WIDE_INT int_size_in_bytes (const_tree);
5566 : extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
5567 : extern tree bit_position (const_tree);
5568 : extern tree byte_position (const_tree);
5569 : extern HOST_WIDE_INT int_byte_position (const_tree);
5570 :
5571 : /* Type for sizes of data-type. */
5572 :
5573 : #define sizetype sizetype_tab[(int) stk_sizetype]
5574 : #define bitsizetype sizetype_tab[(int) stk_bitsizetype]
5575 : #define ssizetype sizetype_tab[(int) stk_ssizetype]
5576 : #define sbitsizetype sizetype_tab[(int) stk_sbitsizetype]
5577 : #define size_int(L) size_int_kind (L, stk_sizetype)
5578 : #define ssize_int(L) size_int_kind (L, stk_ssizetype)
5579 : #define bitsize_int(L) size_int_kind (L, stk_bitsizetype)
5580 : #define sbitsize_int(L) size_int_kind (L, stk_sbitsizetype)
5581 :
5582 : /* Log2 of BITS_PER_UNIT. */
5583 :
5584 : #if BITS_PER_UNIT == 8
5585 : #define LOG2_BITS_PER_UNIT 3
5586 : #elif BITS_PER_UNIT == 16
5587 : #define LOG2_BITS_PER_UNIT 4
5588 : #else
5589 : #error Unknown BITS_PER_UNIT
5590 : #endif
5591 :
5592 : /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
5593 : by making the last node in X point to Y.
5594 : Returns X, except if X is 0 returns Y. */
5595 :
5596 : extern tree chainon (tree, tree);
5597 :
5598 : /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
5599 :
5600 : extern tree tree_cons (tree, tree, tree CXX_MEM_STAT_INFO);
5601 :
5602 : /* Return the last tree node in a chain. */
5603 :
5604 : extern tree tree_last (tree);
5605 :
5606 : /* Reverse the order of elements in a chain, and return the new head. */
5607 :
5608 : extern tree nreverse (tree);
5609 :
5610 : /* Returns the length of a chain of nodes
5611 : (number of chain pointers to follow before reaching a null pointer). */
5612 :
5613 : extern int list_length (const_tree);
5614 :
5615 : /* Returns the first/last FIELD_DECL in a RECORD_TYPE. */
5616 :
5617 : extern tree first_field (const_tree) ATTRIBUTE_NONNULL (1);
5618 : extern tree last_field (const_tree) ATTRIBUTE_NONNULL (1);
5619 :
5620 : /* Given an initializer INIT, return TRUE if INIT is zero or some
5621 : aggregate of zeros. Otherwise return FALSE. If NONZERO is not
5622 : null, set *NONZERO if and only if INIT is known not to be all
5623 : zeros. The combination of return value of false and *NONZERO
5624 : false implies that INIT may but need not be all zeros. Other
5625 : combinations indicate definitive answers. */
5626 :
5627 : extern bool initializer_zerop (const_tree, bool * = NULL);
5628 : extern bool initializer_each_zero_or_onep (const_tree);
5629 :
5630 : extern tree vector_cst_elt (const_tree, unsigned int);
5631 :
5632 : /* Given a vector VEC, return its first element if all elements are
5633 : the same. Otherwise return NULL_TREE. */
5634 :
5635 : extern tree uniform_vector_p (const_tree);
5636 :
5637 : /* Same as above, but if VEC is an SSA_NAME, inspect its definition. */
5638 :
5639 : extern tree ssa_uniform_vector_p (tree);
5640 :
5641 : /* If the argument is INTEGER_CST, return it. If the argument is vector
5642 : with all elements the same INTEGER_CST, return that INTEGER_CST. Otherwise
5643 : return NULL_TREE. */
5644 :
5645 : extern tree uniform_integer_cst_p (tree);
5646 :
5647 : /* Return the uniform difference between two INTEGER_CSTs or corresponding
5648 : elements of two VECTOR_CSTs or NULL_TREE if no such difference exists. */
5649 :
5650 : extern tree uniform_vector_difference_p (const_tree, const_tree);
5651 :
5652 : extern int single_nonzero_element (const_tree);
5653 :
5654 : /* Given a CONSTRUCTOR CTOR, return the element values as a vector. */
5655 :
5656 : extern vec<tree, va_gc> *ctor_to_vec (tree);
5657 :
5658 : /* zerop (tree x) is nonzero if X is a constant of value 0. */
5659 :
5660 : extern bool zerop (const_tree);
5661 :
5662 : /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
5663 :
5664 : extern bool integer_zerop (const_tree);
5665 :
5666 : /* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */
5667 :
5668 : extern bool integer_onep (const_tree);
5669 :
5670 : /* integer_onep (tree x) is nonzero if X is an integer constant of value 1, or
5671 : a vector or complex where each part is 1. */
5672 :
5673 : extern bool integer_each_onep (const_tree);
5674 :
5675 : /* integer_all_onesp (tree x) is nonzero if X is an integer constant
5676 : all of whose significant bits are 1. */
5677 :
5678 : extern bool integer_all_onesp (const_tree);
5679 :
5680 : /* integer_minus_onep (tree x) is nonzero if X is an integer constant of
5681 : value -1. */
5682 :
5683 : extern bool integer_minus_onep (const_tree);
5684 :
5685 : /* integer_pow2p (tree x) is nonzero is X is an integer constant with
5686 : exactly one bit 1. */
5687 :
5688 : extern bool integer_pow2p (const_tree);
5689 :
5690 : /* Checks to see if T is a constant or a constant vector and if each element E
5691 : adheres to ~E + 1 == pow2 then return ~E otherwise NULL_TREE. */
5692 :
5693 : extern tree bitmask_inv_cst_vector_p (tree);
5694 :
5695 : /* integer_nonzerop (tree x) is nonzero if X is an integer constant
5696 : with a nonzero value. */
5697 :
5698 : extern bool integer_nonzerop (const_tree);
5699 :
5700 : /* integer_truep (tree x) is nonzero if X is an integer constant of value 1 or
5701 : a vector where each element is an integer constant of value -1. */
5702 :
5703 : extern bool integer_truep (const_tree);
5704 :
5705 : extern bool cst_and_fits_in_hwi (const_tree);
5706 : extern tree num_ending_zeros (const_tree);
5707 :
5708 : /* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
5709 : value 0. */
5710 :
5711 : extern bool fixed_zerop (const_tree);
5712 :
5713 : /* staticp (tree x) is nonzero if X is a reference to data allocated
5714 : at a fixed address in memory. Returns the outermost data. */
5715 :
5716 : extern tree staticp (tree);
5717 :
5718 : /* save_expr (EXP) returns an expression equivalent to EXP
5719 : but it can be used multiple times within context CTX
5720 : and only evaluate EXP once. */
5721 :
5722 : extern tree save_expr (tree);
5723 :
5724 : /* Return true if T is an object with invariant address. */
5725 :
5726 : extern bool address_invariant_p (tree);
5727 :
5728 : /* Return true if T is function-invariant. */
5729 :
5730 : extern bool tree_invariant_p (tree);
5731 :
5732 : /* Look inside EXPR into any simple arithmetic operations. Return the
5733 : outermost non-arithmetic or non-invariant node. */
5734 :
5735 : extern tree skip_simple_arithmetic (tree);
5736 :
5737 : /* Look inside EXPR into simple arithmetic operations involving constants.
5738 : Return the outermost non-arithmetic or non-constant node. */
5739 :
5740 : extern tree skip_simple_constant_arithmetic (tree);
5741 :
5742 : /* Return which tree structure is used by T. */
5743 :
5744 : enum tree_node_structure_enum tree_node_structure (const_tree);
5745 :
5746 : /* Return true if EXP contains a PLACEHOLDER_EXPR, i.e. if it represents a
5747 : size or offset that depends on a field within a record. */
5748 :
5749 : extern bool contains_placeholder_p (const_tree);
5750 :
5751 : /* This macro calls the above function but short-circuits the common
5752 : case of a constant to save time. Also check for null. */
5753 :
5754 : #define CONTAINS_PLACEHOLDER_P(EXP) \
5755 : ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
5756 :
5757 : /* Return true if any part of the structure of TYPE involves a PLACEHOLDER_EXPR
5758 : directly. This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and
5759 : field positions. */
5760 :
5761 : extern bool type_contains_placeholder_p (tree);
5762 :
5763 : /* Given a tree EXP, find all occurrences of references to fields
5764 : in a PLACEHOLDER_EXPR and place them in vector REFS without
5765 : duplicates. Also record VAR_DECLs and CONST_DECLs. Note that
5766 : we assume here that EXP contains only arithmetic expressions
5767 : or CALL_EXPRs with PLACEHOLDER_EXPRs occurring only in their
5768 : argument list. */
5769 :
5770 : extern void find_placeholder_in_expr (tree, vec<tree> *);
5771 :
5772 : /* This macro calls the above function but short-circuits the common
5773 : case of a constant to save time and also checks for NULL. */
5774 :
5775 : #define FIND_PLACEHOLDER_IN_EXPR(EXP, V) \
5776 : do { \
5777 : if((EXP) && !TREE_CONSTANT (EXP)) \
5778 : find_placeholder_in_expr (EXP, V); \
5779 : } while (0)
5780 :
5781 : /* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
5782 : return a tree with all occurrences of references to F in a
5783 : PLACEHOLDER_EXPR replaced by R. Also handle VAR_DECLs and
5784 : CONST_DECLs. Note that we assume here that EXP contains only
5785 : arithmetic expressions or CALL_EXPRs with PLACEHOLDER_EXPRs
5786 : occurring only in their argument list. */
5787 :
5788 : extern tree substitute_in_expr (tree, tree, tree);
5789 :
5790 : /* This macro calls the above function but short-circuits the common
5791 : case of a constant to save time and also checks for NULL. */
5792 :
5793 : #define SUBSTITUTE_IN_EXPR(EXP, F, R) \
5794 : ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) : substitute_in_expr (EXP, F, R))
5795 :
5796 : /* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
5797 : for it within OBJ, a tree that is an object or a chain of references. */
5798 :
5799 : extern tree substitute_placeholder_in_expr (tree, tree);
5800 :
5801 : /* This macro calls the above function but short-circuits the common
5802 : case of a constant to save time and also checks for NULL. */
5803 :
5804 : #define SUBSTITUTE_PLACEHOLDER_IN_EXPR(EXP, OBJ) \
5805 : ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) \
5806 : : substitute_placeholder_in_expr (EXP, OBJ))
5807 :
5808 :
5809 : /* stabilize_reference (EXP) returns a reference equivalent to EXP
5810 : but it can be used multiple times
5811 : and only evaluate the subexpressions once. */
5812 :
5813 : extern tree stabilize_reference (tree);
5814 :
5815 : /* Return EXP, stripped of any conversions to wider types
5816 : in such a way that the result of converting to type FOR_TYPE
5817 : is the same as if EXP were converted to FOR_TYPE.
5818 : If FOR_TYPE is 0, it signifies EXP's type. */
5819 :
5820 : extern tree get_unwidened (tree, tree);
5821 :
5822 : /* Return OP or a simpler expression for a narrower value
5823 : which can be sign-extended or zero-extended to give back OP.
5824 : Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
5825 : or 0 if the value should be sign-extended. */
5826 :
5827 : extern tree get_narrower (tree, int *);
5828 :
5829 : /* Return true if T is an expression that get_inner_reference handles. */
5830 :
5831 : inline bool
5832 37721208543 : handled_component_p (const_tree t)
5833 : {
5834 37312010327 : switch (TREE_CODE (t))
5835 : {
5836 : case COMPONENT_REF:
5837 : case BIT_FIELD_REF:
5838 : case ARRAY_REF:
5839 : case ARRAY_RANGE_REF:
5840 : case REALPART_EXPR:
5841 : case IMAGPART_EXPR:
5842 : case VIEW_CONVERT_EXPR:
5843 : return true;
5844 :
5845 18767120235 : default:
5846 18767105401 : return false;
5847 : }
5848 : }
5849 :
5850 : /* Return true T is a component with reverse storage order. */
5851 :
5852 : inline bool
5853 3563933206 : reverse_storage_order_for_component_p (tree t)
5854 : {
5855 : /* The storage order only applies to scalar components. */
5856 6948955365 : if (AGGREGATE_TYPE_P (TREE_TYPE (t))
5857 2728159100 : || POINTER_TYPE_P (TREE_TYPE (t))
5858 5425079340 : || VECTOR_TYPE_P (TREE_TYPE (t)))
5859 : return false;
5860 :
5861 1746757481 : if (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR)
5862 10342367 : t = TREE_OPERAND (t, 0);
5863 :
5864 1746757481 : switch (TREE_CODE (t))
5865 : {
5866 1230969161 : case ARRAY_REF:
5867 1230969161 : case COMPONENT_REF:
5868 : /* ??? Fortran can take COMPONENT_REF of a VOID_TYPE. */
5869 : /* ??? UBSan can take COMPONENT_REF of a REFERENCE_TYPE. */
5870 2213848688 : return AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0)))
5871 2213848287 : && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (TREE_OPERAND (t, 0)));
5872 :
5873 321856393 : case BIT_FIELD_REF:
5874 321856393 : case MEM_REF:
5875 321856393 : return REF_REVERSE_STORAGE_ORDER (t);
5876 :
5877 : case ARRAY_RANGE_REF:
5878 : case VIEW_CONVERT_EXPR:
5879 : default:
5880 : return false;
5881 : }
5882 : }
5883 :
5884 : /* Return true if T is a storage order barrier, i.e. a VIEW_CONVERT_EXPR
5885 : that can modify the storage order of objects. Note that, even if the
5886 : TYPE_REVERSE_STORAGE_ORDER flag is set on both the inner type and the
5887 : outer type, a VIEW_CONVERT_EXPR can modify the storage order because
5888 : it can change the partition of the aggregate object into scalars. */
5889 :
5890 : inline bool
5891 88504212 : storage_order_barrier_p (const_tree t)
5892 : {
5893 88504212 : if (TREE_CODE (t) != VIEW_CONVERT_EXPR)
5894 : return false;
5895 :
5896 3526807 : if (AGGREGATE_TYPE_P (TREE_TYPE (t))
5897 3447675 : && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (t)))
5898 : return true;
5899 :
5900 1966817 : tree op = TREE_OPERAND (t, 0);
5901 :
5902 3908583 : if (AGGREGATE_TYPE_P (TREE_TYPE (op))
5903 3447893 : && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (op)))
5904 : return true;
5905 :
5906 1966817 : return reverse_storage_order_for_component_p (op);
5907 : }
5908 :
5909 : /* Given a DECL or TYPE, return the scope in which it was declared, or
5910 : NUL_TREE if there is no containing scope. */
5911 :
5912 : extern tree get_containing_scope (const_tree);
5913 :
5914 : /* Returns the ultimate TRANSLATION_UNIT_DECL context of DECL or NULL. */
5915 :
5916 : extern const_tree get_ultimate_context (const_tree);
5917 :
5918 : /* Return the FUNCTION_DECL which provides this _DECL with its context,
5919 : or zero if none. */
5920 : extern tree decl_function_context (const_tree);
5921 :
5922 : /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
5923 : this _DECL with its context, or zero if none. */
5924 : extern tree decl_type_context (const_tree);
5925 :
5926 : /* Return true if EXPR is the real constant zero. */
5927 : extern bool real_zerop (const_tree);
5928 :
5929 : /* Return true if EXPR is the real constant negative zero. */
5930 : extern bool real_negzerop (const_tree);
5931 :
5932 : /* Initialize the iterator I with arguments from function FNDECL */
5933 :
5934 : inline void
5935 1513897222 : function_args_iter_init (function_args_iterator *i, const_tree fntype)
5936 : {
5937 1513897222 : i->next = TYPE_ARG_TYPES (fntype);
5938 1513897222 : }
5939 :
5940 : /* Return a pointer that holds the next argument if there are more arguments to
5941 : handle, otherwise return NULL. */
5942 :
5943 : inline tree *
5944 : function_args_iter_cond_ptr (function_args_iterator *i)
5945 : {
5946 : return (i->next) ? &TREE_VALUE (i->next) : NULL;
5947 : }
5948 :
5949 : /* Return the next argument if there are more arguments to handle, otherwise
5950 : return NULL. */
5951 :
5952 : inline tree
5953 2370996664 : function_args_iter_cond (function_args_iterator *i)
5954 : {
5955 2370996664 : return (i->next) ? TREE_VALUE (i->next) : NULL_TREE;
5956 : }
5957 :
5958 : /* Advance to the next argument. */
5959 : inline void
5960 860738937 : function_args_iter_next (function_args_iterator *i)
5961 : {
5962 860738937 : gcc_assert (i->next != NULL_TREE);
5963 860738937 : i->next = TREE_CHAIN (i->next);
5964 860738937 : }
5965 :
5966 : /* Returns true if a BLOCK has a source location.
5967 : BLOCK_SOURCE_LOCATION is set only to inlined function entry points,
5968 : so the function returns true for all but the innermost and outermost
5969 : blocks into which an expression has been inlined. */
5970 :
5971 : inline bool
5972 50562352 : inlined_function_outer_scope_p (const_tree block)
5973 : {
5974 50562352 : return LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) != UNKNOWN_LOCATION;
5975 : }
5976 :
5977 : /* Loop over all function arguments of FNTYPE. In each iteration, PTR is set
5978 : to point to the next tree element. ITER is an instance of
5979 : function_args_iterator used to iterate the arguments. */
5980 : #define FOREACH_FUNCTION_ARGS_PTR(FNTYPE, PTR, ITER) \
5981 : for (function_args_iter_init (&(ITER), (FNTYPE)); \
5982 : (PTR = function_args_iter_cond_ptr (&(ITER))) != NULL; \
5983 : function_args_iter_next (&(ITER)))
5984 :
5985 : /* Loop over all function arguments of FNTYPE. In each iteration, TREE is set
5986 : to the next tree element. ITER is an instance of function_args_iterator
5987 : used to iterate the arguments. */
5988 : #define FOREACH_FUNCTION_ARGS(FNTYPE, TREE, ITER) \
5989 : for (function_args_iter_init (&(ITER), (FNTYPE)); \
5990 : (TREE = function_args_iter_cond (&(ITER))) != NULL_TREE; \
5991 : function_args_iter_next (&(ITER)))
5992 :
5993 : /* In tree.cc */
5994 : extern unsigned crc32_unsigned_n (unsigned, unsigned, unsigned);
5995 : extern unsigned crc32_string (unsigned, const char *);
5996 : inline unsigned
5997 972670 : crc32_unsigned (unsigned chksum, unsigned value)
5998 : {
5999 967858 : return crc32_unsigned_n (chksum, value, 4);
6000 : }
6001 : inline unsigned
6002 16496987 : crc32_byte (unsigned chksum, char byte)
6003 : {
6004 16496987 : return crc32_unsigned_n (chksum, byte, 1);
6005 : }
6006 : extern void clean_symbol_name (char *);
6007 : extern tree get_file_function_name (const char *);
6008 : extern tree get_callee_fndecl (const_tree);
6009 : extern combined_fn get_call_combined_fn (const_tree);
6010 : extern int type_num_arguments (const_tree);
6011 : extern tree type_argument_type (const_tree, unsigned) ATTRIBUTE_NONNULL (1);
6012 : extern bool associative_tree_code (enum tree_code);
6013 : extern bool commutative_tree_code (enum tree_code);
6014 : extern bool commutative_ternary_tree_code (enum tree_code);
6015 : extern bool operation_can_overflow (enum tree_code);
6016 : extern bool operation_no_trapping_overflow (tree, enum tree_code);
6017 : extern tree upper_bound_in_type (tree, tree);
6018 : extern tree lower_bound_in_type (tree, tree);
6019 : extern bool operand_equal_for_phi_arg_p (const_tree, const_tree);
6020 : extern tree create_artificial_label (location_t);
6021 : extern const char *get_name (tree);
6022 : extern bool stdarg_p (const_tree);
6023 : extern bool prototype_p (const_tree);
6024 : extern bool auto_var_p (const_tree);
6025 : extern bool auto_var_in_fn_p (const_tree, const_tree);
6026 : extern tree build_low_bits_mask (tree, unsigned);
6027 : extern bool tree_nop_conversion_p (const_tree, const_tree);
6028 : extern bool vector_nop_conversion_p (const_tree, const_tree);
6029 : extern tree tree_strip_nop_conversions (tree);
6030 : extern tree tree_strip_sign_nop_conversions (tree);
6031 : extern const_tree strip_invariant_refs (const_tree);
6032 : extern tree strip_zero_offset_components (tree);
6033 : extern tree lhd_gcc_personality (void);
6034 : extern void assign_assembler_name_if_needed (tree);
6035 : extern bool warn_deprecated_use (tree, tree);
6036 : extern void error_unavailable_use (tree, tree);
6037 : extern tree cache_integer_cst (tree, bool might_duplicate = false);
6038 : extern const char *combined_fn_name (combined_fn);
6039 :
6040 : /* Returns true if X is a typedef decl. */
6041 :
6042 : inline bool
6043 33969563319 : is_typedef_decl (const_tree x)
6044 : {
6045 27627997228 : return (x && TREE_CODE (x) == TYPE_DECL
6046 29359325488 : && DECL_ORIGINAL_TYPE (x) != NULL_TREE);
6047 : }
6048 :
6049 : /* Returns true iff TYPE is a type variant created for a typedef. */
6050 :
6051 : inline bool
6052 26599395689 : typedef_variant_p (const_tree type)
6053 : {
6054 26599395689 : return is_typedef_decl (TYPE_NAME (type));
6055 : }
6056 :
6057 : /* Compare and hash for any structure which begins with a canonical
6058 : pointer. Assumes all pointers are interchangeable, which is sort
6059 : of already assumed by gcc elsewhere IIRC. */
6060 :
6061 : inline int
6062 : struct_ptr_eq (const void *a, const void *b)
6063 : {
6064 : const void * const * x = (const void * const *) a;
6065 : const void * const * y = (const void * const *) b;
6066 : return *x == *y;
6067 : }
6068 :
6069 : inline hashval_t
6070 : struct_ptr_hash (const void *a)
6071 : {
6072 : const void * const * x = (const void * const *) a;
6073 : return (intptr_t)*x >> 4;
6074 : }
6075 :
6076 : /* Return true if CODE can be treated as a truncating division.
6077 :
6078 : EXACT_DIV_EXPR can be treated as a truncating division in which the
6079 : remainder is known to be zero. However, if trunc_div_p gates the
6080 : generation of new IL, the conservative choice for that new IL is
6081 : TRUNC_DIV_EXPR rather than CODE. Using CODE (EXACT_DIV_EXPR) would
6082 : only be correct if the transformation preserves exactness. */
6083 : inline bool
6084 1155769 : trunc_or_exact_div_p (tree_code code)
6085 : {
6086 1155769 : return code == TRUNC_DIV_EXPR || code == EXACT_DIV_EXPR;
6087 : }
6088 :
6089 : /* Return true if CODE is an integer division or integer mod code. */
6090 : inline bool
6091 1469 : int_divide_or_mod_p (const code_helper &code)
6092 : {
6093 1469 : switch (code.get_rep())
6094 : {
6095 : case TRUNC_DIV_EXPR:
6096 : case CEIL_DIV_EXPR:
6097 : case FLOOR_DIV_EXPR:
6098 : case ROUND_DIV_EXPR:
6099 : case EXACT_DIV_EXPR:
6100 : case TRUNC_MOD_EXPR:
6101 : case FLOOR_MOD_EXPR:
6102 : case CEIL_MOD_EXPR:
6103 : case ROUND_MOD_EXPR:
6104 : return true;
6105 : default:
6106 : return false;
6107 : }
6108 : }
6109 :
6110 : /* Return nonzero if CODE is a tree code that represents a truth value. */
6111 : inline bool
6112 192281657 : truth_value_p (enum tree_code code)
6113 : {
6114 192281657 : return (TREE_CODE_CLASS (code) == tcc_comparison
6115 177247374 : || code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
6116 177083023 : || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
6117 369234991 : || code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
6118 : }
6119 :
6120 : /* Return whether TYPE is a type suitable for an offset for
6121 : a POINTER_PLUS_EXPR. */
6122 : inline bool
6123 283809578 : ptrofftype_p (tree type)
6124 : {
6125 283809578 : return (INTEGRAL_TYPE_P (type)
6126 278074110 : && TYPE_PRECISION (type) == TYPE_PRECISION (sizetype)
6127 561854325 : && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));
6128 : }
6129 :
6130 : /* Return true if the argument is a complete type or an array
6131 : of unknown bound (whose type is incomplete but) whose elements
6132 : have complete type. */
6133 : inline bool
6134 8842640 : complete_or_array_type_p (const_tree type)
6135 : {
6136 8842640 : return COMPLETE_TYPE_P (type)
6137 8842640 : || (TREE_CODE (type) == ARRAY_TYPE
6138 134069 : && COMPLETE_TYPE_P (TREE_TYPE (type)));
6139 : }
6140 :
6141 : /* Return true if the value of T could be represented as a poly_widest_int. */
6142 :
6143 : inline bool
6144 21013960876 : poly_int_tree_p (const_tree t)
6145 : {
6146 14767596385 : return (TREE_CODE (t) == INTEGER_CST || POLY_INT_CST_P (t));
6147 : }
6148 :
6149 : /* Return the bit size of BIT_FIELD_REF T, in cases where it is known
6150 : to be a poly_uint64. (This is always true at the gimple level.) */
6151 :
6152 : inline poly_uint64
6153 411880 : bit_field_size (const_tree t)
6154 : {
6155 411880 : return tree_to_poly_uint64 (TREE_OPERAND (t, 1));
6156 : }
6157 :
6158 : /* Return the starting bit offset of BIT_FIELD_REF T, in cases where it is
6159 : known to be a poly_uint64. (This is always true at the gimple level.) */
6160 :
6161 : inline poly_uint64
6162 1222264 : bit_field_offset (const_tree t)
6163 : {
6164 1222264 : return tree_to_poly_uint64 (TREE_OPERAND (t, 2));
6165 : }
6166 :
6167 : extern tree strip_float_extensions (tree);
6168 : extern bool really_constant_p (const_tree);
6169 : extern bool ptrdiff_tree_p (const_tree, poly_int64 *);
6170 : extern bool decl_address_invariant_p (const_tree);
6171 : extern bool decl_address_ip_invariant_p (const_tree);
6172 : extern bool int_fits_type_p (const_tree, const_tree)
6173 : ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2) ATTRIBUTE_PURE;
6174 : #ifndef GENERATOR_FILE
6175 : extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
6176 : #endif
6177 : extern bool variably_modified_type_p (tree, tree);
6178 : extern int tree_log2 (const_tree);
6179 : extern int tree_floor_log2 (const_tree);
6180 : extern unsigned int tree_ctz (const_tree);
6181 : extern int simple_cst_equal (const_tree, const_tree);
6182 :
6183 : namespace inchash
6184 : {
6185 :
6186 : extern void add_expr (const_tree, hash &, unsigned int = 0);
6187 :
6188 : }
6189 :
6190 : /* Compat version until all callers are converted. Return hash for
6191 : TREE with SEED. */
6192 863805287 : inline hashval_t iterative_hash_expr(const_tree tree, hashval_t seed)
6193 : {
6194 858388069 : inchash::hash hstate (seed);
6195 858388069 : inchash::add_expr (tree, hstate);
6196 855915082 : return hstate.end ();
6197 : }
6198 :
6199 : extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
6200 : extern bool type_list_equal (const_tree, const_tree);
6201 : extern bool chain_member (const_tree, const_tree);
6202 : extern void dump_tree_statistics (void);
6203 : extern void recompute_tree_invariant_for_addr_expr (tree);
6204 : extern bool needs_to_live_in_memory (const_tree);
6205 : extern tree reconstruct_complex_type (tree, tree);
6206 : extern bool real_onep (const_tree);
6207 : extern bool real_minus_onep (const_tree);
6208 : extern bool real_maybe_zerop (const_tree);
6209 : extern void init_ttree (void);
6210 : extern void build_common_tree_nodes (bool);
6211 : extern void build_common_builtin_nodes (void);
6212 : extern void tree_cc_finalize (void);
6213 : extern tree unsigned_integer_tree_node_for_type (const char *);
6214 : extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
6215 : extern tree build_nonstandard_boolean_type (unsigned HOST_WIDE_INT);
6216 : extern tree build_bitint_type (unsigned HOST_WIDE_INT, int);
6217 : extern tree build_range_type (tree, tree, tree);
6218 : extern tree build_nonshared_range_type (tree, tree, tree);
6219 : extern bool subrange_type_for_debug_p (const_tree, tree *, tree *);
6220 : extern HOST_WIDE_INT int_cst_value (const_tree);
6221 : extern tree tree_block (tree);
6222 : extern void tree_set_block (tree, tree);
6223 : extern location_t *block_nonartificial_location (tree);
6224 : extern location_t tree_nonartificial_location (tree);
6225 : extern location_t tree_inlined_location (tree, bool = true);
6226 : extern tree block_ultimate_origin (const_tree);
6227 : extern tree get_binfo_at_offset (tree, poly_int64, tree);
6228 : extern bool virtual_method_call_p (const_tree, bool = false);
6229 : extern tree obj_type_ref_class (const_tree ref, bool = false);
6230 : extern bool types_same_for_odr (const_tree type1, const_tree type2);
6231 : extern bool contains_bitfld_component_ref_p (const_tree);
6232 : extern bool block_may_fallthru (const_tree);
6233 : extern void using_eh_for_cleanups (void);
6234 : extern bool using_eh_for_cleanups_p (void);
6235 : extern const char *get_tree_code_name (enum tree_code);
6236 : extern void set_call_expr_flags (tree, int);
6237 : extern tree walk_tree_1 (tree*, walk_tree_fn, void*, hash_set<tree>*,
6238 : walk_tree_lh);
6239 : extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
6240 : walk_tree_lh);
6241 : #define walk_tree(a,b,c,d) \
6242 : walk_tree_1 (a, b, c, d, NULL)
6243 : #define walk_tree_without_duplicates(a,b,c) \
6244 : walk_tree_without_duplicates_1 (a, b, c, NULL)
6245 :
6246 : extern tree drop_tree_overflow (tree);
6247 :
6248 : /* Given a memory reference expression T, return its base address.
6249 : The base address of a memory reference expression is the main
6250 : object being referenced. */
6251 : extern tree get_base_address (tree t);
6252 :
6253 : /* Return a tree of sizetype representing the size, in bytes, of the element
6254 : of EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
6255 : extern tree array_ref_element_size (tree);
6256 :
6257 : /* Return a typenode for the "standard" C type with a given name. */
6258 : extern tree get_typenode_from_name (const char *);
6259 :
6260 : /* Return a tree representing the upper bound of the array mentioned in
6261 : EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
6262 : extern tree array_ref_up_bound (tree);
6263 :
6264 : /* Return a tree representing the lower bound of the array mentioned in
6265 : EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
6266 : extern tree array_ref_low_bound (tree);
6267 :
6268 : /* Returns true if REF is an array reference, a component reference,
6269 : or a memory reference to an array whose actual size might be larger
6270 : than its upper bound implies. */
6271 : extern bool array_ref_flexible_size_p (tree, bool * = NULL);
6272 :
6273 : /* Return a tree representing the offset, in bytes, of the field referenced
6274 : by EXP. This does not include any offset in DECL_FIELD_BIT_OFFSET. */
6275 : extern tree component_ref_field_offset (tree);
6276 :
6277 : /* Describes a "special" array member for a COMPONENT_REF. */
6278 : enum struct special_array_member
6279 : {
6280 : none, /* Not a special array member. */
6281 : int_0, /* Interior array member with zero elements. */
6282 : trail_0, /* Trailing array member with zero elements. */
6283 : trail_1, /* Trailing array member with one element. */
6284 : trail_n, /* Trailing array member with two or more elements. */
6285 : int_n /* Interior array member with one or more elements. */
6286 : };
6287 :
6288 : /* Determines the special array member type for a COMPONENT_REF. */
6289 : extern special_array_member component_ref_sam_type (tree);
6290 :
6291 : /* Return the size of the member referenced by the COMPONENT_REF, using
6292 : its initializer expression if necessary in order to determine the size
6293 : of an initialized flexible array member. The size might be zero for
6294 : an object with an uninitialized flexible array member or null if it
6295 : cannot be determined. */
6296 : extern tree component_ref_size (tree, special_array_member * = NULL);
6297 :
6298 : /* Return true if the given node is a call to a .ACCESS_WITH_SIZE
6299 : function. */
6300 : extern bool is_access_with_size_p (const_tree);
6301 :
6302 : /* Get the corresponding reference from the call to a .ACCESS_WITH_SIZE,
6303 : * i.e. the first argument of this call. Return NULL_TREE otherwise. */
6304 : extern tree get_ref_from_access_with_size (tree);
6305 :
6306 : extern int tree_map_base_eq (const void *, const void *);
6307 : extern unsigned int tree_map_base_hash (const void *);
6308 : extern bool tree_map_base_marked_p (const void *);
6309 : extern void DEBUG_FUNCTION verify_type (const_tree t);
6310 : extern bool gimple_canonical_types_compatible_p (const_tree, const_tree,
6311 : bool trust_type_canonical = true);
6312 : extern bool type_with_interoperable_signedness (const_tree);
6313 : extern bitmap get_nonnull_args (const_tree);
6314 : extern int get_range_pos_neg (tree, gimple * = NULL);
6315 :
6316 : /* Return true for a valid pair of new and delete operators. */
6317 : extern bool valid_new_delete_pair_p (tree, tree, bool * = NULL);
6318 :
6319 : /* Return whether the second argument is a subtree of the first one. */
6320 : extern bool find_tree (tree, tree);
6321 :
6322 : /* Return simplified tree code of type that is used for canonical type
6323 : merging. */
6324 : inline enum tree_code
6325 681487447 : tree_code_for_canonical_type_merging (enum tree_code code)
6326 : {
6327 : /* By C standard, each enumerated type shall be compatible with char,
6328 : a signed integer, or an unsigned integer. The choice of type is
6329 : implementation defined (in our case it depends on -fshort-enum).
6330 :
6331 : For this reason we make no distinction between ENUMERAL_TYPE and INTEGER
6332 : type and compare only by their signedness and precision. */
6333 677205845 : if (code == ENUMERAL_TYPE)
6334 : return INTEGER_TYPE;
6335 : /* To allow inter-operability between languages having references and
6336 : C, we consider reference types and pointers alike. Note that this is
6337 : not strictly necessary for C-Fortran 2008 interoperability because
6338 : Fortran define C_PTR type that needs to be compatible with C pointers
6339 : and we handle this one as ptr_type_node. */
6340 673031659 : if (code == REFERENCE_TYPE)
6341 39834524 : return POINTER_TYPE;
6342 : return code;
6343 : }
6344 :
6345 : /* Return true if get_alias_set care about TYPE_CANONICAL of given type.
6346 : We don't define the types for pointers, arrays and vectors. The reason is
6347 : that pointers are handled specially: ptr_type_node accesses conflict with
6348 : accesses to all other pointers. This is done by alias.cc.
6349 : Because alias sets of arrays and vectors are the same as types of their
6350 : elements, we can't compute canonical type either. Otherwise we could go
6351 : form void *[10] to int *[10] (because they are equivalent for canonical type
6352 : machinery) and get wrong TBAA. */
6353 :
6354 : inline bool
6355 263524737 : canonical_type_used_p (const_tree t)
6356 : {
6357 267615118 : return !(POINTER_TYPE_P (t)
6358 4240908 : || TREE_CODE (t) == ARRAY_TYPE
6359 : || TREE_CODE (t) == VECTOR_TYPE);
6360 : }
6361 :
6362 : /* Kinds of access to pass-by-reference arguments to functions. */
6363 : enum access_mode
6364 : {
6365 : access_none = 0,
6366 : access_read_only = 1,
6367 : access_write_only = 2,
6368 : access_read_write = access_read_only | access_write_only,
6369 : access_deferred = 4
6370 : };
6371 :
6372 : #define tree_map_eq tree_map_base_eq
6373 : extern unsigned int tree_map_hash (const void *);
6374 : #define tree_map_marked_p tree_map_base_marked_p
6375 :
6376 : #define tree_decl_map_eq tree_map_base_eq
6377 : extern unsigned int tree_decl_map_hash (const void *);
6378 : #define tree_decl_map_marked_p tree_map_base_marked_p
6379 :
6380 : struct tree_decl_map_cache_hasher : ggc_cache_ptr_hash<tree_decl_map>
6381 : {
6382 1362009849 : static hashval_t hash (tree_decl_map *m) { return tree_decl_map_hash (m); }
6383 : static bool
6384 1973127112 : equal (tree_decl_map *a, tree_decl_map *b)
6385 : {
6386 1973127112 : return tree_decl_map_eq (a, b);
6387 : }
6388 :
6389 : static int
6390 35556684 : keep_cache_entry (tree_decl_map *&m)
6391 : {
6392 35556684 : return ggc_marked_p (m->base.from);
6393 : }
6394 : };
6395 :
6396 : #define tree_int_map_eq tree_map_base_eq
6397 : #define tree_int_map_hash tree_map_base_hash
6398 : #define tree_int_map_marked_p tree_map_base_marked_p
6399 :
6400 : #define tree_vec_map_eq tree_map_base_eq
6401 : #define tree_vec_map_hash tree_decl_map_hash
6402 : #define tree_vec_map_marked_p tree_map_base_marked_p
6403 :
6404 : struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash<tree_vec_map>
6405 : {
6406 7092779 : static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); }
6407 :
6408 : static bool
6409 8346271 : equal (tree_vec_map *a, tree_vec_map *b)
6410 : {
6411 8346271 : return a->base.from == b->base.from;
6412 : }
6413 :
6414 : static int
6415 920789 : keep_cache_entry (tree_vec_map *&m)
6416 : {
6417 920789 : return ggc_marked_p (m->base.from);
6418 : }
6419 : };
6420 :
6421 : /* Hasher for tree decls. Pointer equality is enough here, but the DECL_UID
6422 : is a better hash than the pointer value and gives a predictable traversal
6423 : order. Additionally it can be used across PCH save/restore. */
6424 : struct tree_decl_hash : ggc_ptr_hash <tree_node>
6425 : {
6426 : static inline hashval_t hash (tree);
6427 : };
6428 :
6429 : inline hashval_t
6430 7778948093 : tree_decl_hash::hash (tree t)
6431 : {
6432 7778948093 : return DECL_UID (t);
6433 : }
6434 :
6435 : /* Similarly for types. Uses TYPE_UID as hash function. */
6436 : struct tree_type_hash : ggc_ptr_hash <tree_node>
6437 : {
6438 : static inline hashval_t hash (tree);
6439 : };
6440 :
6441 : inline hashval_t
6442 847759 : tree_type_hash::hash (tree t)
6443 : {
6444 847759 : return TYPE_UID (t);
6445 : }
6446 :
6447 : /* Hash for SSA_NAMEs in the same function. Pointer equality is enough
6448 : here, but the SSA_NAME_VERSION is a better hash than the pointer
6449 : value and gives a predictable traversal order. */
6450 : struct tree_ssa_name_hash : ggc_ptr_hash <tree_node>
6451 : {
6452 : static inline hashval_t hash (tree);
6453 : };
6454 :
6455 : inline hashval_t
6456 240448 : tree_ssa_name_hash::hash (tree t)
6457 : {
6458 240448 : return SSA_NAME_VERSION (t);
6459 : }
6460 :
6461 : /* Hasher for general trees, based on their TREE_HASH. */
6462 : struct tree_hash : ggc_ptr_hash <tree_node>
6463 : {
6464 : static hashval_t hash (tree);
6465 : };
6466 :
6467 : inline hashval_t
6468 87584 : tree_hash::hash (tree t)
6469 : {
6470 87584 : return TREE_HASH (t);
6471 : }
6472 :
6473 : /* A hash_map of two trees for use with GTY((cache)). Garbage collection for
6474 : such a map will not mark keys, and will mark values if the key is already
6475 : marked. */
6476 : struct tree_cache_traits
6477 : : simple_cache_map_traits<default_hash_traits<tree>, tree> { };
6478 : typedef hash_map<tree,tree,tree_cache_traits> tree_cache_map;
6479 :
6480 : /* Similarly, but use DECL_UID as hash function rather than pointer hashing.
6481 : This is for hash_maps from decls to trees that need to work across PCH. */
6482 : struct decl_tree_cache_traits
6483 : : simple_cache_map_traits<tree_decl_hash, tree> { };
6484 : typedef hash_map<tree,tree,decl_tree_cache_traits> decl_tree_cache_map;
6485 :
6486 : /* Similarly, but use TYPE_UID as hash function rather than pointer hashing.
6487 : This is for hash_maps from types to trees that need to work across PCH. */
6488 : struct type_tree_cache_traits
6489 : : simple_cache_map_traits<tree_type_hash, tree> { };
6490 : typedef hash_map<tree,tree,type_tree_cache_traits> type_tree_cache_map;
6491 :
6492 : /* Similarly to decl_tree_cache_map, but without caching. */
6493 : struct decl_tree_traits
6494 : : simple_hashmap_traits<tree_decl_hash, tree> { };
6495 : typedef hash_map<tree,tree,decl_tree_traits> decl_tree_map;
6496 :
6497 : /* Initialize the abstract argument list iterator object ITER with the
6498 : arguments from CALL_EXPR node EXP. */
6499 : inline void
6500 211397235 : init_call_expr_arg_iterator (tree exp, call_expr_arg_iterator *iter)
6501 : {
6502 211397235 : iter->t = exp;
6503 211397235 : iter->n = call_expr_nargs (exp);
6504 211397235 : iter->i = 0;
6505 211397235 : }
6506 :
6507 : inline void
6508 2208132 : init_const_call_expr_arg_iterator (const_tree exp, const_call_expr_arg_iterator *iter)
6509 : {
6510 2208132 : iter->t = exp;
6511 2208132 : iter->n = call_expr_nargs (exp);
6512 2208132 : iter->i = 0;
6513 2208132 : }
6514 :
6515 : /* Return the next argument from abstract argument list iterator object ITER,
6516 : and advance its state. Return NULL_TREE if there are no more arguments. */
6517 : inline tree
6518 312335097 : next_call_expr_arg (call_expr_arg_iterator *iter)
6519 : {
6520 312335097 : tree result;
6521 312335097 : if (iter->i >= iter->n)
6522 : return NULL_TREE;
6523 150100805 : result = CALL_EXPR_ARG (iter->t, iter->i);
6524 150100805 : iter->i++;
6525 150100805 : return result;
6526 : }
6527 :
6528 : inline const_tree
6529 4318281 : next_const_call_expr_arg (const_call_expr_arg_iterator *iter)
6530 : {
6531 4318281 : const_tree result;
6532 4318281 : if (iter->i >= iter->n)
6533 : return NULL_TREE;
6534 3497366 : result = CALL_EXPR_ARG (iter->t, iter->i);
6535 3497366 : iter->i++;
6536 3497366 : return result;
6537 : }
6538 :
6539 : /* Initialize the abstract argument list iterator object ITER, then advance
6540 : past and return the first argument. Useful in for expressions, e.g.
6541 : for (arg = first_call_expr_arg (exp, &iter); arg;
6542 : arg = next_call_expr_arg (&iter)) */
6543 : inline tree
6544 162234519 : first_call_expr_arg (tree exp, call_expr_arg_iterator *iter)
6545 : {
6546 162234519 : init_call_expr_arg_iterator (exp, iter);
6547 162234519 : return next_call_expr_arg (iter);
6548 : }
6549 :
6550 : inline const_tree
6551 1045634 : first_const_call_expr_arg (const_tree exp, const_call_expr_arg_iterator *iter)
6552 : {
6553 1045634 : init_const_call_expr_arg_iterator (exp, iter);
6554 1045634 : return next_const_call_expr_arg (iter);
6555 : }
6556 :
6557 : /* Test whether there are more arguments in abstract argument list iterator
6558 : ITER, without changing its state. */
6559 : inline bool
6560 26240878 : more_call_expr_args_p (const call_expr_arg_iterator *iter)
6561 : {
6562 26240878 : return (iter->i < iter->n);
6563 : }
6564 :
6565 : /* Iterate through each argument ARG of CALL_EXPR CALL, using variable ITER
6566 : (of type call_expr_arg_iterator) to hold the iteration state. */
6567 : #define FOR_EACH_CALL_EXPR_ARG(arg, iter, call) \
6568 : for ((arg) = first_call_expr_arg ((call), &(iter)); (arg); \
6569 : (arg) = next_call_expr_arg (&(iter)))
6570 :
6571 : #define FOR_EACH_CONST_CALL_EXPR_ARG(arg, iter, call) \
6572 : for ((arg) = first_const_call_expr_arg ((call), &(iter)); (arg); \
6573 : (arg) = next_const_call_expr_arg (&(iter)))
6574 :
6575 : /* Return true if tree node T is a language-specific node. */
6576 : inline bool
6577 171067865 : is_lang_specific (const_tree t)
6578 : {
6579 171067865 : return TREE_CODE (t) == LANG_TYPE || TREE_CODE (t) >= NUM_TREE_CODES;
6580 : }
6581 :
6582 : /* Valid builtin number. */
6583 : #define BUILTIN_VALID_P(FNCODE) \
6584 : (IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1))
6585 :
6586 : /* Obtain a pointer to the identifier string holding the asm name for
6587 : BUILTIN, a BUILT_IN code. This is handy if the target
6588 : mangles/overrides the function name that implements the
6589 : builtin. */
6590 : #define BUILTIN_ASM_NAME_PTR(BUILTIN) \
6591 : (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (builtin_decl_explicit (BUILTIN))))
6592 :
6593 : /* Return the tree node for an explicit standard builtin function or NULL. */
6594 : inline tree
6595 350701993 : builtin_decl_explicit (enum built_in_function fncode)
6596 : {
6597 327783546 : gcc_checking_assert (BUILTIN_VALID_P (fncode));
6598 :
6599 334870692 : return builtin_info[(size_t)fncode].decl;
6600 : }
6601 :
6602 : /* Return the tree node for an implicit builtin function or NULL. */
6603 : inline tree
6604 941754 : builtin_decl_implicit (enum built_in_function fncode)
6605 : {
6606 941754 : size_t uns_fncode = (size_t)fncode;
6607 431169 : gcc_checking_assert (BUILTIN_VALID_P (fncode));
6608 :
6609 941754 : if (!builtin_info[uns_fncode].implicit_p)
6610 : return NULL_TREE;
6611 :
6612 940026 : return builtin_info[uns_fncode].decl;
6613 : }
6614 :
6615 : /* For BUILTIN_UNREACHABLE, use one of these or
6616 : gimple_build_builtin_unreachable instead of one of the above. */
6617 : extern tree builtin_decl_unreachable ();
6618 : extern tree build_builtin_unreachable (location_t);
6619 :
6620 : /* Set explicit builtin function nodes and whether it is an implicit
6621 : function. */
6622 :
6623 : inline void
6624 378146156 : set_builtin_decl (enum built_in_function fncode, tree decl, bool implicit_p)
6625 : {
6626 378146156 : size_t ufncode = (size_t)fncode;
6627 :
6628 378146156 : gcc_checking_assert (BUILTIN_VALID_P (fncode)
6629 : && (decl != NULL_TREE || !implicit_p));
6630 :
6631 378146156 : builtin_info[ufncode].decl = decl;
6632 378146156 : builtin_info[ufncode].implicit_p = implicit_p;
6633 378146156 : builtin_info[ufncode].declared_p = false;
6634 378146156 : }
6635 :
6636 : /* Set the implicit flag for a builtin function. */
6637 :
6638 : inline void
6639 1328659 : set_builtin_decl_implicit_p (enum built_in_function fncode, bool implicit_p)
6640 : {
6641 1328659 : size_t uns_fncode = (size_t)fncode;
6642 :
6643 1328659 : gcc_checking_assert (BUILTIN_VALID_P (fncode)
6644 : && builtin_info[uns_fncode].decl != NULL_TREE);
6645 :
6646 1328659 : builtin_info[uns_fncode].implicit_p = implicit_p;
6647 1328659 : }
6648 :
6649 : /* Set the declared flag for a builtin function. */
6650 :
6651 : inline void
6652 8094944 : set_builtin_decl_declared_p (enum built_in_function fncode, bool declared_p)
6653 : {
6654 8094944 : size_t uns_fncode = (size_t)fncode;
6655 :
6656 8094944 : gcc_checking_assert (BUILTIN_VALID_P (fncode)
6657 : && builtin_info[uns_fncode].decl != NULL_TREE);
6658 :
6659 8094944 : builtin_info[uns_fncode].declared_p = declared_p;
6660 8094944 : }
6661 :
6662 : /* Return whether the standard builtin function can be used as an explicit
6663 : function. */
6664 :
6665 : inline bool
6666 22489095 : builtin_decl_explicit_p (enum built_in_function fncode)
6667 : {
6668 22489095 : gcc_checking_assert (BUILTIN_VALID_P (fncode));
6669 19770515 : return (builtin_info[(size_t)fncode].decl != NULL_TREE);
6670 : }
6671 :
6672 : /* Return whether the standard builtin function can be used implicitly. */
6673 :
6674 : inline bool
6675 161181 : builtin_decl_implicit_p (enum built_in_function fncode)
6676 : {
6677 161181 : size_t uns_fncode = (size_t)fncode;
6678 :
6679 161181 : gcc_checking_assert (BUILTIN_VALID_P (fncode));
6680 161181 : return (builtin_info[uns_fncode].decl != NULL_TREE
6681 161175 : && builtin_info[uns_fncode].implicit_p);
6682 : }
6683 :
6684 : /* Return whether the standard builtin function was declared. */
6685 :
6686 : inline bool
6687 3997868 : builtin_decl_declared_p (enum built_in_function fncode)
6688 : {
6689 3997868 : size_t uns_fncode = (size_t)fncode;
6690 :
6691 3997868 : gcc_checking_assert (BUILTIN_VALID_P (fncode));
6692 3997868 : return (builtin_info[uns_fncode].decl != NULL_TREE
6693 3997868 : && builtin_info[uns_fncode].declared_p);
6694 : }
6695 :
6696 : /* Determine if the function identified by FNDECL is one that
6697 : makes sense to match by name, for those places where we detect
6698 : "magic" functions by name.
6699 :
6700 : Return true if FNDECL has a name and is an extern fndecl at file scope.
6701 : FNDECL must be a non-NULL decl.
6702 :
6703 : Avoid using this, as it's generally better to use attributes rather
6704 : than to check for functions by name. */
6705 :
6706 : inline bool
6707 4627265402 : maybe_special_function_p (const_tree fndecl)
6708 : {
6709 4627265402 : tree name_decl = DECL_NAME (fndecl);
6710 4627265402 : if (name_decl
6711 : /* Exclude functions not at the file scope, or not `extern',
6712 : since they are not the magic functions we would otherwise
6713 : think they are. */
6714 4627265402 : && (DECL_CONTEXT (fndecl) == NULL_TREE
6715 2994196268 : || TREE_CODE (DECL_CONTEXT (fndecl)) == TRANSLATION_UNIT_DECL)
6716 7951113388 : && TREE_PUBLIC (fndecl))
6717 3162472550 : return true;
6718 : return false;
6719 : }
6720 :
6721 : /* Return true if T (assumed to be a DECL) is a global variable.
6722 : A variable is considered global if its storage is not automatic. */
6723 :
6724 : inline bool
6725 2685246516 : is_global_var (const_tree t)
6726 : {
6727 2685246516 : return (TREE_STATIC (t) || DECL_EXTERNAL (t));
6728 : }
6729 :
6730 : /* Return true if VAR may be aliased. A variable is considered as
6731 : maybe aliased if it has its address taken by the local TU
6732 : or possibly by another TU and might be modified through a pointer. */
6733 :
6734 : inline bool
6735 725632202 : may_be_aliased (const_tree var)
6736 : {
6737 725632202 : return (TREE_CODE (var) != CONST_DECL
6738 725076936 : && (TREE_PUBLIC (var)
6739 698813979 : || DECL_EXTERNAL (var)
6740 698813868 : || TREE_ADDRESSABLE (var))
6741 979420870 : && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
6742 36297832 : && (TREE_READONLY (var)
6743 31058067 : || (TREE_CODE (var) == VAR_DECL
6744 30217950 : && DECL_NONALIASED (var)))));
6745 : }
6746 :
6747 : /* Return pointer to optimization flags of FNDECL. */
6748 : inline struct cl_optimization *
6749 3279364633 : opts_for_fn (const_tree fndecl)
6750 : {
6751 3279364633 : tree fn_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl);
6752 3279364633 : if (fn_opts == NULL_TREE)
6753 2983871840 : fn_opts = optimization_default_node;
6754 3279364633 : return TREE_OPTIMIZATION (fn_opts);
6755 : }
6756 :
6757 : /* Return pointer to target flags of FNDECL. */
6758 : inline cl_target_option *
6759 4174038 : target_opts_for_fn (const_tree fndecl)
6760 : {
6761 4174038 : tree fn_opts = DECL_FUNCTION_SPECIFIC_TARGET (fndecl);
6762 4174038 : if (fn_opts == NULL_TREE)
6763 2379490 : fn_opts = target_option_default_node;
6764 6553528 : return fn_opts == NULL_TREE ? NULL : TREE_TARGET_OPTION (fn_opts);
6765 : }
6766 :
6767 : /* opt flag for function FNDECL, e.g. opts_for_fn (fndecl, optimize) is
6768 : the optimization level of function fndecl. */
6769 : #define opt_for_fn(fndecl, opt) (opts_for_fn (fndecl)->x_##opt)
6770 :
6771 : /* For anonymous aggregate types, we need some sort of name to
6772 : hold on to. In practice, this should not appear, but it should
6773 : not be harmful if it does. Identifiers returned will be
6774 : IDENTIFIER_ANON_P. */
6775 : extern tree make_anon_name ();
6776 :
6777 : /* The tree and const_tree overload templates. */
6778 : namespace wi
6779 : {
6780 : class unextended_tree
6781 : {
6782 : private:
6783 : const_tree m_t;
6784 :
6785 : public:
6786 : unextended_tree () {}
6787 1307205142 : unextended_tree (const_tree t) : m_t (t) {}
6788 :
6789 : unsigned int get_precision () const;
6790 : const HOST_WIDE_INT *get_val () const;
6791 : unsigned int get_len () const;
6792 : const_tree get_tree () const { return m_t; }
6793 : };
6794 :
6795 : template <>
6796 : struct int_traits <unextended_tree>
6797 : {
6798 : static const enum precision_type precision_type = VAR_PRECISION;
6799 : static const bool host_dependent_precision = false;
6800 : static const bool is_sign_extended = false;
6801 : static const bool needs_write_val_arg = false;
6802 : };
6803 :
6804 : template <int N>
6805 : class extended_tree
6806 : {
6807 : private:
6808 : const_tree m_t;
6809 :
6810 : public:
6811 : extended_tree () {}
6812 : extended_tree (const_tree);
6813 :
6814 : unsigned int get_precision () const;
6815 : const HOST_WIDE_INT *get_val () const;
6816 : unsigned int get_len () const;
6817 : const_tree get_tree () const { return m_t; }
6818 : };
6819 :
6820 : template <int N>
6821 : struct int_traits <extended_tree <N> >
6822 : {
6823 : static const enum precision_type precision_type
6824 : = N == ADDR_MAX_PRECISION ? INL_CONST_PRECISION : CONST_PRECISION;
6825 : static const bool host_dependent_precision = false;
6826 : static const bool is_sign_extended = true;
6827 : static const bool needs_write_val_arg = false;
6828 : static const unsigned int precision = N;
6829 : };
6830 :
6831 : typedef extended_tree <WIDEST_INT_MAX_PRECISION> widest_extended_tree;
6832 : typedef extended_tree <ADDR_MAX_PRECISION> offset_extended_tree;
6833 :
6834 : typedef const generic_wide_int <widest_extended_tree> tree_to_widest_ref;
6835 : typedef const generic_wide_int <offset_extended_tree> tree_to_offset_ref;
6836 : typedef const generic_wide_int<wide_int_ref_storage<false, false> >
6837 : tree_to_wide_ref;
6838 :
6839 : tree_to_widest_ref to_widest (const_tree);
6840 : tree_to_offset_ref to_offset (const_tree);
6841 : tree_to_wide_ref to_wide (const_tree);
6842 : wide_int to_wide (const_tree, unsigned int);
6843 :
6844 : typedef const poly_int <NUM_POLY_INT_COEFFS,
6845 : generic_wide_int <widest_extended_tree> >
6846 : tree_to_poly_widest_ref;
6847 : typedef const poly_int <NUM_POLY_INT_COEFFS,
6848 : generic_wide_int <offset_extended_tree> >
6849 : tree_to_poly_offset_ref;
6850 : typedef const poly_int <NUM_POLY_INT_COEFFS,
6851 : generic_wide_int <unextended_tree> >
6852 : tree_to_poly_wide_ref;
6853 :
6854 : tree_to_poly_widest_ref to_poly_widest (const_tree);
6855 : tree_to_poly_offset_ref to_poly_offset (const_tree);
6856 : tree_to_poly_wide_ref to_poly_wide (const_tree);
6857 :
6858 : template <int N>
6859 : struct ints_for <generic_wide_int <extended_tree <N> >, INL_CONST_PRECISION>
6860 : {
6861 : typedef generic_wide_int <extended_tree <N> > extended;
6862 : static extended zero (const extended &);
6863 : };
6864 :
6865 : template <int N>
6866 : struct ints_for <generic_wide_int <extended_tree <N> >, CONST_PRECISION>
6867 : {
6868 : typedef generic_wide_int <extended_tree <N> > extended;
6869 : static extended zero (const extended &);
6870 : };
6871 :
6872 : template <>
6873 : struct ints_for <generic_wide_int <unextended_tree>, VAR_PRECISION>
6874 : {
6875 : typedef generic_wide_int <unextended_tree> unextended;
6876 : static unextended zero (const unextended &);
6877 : };
6878 : }
6879 :
6880 : /* Used to convert a tree to a widest2_int like this:
6881 : widest2_int foo = widest2_int_cst (some_tree). */
6882 : typedef generic_wide_int <wi::extended_tree <WIDEST_INT_MAX_PRECISION * 2> >
6883 : widest2_int_cst;
6884 :
6885 : /* Refer to INTEGER_CST T as though it were a widest_int.
6886 :
6887 : This function gives T's actual numerical value, influenced by the
6888 : signedness of its type. For example, a signed byte with just the
6889 : top bit set would be -128 while an unsigned byte with the same
6890 : bit pattern would be 128.
6891 :
6892 : This is the right choice when operating on groups of INTEGER_CSTs
6893 : that might have different signedness or precision. It is also the
6894 : right choice in code that specifically needs an approximation of
6895 : infinite-precision arithmetic instead of normal modulo arithmetic.
6896 :
6897 : The approximation of infinite precision is good enough for realistic
6898 : numbers of additions and subtractions of INTEGER_CSTs (where
6899 : "realistic" includes any number less than 1 << 31) but it cannot
6900 : represent the result of multiplying the two largest supported
6901 : INTEGER_CSTs. The overflow-checking form of wi::mul provides a way
6902 : of multiplying two arbitrary INTEGER_CSTs and checking that the
6903 : result is representable as a widest_int.
6904 :
6905 : Note that any overflow checking done on these values is relative to
6906 : the range of widest_int rather than the range of a TREE_TYPE.
6907 :
6908 : Calling this function should have no overhead in release builds,
6909 : so it is OK to call it several times for the same tree. If it is
6910 : useful for readability reasons to reduce the number of calls,
6911 : it is more efficient to use:
6912 :
6913 : wi::tree_to_widest_ref wt = wi::to_widest (t);
6914 :
6915 : instead of:
6916 :
6917 : widest_int wt = wi::to_widest (t). */
6918 :
6919 : inline wi::tree_to_widest_ref
6920 4213938036 : wi::to_widest (const_tree t)
6921 : {
6922 13658354361 : return t;
6923 : }
6924 :
6925 : /* Refer to INTEGER_CST T as though it were an offset_int.
6926 :
6927 : This function is an optimisation of wi::to_widest for cases
6928 : in which T is known to be a bit or byte count in the range
6929 : (-(2 ^ (N + BITS_PER_UNIT)), 2 ^ (N + BITS_PER_UNIT)), where N is
6930 : the target's address size in bits.
6931 :
6932 : This is the right choice when operating on bit or byte counts as
6933 : untyped numbers rather than M-bit values. The wi::to_widest comments
6934 : about addition, subtraction and multiplication apply here: sequences
6935 : of 1 << 31 additions and subtractions do not induce overflow, but
6936 : multiplying the largest sizes might. Again,
6937 :
6938 : wi::tree_to_offset_ref wt = wi::to_offset (t);
6939 :
6940 : is more efficient than:
6941 :
6942 : offset_int wt = wi::to_offset (t). */
6943 :
6944 : inline wi::tree_to_offset_ref
6945 3673318679 : wi::to_offset (const_tree t)
6946 : {
6947 3432173348 : return t;
6948 : }
6949 :
6950 : /* Refer to INTEGER_CST T as though it were a wide_int.
6951 :
6952 : In contrast to the approximation of infinite-precision numbers given
6953 : by wi::to_widest and wi::to_offset, this function treats T as a
6954 : signless collection of N bits, where N is the precision of T's type.
6955 : As with machine registers, signedness is determined by the operation
6956 : rather than the operands; for example, there is a distinction between
6957 : signed and unsigned division.
6958 :
6959 : This is the right choice when operating on values with the same type
6960 : using normal modulo arithmetic. The overflow-checking forms of things
6961 : like wi::add check whether the result can be represented in T's type.
6962 :
6963 : Calling this function should have no overhead in release builds,
6964 : so it is OK to call it several times for the same tree. If it is
6965 : useful for readability reasons to reduce the number of calls,
6966 : it is more efficient to use:
6967 :
6968 : wi::tree_to_wide_ref wt = wi::to_wide (t);
6969 :
6970 : instead of:
6971 :
6972 : wide_int wt = wi::to_wide (t). */
6973 :
6974 : inline wi::tree_to_wide_ref
6975 16940089978 : wi::to_wide (const_tree t)
6976 : {
6977 33880179956 : return wi::storage_ref (&TREE_INT_CST_ELT (t, 0), TREE_INT_CST_NUNITS (t),
6978 16940089978 : TYPE_PRECISION (TREE_TYPE (t)));
6979 : }
6980 :
6981 : /* Convert INTEGER_CST T to a wide_int of precision PREC, extending or
6982 : truncating as necessary. When extending, use sign extension if T's
6983 : type is signed and zero extension if T's type is unsigned. */
6984 :
6985 : inline wide_int
6986 1576850576 : wi::to_wide (const_tree t, unsigned int prec)
6987 : {
6988 1576850576 : return wide_int::from (wi::to_wide (t), prec, TYPE_SIGN (TREE_TYPE (t)));
6989 : }
6990 :
6991 : template <int N>
6992 27849526359 : inline wi::extended_tree <N>::extended_tree (const_tree t)
6993 27849526359 : : m_t (t)
6994 : {
6995 27849526359 : gcc_checking_assert (TYPE_PRECISION (TREE_TYPE (t)) <= N);
6996 27849526359 : }
6997 :
6998 : template <int N>
6999 : inline unsigned int
7000 : wi::extended_tree <N>::get_precision () const
7001 : {
7002 : return N;
7003 : }
7004 :
7005 : template <int N>
7006 : inline const HOST_WIDE_INT *
7007 27995336703 : wi::extended_tree <N>::get_val () const
7008 : {
7009 27995336703 : return &TREE_INT_CST_ELT (m_t, 0);
7010 : }
7011 :
7012 : template <int N>
7013 : inline unsigned int
7014 27980642616 : wi::extended_tree <N>::get_len () const
7015 : {
7016 : if (N == ADDR_MAX_PRECISION)
7017 : {
7018 : /* to_offset can only be applied to trees that are offset_int-sized
7019 : or smaller. EXT_LEN is correct if it fits, otherwise the constant
7020 : must be exactly the precision of offset_int and so LEN is correct. */
7021 11159901202 : unsigned int ext_len = TREE_INT_CST_EXT_NUNITS (m_t);
7022 11159901202 : if (ext_len <= OFFSET_INT_ELTS)
7023 : return ext_len;
7024 708 : return TREE_INT_CST_NUNITS (m_t);
7025 : }
7026 : else if (N >= WIDEST_INT_MAX_PRECISION)
7027 16820741414 : return TREE_INT_CST_EXT_NUNITS (m_t);
7028 : else
7029 : /* This class is designed to be used for specific output precisions
7030 : and needs to be as fast as possible, so there is no fallback for
7031 : other casees. */
7032 : gcc_unreachable ();
7033 : }
7034 :
7035 : inline unsigned int
7036 2684750603 : wi::unextended_tree::get_precision () const
7037 : {
7038 2684750603 : return TYPE_PRECISION (TREE_TYPE (m_t));
7039 : }
7040 :
7041 : inline const HOST_WIDE_INT *
7042 1346412723 : wi::unextended_tree::get_val () const
7043 : {
7044 1346412723 : return &TREE_INT_CST_ELT (m_t, 0);
7045 : }
7046 :
7047 : inline unsigned int
7048 1338887323 : wi::unextended_tree::get_len () const
7049 : {
7050 1338887323 : return TREE_INT_CST_NUNITS (m_t);
7051 : }
7052 :
7053 : /* Return the value of a POLY_INT_CST in its native precision. */
7054 :
7055 : inline wi::tree_to_poly_wide_ref
7056 0 : poly_int_cst_value (const_tree x)
7057 : {
7058 0 : poly_int <NUM_POLY_INT_COEFFS, generic_wide_int <wi::unextended_tree> > res;
7059 0 : for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
7060 0 : res.coeffs[i] = POLY_INT_CST_COEFF (x, i);
7061 0 : return res;
7062 : }
7063 :
7064 : /* Access INTEGER_CST or POLY_INT_CST tree T as if it were a
7065 : poly_widest_int. See wi::to_widest for more details. */
7066 :
7067 : inline wi::tree_to_poly_widest_ref
7068 103625070 : wi::to_poly_widest (const_tree t)
7069 : {
7070 81874857 : if (POLY_INT_CST_P (t))
7071 : {
7072 : poly_int <NUM_POLY_INT_COEFFS,
7073 : generic_wide_int <widest_extended_tree> > res;
7074 : for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
7075 : res.coeffs[i] = POLY_INT_CST_COEFF (t, i);
7076 : return res;
7077 : }
7078 81874760 : return t;
7079 : }
7080 :
7081 : /* Access INTEGER_CST or POLY_INT_CST tree T as if it were a
7082 : poly_offset_int. See wi::to_offset for more details. */
7083 :
7084 : inline wi::tree_to_poly_offset_ref
7085 7421108984 : wi::to_poly_offset (const_tree t)
7086 : {
7087 2109005435 : if (POLY_INT_CST_P (t))
7088 : {
7089 : poly_int <NUM_POLY_INT_COEFFS,
7090 : generic_wide_int <offset_extended_tree> > res;
7091 : for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
7092 : res.coeffs[i] = POLY_INT_CST_COEFF (t, i);
7093 : return res;
7094 : }
7095 6482695733 : return t;
7096 : }
7097 :
7098 : /* Access INTEGER_CST or POLY_INT_CST tree T as if it were a
7099 : poly_wide_int. See wi::to_wide for more details. */
7100 :
7101 : inline wi::tree_to_poly_wide_ref
7102 1307205142 : wi::to_poly_wide (const_tree t)
7103 : {
7104 1307205142 : if (POLY_INT_CST_P (t))
7105 : return poly_int_cst_value (t);
7106 1307205142 : return t;
7107 : }
7108 :
7109 : /* The precision of extended_tree does not depend on the type of the tree,
7110 : so any zero INTEGER_CST is a valid zero. */
7111 : template <int N>
7112 : inline generic_wide_int <wi::extended_tree <N> >
7113 : wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
7114 : wi::INL_CONST_PRECISION>::zero (const extended &)
7115 : {
7116 : return integer_zero_node;
7117 : }
7118 :
7119 : template <int N>
7120 : inline generic_wide_int <wi::extended_tree <N> >
7121 : wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
7122 : wi::CONST_PRECISION>::zero (const extended &)
7123 : {
7124 : return integer_zero_node;
7125 : }
7126 :
7127 : inline generic_wide_int <wi::unextended_tree>
7128 : wi::ints_for <generic_wide_int <wi::unextended_tree>,
7129 : wi::VAR_PRECISION>::zero (const unextended &x)
7130 : {
7131 : return build_zero_cst (TREE_TYPE (x.get_tree ()));
7132 : }
7133 :
7134 : namespace wi
7135 : {
7136 : template <typename T>
7137 : bool fits_to_boolean_p (const T &x, const_tree);
7138 :
7139 : template <typename T>
7140 : bool fits_to_tree_p (const T &x, const_tree);
7141 :
7142 : wide_int min_value (const_tree);
7143 : wide_int max_value (const_tree);
7144 : #ifndef GENERATOR_FILE
7145 : wide_int from_mpz (const_tree, mpz_t, bool);
7146 : #endif
7147 : }
7148 :
7149 : template <typename T>
7150 : bool
7151 5307405 : wi::fits_to_boolean_p (const T &x, const_tree type)
7152 : {
7153 : typedef typename poly_int_traits<T>::int_type int_type;
7154 5307405 : return (known_eq (x, int_type (0))
7155 5347004 : || known_eq (x, int_type (TYPE_UNSIGNED (type) ? 1 : -1)));
7156 : }
7157 :
7158 : template <typename T>
7159 : bool
7160 3048406257 : wi::fits_to_tree_p (const T &x, const_tree type)
7161 : {
7162 : /* Non-standard boolean types can have arbitrary precision but various
7163 : transformations assume that they can only take values 0 and +/-1. */
7164 3048406257 : if (TREE_CODE (type) == BOOLEAN_TYPE)
7165 4020981 : return fits_to_boolean_p (x, type);
7166 :
7167 3044385276 : if (TYPE_UNSIGNED (type))
7168 2729414961 : return known_eq (x, zext (x, TYPE_PRECISION (type)));
7169 : else
7170 314970315 : return known_eq (x, sext (x, TYPE_PRECISION (type)));
7171 : }
7172 :
7173 : /* Produce the smallest number that is represented in TYPE. The precision
7174 : and sign are taken from TYPE. */
7175 : inline wide_int
7176 87401584 : wi::min_value (const_tree type)
7177 : {
7178 87401584 : return min_value (TYPE_PRECISION (type), TYPE_SIGN (type));
7179 : }
7180 :
7181 : /* Produce the largest number that is represented in TYPE. The precision
7182 : and sign are taken from TYPE. */
7183 : inline wide_int
7184 88024824 : wi::max_value (const_tree type)
7185 : {
7186 88024824 : return max_value (TYPE_PRECISION (type), TYPE_SIGN (type));
7187 : }
7188 :
7189 : /* Return true if INTEGER_CST T1 is less than INTEGER_CST T2,
7190 : extending both according to their respective TYPE_SIGNs. */
7191 :
7192 : inline bool
7193 1501322502 : tree_int_cst_lt (const_tree t1, const_tree t2)
7194 : {
7195 1501322502 : return wi::to_widest (t1) < wi::to_widest (t2);
7196 : }
7197 :
7198 : /* Return true if INTEGER_CST T1 is less than or equal to INTEGER_CST T2,
7199 : extending both according to their respective TYPE_SIGNs. */
7200 :
7201 : inline bool
7202 7661679 : tree_int_cst_le (const_tree t1, const_tree t2)
7203 : {
7204 7661679 : return wi::to_widest (t1) <= wi::to_widest (t2);
7205 : }
7206 :
7207 : /* Returns -1 if T1 < T2, 0 if T1 == T2, and 1 if T1 > T2. T1 and T2
7208 : are both INTEGER_CSTs and their values are extended according to their
7209 : respective TYPE_SIGNs. */
7210 :
7211 : inline int
7212 235393407 : tree_int_cst_compare (const_tree t1, const_tree t2)
7213 : {
7214 235393407 : return wi::cmps (wi::to_widest (t1), wi::to_widest (t2));
7215 : }
7216 :
7217 : /* FIXME - These declarations belong in builtins.h, expr.h and emit-rtl.h,
7218 : but none of these files are allowed to be included from front ends.
7219 : They should be split in two. One suitable for the FEs, the other suitable
7220 : for the BE. */
7221 :
7222 : /* Assign the RTX to declaration. */
7223 : extern void set_decl_rtl (tree, rtx);
7224 : extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
7225 :
7226 : /* Given an expression EXP that is a handled_component_p,
7227 : look for the ultimate containing object, which is returned and specify
7228 : the access position and size. */
7229 : extern tree get_inner_reference (tree, poly_int64 *, poly_int64 *,
7230 : tree *, machine_mode *, int *, int *, int *);
7231 :
7232 : extern tree build_personality_function (const char *);
7233 :
7234 : struct GTY(()) int_n_trees_t {
7235 : /* These parts are initialized at runtime */
7236 : tree signed_type;
7237 : tree unsigned_type;
7238 : };
7239 :
7240 : /* This is also in machmode.h */
7241 : extern bool int_n_enabled_p[NUM_INT_N_ENTS];
7242 : extern GTY(()) struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS];
7243 :
7244 : /* Like bit_position, but return as an integer. It must be representable in
7245 : that way (since it could be a signed value, we don't have the
7246 : option of returning -1 like int_size_in_byte can. */
7247 :
7248 : inline HOST_WIDE_INT
7249 119637228 : int_bit_position (const_tree field)
7250 : {
7251 239274456 : return ((wi::to_offset (DECL_FIELD_OFFSET (field)) << LOG2_BITS_PER_UNIT)
7252 119637228 : + wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi ();
7253 : }
7254 :
7255 : /* Return true if it makes sense to consider alias set for a type T. */
7256 :
7257 : inline bool
7258 203860565 : type_with_alias_set_p (const_tree t)
7259 : {
7260 : /* Function and method types are never accessed as memory locations. */
7261 203860565 : if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE)
7262 : return false;
7263 :
7264 203559197 : if (COMPLETE_TYPE_P (t))
7265 : return true;
7266 :
7267 : /* Incomplete types cannot be accessed in general except for arrays
7268 : where we can fetch its element despite we have no array bounds. */
7269 11936685 : if (TREE_CODE (t) == ARRAY_TYPE && COMPLETE_TYPE_P (TREE_TYPE (t)))
7270 94370 : return true;
7271 :
7272 : return false;
7273 : }
7274 :
7275 : extern location_t set_block (location_t loc, tree block);
7276 :
7277 : extern void gt_ggc_mx (tree &);
7278 : extern void gt_pch_nx (tree &);
7279 : extern void gt_pch_nx (tree &, gt_pointer_operator, void *);
7280 : extern void gt_ggc_mx (tree_raw_data *);
7281 : extern void gt_pch_nx (tree_raw_data *);
7282 : extern void gt_pch_nx (tree_raw_data *, gt_pointer_operator, void *);
7283 :
7284 : extern bool nonnull_arg_p (const_tree);
7285 : extern bool is_empty_type (const_tree);
7286 : extern bool default_is_empty_record (const_tree);
7287 : extern bool flexible_array_member_type_p (const_tree);
7288 : extern bool flexible_array_type_p (const_tree);
7289 : extern HOST_WIDE_INT arg_int_size_in_bytes (const_tree);
7290 : extern tree arg_size_in_bytes (const_tree);
7291 : extern bool expr_type_first_operand_type_p (tree_code);
7292 :
7293 : extern location_t
7294 : set_source_range (tree expr, location_t start, location_t finish);
7295 :
7296 : extern location_t
7297 : set_source_range (tree expr, source_range src_range);
7298 :
7299 : /* Return true if it makes sense to promote/demote from_type to to_type. */
7300 : inline bool
7301 540055 : desired_pro_or_demotion_p (const_tree to_type, const_tree from_type)
7302 : {
7303 540055 : unsigned int to_type_precision = TYPE_PRECISION (to_type);
7304 :
7305 : /* OK to promote if to_type is no bigger than word_mode. */
7306 540055 : if (to_type_precision <= GET_MODE_PRECISION (word_mode))
7307 : return true;
7308 :
7309 : /* Otherwise, allow only if narrowing or same precision conversions. */
7310 36259 : return to_type_precision <= TYPE_PRECISION (from_type);
7311 : }
7312 :
7313 : /* Pointer type used to declare builtins before we have seen its real
7314 : declaration. */
7315 : class builtin_structptr_type
7316 : {
7317 : public:
7318 : tree& node;
7319 : tree& base;
7320 : const char *str;
7321 : };
7322 : extern const builtin_structptr_type builtin_structptr_types[6];
7323 :
7324 : /* Return true if type T has the same precision as its underlying mode. */
7325 :
7326 : inline bool
7327 352370533 : type_has_mode_precision_p (const_tree t)
7328 : {
7329 352370533 : return known_eq (TYPE_PRECISION (t), GET_MODE_PRECISION (TYPE_MODE (t)));
7330 : }
7331 :
7332 : /* Helper functions for fndecl_built_in_p. */
7333 :
7334 : inline bool
7335 : built_in_function_equal_p (built_in_function name0, built_in_function name1)
7336 : {
7337 : return name0 == name1;
7338 : }
7339 :
7340 : /* Recursive case for two or more names. */
7341 :
7342 : template <typename... F>
7343 : inline bool
7344 43646460 : built_in_function_equal_p (built_in_function name0, built_in_function name1,
7345 : built_in_function name2, F... names)
7346 : {
7347 38676538 : return name0 == name1 || built_in_function_equal_p (name0, name2, names...);
7348 : }
7349 :
7350 : /* Return true if a FUNCTION_DECL NODE is a GCC built-in function.
7351 :
7352 : Note that it is different from the DECL_IS_UNDECLARED_BUILTIN
7353 : accessor, as this is impervious to user declaration. */
7354 :
7355 : inline bool
7356 5064556997 : fndecl_built_in_p (const_tree node)
7357 : {
7358 5064556997 : return DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN;
7359 : }
7360 :
7361 : /* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7362 : of class KLASS. */
7363 :
7364 : inline bool
7365 3622700047 : fndecl_built_in_p (const_tree node, built_in_class klass)
7366 : {
7367 4733815687 : return fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass;
7368 : }
7369 :
7370 : /* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7371 : of class KLASS with name equal to NAME. */
7372 :
7373 : inline bool
7374 45722854 : fndecl_built_in_p (const_tree node, unsigned int name, built_in_class klass)
7375 : {
7376 45722854 : return (fndecl_built_in_p (node, klass)
7377 45751692 : && DECL_UNCHECKED_FUNCTION_CODE (node) == name);
7378 : }
7379 :
7380 : /* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7381 : of BUILT_IN_NORMAL class with name equal to NAME1 (or other mentioned
7382 : NAMES). */
7383 :
7384 : template <typename... F>
7385 : inline bool
7386 1226727977 : fndecl_built_in_p (const_tree node, built_in_function name1, F... names)
7387 : {
7388 1226727977 : return (fndecl_built_in_p (node, BUILT_IN_NORMAL)
7389 1226727977 : && built_in_function_equal_p (DECL_FUNCTION_CODE (node),
7390 1226727977 : name1, names...));
7391 : }
7392 :
7393 : /* Returns true if the function decl NODE is an alloca. */
7394 : inline bool
7395 526 : fndecl_builtin_alloc_p (const_tree node)
7396 : {
7397 526 : if (!fndecl_built_in_p (node, BUILT_IN_NORMAL))
7398 : return false;
7399 526 : return ALLOCA_FUNCTION_CODE_P (DECL_FUNCTION_CODE (node));
7400 : }
7401 :
7402 : /* A struct for encapsulating location information about an operator
7403 : and the operation built from it.
7404 :
7405 : m_operator_loc is the location of the operator
7406 : m_combined_loc is the location of the compound expression.
7407 :
7408 : For example, given "a && b" the, operator location is:
7409 : a && b
7410 : ^~
7411 : and the combined location is:
7412 : a && b
7413 : ~~^~~~
7414 : Capturing this information allows for class binary_op_rich_location
7415 : to provide detailed information about e.g. type mismatches in binary
7416 : operations where enough location information is available:
7417 :
7418 : arg_0 op arg_1
7419 : ~~~~~ ^~ ~~~~~
7420 : | |
7421 : | arg1 type
7422 : arg0 type
7423 :
7424 : falling back to just showing the combined location:
7425 :
7426 : arg_0 op arg_1
7427 : ~~~~~~^~~~~~~~
7428 :
7429 : where it is not. */
7430 :
7431 : class op_location_t
7432 : {
7433 : public:
7434 : location_t m_operator_loc;
7435 : location_t m_combined_loc;
7436 :
7437 : /* 1-argument ctor, for constructing from a combined location. */
7438 187878742 : op_location_t (location_t combined_loc)
7439 187790934 : : m_operator_loc (UNKNOWN_LOCATION), m_combined_loc (combined_loc)
7440 : {}
7441 :
7442 : /* 2-argument ctor, for distinguishing between the operator's location
7443 : and the combined location. */
7444 154843580 : op_location_t (location_t operator_loc, location_t combined_loc)
7445 154843580 : : m_operator_loc (operator_loc), m_combined_loc (combined_loc)
7446 : {}
7447 :
7448 : /* Implicitly convert back to a location_t, using the combined location. */
7449 519082233 : operator location_t () const { return m_combined_loc; }
7450 : };
7451 :
7452 : /* Code that doesn't refer to any warning. Has no effect on suppression
7453 : functions. */
7454 : constexpr opt_code no_warning = opt_code ();
7455 : /* Wildcard code that refers to all warnings. */
7456 : constexpr opt_code all_warnings = N_OPTS;
7457 :
7458 : /* Return the disposition for a warning (or all warnings by default)
7459 : at a location. */
7460 : extern bool warning_suppressed_at (location_t, opt_code = all_warnings);
7461 : /* Set the disposition for a warning (or all warnings by default)
7462 : at a location to disabled by default. */
7463 : extern bool suppress_warning_at (location_t, opt_code = all_warnings,
7464 : bool = true);
7465 : /* Overwrite warning disposition bitmap for a location with given spec. */
7466 : extern void put_warning_spec_at (location_t loc, unsigned);
7467 : /* Copy warning disposition from one location to another. */
7468 : extern void copy_warning (location_t, location_t);
7469 :
7470 : /* Return the disposition for a warning (or all warnings by default)
7471 : for an expression. */
7472 : extern bool warning_suppressed_p (const_tree, opt_code = all_warnings);
7473 : /* Set the disposition for a warning (or all warnings by default)
7474 : at a location to disabled by default. */
7475 : extern void suppress_warning (tree, opt_code = all_warnings, bool = true)
7476 : ATTRIBUTE_NONNULL (1);
7477 : /* Copy warning disposition from one expression to another. */
7478 : extern void copy_warning (tree, const_tree);
7479 :
7480 : /* Whether the tree might have a warning spec. */
7481 : extern bool has_warning_spec (const_tree);
7482 : /* Retrieve warning spec bitmap for tree streaming. */
7483 : extern unsigned get_warning_spec (const_tree);
7484 : /* Overwrite warning spec bitmap for a tree with given spec. */
7485 : extern void put_warning_spec (tree, unsigned);
7486 :
7487 : /* Return the zero-based number corresponding to the argument being
7488 : deallocated if FNDECL is a deallocation function or an out-of-bounds
7489 : value if it isn't. */
7490 : extern unsigned fndecl_dealloc_argno (tree);
7491 :
7492 : /* If an expression refers to a character array or pointer declared
7493 : attribute nonstring, return a decl for that array or pointer and
7494 : if nonnull, set the second argument to the referenced enclosing
7495 : object or pointer. Otherwise return null. */
7496 : extern tree get_attr_nonstring_decl (tree, tree * = NULL);
7497 :
7498 : /* Returns the version string for a decl with target_version attribute.
7499 : Returns an invalid string_slice if no attribute is present. */
7500 : extern string_slice get_target_version (const tree);
7501 : /* Returns a vector of the version strings from a target_clones attribute on
7502 : a decl. Can also record the number of default versions found.
7503 : Use bool to control whether or not the results should
7504 : be filtered with TARGET_CHECK_TARGET_CLONE_VERSION. */
7505 : extern auto_vec<string_slice> get_clone_versions
7506 : (const tree,int * = NULL, bool = true);
7507 : /* Returns a vector of the version strings from a target_clones attribute
7508 : directly. Additionally takes a bool to control whether or not the results
7509 : should be filtered with TARGET_CHECK_TARGET_CLONE_VERSION. */
7510 : extern auto_vec<string_slice> get_clone_attr_versions
7511 : (const tree, int *, bool = true);
7512 :
7513 : /* Checks if two decls define any overlapping versions. */
7514 : extern bool disjoint_version_decls (tree, tree);
7515 : /* Checks if two overlapping decls are not mergeable. */
7516 : extern bool diagnose_versioned_decls (tree, tree);
7517 :
7518 : /* Unshare tree if needed. */
7519 : extern tree unshare_expr (tree);
7520 :
7521 : /* Unshare tree if needed.
7522 : Removing the locations if an expr. */
7523 : extern tree unshare_expr_without_location (tree);
7524 :
7525 : extern void copy_if_shared (tree *, void * = NULL);
7526 :
7527 : /* Make a vector to hold an unexpanded omp iterator vector. */
7528 : inline tree
7529 914 : make_omp_iterator (void)
7530 : {
7531 914 : return make_tree_vec (6);
7532 : }
7533 :
7534 : /* Make a vector to hold an expanded omp iterator vector. */
7535 : inline tree
7536 263 : make_expanded_omp_iterator (void)
7537 : {
7538 263 : return make_tree_vec (10);
7539 : }
7540 :
7541 : #endif /* GCC_TREE_H */
|