/* Core data structures for the 'tree' type.
- Copyright (C) 1989-2023 Free Software Foundation, Inc.
+ Copyright (C) 1989-2024 Free Software Foundation, Inc.
This file is part of GCC.
struct real_value;
struct fixed_value;
struct ptr_info_def;
-struct irange_storage_slot;
struct die_struct;
/* Nonzero if this is a cold function. */
#define ECF_COLD (1 << 15)
+/* Nonzero if this is a function expected to end with an exception. */
+#define ECF_XTHROW (1 << 16)
+
/* Call argument flags. */
/* Nonzero if the argument is not used by the function. */
/* OpenMP clause: doacross ({source,sink}:vec). */
OMP_CLAUSE_DOACROSS,
+ /* OpenMP clause: indirect [(constant-integer-expression)]. */
+ OMP_CLAUSE_INDIRECT,
+
/* Internal structure to hold OpenACC cache directive's variable-list.
#pragma acc cache (variable-list). */
OMP_CLAUSE__CACHE_,
/* OpenACC/OpenMP clause: if (scalar-expression). */
OMP_CLAUSE_IF,
+ /* OpenACC clause: self. */
+ OMP_CLAUSE_SELF,
+
/* OpenMP clause: num_threads (integer-expression). */
OMP_CLAUSE_NUM_THREADS,
enum omp_clause_defaultmap_kind {
OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED,
+ OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALL,
OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR,
OMP_CLAUSE_DEFAULTMAP_CATEGORY_AGGREGATE,
OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALLOCATABLE,
OMP_CLAUSE_DEFAULTMAP_NONE = 6 * (OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK + 1),
OMP_CLAUSE_DEFAULTMAP_DEFAULT
= 7 * (OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK + 1),
- OMP_CLAUSE_DEFAULTMAP_MASK = 7 * (OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK + 1)
+ OMP_CLAUSE_DEFAULTMAP_PRESENT = 8 * (OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK + 1),
+ OMP_CLAUSE_DEFAULTMAP_MASK = 15 * (OMP_CLAUSE_DEFAULTMAP_CATEGORY_MASK + 1)
};
enum omp_clause_bind_kind {
annot_expr_kind_last
};
-/* The kind of a TREE_CLOBBER_P CONSTRUCTOR node. */
+/* The kind of a TREE_CLOBBER_P CONSTRUCTOR node. Other than _UNDEF, these are
+ in roughly sequential order. */
enum clobber_kind {
/* Unspecified, this clobber acts as a store of an undefined value. */
CLOBBER_UNDEF,
- /* This clobber ends the lifetime of the storage. */
- CLOBBER_EOL,
+ /* Beginning of storage duration, e.g. malloc. */
+ CLOBBER_STORAGE_BEGIN,
+ /* Beginning of object lifetime, e.g. C++ constructor. */
+ CLOBBER_OBJECT_BEGIN,
+ /* End of object lifetime, e.g. C++ destructor. */
+ CLOBBER_OBJECT_END,
+ /* End of storage duration, e.g. free. */
+ CLOBBER_STORAGE_END,
CLOBBER_LAST
};
unsigned spare1 : 8;
- /* This field is only used with TREE_TYPE nodes; the only reason it is
+ /* For _TYPE nodes, this is TYPE_ADDR_SPACE; the reason it is
present in tree_base instead of tree_type is to save space. The size
of the field must be large enough to hold addr_space_t values.
- For CONSTRUCTOR nodes this holds the clobber_kind enum. */
+ For CONSTRUCTOR nodes this holds the clobber_kind enum.
+ The C++ front-end uses this in IDENTIFIER_NODE and NAMESPACE_DECL. */
unsigned address_space : 8;
} bits;
struct {
/* The number of HOST_WIDE_INTs if the INTEGER_CST is accessed in
its native precision. */
- unsigned char unextended;
+ unsigned short unextended;
/* The number of HOST_WIDE_INTs if the INTEGER_CST is extended to
wider precisions based on its TYPE_SIGN. */
- unsigned char extended;
-
- /* The number of HOST_WIDE_INTs if the INTEGER_CST is accessed in
- offset_int precision, with smaller integers being extended
- according to their TYPE_SIGN. This is equal to one of the two
- fields above but is cached for speed. */
- unsigned char offset;
+ unsigned short extended;
} int_length;
/* VEC length. This field is only used with TREE_VEC. */
DECL_NONALIASED in
VAR_DECL
+ CHREC_NOWRAP in
+ POLYNOMIAL_CHREC
+
deprecated_flag:
TREE_DEPRECATED in
/* Value range information. */
union ssa_name_info_type {
- /* Ranges for integers. */
- struct GTY ((tag ("0"))) irange_storage_slot *irange_info;
- /* Ranges for floating point numbers. */
- struct GTY ((tag ("1"))) frange_storage_slot *frange_info;
- /* Pointer attributes used for alias analysis. */
- struct GTY ((tag ("2"))) ptr_info_def *ptr_info;
- /* This holds any range info supported by ranger (except ptr_info
- above) and is managed by vrange_storage. */
- void * GTY ((skip)) range_info;
+ /* Range and aliasing info for pointers. */
+ struct GTY ((tag ("0"))) ptr_info_def *ptr_info;
+ /* Range info for everything else. */
+ struct GTY ((tag ("1"))) vrange_storage * range_info;
} GTY ((desc ("%1.typed.type ?" \
- "(POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) ? 2 : SCALAR_FLOAT_TYPE_P (TREE_TYPE ((tree)&%1))) : 3"))) info;
+ "!POINTER_TYPE_P (TREE_TYPE ((tree)&%1)) : 2"))) info;
/* Immediate uses list for this SSA_NAME. */
struct ssa_use_operand_t imm_uses;
};
tree attributes;
unsigned int uid;
- unsigned int precision : 10;
- unsigned no_force_blk_flag : 1;
- unsigned needs_constructing_flag : 1;
- unsigned transparent_aggr_flag : 1;
- unsigned restrict_flag : 1;
- unsigned contains_placeholder_bits : 2;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
- ENUM_BITFIELD(machine_mode) mode : 8;
-
- /* TYPE_STRING_FLAG for INTEGER_TYPE and ARRAY_TYPE.
- TYPE_CXX_ODR_P for RECORD_TYPE and UNION_TYPE. */
- unsigned string_flag : 1;
+ unsigned int precision : 16;
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
unsigned lang_flag_2 : 1;
so we need to store the value 32 (not 31, as we need the zero
as well), hence six bits. */
unsigned align : 6;
+ /* TYPE_STRING_FLAG for INTEGER_TYPE and ARRAY_TYPE.
+ TYPE_CXX_ODR_P for RECORD_TYPE and UNION_TYPE. */
+ unsigned string_flag : 1;
+ unsigned no_force_blk_flag : 1;
+
unsigned warn_if_not_align : 6;
+ unsigned needs_constructing_flag : 1;
+ unsigned transparent_aggr_flag : 1;
+
+ unsigned contains_placeholder_bits : 2;
+ unsigned restrict_flag : 1;
unsigned typeless_storage : 1;
unsigned empty_flag : 1;
unsigned indivisible_p : 1;
+ /* TYPE_NO_NAMED_ARGS_STDARG_P for a stdarg function.
+ Or TYPE_INCLUDES_FLEXARRAY for RECORD_TYPE and UNION_TYPE. */
unsigned no_named_args_stdarg_p : 1;
- unsigned spare : 15;
+ unsigned spare : 1;
alias_set_type alias_set;
tree pointer_to;
struct tree_decl_minimal common;
tree size;
- ENUM_BITFIELD(machine_mode) mode : 8;
+ ENUM_BITFIELD(machine_mode) mode : MACHINE_MODE_BITSIZE;
unsigned nonlocal_flag : 1;
unsigned virtual_flag : 1;
In VAR_DECL, PARM_DECL and RESULT_DECL, this is
DECL_HAS_VALUE_EXPR_P. */
unsigned decl_flag_2 : 1;
- /* In FIELD_DECL, this is DECL_PADDING_P. */
+ /* In FIELD_DECL, this is DECL_PADDING_P.
+ In VAR_DECL, this is DECL_MERGEABLE. */
unsigned decl_flag_3 : 1;
/* Logically, these two would go in a theoretical base shared by var and
parm decl. */
/* In FIELD_DECL, this is DECL_NOT_FLEXARRAY. */
unsigned int decl_not_flexarray : 1;
- /* 13 bits unused. */
+ /* 5 bits unused. */
/* UID for points-to sets, stable over copying from inlining. */
unsigned int pt_uid;
extern bool tree_contains_struct[MAX_TREE_CODES][64];
/* Class of tree given its code. */
-#if __cpp_inline_variables >= 201606L
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
#define END_OF_BASE_TREE_CODES tcc_exceptional,
+#if __cpp_inline_variables < 201606L
+template <int N>
+struct tree_code_type_tmpl {
+ static constexpr enum tree_code_class tree_code_type[] = {
+#include "all-tree.def"
+ };
+};
+
+template <int N>
+constexpr enum tree_code_class tree_code_type_tmpl<N>::tree_code_type[];
+#else
constexpr inline enum tree_code_class tree_code_type[] = {
#include "all-tree.def"
};
+#endif
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
-#else
-extern const enum tree_code_class tree_code_type[];
-#endif
/* Each tree code class has an associated string representation.
These must correspond to the tree_code_class entries. */
/* Number of argument-words in each kind of tree-node. */
-#if __cpp_inline_variables >= 201606L
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
#define END_OF_BASE_TREE_CODES 0,
+
+#if __cpp_inline_variables < 201606L
+template <int N>
+struct tree_code_length_tmpl {
+ static constexpr unsigned char tree_code_length[] = {
+#include "all-tree.def"
+ };
+};
+
+template <int N>
+constexpr unsigned char tree_code_length_tmpl<N>::tree_code_length[];
+#else
constexpr inline unsigned char tree_code_length[] = {
#include "all-tree.def"
};
+#endif
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
-#else
-extern const unsigned char tree_code_length[];
-#endif
/* Vector of all alias pairs for global symbols. */
extern GTY(()) vec<alias_pair, va_gc> *alias_pairs;