GCC Middle and Back End API Reference
tree.h
Go to the documentation of this file.
1/* Definitions for the ubiquitous 'tree' type for GNU compilers.
2 Copyright (C) 1989-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
31inline combined_fn
33{
34 return combined_fn (int (fn));
35}
36
37/* Convert an internal function code to a combined_fn. */
38
39inline combined_fn
41{
42 return combined_fn (int (fn) + int (END_BUILTINS));
43}
44
45/* Return true if CODE is a target-independent built-in function. */
46
47inline bool
49{
50 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
58{
60 return built_in_function (int (code));
61}
62
63/* Return true if CODE is an internal function. */
64
65inline bool
67{
68 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
74inline internal_fn
76{
78 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. */
84{
85public:
87 code_helper (tree_code code) : rep ((int) code) {}
88 code_helper (combined_fn fn) : rep (-(int) fn) {}
89 code_helper (internal_fn fn) : rep (-(int) as_combined_fn (fn)) {}
90 explicit operator tree_code () const { return (tree_code) rep; }
91 explicit operator combined_fn () const { return (combined_fn) -rep; }
92 explicit operator internal_fn () const;
93 explicit operator built_in_function () const;
94 bool is_tree_code () const { return rep > 0; }
95 bool is_fn_code () const { return rep < 0; }
96 bool is_internal_fn () const;
97 bool is_builtin_fn () const;
98 int get_rep () const { return rep; }
101 bool operator== (const code_helper &other) { return rep == other.rep; }
102 bool operator!= (const code_helper &other) { return rep != other.rep; }
103 bool operator== (tree_code c) { return rep == code_helper (c).rep; }
104 bool operator!= (tree_code c) { return rep != code_helper (c).rep; }
105
106private:
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
114inline tree_code
116{
117 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
124inline combined_fn
126 return is_fn_code () ? (combined_fn) *this : CFN_LAST;
127}
128
129inline code_helper::operator internal_fn () const
130{
131 return as_internal_fn (combined_fn (*this));
132}
133
134inline code_helper::operator built_in_function () const
135{
136 return as_builtin_fn (combined_fn (*this));
137}
138
139inline bool
141{
142 return is_fn_code () && internal_fn_p (combined_fn (*this));
143}
144
145inline bool
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
443extern 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
448extern void tree_check_failed (const_tree, const char *, int, const char *,
449 ...) ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
450extern void tree_not_check_failed (const_tree, const char *, int, const char *,
451 ...) ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
452extern void tree_class_check_failed (const_tree, const enum tree_code_class,
453 const char *, int, const char *)
454 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
455extern 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;
459extern 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;
463extern void tree_int_cst_elt_check_failed (int, int, const char *,
464 int, const char *)
465 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
466extern void tree_vec_elt_check_failed (int, int, const char *,
467 int, const char *)
468 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
469extern void phi_node_elt_check_failed (int, int, const char *,
470 int, const char *)
471 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
472extern void tree_operand_check_failed (int, const_tree,
473 const char *, int, const char *)
474 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
475extern void omp_clause_check_failed (const_tree, const char *, int,
476 const char *, enum omp_clause_code)
477 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
478extern void omp_clause_operand_check_failed (int, const_tree, const char *,
479 int, const char *)
480 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
481extern 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
1387inline source_range
1389{
1390 location_t loc = EXPR_LOCATION (expr);
1391 return get_range_from_loc (line_table, loc);
1392}
1393
1394extern void protected_set_expr_location (tree, location_t);
1395extern void protected_set_expr_location_if_unset (tree, location_t);
1396ATTRIBUTE_WARN_UNUSED_RESULT
1397extern tree protected_set_expr_location_unshare (tree, location_t);
1398
1400
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
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
2465extern unsigned int element_precision (const_tree);
2466extern machine_mode element_mode (const_tree);
2467extern machine_mode vector_type_mode (const_tree);
2468extern unsigned int vector_element_bits (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
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
2619
2620 /* Construct a qualifier set containing the qualifiers CV_QUALS and the
2621 address space AS. */
2622 constexpr
2627
2628 /* Add QUAL to this qualifier set. */
2629 constexpr void
2631 {
2632 m_cv_quals |= qual;
2633 }
2634
2635 /* Remove QUAL from this qualifier set. */
2636 constexpr void
2638 {
2639 m_cv_quals &= ~qual;
2640 }
2641
2642 /* Set the address space of this qualifier set to AS. */
2643 constexpr void
2645 {
2646 this->m_addr_space = as;
2647 }
2648
2649 /* Returns a new qualifier set, with QUAL added (as with 'add'). */
2651 with (cv_qualifier qual) const
2652 {
2653 auto ret = *this;
2654 ret.add (qual);
2655 return ret;
2656 }
2657
2658 /* Returns a new qualifier set, with QUAL removed (as with 'remove'). */
2661 {
2662 auto ret = *this;
2663 ret.remove (qual);
2664 return ret;
2665 }
2666
2667 /* Return this qualifier set, with address space set to AS. */
2670 {
2671 auto ret = *this;
2672 ret.set_as (as);
2673 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 cv_quals () const
2684 { 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 addr_space () const
2694 { return m_addr_space; }
2695
2696 /* Return all qualifiers both in this qualifier set and in OTHER_CV. */
2698 intersect (cv_qualifier other_cv) const
2699 { return cv_quals () & other_cv; }
2700
2701 /* Return true iff any of OTHER_CV are contained in THIS. */
2702 constexpr bool
2703 has (cv_qualifier other_cv) const
2704 { 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. */
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
2741 {
2742 return ((a.cv_quals () == b.cv_quals ())
2743 && (a.addr_space () == b.addr_space ()));
2744 }
2745
2746 friend constexpr bool
2748 {
2749 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 split () const
2758 { 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 nonempty_p () const
2764 { return *this != qualifier_set {}; }
2765
2766 /* Shorthand for 'nonempty_p', for use in conditions. */
2767 explicit constexpr
2768 operator bool () const
2769 { return nonempty_p (); }
2770
2771 /* Dump the contents of this qualifier set to stderr. */
2772 void debug () const;
2773
2774private:
2777};
2778static_assert (std::is_trivially_copyable<qualifier_set>::value, "");
2779static_assert (std::is_trivially_destructible<qualifier_set>::value, "");
2780static_assert (std::is_trivially_default_constructible<qualifier_set>::value,
2781 "");
2782static_assert ((qualifier_set {}
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
2795constexpr qualifier_set
2797{
2798 return qs.with (cvs);
2799}
2800
2801constexpr qualifier_set
2803{
2804 return qs.with (cvs);
2805}
2806
2807constexpr qualifier_set
2809{
2810 return qs.symmetric_difference (cvs);
2811}
2812
2813constexpr qualifier_set
2815{
2816 return qs.symmetric_difference (cvs);
2817}
2818
2819constexpr qualifier_set &
2821{
2822 return qs = qs | quals;
2823}
2824constexpr qualifier_set &
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
3382extern 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
3693extern 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
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
3793inline void
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
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. */
4041extern 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. */
4052extern tree build_target_option_node (struct gcc_options *opts,
4053 struct gcc_options *opts_set);
4054
4055extern void prepare_target_option_nodes_for_pch (void);
4056
4057#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
4058
4059inline tree
4060tree_check (tree __t, const char *__f, int __l, const char *__g, tree_code __c)
4061{
4062 if (TREE_CODE (__t) != __c)
4063 tree_check_failed (__t, __f, __l, __g, __c, 0);
4064 return __t;
4065}
4066
4067inline tree
4068tree_not_check (tree __t, const char *__f, int __l, const char *__g,
4069 enum tree_code __c)
4070{
4071 if (TREE_CODE (__t) == __c)
4072 tree_not_check_failed (__t, __f, __l, __g, __c, 0);
4073 return __t;
4074}
4075
4076inline tree
4077tree_check2 (tree __t, const char *__f, int __l, const char *__g,
4078 enum tree_code __c1, enum tree_code __c2)
4079{
4080 if (TREE_CODE (__t) != __c1
4081 && TREE_CODE (__t) != __c2)
4082 tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4083 return __t;
4084}
4085
4086inline tree
4087tree_not_check2 (tree __t, const char *__f, int __l, const char *__g,
4088 enum tree_code __c1, enum tree_code __c2)
4089{
4090 if (TREE_CODE (__t) == __c1
4091 || TREE_CODE (__t) == __c2)
4092 tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4093 return __t;
4094}
4095
4096inline tree
4097tree_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 if (TREE_CODE (__t) != __c1
4101 && TREE_CODE (__t) != __c2
4102 && TREE_CODE (__t) != __c3)
4103 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4104 return __t;
4105}
4106
4107inline tree
4108tree_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
4118inline tree
4119tree_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 if (TREE_CODE (__t) != __c1
4124 && TREE_CODE (__t) != __c2
4125 && TREE_CODE (__t) != __c3
4126 && TREE_CODE (__t) != __c4)
4127 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4128 return __t;
4129}
4130
4131inline tree
4132tree_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 if (TREE_CODE (__t) == __c1
4137 || TREE_CODE (__t) == __c2
4138 || TREE_CODE (__t) == __c3
4139 || TREE_CODE (__t) == __c4)
4140 tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4141 return __t;
4142}
4143
4144inline tree
4145tree_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 if (TREE_CODE (__t) != __c1
4150 && TREE_CODE (__t) != __c2
4151 && TREE_CODE (__t) != __c3
4152 && TREE_CODE (__t) != __c4
4153 && TREE_CODE (__t) != __c5)
4154 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
4155 return __t;
4156}
4157
4158inline tree
4159tree_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
4172inline tree
4173tree_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 if (TREE_CODE (__t) != __c1
4178 && TREE_CODE (__t) != __c2
4179 && TREE_CODE (__t) != __c3
4180 && TREE_CODE (__t) != __c4
4181 && TREE_CODE (__t) != __c5
4182 && TREE_CODE (__t) != __c6)
4183 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, __c6,
4184 0);
4185 return __t;
4186}
4187
4188inline tree
4189tree_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
4204inline tree
4205contains_struct_check (tree __t, const enum tree_node_structure_enum __s,
4206 const char *__f, int __l, const char *__g)
4207{
4208 if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
4209 tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
4210 return __t;
4211}
4212
4213inline tree
4214tree_class_check (tree __t, const enum tree_code_class __class,
4215 const char *__f, int __l, const char *__g)
4216{
4217 if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
4218 tree_class_check_failed (__t, __class, __f, __l, __g);
4219 return __t;
4220}
4221
4222inline tree
4223tree_range_check (tree __t,
4224 enum tree_code __code1, enum tree_code __code2,
4225 const char *__f, int __l, const char *__g)
4226{
4227 if (TREE_CODE (__t) < __code1 || TREE_CODE (__t) > __code2)
4228 tree_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4229 return __t;
4230}
4231
4232inline tree
4233omp_clause_subcode_check (tree __t, enum omp_clause_code __code,
4234 const char *__f, int __l, const char *__g)
4235{
4236 if (TREE_CODE (__t) != OMP_CLAUSE)
4237 tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4238 if (__t->omp_clause.code != __code)
4239 omp_clause_check_failed (__t, __f, __l, __g, __code);
4240 return __t;
4241}
4242
4243inline tree
4244omp_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 if (TREE_CODE (__t) != OMP_CLAUSE)
4250 tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4251 if ((int) __t->omp_clause.code < (int) __code1
4252 || (int) __t->omp_clause.code > (int) __code2)
4253 omp_clause_range_check_failed (__t, __f, __l, __g, __code1, __code2);
4254 return __t;
4255}
4256
4257/* These checks have to be special cased. */
4258
4259inline tree
4260expr_check (tree __t, const char *__f, int __l, const char *__g)
4261{
4262 char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
4263 if (!IS_EXPR_CODE_CLASS (__c))
4264 tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
4265 return __t;
4266}
4267
4268/* These checks have to be special cased. */
4269
4270inline tree
4271non_type_check (tree __t, const char *__f, int __l, const char *__g)
4272{
4273 if (TYPE_P (__t))
4274 tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
4275 return __t;
4276}
4277
4278inline const HOST_WIDE_INT *
4279tree_int_cst_elt_check (const_tree __t, int __i,
4280 const char *__f, int __l, const char *__g)
4281{
4282 if (TREE_CODE (__t) != INTEGER_CST)
4283 tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
4284 if (__i < 0 || __i >= __t->base.u.int_length.extended)
4285 tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
4286 __f, __l, __g);
4287 return &const_cast<tree> (__t)->int_cst.val[__i];
4288}
4289
4290inline HOST_WIDE_INT *
4291tree_int_cst_elt_check (tree __t, int __i,
4292 const char *__f, int __l, const char *__g)
4293{
4294 if (TREE_CODE (__t) != INTEGER_CST)
4295 tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
4296 if (__i < 0 || __i >= __t->base.u.int_length.extended)
4297 tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
4298 __f, __l, __g);
4299 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
4309inline tree *
4310tree_vec_elt_check (tree __t, int __i,
4311 const char *__f, int __l, const char *__g)
4312{
4313 if (TREE_CODE (__t) != TREE_VEC)
4314 tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
4315 if (__i < 0 || __i >= __t->base.u.length)
4316 tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
4317 return &const_cast<tree> (__t)->vec.a[__i];
4318}
4319
4320# if GCC_VERSION >= 4006
4321#pragma GCC diagnostic pop
4322#endif
4323
4324inline tree *
4325omp_clause_elt_check (tree __t, int __i,
4326 const char *__f, int __l, const char *__g)
4327{
4328 if (TREE_CODE (__t) != OMP_CLAUSE)
4329 tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
4330 if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])
4331 omp_clause_operand_check_failed (__i, __t, __f, __l, __g);
4332 return &__t->omp_clause.ops[__i];
4333}
4334
4335/* These checks have to be special cased. */
4336
4337inline tree
4338any_integral_type_check (tree __t, const char *__f, int __l, const char *__g)
4339{
4340 if (!ANY_INTEGRAL_TYPE_P (__t))
4341 tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
4342 INTEGER_TYPE, BITINT_TYPE, 0);
4343 return __t;
4344}
4345
4346inline const_tree
4347tree_check (const_tree __t, const char *__f, int __l, const char *__g,
4348 tree_code __c)
4349{
4350 if (TREE_CODE (__t) != __c)
4351 tree_check_failed (__t, __f, __l, __g, __c, 0);
4352 return __t;
4353}
4354
4355inline const_tree
4356tree_not_check (const_tree __t, const char *__f, int __l, const char *__g,
4357 enum tree_code __c)
4358{
4359 if (TREE_CODE (__t) == __c)
4360 tree_not_check_failed (__t, __f, __l, __g, __c, 0);
4361 return __t;
4362}
4363
4364inline const_tree
4365tree_check2 (const_tree __t, const char *__f, int __l, const char *__g,
4366 enum tree_code __c1, enum tree_code __c2)
4367{
4368 if (TREE_CODE (__t) != __c1
4369 && TREE_CODE (__t) != __c2)
4370 tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4371 return __t;
4372}
4373
4374inline const_tree
4375tree_not_check2 (const_tree __t, const char *__f, int __l, const char *__g,
4376 enum tree_code __c1, enum tree_code __c2)
4377{
4378 if (TREE_CODE (__t) == __c1
4379 || TREE_CODE (__t) == __c2)
4380 tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
4381 return __t;
4382}
4383
4384inline const_tree
4385tree_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 if (TREE_CODE (__t) != __c1
4389 && TREE_CODE (__t) != __c2
4390 && TREE_CODE (__t) != __c3)
4391 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
4392 return __t;
4393}
4394
4395inline const_tree
4396tree_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
4406inline const_tree
4407tree_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 if (TREE_CODE (__t) != __c1
4412 && TREE_CODE (__t) != __c2
4413 && TREE_CODE (__t) != __c3
4414 && TREE_CODE (__t) != __c4)
4415 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4416 return __t;
4417}
4418
4419inline const_tree
4420tree_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 if (TREE_CODE (__t) == __c1
4425 || TREE_CODE (__t) == __c2
4426 || TREE_CODE (__t) == __c3
4427 || TREE_CODE (__t) == __c4)
4428 tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
4429 return __t;
4430}
4431
4432inline const_tree
4433tree_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
4446inline const_tree
4447tree_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
4460inline const_tree
4461tree_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 if (TREE_CODE (__t) != __c1
4466 && TREE_CODE (__t) != __c2
4467 && TREE_CODE (__t) != __c3
4468 && TREE_CODE (__t) != __c4
4469 && TREE_CODE (__t) != __c5
4470 && TREE_CODE (__t) != __c6)
4471 tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, __c6,
4472 0);
4473 return __t;
4474}
4475
4476inline const_tree
4477tree_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
4492inline const_tree
4493contains_struct_check (const_tree __t, const enum tree_node_structure_enum __s,
4494 const char *__f, int __l, const char *__g)
4495{
4496 if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
4497 tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
4498 return __t;
4499}
4500
4501inline const_tree
4502tree_class_check (const_tree __t, const enum tree_code_class __class,
4503 const char *__f, int __l, const char *__g)
4504{
4505 if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
4506 tree_class_check_failed (__t, __class, __f, __l, __g);
4507 return __t;
4508}
4509
4510inline const_tree
4511tree_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
4520inline const_tree
4521omp_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
4531inline const_tree
4532omp_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
4545inline const_tree
4546expr_check (const_tree __t, const char *__f, int __l, const char *__g)
4547{
4548 char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
4549 if (!IS_EXPR_CODE_CLASS (__c))
4550 tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
4551 return __t;
4552}
4553
4554inline const_tree
4555non_type_check (const_tree __t, const char *__f, int __l, const char *__g)
4556{
4557 if (TYPE_P (__t))
4558 tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
4559 return __t;
4560}
4561
4562# if GCC_VERSION >= 4006
4563#pragma GCC diagnostic push
4564#pragma GCC diagnostic ignored "-Wstrict-overflow"
4565#endif
4566
4567inline const_tree *
4568tree_vec_elt_check (const_tree __t, int __i,
4569 const char *__f, int __l, const char *__g)
4570{
4571 if (TREE_CODE (__t) != TREE_VEC)
4572 tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
4573 if (__i < 0 || __i >= __t->base.u.length)
4574 tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
4575 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
4583inline const_tree *
4584omp_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
4594inline const_tree
4595any_integral_type_check (const_tree __t, const char *__f, int __l,
4596 const char *__g)
4597{
4598 if (!ANY_INTEGRAL_TYPE_P (__t))
4599 tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
4600 INTEGER_TYPE, BITINT_TYPE, 0);
4601 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. */
4609inline int
4611{
4612 if (VL_EXP_CLASS_P (node))
4613 return VL_EXP_OPERAND_LENGTH (node);
4614 else
4615 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. */
4621inline tree *
4622tree_operand_check (tree __t, int __i,
4623 const char *__f, int __l, const char *__g)
4624{
4625 const_tree __u = EXPR_CHECK (__t);
4626 if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
4627 tree_operand_check_failed (__i, __u, __f, __l, __g);
4628 return &const_cast<tree> (__u)->exp.operands[__i];
4629}
4630
4631inline tree *
4632tree_operand_check_code (tree __t, enum tree_code __code, int __i,
4633 const char *__f, int __l, const char *__g)
4634{
4635 if (TREE_CODE (__t) != __code)
4636 tree_check_failed (__t, __f, __l, __g, __code, 0);
4637 if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
4638 tree_operand_check_failed (__i, __t, __f, __l, __g);
4639 return &__t->exp.operands[__i];
4640}
4641
4642inline const_tree *
4643tree_operand_check (const_tree __t, int __i,
4644 const char *__f, int __l, const char *__g)
4645{
4646 const_tree __u = EXPR_CHECK (__t);
4647 if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
4648 tree_operand_check_failed (__i, __u, __f, __l, __g);
4649 return const_cast<const_tree *> (&__u->exp.operands[__i]);
4650}
4651
4652inline const_tree *
4653tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
4654 const char *__f, int __l, const char *__g)
4655{
4656 if (TREE_CODE (__t) != __code)
4657 tree_check_failed (__t, __f, __l, __g, __code, 0);
4658 if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
4659 tree_operand_check_failed (__i, __t, __f, __l, __g);
4660 return const_cast<const_tree *> (&__t->exp.operands[__i]);
4661}
4662
4663#endif
4664
4665/* True iff an identifier matches a C string. */
4666
4667inline bool
4668id_equal (const_tree id, const char *str)
4669{
4670 return !strcmp (IDENTIFIER_POINTER (id), str);
4671}
4672
4673inline bool
4674id_equal (const char *str, const_tree id)
4675{
4676 return id_equal (id, str);
4677}
4678
4679/* Return the number of elements in the VECTOR_TYPE given by NODE. */
4680
4681inline poly_uint64
4683{
4685 unsigned int precision = VECTOR_TYPE_CHECK (node)->type_common.precision;
4686 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 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
4703inline void
4705{
4707 unsigned HOST_WIDE_INT coeff0 = subparts.coeffs[0];
4708 int index = exact_log2 (coeff0);
4709 gcc_assert (index >= 0);
4710 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 VECTOR_TYPE_CHECK (node)->type_common.precision = index;
4734}
4735
4736/* Return true if we can construct vector types with the given number
4737 of subparts. */
4738
4739inline bool
4741{
4742 unsigned HOST_WIDE_INT coeff0 = subparts.coeffs[0];
4743 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. */
4756inline built_in_function
4758{
4759 const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4761 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. */
4767inline int
4769{
4770 const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4772 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. */
4778inline int
4780{
4781 const tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4783 return fndecl.function_code;
4784}
4785
4786/* Record that FUNCTION_DECL DECL represents built-in function FCODE of
4787 class FCLASS. */
4788inline void
4790 unsigned int fcode)
4791{
4792 tree_function_decl &fndecl = FUNCTION_DECL_CHECK (decl)->function_decl;
4793 fndecl.built_in_class = fclass;
4794 fndecl.function_code = fcode;
4795}
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). */
4799inline void
4801{
4802 tree_function_decl &newfndecl = FUNCTION_DECL_CHECK (newdecl)->function_decl;
4803 const tree_function_decl &oldfndecl
4804 = FUNCTION_DECL_CHECK (olddecl)->function_decl;
4805 newfndecl.built_in_class = oldfndecl.built_in_class;
4806 newfndecl.function_code = oldfndecl.function_code;
4807}
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
4819inline bool
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 if ((TREE_CODE (exp) == NON_LVALUE_EXPR
4831 || TREE_CODE (exp) == VIEW_CONVERT_EXPR)
4833 return true;
4834 return false;
4835}
4836
4837/* Implementation of STRIP_ANY_LOCATION_WRAPPER. */
4838
4839inline tree
4841{
4842 if (location_wrapper_p (exp))
4843 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
5084inline bool
5086{
5087 return (t == error_mark_node
5088 || (t && TREE_TYPE (t) == error_mark_node));
5089}
5090
5091/* Return the number of elements encoded directly in a VECTOR_CST. */
5092
5093inline unsigned int
5098
5099extern tree generate_internal_label (const char *);
5100extern const char *prefix_for_internal_label (tree label);
5102extern void overwrite_decl_assembler_name (tree decl, tree name);
5105extern const char *decl_section_name (const_tree);
5106extern void set_decl_section_name (tree, const char *);
5108extern enum tls_model decl_tls_model (const_tree);
5109extern 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
5114extern 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. */
5119extern size_t tree_code_size (enum tree_code);
5120
5121/* Allocate and return a new UID from the DECL_UID namespace. */
5122extern 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
5129
5130/* Free tree node. */
5131
5132extern void free_node (tree);
5133
5134/* Make a copy of a node, with all the same contents. */
5135
5137
5138/* Make a copy of a chain of TREE_LIST nodes. */
5139
5140extern tree copy_list (tree);
5141
5142/* Make a CASE_LABEL_EXPR. */
5143
5145
5146/* Make a BINFO. */
5148
5149/* Make an INTEGER_CST. */
5150
5152
5153/* Make a TREE_VEC. */
5154
5156
5157/* Grow a TREE_VEC. */
5158
5160
5161/* Treat a TREE_VEC as a range of trees, e.g.
5162 for (tree e : tree_vec_range (v)) { ... } */
5163
5165{
5167public:
5169 tree *begin() { return TREE_VEC_BEGIN (v); }
5170 tree *end() { return TREE_VEC_END (v); }
5171};
5172
5173/* Construct various types of nodes. */
5174
5175extern tree build_nt (enum tree_code, ...);
5177
5186
5187/* _loc versions of build[1-5]. */
5188
5189inline tree
5190build1_loc (location_t loc, enum tree_code code, tree type,
5192{
5193 tree t = build1 (code, type, arg1 PASS_MEM_STAT);
5194 if (CAN_HAVE_LOCATION_P (t))
5195 SET_EXPR_LOCATION (t, loc);
5196 return t;
5197}
5198
5199inline tree
5200build2_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5202{
5203 tree t = build2 (code, type, arg0, arg1 PASS_MEM_STAT);
5204 if (CAN_HAVE_LOCATION_P (t))
5205 SET_EXPR_LOCATION (t, loc);
5206 return t;
5207}
5208
5209inline tree
5210build3_loc (location_t loc, enum tree_code code, tree type, tree arg0,
5211 tree arg1, tree arg2 CXX_MEM_STAT_INFO)
5212{
5213 tree t = build3 (code, type, arg0, arg1, arg2 PASS_MEM_STAT);
5214 if (CAN_HAVE_LOCATION_P (t))
5215 SET_EXPR_LOCATION (t, loc);
5216 return t;
5217}
5218
5219inline tree
5220build4_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 tree t = build4 (code, type, arg0, arg1, arg2, arg3 PASS_MEM_STAT);
5224 if (CAN_HAVE_LOCATION_P (t))
5225 SET_EXPR_LOCATION (t, loc);
5226 return t;
5227}
5228
5229inline tree
5230build5_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 tree t = build5 (code, type, arg0, arg1, arg2, arg3,
5234 arg4 PASS_MEM_STAT);
5235 if (CAN_HAVE_LOCATION_P (t))
5236 SET_EXPR_LOCATION (t, loc);
5237 return t;
5238}
5239
5240/* Constructs double_int from tree CST. */
5241
5243
5244extern tree wide_int_to_tree (tree type, const poly_wide_int_ref &cst);
5245extern 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 */
5253extern tree make_vector (unsigned, unsigned CXX_MEM_STAT_INFO);
5259extern tree build_vector_a_then_b (tree, unsigned int, tree, tree);
5260extern void recompute_constructor_flags (tree);
5261extern void verify_constructor_flags (tree);
5266extern tree build_constructor_va (tree, int, ...);
5270extern tree build_complex (tree, tree, tree);
5271extern tree build_complex_inf (tree, bool);
5273extern tree build_one_cst (tree);
5276extern tree build_zero_cst (tree);
5277extern tree build_replicated_int_cst (tree, unsigned, HOST_WIDE_INT);
5278extern tree sign_mask_for (tree);
5279extern tree build_string (unsigned, const char * = NULL);
5283extern tree build_decl (location_t, enum tree_code,
5286extern tree build_fn_decl (const char *, tree);
5288extern tree build_block (tree, tree, tree, tree);
5289extern tree build_empty_stmt (location_t);
5290extern tree build_omp_clause (location_t, enum omp_clause_code);
5291
5293
5294extern tree build_call_valist (tree, tree, int, va_list);
5295extern 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
5302template <typename ...T>
5303inline tree build_call_nary (tree return_type, tree fn, int nargs, T... args)
5304{
5305 std::initializer_list<tree> args_ = {args...};
5306 gcc_checking_assert (sizeof...(args) == nargs);
5307 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)
5311extern tree build_call_array_loc (location_t, tree, tree, int, const tree *);
5312extern tree build_call_vec (tree, tree, const vec<tree, va_gc> *);
5313extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
5314extern tree build_call_expr_loc_vec (location_t, tree, vec<tree, va_gc> *);
5315extern tree build_call_expr_loc (location_t, tree, int, ...);
5316extern tree build_call_expr (tree, int, ...);
5317extern tree build_call_expr_internal_loc (location_t, enum internal_fn,
5318 tree, int, ...);
5320 tree, int, const tree *);
5321extern tree maybe_build_call_expr_loc (location_t, combined_fn, tree,
5322 int, ...);
5323extern tree build_alloca_call_expr (tree, unsigned int, HOST_WIDE_INT);
5324extern tree build_string_literal (unsigned, const char * = NULL,
5326 unsigned HOST_WIDE_INT = HOST_WIDE_INT_M1U);
5327inline tree build_string_literal (const char *p)
5328{ return build_string_literal (strlen (p) + 1, p); }
5330{
5332 IDENTIFIER_POINTER (t));
5333}
5334
5335/* Construct various nodes representing data types. */
5336
5338extern tree signed_type_for (tree);
5339extern tree unsigned_type_for (tree);
5340extern bool is_truth_type_for (tree, tree);
5342extern tree truth_type_for (tree);
5343extern tree build_pointer_type_for_mode (tree, machine_mode, bool);
5345extern tree build_reference_type_for_mode (tree, machine_mode, bool);
5347extern tree build_vector_type_for_mode (tree, machine_mode);
5351extern tree build_index_type (tree);
5352extern tree build_array_type_1 (tree, tree, bool, bool, bool);
5353extern tree build_array_type (tree, tree, bool = false);
5356extern tree build_function_type (tree, tree, bool = false);
5357extern tree build_function_type_list (tree, ...);
5359extern tree build_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))
5369extern tree build_complex_type (tree, bool named = false);
5372
5373extern tree value_member (tree, tree);
5375extern bool vec_member (const_tree, vec<tree, va_gc> *);
5376extern tree chain_index (int, tree);
5377
5378/* Arguments may be null. */
5380
5381/* The following predicates are safe to call with a null argument. */
5382extern bool tree_fits_shwi_p (const_tree) ATTRIBUTE_PURE;
5383extern bool tree_fits_poly_int64_p (const_tree) ATTRIBUTE_PURE;
5384extern bool tree_fits_uhwi_p (const_tree) ATTRIBUTE_PURE;
5385extern bool tree_fits_poly_uint64_p (const_tree) ATTRIBUTE_PURE;
5386extern bool tree_fits_sanitize_code_type_p (const_tree) ATTRIBUTE_PURE;
5387
5388
5389extern HOST_WIDE_INT tree_to_shwi (const_tree)
5390 ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5392 ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5393extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree)
5394 ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5396 ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5398 ATTRIBUTE_NONNULL (1) ATTRIBUTE_PURE;
5399#if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)
5400extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
5402{
5404 return TREE_INT_CST_LOW (t);
5405}
5406
5407extern inline __attribute__ ((__gnu_inline__)) unsigned HOST_WIDE_INT
5409{
5411 return TREE_INT_CST_LOW (t);
5412}
5413#if NUM_POLY_INT_COEFFS == 1
5414extern inline __attribute__ ((__gnu_inline__)) poly_int64
5416{
5418 return TREE_INT_CST_LOW (t);
5419}
5420
5421extern inline __attribute__ ((__gnu_inline__)) poly_uint64
5423{
5425 return TREE_INT_CST_LOW (t);
5426}
5427#endif
5428#endif
5429extern int tree_int_cst_sgn (const_tree);
5431extern unsigned int tree_int_cst_min_precision (tree, signop);
5433
5434/* Recursively examines the array elements of TYPE, until a non-array
5435 element type is found. */
5436
5437inline tree
5439{
5440 while (TREE_CODE (type) == ARRAY_TYPE)
5441 type = TREE_TYPE (type);
5442
5443 return type;
5444}
5445
5446/* Recursively traverse down pointer type layers to pointee type. */
5447
5448inline const_tree
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. */
5466
5468extern 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
5473inline bool
5475{
5476 if (tree_fits_poly_int64_p (t))
5477 {
5478 *value = tree_to_poly_int64 (t);
5479 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
5487inline bool
5489{
5491 {
5492 *value = tree_to_poly_uint64 (t);
5493 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
5502extern tree make_tree (tree, rtx);
5503
5504/* Returns true iff CAND and BASE have equivalent language-specific
5505 qualifiers. */
5506
5507extern bool check_lang_type (const_tree cand, const_tree base);
5508
5509/* Returns true iff unqualified CAND and BASE are equivalent. */
5510
5511extern 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
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
5523
5524/* Like get_qualified_type, but creates the type if it does not
5525 exist. This function never returns NULL_TREE. */
5526
5528
5529/* Create a variant of type T with alignment ALIGN. */
5530
5531extern 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
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
5554extern hashval_t type_hash_canon_hash (tree);
5555extern tree type_hash_canon (unsigned int, tree);
5556
5558extern tree size_in_bytes_loc (location_t, const_tree);
5559inline tree
5564
5565extern HOST_WIDE_INT int_size_in_bytes (const_tree);
5566extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
5569extern 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
5596extern tree chainon (tree, tree);
5597
5598/* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
5599
5601
5602/* Return the last tree node in a chain. */
5603
5604extern tree tree_last (tree);
5605
5606/* Reverse the order of elements in a chain, and return the new head. */
5607
5608extern 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
5613extern int list_length (const_tree);
5614
5615/* Returns the first/last FIELD_DECL in a RECORD_TYPE. */
5616
5617extern tree first_field (const_tree) ATTRIBUTE_NONNULL (1);
5618extern 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
5627extern bool initializer_zerop (const_tree, bool * = NULL);
5629
5630extern 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
5636
5637/* Same as above, but if VEC is an SSA_NAME, inspect its definition. */
5638
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
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
5651
5653
5654/* Given a CONSTRUCTOR CTOR, return the element values as a vector. */
5655
5657
5658/* zerop (tree x) is nonzero if X is a constant of value 0. */
5659
5660extern bool zerop (const_tree);
5661
5662/* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
5663
5664extern bool integer_zerop (const_tree);
5665
5666/* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */
5667
5668extern 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
5673extern 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
5678extern 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
5683extern 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
5688extern 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
5694
5695/* integer_nonzerop (tree x) is nonzero if X is an integer constant
5696 with a nonzero value. */
5697
5698extern 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
5703extern bool integer_truep (const_tree);
5704
5705extern bool cst_and_fits_in_hwi (const_tree);
5707
5708/* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
5709 value 0. */
5710
5711extern 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
5716extern 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
5722extern tree save_expr (tree);
5723
5724/* Return true if T is an object with invariant address. */
5725
5726extern bool address_invariant_p (tree);
5727
5728/* Return true if T is function-invariant. */
5729
5730extern 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
5736
5737/* Look inside EXPR into simple arithmetic operations involving constants.
5738 Return the outermost non-arithmetic or non-constant node. */
5739
5741
5742/* Return which tree structure is used by T. */
5743
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
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
5761extern 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
5770extern 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) \
5776do { \
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
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
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
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
5820extern 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
5827extern tree get_narrower (tree, int *);
5828
5829/* Return true if T is an expression that get_inner_reference handles. */
5830
5831inline bool
5833{
5834 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 default:
5846 return false;
5847 }
5848}
5849
5850/* Return true T is a component with reverse storage order. */
5851
5852inline bool
5854{
5855 /* The storage order only applies to scalar components. */
5856 if (AGGREGATE_TYPE_P (TREE_TYPE (t))
5857 || POINTER_TYPE_P (TREE_TYPE (t))
5858 || VECTOR_TYPE_P (TREE_TYPE (t)))
5859 return false;
5860
5861 if (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR)
5862 t = TREE_OPERAND (t, 0);
5863
5864 switch (TREE_CODE (t))
5865 {
5866 case ARRAY_REF:
5867 case COMPONENT_REF:
5868 /* ??? Fortran can take COMPONENT_REF of a VOID_TYPE. */
5869 /* ??? UBSan can take COMPONENT_REF of a REFERENCE_TYPE. */
5870 return AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0)))
5872
5873 case BIT_FIELD_REF:
5874 case MEM_REF:
5875 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
5890inline bool
5892{
5893 if (TREE_CODE (t) != VIEW_CONVERT_EXPR)
5894 return false;
5895
5896 if (AGGREGATE_TYPE_P (TREE_TYPE (t))
5898 return true;
5899
5900 tree op = TREE_OPERAND (t, 0);
5901
5902 if (AGGREGATE_TYPE_P (TREE_TYPE (op))
5904 return true;
5905
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
5913
5914/* Returns the ultimate TRANSLATION_UNIT_DECL context of DECL or NULL. */
5915
5917
5918/* Return the FUNCTION_DECL which provides this _DECL with its context,
5919 or zero if none. */
5921
5922/* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
5923 this _DECL with its context, or zero if none. */
5925
5926/* Return true if EXPR is the real constant zero. */
5927extern bool real_zerop (const_tree);
5928
5929/* Return true if EXPR is the real constant negative zero. */
5930extern bool real_negzerop (const_tree);
5931
5932/* Initialize the iterator I with arguments from function FNDECL */
5933
5934inline void
5936{
5937 i->next = TYPE_ARG_TYPES (fntype);
5938}
5939
5940/* Return a pointer that holds the next argument if there are more arguments to
5941 handle, otherwise return NULL. */
5942
5943inline tree *
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
5952inline tree
5954{
5955 return (i->next) ? TREE_VALUE (i->next) : NULL_TREE;
5956}
5957
5958/* Advance to the next argument. */
5959inline void
5961{
5962 gcc_assert (i->next != NULL_TREE);
5963 i->next = TREE_CHAIN (i->next);
5964}
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
5971inline bool
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 */
5994extern unsigned crc32_unsigned_n (unsigned, unsigned, unsigned);
5995extern unsigned crc32_string (unsigned, const char *);
5996inline unsigned
5997crc32_unsigned (unsigned chksum, unsigned value)
5998{
5999 return crc32_unsigned_n (chksum, value, 4);
6000}
6001inline unsigned
6002crc32_byte (unsigned chksum, char byte)
6003{
6004 return crc32_unsigned_n (chksum, byte, 1);
6005}
6006extern void clean_symbol_name (char *);
6007extern tree get_file_function_name (const char *);
6010extern int type_num_arguments (const_tree);
6011extern tree type_argument_type (const_tree, unsigned) ATTRIBUTE_NONNULL (1);
6012extern bool associative_tree_code (enum tree_code);
6013extern bool commutative_tree_code (enum tree_code);
6014extern bool commutative_ternary_tree_code (enum tree_code);
6015extern bool operation_can_overflow (enum tree_code);
6020extern tree create_artificial_label (location_t);
6021extern const char *get_name (tree);
6022extern bool stdarg_p (const_tree);
6023extern bool prototype_p (const_tree);
6024extern bool auto_var_p (const_tree);
6026extern tree build_low_bits_mask (tree, unsigned);
6033extern tree lhd_gcc_personality (void);
6035extern bool warn_deprecated_use (tree, tree);
6036extern void error_unavailable_use (tree, tree);
6037extern tree cache_integer_cst (tree, bool might_duplicate = false);
6038extern const char *combined_fn_name (combined_fn);
6039
6040/* Returns true if X is a typedef decl. */
6041
6042inline bool
6044{
6045 return (x && TREE_CODE (x) == TYPE_DECL
6046 && DECL_ORIGINAL_TYPE (x) != NULL_TREE);
6047}
6048
6049/* Returns true iff TYPE is a type variant created for a typedef. */
6050
6051inline bool
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
6061inline int
6062struct_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
6069inline hashval_t
6070struct_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. */
6083inline bool
6085{
6086 return code == TRUNC_DIV_EXPR || code == EXACT_DIV_EXPR;
6087}
6088
6089/* Return true if CODE is an integer division or integer mod code. */
6090inline bool
6092{
6093 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. */
6111inline bool
6113{
6114 return (TREE_CODE_CLASS (code) == tcc_comparison
6115 || code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
6116 || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
6117 || 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. */
6122inline bool
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. */
6133inline bool
6135{
6136 return COMPLETE_TYPE_P (type)
6137 || (TREE_CODE (type) == ARRAY_TYPE
6139}
6140
6141/* Return true if the value of T could be represented as a poly_widest_int. */
6142
6143inline bool
6145{
6146 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
6152inline poly_uint64
6154{
6155 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
6161inline poly_uint64
6163{
6164 return tree_to_poly_uint64 (TREE_OPERAND (t, 2));
6165}
6166
6168extern bool really_constant_p (const_tree);
6169extern bool ptrdiff_tree_p (const_tree, poly_int64 *);
6173 ATTRIBUTE_NONNULL (1) ATTRIBUTE_NONNULL (2) ATTRIBUTE_PURE;
6174#ifndef GENERATOR_FILE
6175extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
6176#endif
6177extern bool variably_modified_type_p (tree, tree);
6178extern int tree_log2 (const_tree);
6179extern int tree_floor_log2 (const_tree);
6180extern unsigned int tree_ctz (const_tree);
6182
6183namespace inchash
6184{
6185
6186extern 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. */
6192inline hashval_t iterative_hash_expr(const_tree tree, hashval_t seed)
6193{
6194 inchash::hash hstate (seed);
6195 inchash::add_expr (tree, hstate);
6196 return hstate.end ();
6197}
6198
6199extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
6201extern bool chain_member (const_tree, const_tree);
6202extern void dump_tree_statistics (void);
6206extern bool real_onep (const_tree);
6207extern bool real_minus_onep (const_tree);
6208extern bool real_maybe_zerop (const_tree);
6209extern void init_ttree (void);
6210extern void build_common_tree_nodes (bool);
6211extern void build_common_builtin_nodes (void);
6212extern void tree_cc_finalize (void);
6213extern tree unsigned_integer_tree_node_for_type (const char *);
6214extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
6215extern tree build_nonstandard_boolean_type (unsigned HOST_WIDE_INT);
6216extern tree build_bitint_type (unsigned HOST_WIDE_INT, int);
6219extern bool subrange_type_for_debug_p (const_tree, tree *, tree *);
6220extern HOST_WIDE_INT int_cst_value (const_tree);
6221extern tree tree_block (tree);
6222extern void tree_set_block (tree, tree);
6223extern location_t *block_nonartificial_location (tree);
6224extern location_t tree_nonartificial_location (tree);
6225extern location_t tree_inlined_location (tree, bool = true);
6228extern bool virtual_method_call_p (const_tree, bool = false);
6229extern tree obj_type_ref_class (const_tree ref, bool = false);
6230extern bool types_same_for_odr (const_tree type1, const_tree type2);
6232extern bool block_may_fallthru (const_tree);
6233extern void using_eh_for_cleanups (void);
6234extern bool using_eh_for_cleanups_p (void);
6235extern const char *get_tree_code_name (enum tree_code);
6236extern void set_call_expr_flags (tree, int);
6238 walk_tree_lh);
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
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. */
6251extern 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. */
6256
6257/* Return a typenode for the "standard" C type with a given name. */
6258extern 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. */
6263
6264/* Return a tree representing the lower bound of the array mentioned in
6265 EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
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. */
6271extern 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. */
6276
6277/* Describes a "special" array member for a COMPONENT_REF. */
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. */
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. */
6297
6298/* Return true if the given node is a call to a .ACCESS_WITH_SIZE
6299 function. */
6300extern 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. */
6305
6306extern int tree_map_base_eq (const void *, const void *);
6307extern unsigned int tree_map_base_hash (const void *);
6308extern bool tree_map_base_marked_p (const void *);
6309extern void DEBUG_FUNCTION verify_type (const_tree t);
6311 bool trust_type_canonical = true);
6314extern int get_range_pos_neg (tree, gimple * = NULL);
6315
6316/* Return true for a valid pair of new and delete operators. */
6317extern bool valid_new_delete_pair_p (tree, tree, bool * = NULL);
6318
6319/* Return whether the second argument is a subtree of the first one. */
6320extern bool find_tree (tree, tree);
6321
6322/* Return simplified tree code of type that is used for canonical type
6323 merging. */
6324inline enum tree_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 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 if (code == REFERENCE_TYPE)
6341 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
6354inline bool
6356{
6357 return !(POINTER_TYPE_P (t)
6358 || TREE_CODE (t) == ARRAY_TYPE
6359 || TREE_CODE (t) == VECTOR_TYPE);
6360}
6361
6362/* Kinds of access to pass-by-reference arguments to functions. */
6371
6372#define tree_map_eq tree_map_base_eq
6373extern 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
6377extern unsigned int tree_decl_map_hash (const void *);
6378#define tree_decl_map_marked_p tree_map_base_marked_p
6379
6381{
6382 static hashval_t hash (tree_decl_map *m) { return tree_decl_map_hash (m); }
6383 static bool
6385 {
6386 return tree_decl_map_eq (a, b);
6387 }
6388
6389 static int
6391 {
6392 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
6405{
6406 static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); }
6407
6408 static bool
6410 {
6411 return a->base.from == b->base.from;
6412 }
6413
6414 static int
6416 {
6417 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. */
6424struct tree_decl_hash : ggc_ptr_hash <tree_node>
6425{
6426 static inline hashval_t hash (tree);
6427};
6428
6429inline hashval_t
6431{
6432 return DECL_UID (t);
6433}
6434
6435/* Similarly for types. Uses TYPE_UID as hash function. */
6436struct tree_type_hash : ggc_ptr_hash <tree_node>
6437{
6438 static inline hashval_t hash (tree);
6439};
6440
6441inline hashval_t
6443{
6444 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. */
6451{
6452 static inline hashval_t hash (tree);
6453};
6454
6455inline hashval_t
6457{
6458 return SSA_NAME_VERSION (t);
6459}
6460
6461/* Hasher for general trees, based on their TREE_HASH. */
6462struct tree_hash : ggc_ptr_hash <tree_node>
6463{
6464 static hashval_t hash (tree);
6465};
6466
6467inline hashval_t
6469{
6470 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. */
6476struct tree_cache_traits
6477 : simple_cache_map_traits<default_hash_traits<tree>, tree> { };
6478typedef 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. */
6482struct decl_tree_cache_traits
6483 : simple_cache_map_traits<tree_decl_hash, tree> { };
6484typedef 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. */
6488struct type_tree_cache_traits
6489 : simple_cache_map_traits<tree_type_hash, tree> { };
6490typedef hash_map<tree,tree,type_tree_cache_traits> type_tree_cache_map;
6492/* Similarly to decl_tree_cache_map, but without caching. */
6493struct decl_tree_traits
6494 : simple_hashmap_traits<tree_decl_hash, tree> { };
6495typedef 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. */
6499inline void
6500init_call_expr_arg_iterator (tree exp, call_expr_arg_iterator *iter)
6501{
6502 iter->t = exp;
6503 iter->n = call_expr_nargs (exp);
6504 iter->i = 0;
6505}
6506
6507inline void
6508init_const_call_expr_arg_iterator (const_tree exp, const_call_expr_arg_iterator *iter)
6509{
6510 iter->t = exp;
6511 iter->n = call_expr_nargs (exp);
6512 iter->i = 0;
6513}
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. */
6517inline tree
6518next_call_expr_arg (call_expr_arg_iterator *iter)
6519{
6520 tree result;
6521 if (iter->i >= iter->n)
6522 return NULL_TREE;
6523 result = CALL_EXPR_ARG (iter->t, iter->i);
6524 iter->i++;
6525 return result;
6527
6528inline const_tree
6529next_const_call_expr_arg (const_call_expr_arg_iterator *iter)
6530{
6531 const_tree result;
6532 if (iter->i >= iter->n)
6533 return NULL_TREE;
6534 result = CALL_EXPR_ARG (iter->t, iter->i);
6535 iter->i++;
6536 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)) */
6543inline tree
6545{
6546 init_call_expr_arg_iterator (exp, iter);
6547 return next_call_expr_arg (iter);
6548}
6549
6550inline const_tree
6552{
6553 init_const_call_expr_arg_iterator (exp, iter);
6554 return next_const_call_expr_arg (iter);
6556
6557/* Test whether there are more arguments in abstract argument list iterator
6558 ITER, without changing its state. */
6559inline bool
6561{
6562 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)))
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. */
6576inline bool
6578{
6579 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. */
6594inline tree
6596{
6598
6599 return builtin_info[(size_t)fncode].decl;
6600}
6601
6602/* Return the tree node for an implicit builtin function or NULL. */
6603inline tree
6605{
6606 size_t uns_fncode = (size_t)fncode;
6608
6609 if (!builtin_info[uns_fncode].implicit_p)
6610 return NULL_TREE;
6611
6612 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. */
6619
6620/* Set explicit builtin function nodes and whether it is an implicit
6621 function. */
6622
6623inline void
6624set_builtin_decl (enum built_in_function fncode, tree decl, bool implicit_p)
6625{
6626 size_t ufncode = (size_t)fncode;
6627
6629 && (decl != NULL_TREE || !implicit_p));
6630
6631 builtin_info[ufncode].decl = decl;
6632 builtin_info[ufncode].implicit_p = implicit_p;
6633 builtin_info[ufncode].declared_p = false;
6634}
6635
6636/* Set the implicit flag for a builtin function. */
6637
6638inline void
6639set_builtin_decl_implicit_p (enum built_in_function fncode, bool implicit_p)
6640{
6641 size_t uns_fncode = (size_t)fncode;
6642
6644 && builtin_info[uns_fncode].decl != NULL_TREE);
6645
6646 builtin_info[uns_fncode].implicit_p = implicit_p;
6647}
6648
6649/* Set the declared flag for a builtin function. */
6650
6651inline void
6652set_builtin_decl_declared_p (enum built_in_function fncode, bool declared_p)
6653{
6654 size_t uns_fncode = (size_t)fncode;
6655
6657 && builtin_info[uns_fncode].decl != NULL_TREE);
6658
6659 builtin_info[uns_fncode].declared_p = declared_p;
6660}
6661
6662/* Return whether the standard builtin function can be used as an explicit
6663 function. */
6664
6665inline bool
6667{
6669 return (builtin_info[(size_t)fncode].decl != NULL_TREE);
6670}
6671
6672/* Return whether the standard builtin function can be used implicitly. */
6673
6674inline bool
6676{
6677 size_t uns_fncode = (size_t)fncode;
6678
6680 return (builtin_info[uns_fncode].decl != NULL_TREE
6681 && builtin_info[uns_fncode].implicit_p);
6682}
6683
6684/* Return whether the standard builtin function was declared. */
6685
6686inline bool
6688{
6689 size_t uns_fncode = (size_t)fncode;
6692 return (builtin_info[uns_fncode].decl != NULL_TREE
6693 && 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
6706inline bool
6708{
6709 tree name_decl = DECL_NAME (fndecl);
6710 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 && (DECL_CONTEXT (fndecl) == NULL_TREE
6715 || TREE_CODE (DECL_CONTEXT (fndecl)) == TRANSLATION_UNIT_DECL)
6716 && TREE_PUBLIC (fndecl))
6717 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. */
6724inline bool
6726{
6727 return (TREE_STATIC (t) || DECL_EXTERNAL (t));
6728}
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
6734inline bool
6737 return (TREE_CODE (var) != CONST_DECL
6738 && (TREE_PUBLIC (var)
6740 || TREE_ADDRESSABLE (var))
6741 && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
6743 || (TREE_CODE (var) == VAR_DECL
6744 && DECL_NONALIASED (var)))));
6747/* Return pointer to optimization flags of FNDECL. */
6748inline struct cl_optimization *
6749opts_for_fn (const_tree fndecl)
6750{
6751 tree fn_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl);
6752 if (fn_opts == NULL_TREE)
6753 fn_opts = optimization_default_node;
6754 return TREE_OPTIMIZATION (fn_opts);
6755}
6757/* Return pointer to target flags of FNDECL. */
6758inline cl_target_option *
6760{
6761 tree fn_opts = DECL_FUNCTION_SPECIFIC_TARGET (fndecl);
6762 if (fn_opts == NULL_TREE)
6764 return fn_opts == NULL_TREE ? NULL : TREE_TARGET_OPTION (fn_opts);
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. */
6775extern tree make_anon_name ();
6776
6777/* The tree and const_tree overload templates. */
6778namespace wi
6779{
6781 {
6782 private:
6784
6785 public:
6786 unextended_tree () {}
6787 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; }
6794
6795 template <>
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
6807 private:
6809
6810 public:
6811 extended_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
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> >
6838
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> >
6847 typedef const poly_int <NUM_POLY_INT_COEFFS,
6848 generic_wide_int <offset_extended_tree> >
6850 typedef const poly_int <NUM_POLY_INT_COEFFS,
6851 generic_wide_int <unextended_tree> >
6853
6857
6858 template <int N>
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). */
6882typedef generic_wide_int <wi::extended_tree <WIDEST_INT_MAX_PRECISION * 2> >
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
6921{
6922 return t;
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.
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
6946{
6947 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:
6968 wi::tree_to_wide_ref wt = wi::to_wide (t);
6969
6970 instead of:
6971
6972 wide_int wt = wi::to_wide (t). */
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
6985inline wide_int
6986wi::to_wide (const_tree t, unsigned int prec)
6988 return wide_int::from (wi::to_wide (t), prec, TYPE_SIGN (TREE_TYPE (t)));
6989}
6990
6991template <int N>
6993 : m_t (t)
6994{
6996}
6997
6998template <int N>
6999inline unsigned int
7001{
7002 return N;
7003}
7004
7005template <int N>
7006inline const HOST_WIDE_INT *
7008{
7009 return &TREE_INT_CST_ELT (m_t, 0);
7010}
7011
7012template <int N>
7013inline unsigned int
7015{
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 unsigned int ext_len = TREE_INT_CST_EXT_NUNITS (m_t);
7022 if (ext_len <= OFFSET_INT_ELTS)
7023 return ext_len;
7024 return TREE_INT_CST_NUNITS (m_t);
7025 }
7026 else if (N >= WIDEST_INT_MAX_PRECISION)
7027 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 ();
7034
7035inline unsigned int
7037{
7038 return TYPE_PRECISION (TREE_TYPE (m_t));
7039}
7040
7041inline const HOST_WIDE_INT *
7043{
7044 return &TREE_INT_CST_ELT (m_t, 0);
7045}
7046
7047inline unsigned int
7049{
7050 return TREE_INT_CST_NUNITS (m_t);
7051}
7052
7053/* Return the value of a POLY_INT_CST in its native precision. */
7054
7057{
7058 poly_int <NUM_POLY_INT_COEFFS, generic_wide_int <wi::unextended_tree> > res;
7059 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
7060 res.coeffs[i] = POLY_INT_CST_COEFF (x, i);
7061 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
7069{
7070 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 return t;
7079}
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
7086{
7087 if (POLY_INT_CST_P (t))
7088 {
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 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
7103{
7104 if (POLY_INT_CST_P (t))
7106 return t;
7107}
7108
7109template <int N>
7110inline generic_wide_int <wi::extended_tree <N> >
7111wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
7112 wi::INL_CONST_PRECISION>::zero (const extended &x)
7114 return build_zero_cst (TREE_TYPE (x.get_tree ()));
7115}
7116
7117template <int N>
7118inline generic_wide_int <wi::extended_tree <N> >
7119wi::ints_for <generic_wide_int <wi::extended_tree <N> >,
7120 wi::CONST_PRECISION>::zero (const extended &x)
7121{
7122 return build_zero_cst (TREE_TYPE (x.get_tree ()));
7123}
7124
7125inline generic_wide_int <wi::unextended_tree>
7126wi::ints_for <generic_wide_int <wi::unextended_tree>,
7127 wi::VAR_PRECISION>::zero (const unextended &x)
7128{
7129 return build_zero_cst (TREE_TYPE (x.get_tree ()));
7130}
7132namespace wi
7133{
7134 template <typename T>
7135 bool fits_to_boolean_p (const T &x, const_tree);
7136
7137 template <typename T>
7138 bool fits_to_tree_p (const T &x, const_tree);
7139
7142#ifndef GENERATOR_FILE
7143 wide_int from_mpz (const_tree, mpz_t, bool);
7144#endif
7145}
7146
7147template <typename T>
7148bool
7149wi::fits_to_boolean_p (const T &x, const_tree type)
7150{
7151 typedef typename poly_int_traits<T>::int_type int_type;
7152 return (known_eq (x, int_type (0))
7153 || known_eq (x, int_type (TYPE_UNSIGNED (type) ? 1 : -1)));
7154}
7155
7156template <typename T>
7157bool
7158wi::fits_to_tree_p (const T &x, const_tree type)
7159{
7160 /* Non-standard boolean types can have arbitrary precision but various
7161 transformations assume that they can only take values 0 and +/-1. */
7162 if (TREE_CODE (type) == BOOLEAN_TYPE)
7164
7166 return known_eq (x, zext (x, TYPE_PRECISION (type)));
7167 else
7168 return known_eq (x, sext (x, TYPE_PRECISION (type)));
7169}
7170
7171/* Produce the smallest number that is represented in TYPE. The precision
7172 and sign are taken from TYPE. */
7173inline wide_int
7175{
7177}
7179/* Produce the largest number that is represented in TYPE. The precision
7180 and sign are taken from TYPE. */
7181inline wide_int
7183{
7185}
7186
7187/* Return true if INTEGER_CST T1 is less than INTEGER_CST T2,
7188 extending both according to their respective TYPE_SIGNs. */
7189
7190inline bool
7192{
7193 return wi::to_widest (t1) < wi::to_widest (t2);
7194}
7195
7196/* Return true if INTEGER_CST T1 is less than or equal to INTEGER_CST T2,
7197 extending both according to their respective TYPE_SIGNs. */
7198
7199inline bool
7201{
7202 return wi::to_widest (t1) <= wi::to_widest (t2);
7203}
7204
7205/* Returns -1 if T1 < T2, 0 if T1 == T2, and 1 if T1 > T2. T1 and T2
7206 are both INTEGER_CSTs and their values are extended according to their
7207 respective TYPE_SIGNs. */
7209inline int
7211{
7212 return wi::cmps (wi::to_widest (t1), wi::to_widest (t2));
7213}
7214
7215/* FIXME - These declarations belong in builtins.h, expr.h and emit-rtl.h,
7216 but none of these files are allowed to be included from front ends.
7217 They should be split in two. One suitable for the FEs, the other suitable
7218 for the BE. */
7219
7220/* Assign the RTX to declaration. */
7221extern void set_decl_rtl (tree, rtx);
7222extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
7223
7224/* Given an expression EXP that is a handled_component_p,
7225 look for the ultimate containing object, which is returned and specify
7226 the access position and size. */
7228 tree *, machine_mode *, int *, int *, int *);
7229
7230extern tree build_personality_function (const char *);
7231
7232struct GTY(()) int_n_trees_t {
7233 /* These parts are initialized at runtime */
7234 tree signed_type;
7235 tree unsigned_type;
7236};
7237
7238/* This is also in machmode.h */
7239extern bool int_n_enabled_p[NUM_INT_N_ENTS];
7240extern GTY(()) struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS];
7241
7242/* Like bit_position, but return as an integer. It must be representable in
7243 that way (since it could be a signed value, we don't have the
7244 option of returning -1 like int_size_in_byte can. */
7245
7246inline HOST_WIDE_INT
7249 return ((wi::to_offset (DECL_FIELD_OFFSET (field)) << LOG2_BITS_PER_UNIT)
7250 + wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi ();
7251}
7252
7253/* Return true if it makes sense to consider alias set for a type T. */
7254
7255inline bool
7257{
7258 /* Function and method types are never accessed as memory locations. */
7259 if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE)
7260 return false;
7261
7262 if (COMPLETE_TYPE_P (t))
7263 return true;
7265 /* Incomplete types cannot be accessed in general except for arrays
7266 where we can fetch its element despite we have no array bounds. */
7267 if (TREE_CODE (t) == ARRAY_TYPE && COMPLETE_TYPE_P (TREE_TYPE (t)))
7268 return true;
7269
7270 return false;
7271}
7272
7273extern location_t set_block (location_t loc, tree block);
7274
7275extern void gt_ggc_mx (tree &);
7276extern void gt_pch_nx (tree &);
7277extern void gt_pch_nx (tree &, gt_pointer_operator, void *);
7278extern void gt_ggc_mx (tree_raw_data *);
7279extern void gt_pch_nx (tree_raw_data *);
7280extern void gt_pch_nx (tree_raw_data *, gt_pointer_operator, void *);
7281
7282extern bool nonnull_arg_p (const_tree);
7283extern bool is_empty_type (const_tree);
7290
7291extern location_t
7292set_source_range (tree expr, location_t start, location_t finish);
7293
7294extern location_t
7295set_source_range (tree expr, source_range src_range);
7296
7297/* Return true if it makes sense to promote/demote from_type to to_type. */
7298inline bool
7300{
7301 unsigned int to_type_precision = TYPE_PRECISION (to_type);
7302
7303 /* OK to promote if to_type is no bigger than word_mode. */
7304 if (to_type_precision <= GET_MODE_PRECISION (word_mode))
7305 return true;
7306
7307 /* Otherwise, allow only if narrowing or same precision conversions. */
7308 return to_type_precision <= TYPE_PRECISION (from_type);
7309}
7310
7311/* Pointer type used to declare builtins before we have seen its real
7312 declaration. */
7313class builtin_structptr_type
7314{
7315public:
7316 tree& node;
7317 tree& base;
7318 const char *str;
7319};
7320extern const builtin_structptr_type builtin_structptr_types[6];
7321
7322/* Return true if type T has the same precision as its underlying mode. */
7323
7324inline bool
7326{
7328}
7329
7330/* Helper functions for fndecl_built_in_p. */
7331
7332inline bool
7334{
7335 return name0 == name1;
7336}
7337
7338/* Recursive case for two or more names. */
7339
7340template <typename... F>
7341inline bool
7343 built_in_function name2, F... names)
7344{
7345 return name0 == name1 || built_in_function_equal_p (name0, name2, names...);
7346}
7347
7348/* Return true if a FUNCTION_DECL NODE is a GCC built-in function.
7349
7350 Note that it is different from the DECL_IS_UNDECLARED_BUILTIN
7351 accessor, as this is impervious to user declaration. */
7352
7353inline bool
7355{
7356 return DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN;
7357}
7358
7359/* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7360 of class KLASS. */
7361
7362inline bool
7365 return fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass;
7366}
7368/* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7369 of class KLASS with name equal to NAME. */
7370
7371inline bool
7372fndecl_built_in_p (const_tree node, unsigned int name, built_in_class klass)
7374 return (fndecl_built_in_p (node, klass)
7375 && DECL_UNCHECKED_FUNCTION_CODE (node) == name);
7376}
7377
7378/* Return true if a FUNCTION_DECL NODE is a GCC built-in function
7379 of BUILT_IN_NORMAL class with name equal to NAME1 (or other mentioned
7380 NAMES). */
7381
7382template <typename... F>
7383inline bool
7388 name1, names...));
7389}
7390
7391/* Returns true if the function decl NODE is an alloca. */
7392inline bool
7394{
7396 return false;
7398}
7399
7400/* A struct for encapsulating location information about an operator
7401 and the operation built from it.
7402
7403 m_operator_loc is the location of the operator
7404 m_combined_loc is the location of the compound expression.
7405
7406 For example, given "a && b" the, operator location is:
7407 a && b
7408 ^~
7409 and the combined location is:
7410 a && b
7411 ~~^~~~
7412 Capturing this information allows for class binary_op_rich_location
7413 to provide detailed information about e.g. type mismatches in binary
7414 operations where enough location information is available:
7415
7416 arg_0 op arg_1
7417 ~~~~~ ^~ ~~~~~
7418 | |
7419 | arg1 type
7420 arg0 type
7421
7422 falling back to just showing the combined location:
7423
7424 arg_0 op arg_1
7425 ~~~~~~^~~~~~~~
7426
7427 where it is not. */
7428
7429class op_location_t
7430{
7431public:
7432 location_t m_operator_loc;
7433 location_t m_combined_loc;
7434
7435 /* 1-argument ctor, for constructing from a combined location. */
7436 op_location_t (location_t combined_loc)
7437 : m_operator_loc (UNKNOWN_LOCATION), m_combined_loc (combined_loc)
7438 {}
7439
7440 /* 2-argument ctor, for distinguishing between the operator's location
7441 and the combined location. */
7442 op_location_t (location_t operator_loc, location_t combined_loc)
7443 : m_operator_loc (operator_loc), m_combined_loc (combined_loc)
7444 {}
7445
7446 /* Implicitly convert back to a location_t, using the combined location. */
7447 operator location_t () const { return m_combined_loc; }
7448};
7449
7450/* Code that doesn't refer to any warning. Has no effect on suppression
7451 functions. */
7452constexpr opt_code no_warning = opt_code ();
7453/* Wildcard code that refers to all warnings. */
7454constexpr opt_code all_warnings = N_OPTS;
7455
7456/* Return the disposition for a warning (or all warnings by default)
7457 at a location. */
7458extern bool warning_suppressed_at (location_t, opt_code = all_warnings);
7459/* Set the disposition for a warning (or all warnings by default)
7460 at a location to disabled by default. */
7461extern bool suppress_warning_at (location_t, opt_code = all_warnings,
7462 bool = true);
7463/* Overwrite warning disposition bitmap for a location with given spec. */
7464extern void put_warning_spec_at (location_t loc, unsigned);
7465/* Copy warning disposition from one location to another. */
7466extern void copy_warning (location_t, location_t);
7467
7468/* Return the disposition for a warning (or all warnings by default)
7469 for an expression. */
7470extern bool warning_suppressed_p (const_tree, opt_code = all_warnings);
7471/* Set the disposition for a warning (or all warnings by default)
7472 at a location to disabled by default. */
7473extern void suppress_warning (tree, opt_code = all_warnings, bool = true)
7474 ATTRIBUTE_NONNULL (1);
7475/* Copy warning disposition from one expression to another. */
7476extern void copy_warning (tree, const_tree);
7477
7478/* Whether the tree might have a warning spec. */
7479extern bool has_warning_spec (const_tree);
7480/* Retrieve warning spec bitmap for tree streaming. */
7481extern unsigned get_warning_spec (const_tree);
7482/* Overwrite warning spec bitmap for a tree with given spec. */
7483extern void put_warning_spec (tree, unsigned);
7484
7485/* Return the zero-based number corresponding to the argument being
7486 deallocated if FNDECL is a deallocation function or an out-of-bounds
7487 value if it isn't. */
7488extern unsigned fndecl_dealloc_argno (tree);
7489
7490/* If an expression refers to a character array or pointer declared
7491 attribute nonstring, return a decl for that array or pointer and
7492 if nonnull, set the second argument to the referenced enclosing
7493 object or pointer. Otherwise return null. */
7495
7496/* Returns the version string for a decl with target_version attribute.
7497 Returns an invalid string_slice if no attribute is present. */
7498extern string_slice get_target_version (const tree);
7499/* Returns a vector of the version strings from a target_clones attribute on
7500 a decl. Can also record the number of default versions found.
7501 Use bool to control whether or not the results should
7502 be filtered with TARGET_CHECK_TARGET_CLONE_VERSION. */
7504 (const tree,int * = NULL, bool = true);
7505/* Returns a vector of the version strings from a target_clones attribute
7506 directly. Additionally takes a bool to control whether or not the results
7507 should be filtered with TARGET_CHECK_TARGET_CLONE_VERSION. */
7509 (const tree, int *, bool = true);
7510
7511/* Checks if two decls define any overlapping versions. */
7512extern bool disjoint_version_decls (tree, tree);
7513/* Checks if two overlapping decls are not mergeable. */
7514extern bool diagnose_versioned_decls (tree, tree);
7515
7516/* Unshare tree if needed. */
7517extern tree unshare_expr (tree);
7518
7519/* Unshare tree if needed.
7520 Removing the locations if an expr. */
7522
7523extern void copy_if_shared (tree *, void * = NULL);
7524
7525/* Make a vector to hold an unexpanded omp iterator vector. */
7526inline tree
7527make_omp_iterator (void)
7528{
7529 return make_tree_vec (6);
7530}
7531
7532/* Make a vector to hold an expanded omp iterator vector. */
7533inline tree
7535{
7536 return make_tree_vec (10);
7537}
7538
7539#endif /* GCC_TREE_H */
void gt_pch_nx(bbitmap< N > *)
Definition bbitmap.h:226
void gt_ggc_mx(bbitmap< N > *)
Definition bbitmap.h:220
auto_suppress_location_wrappers()
Definition tree.h:1410
~auto_suppress_location_wrappers()
Definition tree.h:1411
Definition vec.h:1667
Definition tree.h:7245
tree & base
Definition tree.h:7248
const char * str
Definition tree.h:7249
Definition tree.h:84
code_helper(tree_code code)
Definition tree.h:87
tree_code safe_as_tree_code() const
Definition tree.h:115
bool is_internal_fn() const
Definition tree.h:140
code_helper()
Definition tree.h:86
bool operator!=(const code_helper &other)
Definition tree.h:102
code_helper(internal_fn fn)
Definition tree.h:89
bool is_fn_code() const
Definition tree.h:95
bool operator==(const code_helper &other)
Definition tree.h:101
int rep
Definition tree.h:107
code_helper(combined_fn fn)
Definition tree.h:88
int get_rep() const
Definition tree.h:98
bool is_tree_code() const
Definition tree.h:94
bool is_builtin_fn() const
Definition tree.h:146
combined_fn safe_as_fn_code() const
Definition tree.h:125
Definition genmatch.cc:1627
Definition wide-int.h:776
Definition hash-map.h:40
Definition hash-set.h:37
Definition inchash.h:38
hashval_t end() const
Definition inchash.h:49
op_location_t(location_t operator_loc, location_t combined_loc)
Definition tree.h:7373
op_location_t(location_t combined_loc)
Definition tree.h:7367
location_t m_operator_loc
Definition tree.h:7363
location_t m_combined_loc
Definition tree.h:7364
Definition poly-int.h:378
C coeffs[N]
Definition poly-int.h:433
Definition vec.h:2502
tree * end()
Definition tree.h:5170
tree v
Definition tree.h:5166
tree_vec_range(tree v)
Definition tree.h:5168
tree * begin()
Definition tree.h:5169
Definition tree.h:6737
unsigned int get_precision() const
Definition tree.h:6931
const_tree m_t
Definition tree.h:6739
extended_tree(const_tree)
Definition tree.h:6923
const_tree get_tree() const
Definition tree.h:6748
extended_tree()
Definition tree.h:6742
const HOST_WIDE_INT * get_val() const
Definition tree.h:6938
unsigned int get_len() const
Definition tree.h:6945
Definition wide-int.h:707
Definition tree.h:6712
const_tree get_tree() const
Definition tree.h:6723
unextended_tree()
Definition tree.h:6717
unsigned int get_len() const
Definition tree.h:6979
unextended_tree(const_tree t)
Definition tree.h:6718
unsigned int get_precision() const
Definition tree.h:6967
const HOST_WIDE_INT * get_val() const
Definition tree.h:6973
const_tree m_t
Definition tree.h:6714
static wide_int from(const wide_int_ref &, unsigned int, signop)
Definition wide-int.h:1289
bool debug
Definition collect-utils.cc:34
struct rtx_def * rtx
Definition coretypes.h:57
unsigned char addr_space_t
Definition coretypes.h:191
tls_model
Definition coretypes.h:215
#define ADDR_SPACE_GENERIC
Definition coretypes.h:194
excess_precision_type
Definition coretypes.h:454
const union tree_node * const_tree
Definition coretypes.h:98
#define GTY(x)
Definition coretypes.h:41
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
void(*) gt_pointer_operator(void *, void *, void *)
Definition coretypes.h:477
void ATTRIBUTE_NORETURN
Definition diagnostic-core.h:76
scalar_int_mode word_mode
Definition emit-rtl.cc:78
void set_decl_rtl(tree t, rtx x)
Definition emit-rtl.cc:1477
tree make_tree(tree type, rtx x)
Definition expmed.cc:5711
tree get_inner_reference(tree exp, poly_int64 *pbitsize, poly_int64 *pbitpos, tree *poffset, machine_mode *pmode, int *punsignedp, int *preversep, int *pvolatilep)
Definition expr.cc:8530
bool complete_ctor_at_level_p(const_tree type, HOST_WIDE_INT num_elts, const_tree last_type)
Definition expr.cc:7392
tree build_personality_function(const char *lang)
Definition expr.cc:14463
uint64_t sanitize_code_type
Definition flag-types.h:359
tree protected_set_expr_location_unshare(tree x, location_t loc)
Definition fold-const.cc:296
double exp(double)
void copy_warning(location_t to, location_t from)
Definition gcc-diagnostic-spec.cc:205
bool warning_suppressed_at(location_t loc, opt_code opt)
Definition gcc-diagnostic-spec.cc:125
bool suppress_warning_at(location_t loc, opt_code opt, bool supp)
Definition gcc-diagnostic-spec.cc:148
void put_warning_spec_at(location_t loc, unsigned bits)
Definition gcc-diagnostic-spec.cc:184
built_in_function
Definition genmatch.cc:1018
combined_fn
Definition genmatch.cc:1029
bool commutative_ternary_tree_code(enum tree_code code)
Definition genmatch.cc:1083
internal_fn
Definition genmatch.cc:1024
tree_code
Definition genmatch.cc:1011
bool commutative_tree_code(enum tree_code code)
Definition genmatch.cc:1046
#define NUM_POLY_INT_COEFFS
Definition genmodes.cc:859
#define N
Definition gensupport.cc:202
bool ggc_marked_p(const void *p)
Definition ggc-page.cc:1681
void suppress_warning(gimple *, opt_code=all_warnings, bool=true) ATTRIBUTE_NONNULL(1)
Definition warning-control.cc:173
bool warning_suppressed_p(const gimple *, opt_code=all_warnings) ATTRIBUTE_NONNULL(1)
Definition warning-control.cc:138
int exact_log2(unsigned HOST_WIDE_INT x)
Definition hwint.cc:82
bool pow2p_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.h:158
#define HOST_WIDE_INT_M1U
Definition hwint.h:55
#define HOST_WIDE_INT_1U
Definition hwint.h:53
class line_maps * line_table
Definition input.cc:43
location_t input_location
Definition input.cc:41
#define LOCATION_LOCUS(LOC)
Definition input.h:138
#define UNKNOWN_LOCATION
Definition input.h:32
tree obj_type_ref_class(const_tree ref, bool for_dump_p)
Definition ipa-devirt.cc:1986
bool types_same_for_odr(const_tree type1, const_tree type2)
Definition ipa-devirt.cc:436
bool int_n_enabled_p[NUM_INT_N_ENTS]
Definition tree.cc:293
ALWAYS_INLINE poly_uint16 GET_MODE_PRECISION(machine_mode mode)
Definition machmode.h:710
Definition custom-sarif-properties/state-graphs.h:33
Definition fold-const.cc:4395
void add_expr(const_tree t, inchash::hash &hstate, unsigned int flags)
Definition fold-const.cc:4403
Definition double-int.h:439
precision_type
Definition wide-int.h:387
@ INL_CONST_PRECISION
Definition wide-int.h:398
@ VAR_PRECISION
Definition wide-int.h:394
@ CONST_PRECISION
Definition wide-int.h:402
wide_int min_value(machine_mode, signop)
Definition rtl.h:2381
const poly_int< NUM_POLY_INT_COEFFS, generic_wide_int< unextended_tree > > tree_to_poly_wide_ref
Definition tree.h:6783
tree_to_offset_ref to_offset(const_tree)
Definition tree.h:6876
tree_to_poly_offset_ref to_poly_offset(const_tree)
Definition tree.h:7016
int cmps(const T1 &, const T2 &)
Definition wide-int.h:2445
const generic_wide_int< widest_extended_tree > tree_to_widest_ref
Definition tree.h:6765
UNARY_FUNCTION zext(const T &, unsigned int)
extended_tree< ADDR_MAX_PRECISION > offset_extended_tree
Definition tree.h:6763
tree_to_poly_widest_ref to_poly_widest(const_tree)
Definition tree.h:6999
bool fits_to_tree_p(const T &x, const_tree)
Definition tree.h:7089
const generic_wide_int< wide_int_ref_storage< false, false > > tree_to_wide_ref
Definition tree.h:6768
const generic_wide_int< offset_extended_tree > tree_to_offset_ref
Definition tree.h:6766
hwi_with_prec zero(unsigned int)
Definition wide-int.h:2016
const poly_int< NUM_POLY_INT_COEFFS, generic_wide_int< offset_extended_tree > > tree_to_poly_offset_ref
Definition tree.h:6780
unsigned int get_precision(const T &)
Definition wide-int.h:2164
tree_to_widest_ref to_widest(const_tree)
Definition tree.h:6851
rtx_to_poly_wide_ref to_poly_wide(const_rtx, machine_mode)
Definition rtl.h:2426
Ca unsigned int precision
Definition poly-int.h:746
wide_int from_mpz(const_tree, mpz_t, bool)
Definition wide-int.cc:252
bool fits_to_boolean_p(const T &x, const_tree)
Definition tree.h:7080
wide_int max_value(machine_mode, signop)
Definition rtl.h:2389
extended_tree< WIDEST_INT_MAX_PRECISION > widest_extended_tree
Definition tree.h:6762
tree_to_wide_ref to_wide(const_tree)
Definition tree.h:6906
UNARY_FUNCTION sext(const T &, unsigned int)
const poly_int< NUM_POLY_INT_COEFFS, generic_wide_int< widest_extended_tree > > tree_to_poly_widest_ref
Definition tree.h:6777
i
Definition poly-int.h:750
poly_int< NUM_POLY_INT_COEFFS, unsigned HOST_WIDE_INT > poly_uint64
Definition poly-int-types.h:25
poly_int< NUM_POLY_INT_COEFFS, wide_int_ref > poly_wide_int_ref
Definition poly-int-types.h:28
poly_int< NUM_POLY_INT_COEFFS, HOST_WIDE_INT > poly_int64
Definition poly-int-types.h:24
#define known_eq(A, B)
i
Definition poly-int.h:776
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
signop
Definition signop.h:28
#define PASS_MEM_STAT
Definition statistics.h:54
#define CXX_MEM_STAT_INFO
Definition statistics.h:58
Definition tree-loop-distribution.cc:240
Definition tree-core.h:2435
int n
Definition tree-core.h:2437
int i
Definition tree-core.h:2438
tree t
Definition tree-core.h:2436
Definition lra-remat.cc:91
Definition tree-core.h:2441
int n
Definition tree-core.h:2443
int i
Definition tree-core.h:2444
const_tree t
Definition tree-core.h:2442
Definition genautomata.cc:499
Definition double-int.h:50
Definition tree-core.h:2395
Definition hash-traits.h:328
Definition hash-traits.h:321
Definition gimple.h:225
Definition tree.h:7163
tree signed_type
Definition tree.h:7165
tree unsigned_type
Definition tree.h:7166
poly_coeff_traits< T >::int_type int_type
Definition poly-int.h:198
Definition tree.h:2592
constexpr void remove(cv_qualifier qual)
Definition tree.h:2637
qualifier_set()=default
constexpr void set_as(addr_space_t as)
Definition tree.h:2644
cv_qualifier m_cv_quals
Definition tree.h:2775
WARN_UNUSED_RESULT constexpr qualifier_set without(cv_qualifier qual) const
Definition tree.h:2660
constexpr bool nonempty_p() const
Definition tree.h:2763
constexpr std::pair< cv_qualifier, addr_space_t > split() const
Definition tree.h:2757
constexpr addr_space_t addr_space() const
Definition tree.h:2693
merge_error
Definition tree.h:2718
WARN_UNUSED_RESULT constexpr cv_qualifier intersect(cv_qualifier other_cv) const
Definition tree.h:2698
join_error
Definition tree.h:2731
constexpr qualifier_set(cv_qualifier cv_quals, addr_space_t as)
Definition tree.h:2623
bool superset_of(qualifier_set subset, bool nop_only=false) const
Definition tree.cc:5793
addr_space_t m_addr_space
Definition tree.h:2776
WARN_UNUSED_RESULT constexpr qualifier_set with_as(addr_space_t as) const
Definition tree.h:2669
gcc::expected< qualifier_set, merge_error > merge(qualifier_set other, bool strict_addr_space=false) const
Definition tree.cc:5719
friend constexpr bool operator==(const qualifier_set &a, const qualifier_set &b)
Definition tree.h:2740
gcc::expected< qualifier_set, join_error > join(qualifier_set other) const
Definition tree.cc:5762
WARN_UNUSED_RESULT constexpr qualifier_set with(cv_qualifier qual) const
Definition tree.h:2651
constexpr cv_qualifier cv_quals() const
Definition tree.h:2683
constexpr qualifier_set(cv_qualifier cv_quals)
Definition tree.h:2615
friend constexpr bool operator!=(const qualifier_set &a, const qualifier_set &b)
Definition tree.h:2747
constexpr bool has(cv_qualifier other_cv) const
Definition tree.h:2703
WARN_UNUSED_RESULT constexpr qualifier_set symmetric_difference(cv_qualifier qual) const
Definition tree.h:2710
constexpr void add(cv_qualifier qual)
Definition tree.h:2630
Definition cse.cc:4184
Definition hash-map-traits.h:104
Definition hash-map-traits.h:33
union tree_base::@216040220236163152164012241125060173100217046066 u
Definition tree-core.h:1848
Definition tree.h:6425
static hashval_t hash(tree)
Definition tree.h:6430
Definition tree.h:6381
static bool equal(tree_decl_map *a, tree_decl_map *b)
Definition tree.h:6384
static hashval_t hash(tree_decl_map *m)
Definition tree.h:6382
static int keep_cache_entry(tree_decl_map *&m)
Definition tree.h:6390
Definition tree-core.h:2413
struct tree_map_base base
Definition tree-core.h:2414
tree operands[1]
Definition tree-core.h:1773
Definition tree-core.h:2141
enum built_in_class built_in_class
Definition tree-core.h:2163
unsigned int function_code
Definition tree-core.h:2161
Definition tree.h:6463
static hashval_t hash(tree)
Definition tree.h:6468
tree from
Definition tree-core.h:2401
tree ops[1]
Definition tree-core.h:1845
enum omp_clause_code code
Definition tree-core.h:1822
Definition tree-core.h:1671
Definition tree.h:6451
static hashval_t hash(tree)
Definition tree.h:6456
Definition tree.h:6437
static hashval_t hash(tree)
Definition tree.h:6442
Definition tree.h:6405
static hashval_t hash(tree_vec_map *m)
Definition tree.h:6406
static bool equal(tree_vec_map *a, tree_vec_map *b)
Definition tree.h:6409
static int keep_cache_entry(tree_vec_map *&m)
Definition tree.h:6415
Definition tree-core.h:2425
struct tree_map_base base
Definition tree-core.h:2426
tree a[1]
Definition tree-core.h:1707
Definition gengtype.h:252
Definition vec.h:450
static const bool is_sign_extended
Definition tree.h:6757
static const unsigned int precision
Definition tree.h:6759
static const bool needs_write_val_arg
Definition tree.h:6758
static const bool host_dependent_precision
Definition tree.h:6756
static enum precision_type precision_type
Definition tree.h:6755
static enum precision_type precision_type
Definition tree.h:6729
static const bool is_sign_extended
Definition tree.h:6731
static const bool needs_write_val_arg
Definition tree.h:6732
static const bool host_dependent_precision
Definition tree.h:6730
Definition wide-int.h:427
generic_wide_int< extended_tree< N > > extended
Definition tree.h:6799
generic_wide_int< extended_tree< N > > extended
Definition tree.h:6792
generic_wide_int< unextended_tree > unextended
Definition tree.h:6806
Definition wide-int.h:2041
static int zero(const T &)
Definition wide-int.h:2042
#define NULL
Definition system.h:55
#define gcc_assert(EXPR)
Definition system.h:772
#define gcc_unreachable()
Definition system.h:799
#define true
Definition system.h:845
#define WARN_UNUSED_RESULT
Definition system.h:791
#define bool
Definition system.h:844
#define STATIC_ASSERT(X)
Definition system.h:822
#define DEBUG_FUNCTION
Definition system.h:1145
#define gcc_checking_assert(EXPR)
Definition system.h:779
@ END_BUILTINS
Definition tree-core.h:3619
cv_qualifier
Definition tree-core.h:713
@ TYPE_UNQUALIFIED
Definition tree-core.h:714
tree(*) walk_tree_fn(tree *, int *, void *)
Definition tree-core.h:1181
omp_clause_code
Definition tree-core.h:256
built_in_class
Definition tree-core.h:173
@ NOT_BUILT_IN
Definition tree-core.h:174
@ BUILT_IN_FRONTEND
Definition tree-core.h:175
@ BUILT_IN_NORMAL
Definition tree-core.h:177
@ BUILT_IN_MD
Definition tree-core.h:176
function_decl_type
Definition tree-core.h:2127
@ NONE
Definition tree-core.h:2128
tree_code_class
Definition tree-core.h:232
@ tcc_comparison
Definition tree-core.h:239
@ tcc_expression
Definition tree-core.h:246
@ tcc_type
Definition tree-core.h:236
unsigned const char omp_clause_num_ops[]
Definition tree.cc:299
tree_node_structure_enum
Definition tree-core.h:623
unsigned short priority_type
Definition tree-core.h:1178
tree(*) walk_tree_lh(tree *, int *, tree(*)(tree *, int *, void *), void *, hash_set< tree > *)
Definition tree-core.h:1184
@ MAX_TREE_CODES
Definition tree-core.h:157
clobber_kind
Definition tree-core.h:1150
@ CLOBBER_UNDEF
Definition tree-core.h:1152
#define NUM_TREE_CODES
Definition tree-core.h:164
bool tree_contains_struct[MAX_TREE_CODES][64]
Definition tree.cc:296
void using_eh_for_cleanups(void)
Definition tree.cc:13353
static bool valid_new_delete_pair_p(gimple *new_call, gimple *delete_call)
Definition tree-ssa-dce.cc:869
tree tree_cons(tree purpose, tree value, tree chain MEM_STAT_DECL)
Definition tree.cc:3719
unsigned int element_precision(const_tree type)
Definition tree.cc:7202
bool type_contains_placeholder_p(tree type)
Definition tree.cc:4469
tree size_in_bytes_loc(location_t loc, const_tree type)
Definition tree.cc:3759
tree reconstruct_complex_type(tree type, tree bottom)
Definition tree.cc:10595
int suppress_location_wrappers
Definition tree.cc:15338
void overwrite_decl_assembler_name(tree decl, tree name)
Definition tree.cc:868
tree grow_tree_vec(tree v, int len MEM_STAT_DECL)
Definition tree.cc:2968
bool check_lang_type(const_tree cand, const_tree base)
Definition tree.cc:5869
bool disjoint_version_decls(tree fn1, tree fn2)
Definition tree.cc:15942
tree build_tree_list(tree parm, tree value MEM_STAT_DECL)
Definition tree.cc:3689
tree build_function_type_array(tree return_type, int n, tree *arg_types)
Definition tree.cc:8054
tree build_variant_type_copy(tree type MEM_STAT_DECL)
Definition tree.cc:6120
bool stdarg_p(const_tree fntype)
Definition tree.cc:12368
tree first_field(const_tree type)
Definition tree.cc:3598
tree build_reference_type_for_mode(tree to_type, machine_mode mode, bool can_alias_all)
Definition tree.cc:7442
int compare_tree_int(const_tree t, unsigned HOST_WIDE_INT u)
Definition tree.cc:7133
tree make_anon_name()
Definition tree.cc:9251
bool integer_onep(const_tree expr)
Definition tree.cc:3026
tree num_ending_zeros(const_tree x)
Definition tree.cc:11889
tree uniform_integer_cst_p(tree t)
Definition tree.cc:11069
tree skip_simple_arithmetic(tree expr)
Definition tree.cc:4198
string_slice get_target_version(const tree decl)
Definition tree.cc:15920
tree decl_value_expr_lookup(tree from)
Definition tree.cc:6300
tree build_call_expr_loc_vec(location_t loc, tree fndecl, vec< tree, va_gc > *vec)
Definition tree.cc:11420
tree decl_comdat_group(const_tree node)
Definition tree.cc:985
int allocate_decl_uid(void)
Definition tree.cc:1309
tree decl_debug_expr_lookup(tree from)
Definition tree.cc:6273
priority_type decl_fini_priority_lookup(tree decl)
Definition tree.cc:6200
tree staticp(tree arg)
Definition tree.cc:3915
const char * prefix_for_internal_label(tree label)
Definition tree.cc:843
const char * get_name(tree t)
Definition tree.cc:12338
void decl_fini_priority_insert(tree decl, priority_type priority)
Definition tree.cc:6231
tree build_constructor_from_vec(tree type, const vec< tree, va_gc > *vals)
Definition tree.cc:2450
tree maybe_build_call_expr_loc(location_t loc, combined_fn fn, tree type, int n,...)
Definition tree.cc:11505
bool warn_deprecated_use(tree node, tree attr)
Definition tree.cc:13028
tree build_complex_inf(tree type, bool neg)
Definition tree.cc:2665
bool is_access_with_size_p(const_tree call)
Definition tree.cc:14000
bool variably_modified_type_p(tree type, tree fn)
Definition tree.cc:8774
tree block_ultimate_origin(const_tree block)
Definition tree.cc:12598
bool integer_pow2p(const_tree expr)
Definition tree.cc:3107
tree build_call_expr_loc(location_t loc, tree fndecl, int n,...)
Definition tree.cc:11432
machine_mode vector_type_mode(const_tree t)
Definition tree.cc:14043
bool fixed_zerop(const_tree expr)
Definition tree.cc:3157
bool find_tree(tree top, tree search)
Definition tree.cc:15647
tree decl_comdat_group_id(const_tree node)
Definition tree.cc:995
bool tree_int_cst_equal(const_tree t1, const_tree t2)
Definition tree.cc:6756
bool decl_address_ip_invariant_p(const_tree op)
Definition tree.cc:4023
int tree_log2(const_tree expr)
Definition tree.cc:3169
tree build_constructor(tree type, vec< constructor_elt, va_gc > *vals MEM_STAT_DECL)
Definition tree.cc:2400
unsigned int vector_element_bits(const_tree type)
Definition tree.cc:14076
tree build_nonstandard_integer_type(unsigned HOST_WIDE_INT precision, int unsignedp)
Definition tree.cc:7528
tree build_truth_vector_type_for_mode(poly_uint64 nunits, machine_mode mask_mode)
Definition tree.cc:10691
tree build_int_cstu(tree type, poly_uint64 cst)
Definition tree.cc:1654
tree create_artificial_label(location_t loc)
Definition tree.cc:12322
tree make_node(enum tree_code code MEM_STAT_DECL)
Definition tree.cc:1323
tree get_narrower(tree op, int *unsignedp_ptr)
Definition tree.cc:8482
tree array_ref_low_bound(tree exp)
Definition tree.cc:13486
tree build_int_cst_type(tree type, poly_int64 cst)
Definition tree.cc:1662
vec< tree, va_gc > ** decl_debug_args_insert(tree from)
Definition tree.cc:6349
tree build_index_vector(tree vec_type, poly_uint64 base, poly_uint64 step)
Definition tree.cc:2313
bool vector_nop_conversion_p(const_tree outer_type, const_tree inner_type)
Definition tree.cc:12672
tree build2(enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
Definition tree.cc:5298
tree build1(enum tree_code code, tree type, tree node MEM_STAT_DECL)
Definition tree.cc:5219
tree build_opaque_vector_type(tree innertype, poly_int64 nunits)
Definition tree.cc:10735
bool real_onep(const_tree expr)
Definition tree.cc:3361
tree build_constructor_va(tree type, int nelts,...)
Definition tree.cc:2464
unsigned int tree_decl_map_hash(const void *item)
Definition tree.cc:6179
tree nreverse(tree t)
Definition tree.cc:3670
bool operand_equal_for_phi_arg_p(const_tree arg0, const_tree arg1)
Definition tree.cc:11877
bool subrange_type_for_debug_p(const_tree type, tree *lowval, tree *highval)
Definition tree.cc:7706
tree build_optimization_node(struct gcc_options *opts, struct gcc_options *opts_set)
Definition tree.cc:12530
bool tree_map_base_marked_p(const void *p)
Definition tree.cc:6163
tree arg_size_in_bytes(const_tree type)
Definition tree.cc:15508
poly_int64 tree_to_poly_int64(const_tree t)
Definition tree.cc:3481
unsigned int tree_int_cst_min_precision(tree value, signop sgn)
Definition tree.cc:6911
bool integer_each_onep(const_tree expr)
Definition tree.cc:3051
int get_range_pos_neg(tree arg, gimple *stmt)
Definition tree.cc:15111
tree last_field(const_tree type)
Definition tree.cc:3610
bool tree_fits_sanitize_code_type_p(const_tree t)
Definition tree.cc:6839
tree chainon(tree op1, tree op2)
Definition tree.cc:3630
bool type_with_interoperable_signedness(const_tree type)
Definition tree.cc:14353
void get_type_static_bounds(const_tree type, mpz_t min, mpz_t max)
Definition tree.cc:8692
int tree_floor_log2(const_tree expr)
Definition tree.cc:3181
tree bit_position(const_tree field)
Definition tree.cc:3835
bool tree_nop_conversion_p(const_tree outer_type, const_tree inner_type)
Definition tree.cc:12617
tree component_ref_size(tree ref, special_array_member *sam)
Definition tree.cc:13829
tree build_debug_expr_decl(tree type)
Definition tree.cc:5617
bool tree_fits_poly_int64_p(const_tree t)
Definition tree.cc:6790
enum tls_model decl_tls_model(const_tree node)
Definition tree.cc:1057
tree wide_int_to_tree(tree type, const poly_wide_int_ref &value)
Definition tree.cc:2009
tree build_bitint_type(unsigned HOST_WIDE_INT precision, int unsignedp)
Definition tree.cc:7592
tree purpose_member(const_tree elem, tree list)
Definition tree.cc:3517
void free_node(tree node)
Definition tree.cc:1433
void protected_set_expr_location_if_unset(tree t, location_t loc)
Definition tree.cc:5696
tree build0(enum tree_code code, tree tt MEM_STAT_DECL)
Definition tree.cc:5206
void decl_init_priority_insert(tree decl, priority_type priority)
Definition tree.cc:6213
HOST_WIDE_INT int_byte_position(const_tree field)
Definition tree.cc:3856
unsigned int tree_map_hash(const void *item)
Definition tree.cc:6171
tree build_function_type_list(tree return_type,...)
Definition tree.cc:8002
tree builtin_decl_unreachable()
Definition tree.cc:11572
tree build_vector_type_for_mode(tree innertype, machine_mode mode)
Definition tree.cc:10648
tree build_minus_one_cst(tree type)
Definition tree.cc:2746
tree walk_tree_without_duplicates_1(tree *tp, walk_tree_fn func, void *data, walk_tree_lh lh)
Definition tree.cc:12282
tree double_int_to_tree(tree type, double_int cst)
Definition tree.cc:1672
tree build_pointer_type_for_mode(tree to_type, machine_mode mode, bool can_alias_all)
Definition tree.cc:7370
tree array_type_nelts_top(tree type)
Definition tree.cc:3902
tree strip_float_extensions(tree exp)
Definition tree.cc:12745
bool operation_can_overflow(enum tree_code code)
Definition tree.cc:7293
tree build_range_type(tree type, tree lowval, tree highval)
Definition tree.cc:7672
tree build_all_ones_cst(tree type)
Definition tree.cc:2731
int simple_cst_equal(const_tree t1, const_tree t2)
Definition tree.cc:6939
hashval_t type_hash_canon_hash(tree type)
Definition tree.cc:6374
int tree_int_cst_sgn(const_tree t)
Definition tree.cc:6895
tree build5(enum tree_code code, tree tt, tree arg0, tree arg1, tree arg2, tree arg3, tree arg4 MEM_STAT_DECL)
Definition tree.cc:5446
int list_length(const_tree t)
Definition tree.cc:3572
bool flexible_array_type_p(const_tree type)
Definition tree.cc:15471
tree get_attr_nonstring_decl(tree expr, tree *ref)
Definition tree.cc:15817
unsigned int tree_ctz(const_tree expr)
Definition tree.cc:3193
unsigned crc32_string(unsigned chksum, const char *string)
Definition tree.cc:9219
bool real_negzerop(const_tree expr)
Definition tree.cc:3335
tree build4(enum tree_code code, tree tt, tree arg0, tree arg1, tree arg2, tree arg3 MEM_STAT_DECL)
Definition tree.cc:5419
tree build_omp_clause(location_t loc, enum omp_clause_code code)
Definition tree.cc:11271
tree build_case_label(tree low_value, tree high_value, tree label_decl)
Definition tree.cc:2908
tree make_vector(unsigned log2_npatterns, unsigned int nelts_per_pattern MEM_STAT_DECL)
Definition tree.cc:2178
combined_fn get_call_combined_fn(const_tree call)
Definition tree.cc:9076
tree build_call(tree return_type, tree fn, std::initializer_list< tree > args)
Definition tree.cc:11355
tree build_varargs_function_type_array(tree return_type, int n, tree *arg_types)
Definition tree.cc:8064
void set_decl_tls_model(tree node, enum tls_model model)
Definition tree.cc:1067
bool contains_placeholder_p(const_tree exp)
Definition tree.cc:4313
tree build_int_cst(tree type, poly_int64 cst)
Definition tree.cc:1642
tree decl_function_context(const_tree decl)
Definition tree.cc:8913
bool virtual_method_call_p(const_tree target, bool for_dump_p)
Definition tree.cc:12853
tree get_binfo_at_offset(tree binfo, poly_int64 offset, tree expected_type)
Definition tree.cc:12893
tree lhd_gcc_personality(void)
Definition tree.cc:12837
tree stabilize_reference(tree ref)
Definition tree.cc:5044
bitmap get_nonnull_args(const_tree fntype)
Definition tree.cc:15360
bool tree_fits_uhwi_p(const_tree t)
Definition tree.cc:6809
tree make_int_cst(int len, int ext_len MEM_STAT_DECL)
Definition tree.cc:2928
tree generate_internal_label(const char *prefix)
Definition tree.cc:821
special_array_member component_ref_sam_type(tree ref)
Definition tree.cc:13756
bool integer_zerop(const_tree expr)
Definition tree.cc:3002
void verify_constructor_flags(tree c)
Definition tree.cc:2380
tree save_expr(tree expr)
Definition tree.cc:4157
tree build_zero_cst(tree type)
Definition tree.cc:2787
tree build_call_array_loc(location_t loc, tree return_type, tree fn, int nargs, const tree *args)
Definition tree.cc:11373
size_t tree_code_size(enum tree_code code)
Definition tree.cc:1086
const char * combined_fn_name(combined_fn fn)
Definition tree.cc:15343
tree build_constructor_from_list(tree type, tree vals)
Definition tree.cc:2430
tree build_nt(enum tree_code code,...)
Definition tree.cc:5544
void assign_assembler_name_if_needed(tree t)
Definition tree.cc:957
tree unsigned_integer_tree_node_for_type(const char *type)
Definition tree.cc:9796
tree build_reference_type(tree to_type)
Definition tree.cc:7506
tree build_vector_from_val(tree vectype, tree sc)
Definition tree.cc:2238
tree build_array_type_1(tree elt_type, tree index_type, bool typeless_storage, bool shared, bool set_canonical)
Definition tree.cc:7747
HOST_WIDE_INT int_size_in_bytes(const_tree type)
Definition tree.cc:3782
void build_common_builtin_nodes(void)
Definition tree.cc:10254
bool address_invariant_p(tree t)
Definition tree.cc:4069
tree build_complex(tree type, tree real, tree imag)
Definition tree.cc:2646
bool default_is_empty_record(const_tree type)
Definition tree.cc:15437
tree build_pointer_type(tree to_type)
Definition tree.cc:7434
tree build_real_from_int_cst(tree type, const_tree i)
Definition tree.cc:2585
bool initializer_each_zero_or_onep(const_tree expr)
Definition tree.cc:10955
void recompute_constructor_flags(tree c)
Definition tree.cc:2352
bool tree_fits_shwi_p(const_tree t)
Definition tree.cc:6779
unsigned crc32_unsigned_n(unsigned chksum, unsigned value, unsigned bytes)
Definition tree.cc:9189
HOST_WIDE_INT int_cst_value(const_tree x)
Definition tree.cc:11646
HOST_WIDE_INT max_int_size_in_bytes(const_tree type)
Definition tree.cc:3802
tree build_replicated_int_cst(tree type, unsigned int width, HOST_WIDE_INT value)
Definition tree.cc:2827
tree drop_tree_overflow(tree t)
Definition tree.cc:13386
bool nonnull_arg_p(const_tree arg)
Definition tree.cc:15193
tree upper_bound_in_type(tree outer, tree inner)
Definition tree.cc:11791
tree build_alloca_call_expr(tree size, unsigned int align, HOST_WIDE_INT max_size)
Definition tree.cc:11544
tree vector_cst_elt(const_tree t, unsigned int i)
Definition tree.cc:10790
tree make_tree_vec(int len MEM_STAT_DECL)
Definition tree.cc:2950
machine_mode element_mode(const_tree t)
Definition tree.cc:14024
tree array_ref_up_bound(tree exp)
Definition tree.cc:13509
bool prototype_p(const_tree fntype)
Definition tree.cc:12390
void set_decl_section_name(tree node, const char *value)
Definition tree.cc:1017
bool auto_var_in_fn_p(const_tree var, const_tree fn)
Definition tree.cc:8732
tree build_string(unsigned len, const char *str)
Definition tree.cc:2618
void error_unavailable_use(tree node, tree attr)
Definition tree.cc:13115
bool gimple_canonical_types_compatible_p(const_tree t1, const_tree t2, bool trust_type_canonical)
Definition tree.cc:14380
tree substitute_placeholder_in_expr(tree exp, tree obj)
Definition tree.cc:4781
auto_vec< string_slice > get_clone_attr_versions(const tree arglist, int *default_count, bool filter)
Definition tree.cc:15872
void tree_cc_finalize(void)
Definition tree.cc:16341
bool real_maybe_zerop(const_tree expr)
Definition tree.cc:3411
void set_call_expr_flags(tree decl, int flags)
Definition tree.cc:10183
location_t set_block(location_t loc, tree block)
Definition tree.cc:15256
tree unsigned_type_for(tree type)
Definition tree.cc:11726
bool chain_member(const_tree elem, const_tree chain)
Definition tree.cc:3555
bool check_qualified_type(const_tree cand, const_tree base, qualifier_set type_quals)
Definition tree.cc:5951
tree build_string_literal(unsigned len, const char *str, tree eltype, unsigned HOST_WIDE_INT size)
Definition tree.cc:11604
tree signed_type_for(tree type)
Definition tree.cc:11737
tree tree_last(tree chain)
Definition tree.cc:3657
tree build_nonstandard_boolean_type(unsigned HOST_WIDE_INT precision)
Definition tree.cc:7567
tree byte_position(const_tree field)
Definition tree.cc:3845
tree get_typenode_from_name(const char *name)
Definition tree.cc:15559
tree tree_strip_sign_nop_conversions(tree exp)
Definition tree.cc:12736
location_t tree_nonartificial_location(tree exp)
Definition tree.cc:12440
tree unshare_expr(tree expr)
Definition tree.cc:16310
bool type_list_equal(const_tree l1, const_tree l2)
Definition tree.cc:6683
bool expr_type_first_operand_type_p(tree_code code)
Definition tree.cc:15517
tree maybe_wrap_with_location(tree expr, location_t loc)
Definition tree.cc:15300
void dump_tree_statistics(void)
Definition tree.cc:9121
tree make_tree_binfo(unsigned base_binfos MEM_STAT_DECL)
Definition tree.cc:2886
tree build_complex_type(tree component_type, bool named)
Definition tree.cc:8197
tree build_nonshared_array_type(tree elt_type, tree index_type)
Definition tree.cc:7812
tree build_qualified_type(tree type, qualifier_set type_quals MEM_STAT_DECL)
Definition tree.cc:6014
tree lower_bound_in_type(tree outer, tree inner)
Definition tree.cc:11844
tree build_block(tree vars, tree subblocks, tree supercontext, tree chain)
Definition tree.cc:5663
bool int_fits_type_p(const_tree c, const_tree type)
Definition tree.cc:8593
const builtin_structptr_type builtin_structptr_types[6]
Definition tree.cc:15598
tree walk_tree_1(tree *tp, walk_tree_fn func, void *data, hash_set< tree > *pset, walk_tree_lh lh)
Definition tree.cc:11992
tree build_builtin_unreachable(location_t loc)
Definition tree.cc:11590
tree build_real_from_wide(tree type, const wide_int_ref &i, signop sgn)
Definition tree.cc:2600
tree vector_element_bits_tree(const_tree type)
Definition tree.cc:14088
tree build_each_one_cst(tree type)
Definition tree.cc:2678
tree build_constructor_single(tree type, tree index, tree value)
Definition tree.cc:2415
tree build3(enum tree_code code, tree tt, tree arg0, tree arg1, tree arg2 MEM_STAT_DECL)
Definition tree.cc:5378
auto_vec< string_slice > get_clone_versions(const tree decl, int *default_count, bool filter)
Definition tree.cc:15906
location_t tree_inlined_location(tree exp, bool system_header)
Definition tree.cc:12456
const_tree get_ultimate_context(const_tree decl)
Definition tree.cc:8897
tree force_fit_type(tree type, const poly_wide_int_ref &cst, int overflowable, bool overflowed)
Definition tree.cc:1693
tree build_vector_from_ctor(tree type, const vec< constructor_elt, va_gc > *v)
Definition tree.cc:2204
tree build_function_type(tree value_type, tree arg_types, bool no_named_args_stdarg_p)
Definition tree.cc:7908
void recompute_tree_invariant_for_addr_expr(tree t)
Definition tree.cc:5125
tree strip_zero_offset_components(tree op)
Definition tree.cc:12823
tree uniform_vector_difference_p(const_tree t1, const_tree t2)
Definition tree.cc:11115
tree build_method_type(tree basetype, tree type)
Definition tree.cc:8137
tree build_method_type_directly(tree basetype, tree rettype, tree argtypes)
Definition tree.cc:8075
tree get_ref_from_access_with_size(tree call)
Definition tree.cc:14012
bool cst_and_fits_in_hwi(const_tree x)
Definition tree.cc:2168
tree build_distinct_type_copy(tree type MEM_STAT_DECL)
Definition tree.cc:6088
HOST_WIDE_INT arg_int_size_in_bytes(const_tree type)
Definition tree.cc:15500
const char * get_tree_code_name(enum tree_code code)
Definition tree.cc:13367
void clean_symbol_name(char *p)
Definition tree.cc:9231
bool block_may_fallthru(const_tree block)
Definition tree.cc:13274
void verify_type(const_tree t)
Definition tree.cc:14735
const char * decl_section_name(const_tree node)
Definition tree.cc:1006
tree type_argument_type(const_tree fntype, unsigned argno)
Definition tree.cc:6724
tree substitute_in_expr(tree exp, tree f, tree r)
Definition tree.cc:4589
bool check_base_type(const_tree cand, const_tree base)
Definition tree.cc:5924
bool integer_nonzerop(const_tree expr)
Definition tree.cc:3127
tree build_empty_stmt(location_t loc)
Definition tree.cc:11259
bool operation_no_trapping_overflow(tree type, enum tree_code code)
Definition tree.cc:7323
tree max_object_size(void)
Definition tree.cc:15611
tree uniform_vector_p(const_tree vec)
Definition tree.cc:10994
bool is_truth_type_for(tree type, tree truth_type)
Definition tree.cc:11750
bool needs_to_live_in_memory(const_tree t)
Definition tree.cc:11634
vec< tree, va_gc > ** decl_debug_args_lookup(tree from)
Definition tree.cc:6331
bool integer_minus_onep(const_tree expr)
Definition tree.cc:3092
tree get_callee_fndecl(const_tree call)
Definition tree.cc:8986
int single_nonzero_element(const_tree t)
Definition tree.cc:11228
tree build_call_expr_loc_array(location_t loc, tree fndecl, int n, tree *argarray)
Definition tree.cc:11407
bool zerop(const_tree expr)
Definition tree.cc:2991
tree get_unwidened(tree op, tree for_type)
Definition tree.cc:8398
bool tree_invariant_p(tree t)
Definition tree.cc:4128
bool diagnose_versioned_decls(tree old_decl, tree new_decl)
Definition tree.cc:16067
tree build_decl(location_t loc, enum tree_code code, tree name, tree type MEM_STAT_DECL)
Definition tree.cc:5592
tree build_call_expr_internal_loc(location_t loc, enum internal_fn ifn, tree type, int n,...)
Definition tree.cc:11484
bool initializer_zerop(const_tree init, bool *nonzero)
Definition tree.cc:10821
tree build_one_cst(tree type)
Definition tree.cc:2693
tree type_hash_canon(unsigned int hashcode, tree type)
Definition tree.cc:6605
tree build_call_expr(tree fndecl, int n,...)
Definition tree.cc:11449
tree build_translation_unit_decl(tree name)
Definition tree.cc:5648
tree build_offset_type(tree basetype, tree type)
Definition tree.cc:8151
tree build_tree_list_vec(const vec< tree, va_gc > *vec MEM_STAT_DECL)
Definition tree.cc:3700
tree build_call_vec(tree return_type, tree fn, const vec< tree, va_gc > *args)
Definition tree.cc:11390
bool contains_bitfld_component_ref_p(const_tree ref)
Definition tree.cc:13189
void init_ttree(void)
Definition tree.cc:772
bool is_empty_type(const_tree type)
Definition tree.cc:15415
tree array_ref_element_size(tree exp)
Definition tree.cc:13458
tree build_call_valist(tree return_type, tree fn, int nargs, va_list args)
Definition tree.cc:11339
tree sign_mask_for(tree type)
Definition tree.cc:2858
bool decl_address_invariant_p(const_tree op)
Definition tree.cc:3986
void decl_value_expr_insert(tree from, tree to)
Definition tree.cc:6314
HOST_WIDE_INT tree_to_shwi(const_tree t)
Definition tree.cc:6852
int tree_map_base_eq(const void *va, const void *vb)
Definition tree.cc:6143
tree ssa_uniform_vector_p(tree op)
Definition tree.cc:11043
tree cache_integer_cst(tree t, bool might_duplicate)
Definition tree.cc:2024
priority_type decl_init_priority_lookup(tree decl)
Definition tree.cc:6187
tree bitmask_inv_cst_vector_p(tree t)
Definition tree.cc:11173
void build_common_tree_nodes(bool signed_char)
Definition tree.cc:9851
bool associative_tree_code(enum tree_code code)
Definition tree.cc:7216
bool tree_fits_poly_uint64_p(const_tree t)
Definition tree.cc:6820
tree build_uniform_cst(tree type, tree sc)
Definition tree.cc:2276
tree build_clobber(tree type, enum clobber_kind kind)
Definition tree.cc:2484
bool integer_truep(const_tree expr)
Definition tree.cc:3144
void prepare_target_option_nodes_for_pch(void)
Definition tree.cc:12587
bool auto_var_p(const_tree var)
Definition tree.cc:8721
location_t set_source_range(tree expr, location_t start, location_t finish)
Definition tree.cc:15266
tree build_array_type(tree elt_type, tree index_type, bool typeless_storage)
Definition tree.cc:7803
void copy_if_shared(tree *tp, void *data)
Definition tree.cc:16300
tree build_vl_exp(enum tree_code code, int len MEM_STAT_DECL)
Definition tree.cc:11296
tree copy_list(tree list)
Definition tree.cc:1554
bool vec_member(const_tree elem, vec< tree, va_gc > *v)
Definition tree.cc:3531
bool real_zerop(const_tree expr)
Definition tree.cc:3305
unsigned HOST_WIDE_INT tree_to_uhwi(const_tree t)
Definition tree.cc:6863
tree copy_node(tree node MEM_STAT_DECL)
Definition tree.cc:1465
tree build_nonshared_range_type(tree type, tree lowval, tree highval)
Definition tree.cc:7680
tree build_low_bits_mask(tree type, unsigned bits)
Definition tree.cc:2156
tree decl_type_context(const_tree decl)
Definition tree.cc:8949
struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS]
Definition tree.cc:294
tree build_index_type(tree maxval)
Definition tree.cc:7695
enum tree_node_structure_enum tree_node_structure(const_tree t)
Definition tree.cc:4273
tree decl_assembler_name(tree decl)
Definition tree.cc:856
tree build_aligned_type(tree type, unsigned int align)
Definition tree.cc:6063
vec< tree, va_gc > * ctor_to_vec(tree ctor)
Definition tree.cc:3739
void find_placeholder_in_expr(tree exp, vec< tree > *refs)
Definition tree.cc:4515
tree build_varargs_function_type_list(tree return_type,...)
Definition tree.cc:8019
poly_uint64 tree_to_poly_uint64(const_tree t)
Definition tree.cc:3490
tree build_poly_int_cst(tree type, const poly_wide_int_ref &values)
Definition tree.cc:1983
tree build_vector_a_then_b(tree vec_type, unsigned int num_a, tree a, tree b)
Definition tree.cc:2335
void protected_set_expr_location(tree t, location_t loc)
Definition tree.cc:5680
tree build_vector_type(tree innertype, poly_int64 nunits)
Definition tree.cc:10683
bool using_eh_for_cleanups_p(void)
Definition tree.cc:13360
tree unshare_expr_without_location(tree expr)
Definition tree.cc:16332
sanitize_code_type tree_to_sanitize_code_type(const_tree t)
Definition tree.cc:6874
tree build_array_type_nelts(tree elt_type, poly_uint64 nelts)
Definition tree.cc:7821
tree get_file_function_name(const char *type)
Definition tree.cc:9286
tree skip_simple_constant_arithmetic(tree expr)
Definition tree.cc:4245
bool ptrdiff_tree_p(const_tree t, poly_int64 *value)
Definition tree.cc:3457
int type_num_arguments(const_tree fntype)
Definition tree.cc:6703
tree get_base_address(tree t)
Definition tree.cc:13439
tree build_fn_decl(const char *name, tree type)
Definition tree.cc:5629
tree build_vec_series(tree type, tree base, tree step)
Definition tree.cc:2289
location_t * block_nonartificial_location(tree block)
Definition tree.cc:12407
tree build_call_expr_internal_loc_array(location_t loc, internal_fn ifn, tree type, int n, const tree *args)
Definition tree.cc:11467
tree component_ref_field_offset(tree exp)
Definition tree.cc:13701
tree get_containing_scope(const_tree t)
Definition tree.cc:8889
tree signed_or_unsigned_type_for(int unsignedp, tree type)
Definition tree.cc:11674
tree truth_type_for(tree type)
Definition tree.cc:11775
size_t tree_size(const_tree node)
Definition tree.cc:1199
unsigned int tree_map_base_hash(const void *item)
Definition tree.cc:6153
int tree_int_cst_sign_bit(const_tree t)
Definition tree.cc:6883
unsigned fndecl_dealloc_argno(tree fndecl)
Definition tree.cc:15755
tree build_nt_call_vec(tree fn, vec< tree, va_gc > *args)
Definition tree.cc:5569
tree build_target_option_node(struct gcc_options *opts, struct gcc_options *opts_set)
Definition tree.cc:12558
const_tree strip_invariant_refs(const_tree op)
Definition tree.cc:12793
bool valid_constant_size_p(const_tree size, cst_size_error *perr)
Definition tree.cc:7154
tree get_qualified_type(tree type, qualifier_set type_quals)
Definition tree.cc:5982
void decl_debug_expr_insert(tree from, tree to)
Definition tree.cc:6287
tree tree_strip_nop_conversions(tree exp)
Definition tree.cc:12725
tree value_member(tree elem, tree list)
Definition tree.cc:3502
bool really_constant_p(const_tree exp)
Definition tree.cc:3440
bool array_ref_flexible_size_p(tree ref, bool *is_trailing_array)
Definition tree.cc:13543
bool integer_all_onesp(const_tree expr)
Definition tree.cc:3067
tree chain_index(int idx, tree chain)
Definition tree.cc:3545
bool real_minus_onep(const_tree expr)
Definition tree.cc:3387
void tree_set_block(tree t, tree b)
Definition tree.cc:12305
bool flexible_array_member_type_p(const_tree type)
Definition tree.cc:15455
tree array_type_nelts_minus_one(const_tree type)
Definition tree.cc:3865
int suppress_location_wrappers
Definition tree.cc:15338
constexpr qualifier_set operator^(qualifier_set qs, cv_qualifier cvs)
Definition tree.h:2808
#define TYPE_NAME(NODE)
Definition tree.h:2447
bool is_lang_specific(const_tree t)
Definition tree.h:6508
tree strip_array_types(tree type)
Definition tree.h:5438
tree function_args_iter_cond(function_args_iterator *i)
Definition tree.h:5953
#define TREE_VALUE(NODE)
Definition tree.h:1254
poly_uint64 bit_field_offset(const_tree t)
Definition tree.h:6162
#define COMPLETE_TYPE_P(NODE)
Definition tree.h:723
#define DECL_CONTEXT(NODE)
Definition tree.h:3167
enum tree_code tree_code_for_canonical_type_merging(enum tree_code code)
Definition tree.h:6325
#define target_option_default_node
Definition tree.h:5057
tree make_omp_iterator(void)
Definition tree.h:7458
#define DECL_ORIGINAL_TYPE(NODE)
Definition tree.h:4000
unsigned int tree_decl_map_hash(const void *)
Definition tree.cc:6179
poly_uint64 TYPE_VECTOR_SUBPARTS(const_tree node)
Definition tree.h:4682
#define optimization_default_node
Definition tree.h:5053
#define TREE_READONLY(NODE)
Definition tree.h:967
#define DECL_FUNCTION_SPECIFIC_TARGET(NODE)
Definition tree.h:3953
cst_size_error
Definition tree.h:5459
@ cst_size_too_big
Definition tree.h:5463
@ cst_size_not_constant
Definition tree.h:5461
@ cst_size_ok
Definition tree.h:5460
@ cst_size_overflow
Definition tree.h:5464
@ cst_size_negative
Definition tree.h:5462
#define call_expr_nargs(NODE)
Definition tree.h:1522
#define DECL_FIELD_BIT_OFFSET(NODE)
Definition tree.h:3445
bool tree_int_cst_lt(const_tree t1, const_tree t2)
Definition tree.h:7122
built_in_function as_builtin_fn(combined_fn code)
Definition tree.h:57
tree convert(tree, tree)
#define TYPE_PRECISION(NODE)
Definition tree.h:2444
#define TREE_INT_CST_NUNITS(NODE)
Definition tree.h:1170
unsigned int vector_cst_encoded_nelts(const_tree t)
Definition tree.h:5094
built_in_function DECL_FUNCTION_CODE(const_tree decl)
Definition tree.h:4757
#define EXPR_CHECK(T)
Definition tree.h:503
#define TREE_OPERAND(NODE, I)
Definition tree.h:1338
poly_uint64 bit_field_size(const_tree t)
Definition tree.h:6153
bool poly_int_tree_p(const_tree t, poly_int64 *value)
Definition tree.h:5474
#define DECL_NAME(NODE)
Definition tree.h:3115
bool canonical_type_used_p(const_tree t)
Definition tree.h:6355
tree make_expanded_omp_iterator(void)
Definition tree.h:7465
#define IS_EXPR_CODE_CLASS(CLASS)
Definition tree.h:296
void put_warning_spec(tree, unsigned)
Definition warning-control.cc:280
tree build4_loc(location_t loc, enum tree_code code, tree type, tree arg0, tree arg1, tree arg2, tree arg3 CXX_MEM_STAT_INFO)
Definition tree.h:5220
int struct_ptr_eq(const void *a, const void *b)
Definition tree.h:6062
#define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE)
Definition tree.h:3958
#define AGGREGATE_TYPE_P(TYPE)
Definition tree.h:708
#define sizetype
Definition tree.h:5573
bool maybe_special_function_p(const_tree fndecl)
Definition tree.h:6638
tree * function_args_iter_cond_ptr(function_args_iterator *i)
Definition tree.h:5944
#define TREE_VEC_BEGIN(NODE)
Definition tree.h:1264
bool ptrofftype_p(tree type)
Definition tree.h:6123
tree first_call_expr_arg(tree exp, call_expr_arg_iterator *iter)
Definition tree.h:6475
bool int_divide_or_mod_p(const code_helper &code)
Definition tree.h:6091
tree build2_loc(location_t loc, enum tree_code code, tree type, tree arg0, tree arg1 CXX_MEM_STAT_INFO)
Definition tree.h:5200
#define TREE_INT_CST_LOW(NODE)
Definition tree.h:1175
bool tree_zero_one_valued_p(tree)
tree build3_loc(location_t loc, enum tree_code code, tree type, tree arg0, tree arg1, tree arg2 CXX_MEM_STAT_INFO)
Definition tree.h:5210
#define TREE_OPTIMIZATION(NODE)
Definition tree.h:4030
bool inlined_function_outer_scope_p(const_tree block)
Definition tree.h:5972
void function_args_iter_init(function_args_iterator *i, const_tree fntype)
Definition tree.h:5935
#define tree_decl_map_eq
Definition tree.h:6376
bool builtin_fn_p(combined_fn code)
Definition tree.h:48
constexpr qualifier_set & operator|=(qualifier_set &qs, cv_qualifier quals)
Definition tree.h:2820
bool type_has_mode_precision_p(const_tree t)
Definition tree.h:7256
bool typedef_variant_p(const_tree type)
Definition tree.h:6052
void function_args_iter_next(function_args_iterator *i)
Definition tree.h:5960
#define TREE_CODE_CLASS(CODE)
Definition tree.h:205
HOST_WIDE_INT int_bit_position(const_tree field)
Definition tree.h:7178
hashval_t struct_ptr_hash(const void *a)
Definition tree.h:6070
bool desired_pro_or_demotion_p(const_tree to_type, const_tree from_type)
Definition tree.h:7230
#define BLOCK_SOURCE_LOCATION(NODE)
Definition tree.h:2416
constexpr opt_code all_warnings
Definition tree.h:7385
#define DECL_UNCHECKED_FUNCTION_CODE(NODE)
Definition tree.h:3259
void SET_TYPE_VECTOR_SUBPARTS(tree node, poly_uint64 subparts)
Definition tree.h:4704
tree tree_strip_any_location_wrapper(tree exp)
Definition tree.h:4840
bool error_operand_p(const_tree t)
Definition tree.h:5085
tree build5_loc(location_t loc, enum tree_code code, tree type, tree arg0, tree arg1, tree arg2, tree arg3, tree arg4 CXX_MEM_STAT_INFO)
Definition tree.h:5230
void set_decl_built_in_function(tree decl, built_in_class fclass, unsigned int fcode)
Definition tree.h:4789
bool more_call_expr_args_p(const call_expr_arg_iterator *iter)
Definition tree.h:6491
#define IDENTIFIER_LENGTH(NODE)
Definition tree.h:1238
bool built_in_function_equal_p(built_in_function name0, built_in_function name1)
Definition tree.h:7264
#define TYPE_UNSIGNED(NODE)
Definition tree.h:982
#define TREE_CODE(NODE)
Definition tree.h:327
bool handled_component_p(const_tree t)
Definition tree.h:5832
#define TYPE_MODE(NODE)
Definition tree.h:2453
unsigned crc32_byte(unsigned chksum, char byte)
Definition tree.h:6002
#define TYPE_SIGN(NODE)
Definition tree.h:985
bool builtin_decl_declared_p(enum built_in_function fncode)
Definition tree.h:6618
generic_wide_int< wi::extended_tree< WIDEST_INT_MAX_PRECISION *2 > > widest2_int_cst
Definition tree.h:6814
bool truth_value_p(enum tree_code code)
Definition tree.h:6112
int DECL_FE_FUNCTION_CODE(const_tree decl)
Definition tree.h:4779
#define FUNCTION_DECL_DECL_TYPE(NODE)
Definition tree.h:3787
#define EXPR_LOCATION(NODE)
Definition tree.h:1363
source_range get_expr_source_range(tree expr)
Definition tree.h:1388
#define POINTER_TYPE_P(TYPE)
Definition tree.h:715
#define CAN_HAVE_LOCATION_P(NODE)
Definition tree.h:1385
#define TREE_TARGET_OPTION(NODE)
Definition tree.h:4044
#define SSA_NAME_VERSION(NODE)
Definition tree.h:2298
#define TYPE_P(NODE)
Definition tree.h:229
hashval_t iterative_hash_expr(const_tree tree, hashval_t seed)
Definition tree.h:6192
constexpr qualifier_set operator|(qualifier_set qs, cv_qualifier cvs)
Definition tree.h:2796
tree build_call_nary(tree return_type, tree fn, int nargs, T... args)
Definition tree.h:5303
const_tree first_const_call_expr_arg(const_tree exp, const_call_expr_arg_iterator *iter)
Definition tree.h:6482
void set_builtin_decl_implicit_p(enum built_in_function fncode, bool implicit_p)
Definition tree.h:6570
unsigned get_warning_spec(const_tree)
Definition warning-control.cc:271
#define TREE_CHAIN(NODE)
Definition tree.h:514
bool builtin_decl_implicit_p(enum built_in_function fncode)
Definition tree.h:6606
bool fndecl_built_in_p(const_tree node)
Definition tree.h:7285
tree builtin_decl_explicit(enum built_in_function fncode)
Definition tree.h:6526
#define VL_EXP_CLASS_P(NODE)
Definition tree.h:280
#define IDENTIFIER_POINTER(NODE)
Definition tree.h:1240
#define BUILTIN_VALID_P(FNCODE)
Definition tree.h:6514
constexpr opt_code no_warning
Definition tree.h:7383
#define POLY_INT_CST_P(NODE)
Definition tree.h:1180
#define TYPE_REVERSE_STORAGE_ORDER(NODE)
Definition tree.h:1121
#define TREE_STATIC(NODE)
Definition tree.h:787
int tree_int_cst_compare(const_tree t1, const_tree t2)
Definition tree.h:7141
tree builtin_decl_implicit(enum built_in_function fncode)
Definition tree.h:6535
#define CALL_EXPR_ARG(NODE, I)
Definition tree.h:1521
int DECL_MD_FUNCTION_CODE(const_tree decl)
Definition tree.h:4768
#define ANY_INTEGRAL_TYPE_P(TYPE)
Definition tree.h:632
void set_builtin_decl(enum built_in_function fncode, tree decl, bool implicit_p)
Definition tree.h:6555
#define TREE_INT_CST_ELT(NODE, I)
Definition tree.h:1174
#define DECL_EXTERNAL(NODE)
Definition tree.h:3304
bool builtin_decl_explicit_p(enum built_in_function fncode)
Definition tree.h:6597
tree size_in_bytes(const_tree t)
Definition tree.h:5560
cl_target_option * target_opts_for_fn(const_tree fndecl)
Definition tree.h:6690
bool location_wrapper_p(const_tree exp)
Definition tree.h:4820
#define TREE_TYPE(NODE)
Definition tree.h:515
#define VL_EXP_OPERAND_LENGTH(NODE)
Definition tree.h:1345
#define INTEGRAL_TYPE_P(TYPE)
Definition tree.h:616
bool fndecl_builtin_alloc_p(const_tree node)
Definition tree.h:7324
void copy_decl_built_in_function(tree newdecl, const_tree olddecl)
Definition tree.h:4800
#define DECL_BUILT_IN_CLASS(NODE)
Definition tree.h:3944
bool reverse_storage_order_for_component_p(tree t)
Definition tree.h:5853
#define TREE_CODE_LENGTH(CODE)
Definition tree.h:304
constexpr qualifier_set & operator^=(qualifier_set &qs, cv_qualifier quals)
Definition tree.h:2825
#define TREE_PUBLIC(NODE)
Definition tree.h:877
bool storage_order_barrier_p(const_tree t)
Definition tree.h:5891
#define TYPE_ARG_TYPES(NODE)
Definition tree.h:2956
bool complete_or_array_type_p(const_tree type)
Definition tree.h:6134
access_mode
Definition tree.h:6364
@ access_deferred
Definition tree.h:6369
@ access_none
Definition tree.h:6365
@ access_read_write
Definition tree.h:6368
@ access_write_only
Definition tree.h:6367
@ access_read_only
Definition tree.h:6366
wi::tree_to_poly_wide_ref poly_int_cst_value(const_tree x)
Definition tree.h:6987
#define EXPR_LOCATION_WRAPPER_P(NODE)
Definition tree.h:4813
bool internal_fn_p(combined_fn code)
Definition tree.h:66
#define DECL_UID(NODE)
Definition tree.h:3123
unsigned crc32_unsigned(unsigned chksum, unsigned value)
Definition tree.h:5997
bool valid_vector_subparts_p(poly_uint64 subparts)
Definition tree.h:4740
tree build1_loc(location_t loc, enum tree_code code, tree type, tree arg1 CXX_MEM_STAT_INFO)
Definition tree.h:5190
int tree_operand_length(const_tree node)
Definition tree.h:4610
bool type_with_alias_set_p(const_tree t)
Definition tree.h:7187
#define REF_REVERSE_STORAGE_ORDER(NODE)
Definition tree.h:1139
bool tree_int_cst_le(const_tree t1, const_tree t2)
Definition tree.h:7131
#define TREE_HASH(NODE)
Definition tree.h:553
#define ALLOCA_FUNCTION_CODE_P(FCODE)
Definition tree.h:3263
#define DECL_NONALIASED(NODE)
Definition tree.h:3744
bool trunc_or_exact_div_p(tree_code code)
Definition tree.h:6084
struct cl_optimization * opts_for_fn(const_tree fndecl)
Definition tree.h:6680
#define VECTOR_CST_NPATTERNS(NODE)
Definition tree.h:1222
bool id_equal(const_tree id, const char *str)
Definition tree.h:4668
special_array_member
Definition tree.h:6279
@ none
Definition tree.h:6280
@ int_0
Definition tree.h:6281
@ trail_0
Definition tree.h:6282
@ trail_n
Definition tree.h:6284
@ trail_1
Definition tree.h:6283
@ int_n
Definition tree.h:6285
#define error_mark_node
Definition tree.h:4848
const_tree strip_pointer_types(const_tree type)
Definition tree.h:5449
#define TREE_VEC_END(NODE)
Definition tree.h:1265
#define TREE_ADDRESSABLE(NODE)
Definition tree.h:759
bool is_typedef_decl(const_tree x)
Definition tree.h:6043
#define SET_EXPR_LOCATION(NODE, LOCUS)
Definition tree.h:1365
internal_fn as_internal_fn(combined_fn code)
Definition tree.h:75
#define DECL_FIELD_OFFSET(NODE)
Definition tree.h:3439
#define VECTOR_CST_NELTS_PER_PATTERN(NODE)
Definition tree.h:1224
combined_fn as_combined_fn(built_in_function fn)
Definition tree.h:32
void set_function_decl_type(tree decl, function_decl_type t, bool set)
Definition tree.h:3794
#define NULL_TREE
Definition tree.h:320
#define POLY_INT_CST_COEFF(NODE, I)
Definition tree.h:1184
#define VECTOR_TYPE_P(TYPE)
Definition tree.h:604
void set_builtin_decl_declared_p(enum built_in_function fncode, bool declared_p)
Definition tree.h:6583
bool is_global_var(const_tree t)
Definition tree.h:6656
#define TREE_INT_CST_EXT_NUNITS(NODE)
Definition tree.h:1172
#define TYPE_UID(NODE)
Definition tree.h:2434
#define char_type_node
Definition tree.h:5070
#define TREE_OPERAND_LENGTH(NODE)
Definition tree.h:1337
bool has_warning_spec(const_tree)
Definition warning-control.cc:262
bool may_be_aliased(const_tree var)
Definition tree.h:6666
struct tree_base base
Definition tree-core.h:2255
struct tree_omp_clause omp_clause
Definition tree-core.h:2292
struct tree_vec vec
Definition tree-core.h:2285
struct tree_exp exp
Definition tree-core.h:2286
#define WIDEST_INT_MAX_PRECISION
Definition wide-int.h:257
generic_wide_int< wide_int_ref_storage< false > > wide_int_ref
Definition wide-int.h:353
#define OFFSET_INT_ELTS
Definition wide-int.h:281
#define ADDR_MAX_PRECISION
Definition wide-int.h:276
generic_wide_int< wide_int_storage > wide_int
Definition wide-int.h:343
const T2 & y
Definition wide-int.h:3871