#include "input.h"
#include "statistics.h"
#include "vec.h"
+#include "vecir.h"
#include "double-int.h"
+#include "real.h"
+#include "fixed-value.h"
#include "alias.h"
#include "options.h"
extern const char *const tree_code_name[];
-/* A vectors of trees. */
-DEF_VEC_P(tree);
-DEF_VEC_ALLOC_P(tree,gc);
-DEF_VEC_ALLOC_P(tree,heap);
-
/* We have to be able to tell cgraph about the needed-ness of the target
of an alias. This requires that the decl have been defined. Aliases
that precede their definition have to be queued for later processing. */
addressable_flag:
TREE_ADDRESSABLE in
- VAR_DECL, FUNCTION_DECL, FIELD_DECL, LABEL_DECL
+ VAR_DECL, PARM_DECL, RESULT_DECL, FUNCTION_DECL, LABEL_DECL
all types
CONSTRUCTOR, IDENTIFIER_NODE
STMT_EXPR, it means we want the result of the enclosed expression
ATTRIBUTE_NORETURN;
extern void tree_range_check_failed (const_tree, const char *, int,
const char *, enum tree_code,
- enum tree_code);
+ enum tree_code)
+ ATTRIBUTE_NORETURN;
extern void tree_not_class_check_failed (const_tree,
const enum tree_code_class,
const char *, int, const char *)
\f
/* Define many boolean fields that all tree nodes have. */
-/* In VAR_DECL nodes, nonzero means address of this is needed.
- So it cannot be in a register.
+/* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address
+ of this is needed. So it cannot be in a register.
In a FUNCTION_DECL, nonzero means its address is needed.
So it must be compiled even if it is an inline function.
- In a FIELD_DECL node, it means that the programmer is permitted to
- construct the address of this field. This is used for aliasing
- purposes: see record_component_aliases.
In CONSTRUCTOR nodes, it means object constructed must be in memory.
In LABEL_DECL nodes, it means a goto for this label has been seen
from a place outside all binding contours that restore stack levels.
*/
#define CALL_EXPR_FN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 1)
#define CALL_EXPR_STATIC_CHAIN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 2)
-#define CALL_EXPR_ARGS(NODE) call_expr_arglist (NODE)
#define CALL_EXPR_ARG(NODE, I) TREE_OPERAND (CALL_EXPR_CHECK (NODE), (I) + 3)
#define call_expr_nargs(NODE) (VL_EXP_OPERAND_LENGTH(NODE) - 3)
#define SET_TYPE_MODE(NODE, MODE) \
(TYPE_CHECK (NODE)->type.mode = (MODE))
-/* The "canonical" type for this type node, which can be used to
- compare the type for equality with another type. If two types are
+/* The "canonical" type for this type node, which is used by frontends to
+ compare the type for equality with another type. If two types are
equal (based on the semantics of the language), then they will have
equivalent TYPE_CANONICAL entries.
- As a special case, if TYPE_CANONICAL is NULL_TREE, then it cannot
- be used for comparison against other types. Instead, the type is
+ As a special case, if TYPE_CANONICAL is NULL_TREE, and thus
+ TYPE_STRUCTURAL_EQUALITY_P is true, then it cannot
+ be used for comparison against other types. Instead, the type is
said to require structural equality checks, described in
- TYPE_STRUCTURAL_EQUALITY_P. */
+ TYPE_STRUCTURAL_EQUALITY_P.
+
+ For unqualified aggregate and function types the middle-end relies on
+ TYPE_CANONICAL to tell whether two variables can be assigned
+ to each other without a conversion. The middle-end also makes sure
+ to assign the same alias-sets to the type partition with equal
+ TYPE_CANONICAL of their unqualified variants. */
#define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type.canonical)
/* Indicates that the type node requires structural equality
- checks. The compiler will need to look at the composition of the
+ checks. The compiler will need to look at the composition of the
type to determine whether it is equal to another type, rather than
- just comparing canonical type pointers. For instance, we would need
+ just comparing canonical type pointers. For instance, we would need
to look at the return and parameter types of a FUNCTION_TYPE
- node. */
+ node. */
#define TYPE_STRUCTURAL_EQUALITY_P(NODE) (TYPE_CANONICAL (NODE) == NULL_TREE)
/* Sets the TYPE_CANONICAL field to NULL_TREE, indicating that the
- type node requires structural equality. */
+ type node requires structural equality. */
#define SET_TYPE_STRUCTURAL_EQUALITY(NODE) (TYPE_CANONICAL (NODE) = NULL_TREE)
+
#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
#define TYPE_IBIT(NODE) (GET_MODE_IBIT (TYPE_MODE (NODE)))
#define TYPE_FBIT(NODE) (GET_MODE_FBIT (TYPE_MODE (NODE)))
for various types of node. */
union GTY ((ptr_alias (union lang_tree_node),
- desc ("tree_node_structure (&%h)"))) tree_node {
+ desc ("tree_node_structure (&%h)"), variable_size)) tree_node {
struct tree_base GTY ((tag ("TS_BASE"))) base;
struct tree_common GTY ((tag ("TS_COMMON"))) common;
struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
itk_unsigned_long,
itk_long_long,
itk_unsigned_long_long,
+ itk_int128,
+ itk_unsigned_int128,
itk_none
};
#define long_unsigned_type_node integer_types[itk_unsigned_long]
#define long_long_integer_type_node integer_types[itk_long_long]
#define long_long_unsigned_type_node integer_types[itk_unsigned_long_long]
+#define int128_integer_type_node integer_types[itk_int128]
+#define int128_unsigned_type_node integer_types[itk_unsigned_int128]
\f
/* Set to the default thread-local storage (tls) model to use. */
/* Construct various types of nodes. */
extern tree build_nt (enum tree_code, ...);
-extern tree build_nt_call_list (tree, tree);
extern tree build_nt_call_vec (tree, VEC(tree,gc) *);
extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
#define build_var_debug_value(t1,t2) \
build_var_debug_value_stat (t1,t2 MEM_STAT_INFO)
+/* Constructs double_int from tree CST. */
+
+static inline double_int
+tree_to_double_int (const_tree cst)
+{
+ return TREE_INT_CST (cst);
+}
+
+extern tree double_int_to_tree (tree, double_int);
+extern bool double_int_fits_to_tree_p (const_tree, double_int);
+
+/* Create an INT_CST node with a CST value zero extended. */
+
+static inline tree
+build_int_cstu (tree type, unsigned HOST_WIDE_INT cst)
+{
+ return double_int_to_tree (type, uhwi_to_double_int (cst));
+}
+
extern tree build_int_cst (tree, HOST_WIDE_INT);
extern tree build_int_cst_type (tree, HOST_WIDE_INT);
-extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
extern tree build_int_cst_wide (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT);
-extern tree build_int_cst_wide_type (tree,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT);
extern tree build_vector (tree, tree);
extern tree build_vector_from_ctor (tree, VEC(constructor_elt,gc) *);
extern tree build_constructor (tree, VEC(constructor_elt,gc) *);
extern tree round_up_loc (location_t, tree, int);
#define round_down(T,N) round_down_loc (UNKNOWN_LOCATION, T, N)
extern tree round_down_loc (location_t, tree, int);
-extern tree get_pending_sizes (void);
+extern VEC(tree,gc) *get_pending_sizes (void);
extern void put_pending_size (tree);
-extern void put_pending_sizes (tree);
+extern void put_pending_sizes (VEC(tree,gc) *);
extern void finalize_size_functions (void);
/* Type for sizes of data-type. */
extern bool initializer_zerop (const_tree);
-/* Given a CONSTRUCTOR CTOR, return the elements as a TREE_LIST. */
-
-extern tree ctor_to_list (tree);
-
/* Given a CONSTRUCTOR CTOR, return the element values as a vector. */
extern VEC(tree,gc) *ctor_to_vec (tree);
extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
extern tree call_expr_arg (tree, int);
extern tree *call_expr_argp (tree, int);
-extern tree call_expr_arglist (tree);
extern tree create_artificial_label (location_t);
extern const char *get_name (tree);
extern bool stdarg_p (tree);
extern bool prototype_p (tree);
+extern bool is_typedef_decl (tree x);
+extern bool typedef_variant_p (tree);
extern bool auto_var_in_fn_p (const_tree, const_tree);
extern tree build_low_bits_mask (tree, unsigned);
extern tree tree_strip_nop_conversions (tree);
extern tree block_ultimate_origin (const_tree);
+extern tree get_binfo_at_offset (tree, HOST_WIDE_INT, tree);
+
/* In tree-nested.c */
extern tree build_addr (tree, tree);
/* In print-tree.c */
extern void debug_tree (tree);
+extern void debug_vec_tree (VEC(tree,gc) *);
#ifdef BUFSIZ
extern void dump_addr (FILE*, const char *, const void *);
extern void print_node (FILE *, const char *, tree, int);
+extern void print_vec_tree (FILE *, const char *, VEC(tree,gc) *, int);
extern void print_node_brief (FILE *, const char *, const_tree, int);
extern void indent_to (FILE *, int);
#endif
extern int flags_from_decl_or_type (const_tree);
extern int call_expr_flags (const_tree);
+/* Call argument flags. */
+
+/* Nonzero if the argument is not dereferenced recursively, thus only
+ directly reachable memory is read or written. */
+#define EAF_DIRECT (1 << 0)
+/* Nonzero if memory reached by the argument is not clobbered. */
+#define EAF_NOCLOBBER (1 << 1)
+/* Nonzero if the argument does not escape. */
+#define EAF_NOESCAPE (1 << 2)
+/* Nonzero if the argument is not used by the function. */
+#define EAF_UNUSED (1 << 3)
+
+/* Call return flags. */
+
+/* Mask for the argument number that is returned. Lower two bits of
+ the return flags, encodes argument slots zero to three. */
+#define ERF_RETURN_ARG_MASK (3)
+/* Nonzero if the return value is equal to the argument number
+ flags & ERF_RETURN_ARG_MASK. */
+#define ERF_RETURNS_ARG (1 << 2)
+/* Nonzero if the return value does not alias with anything. Functions
+ with the malloc attribute have this set on their return value. */
+#define ERF_NOALIAS (1 << 3)
+
extern int setjmp_call_p (const_tree);
extern bool gimple_alloca_call_p (const_gimple);
extern bool alloca_call_p (const_tree);
extern unsigned int tree_map_hash (const void *);
#define tree_map_marked_p tree_map_base_marked_p
+/* Map from a decl tree to another tree. */
+
+struct GTY(()) tree_decl_map {
+ struct tree_map_base base;
+ tree to;
+};
+
+#define tree_decl_map_eq tree_map_base_eq
+extern unsigned int tree_decl_map_hash (const void *);
+#define tree_decl_map_marked_p tree_map_base_marked_p
+
/* Map from a tree to an int. */
struct GTY(()) tree_int_map {
void init_inline_once (void);
-/* In ipa-reference.c. Used for parsing attributes of asm code. */
-extern GTY(()) tree memory_identifier_string;
-
/* Compute the number of operands in an expression node NODE. For
tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
otherwise it is looked up from the node's code. */