#include "statistics.h"
#include "vec.h"
#include "double-int.h"
+#include "alias.h"
/* Codes of tree nodes */
(TREE_CODE (NODE) == OMP_PARALLEL \
|| TREE_CODE (NODE) == OMP_FOR \
|| TREE_CODE (NODE) == OMP_SECTIONS \
+ || TREE_CODE (NODE) == OMP_SECTIONS_SWITCH \
|| TREE_CODE (NODE) == OMP_SINGLE \
|| TREE_CODE (NODE) == OMP_SECTION \
|| TREE_CODE (NODE) == OMP_MASTER \
unsigned protected_flag : 1;
unsigned deprecated_flag : 1;
unsigned invariant_flag : 1;
+ unsigned saturating_flag : 1;
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
unsigned lang_flag_6 : 1;
unsigned visited : 1;
- unsigned spare : 24;
+ unsigned spare : 23;
/* FIXME tuples: Eventually, we need to move this somewhere external to
the trees. */
VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE
ASM_VOLATILE_P in
ASM_EXPR
+ CALL_EXPR_VA_ARG_PACK in
+ CALL_EXPR
TYPE_CACHED_VALUES_P in
..._TYPE
SAVE_EXPR_RESOLVED_P in
TREE_INVARIANT in
all expressions.
+ saturating_flag:
+
+ TYPE_SATURATING in
+ all types
+
nowarning_flag:
TREE_NO_WARNING in
TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
#define NUMERICAL_TYPE_CHECK(T) \
- TREE_CHECK4 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE)
+ TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \
+ FIXED_POINT_TYPE)
/* Nonzero if NODE is a GIMPLE statement. */
#define GIMPLE_STMT_P(NODE) \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
== TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
&& (TYPE_UNSIGNED (TREE_TYPE (EXP)) \
- == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
+ == TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
+ && (POINTER_TYPE_P (TREE_TYPE (EXP)) \
+ == POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
(EXP) = TREE_OPERAND (EXP, 0)
/* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */
|| TREE_CODE (TYPE) == BOOLEAN_TYPE \
|| TREE_CODE (TYPE) == INTEGER_TYPE)
+/* Nonzero if TYPE represents a non-saturating fixed-point type. */
+
+#define NON_SAT_FIXED_POINT_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == FIXED_POINT_TYPE && !TYPE_SATURATING (TYPE))
+
+/* Nonzero if TYPE represents a saturating fixed-point type. */
+
+#define SAT_FIXED_POINT_TYPE_P(TYPE) \
+ (TREE_CODE (TYPE) == FIXED_POINT_TYPE && TYPE_SATURATING (TYPE))
+
+/* Nonzero if TYPE represents a fixed-point type. */
+
+#define FIXED_POINT_TYPE_P(TYPE) (TREE_CODE (TYPE) == FIXED_POINT_TYPE)
+
/* Nonzero if TYPE represents a scalar floating-point type. */
#define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
#define SAVE_EXPR_RESOLVED_P(NODE) \
(TREE_CHECK (NODE, SAVE_EXPR)->base.public_flag)
+/* Set on a CALL_EXPR if this stdarg call should be passed the argument
+ pack. */
+#define CALL_EXPR_VA_ARG_PACK(NODE) \
+ (CALL_EXPR_CHECK(NODE)->base.public_flag)
+
/* In any expression, decl, or constant, nonzero means it has side effects or
reevaluation of the whole expression could produce a different value.
This is set if any subexpression is a function call, a side effect or a
any expression node. */
#define TREE_INVARIANT(NODE) ((NODE)->base.invariant_flag)
+/* In fixed-point types, means a saturating type. */
+#define TYPE_SATURATING(NODE) ((NODE)->base.saturating_flag)
+
/* These flags are available for each language front end to use internally. */
#define TREE_LANG_FLAG_0(NODE) ((NODE)->base.lang_flag_0)
#define TREE_LANG_FLAG_1(NODE) ((NODE)->base.lang_flag_1)
struct real_value * real_cst_ptr;
};
+/* In a FIXED_CST node. */
+struct fixed_value;
+
+#define TREE_FIXED_CST_PTR(NODE) (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
+#define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
+
+struct tree_fixed_cst GTY(())
+{
+ struct tree_common common;
+ struct fixed_value * fixed_cst_ptr;
+};
+
/* In a STRING_CST */
#define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
#define TREE_STRING_POINTER(NODE) \
#define EXPR_HAS_LOCATION(NODE) expr_has_location ((NODE))
#define EXPR_LOCUS(NODE) expr_locus ((NODE))
#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM))
-#define EXPR_FILENAME(NODE) *(expr_filename ((NODE)))
-#define EXPR_LINENO(NODE) *(expr_lineno ((NODE)))
+#define EXPR_FILENAME(NODE) (expr_filename ((NODE)))
+#define EXPR_LINENO(NODE) (expr_lineno ((NODE)))
/* True if a tree is an expression or statement that can have a
location. */
#define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
#define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
+#define OMP_SECTIONS_CONTROL(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 2)
#define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
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 a VECTOR_TYPE node, this describes a different type which is emitted
in the debugging output. We use this to describe a vector as a
tree reference_to;
union tree_type_symtab {
int GTY ((tag ("0"))) address;
- char * GTY ((tag ("1"))) pointer;
+ const char * GTY ((tag ("1"))) pointer;
struct die_struct * GTY ((tag ("2"))) die;
} GTY ((desc ("debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"),
descbits ("2"))) symtab;
tree binfo;
tree context;
tree canonical;
- HOST_WIDE_INT alias_set;
+ alias_set_type alias_set;
/* Points to a structure whose details depend on the language in use. */
struct lang_type *lang_specific;
};
unsigned HOST_WIDE_INT size;
/* Alias set for a DECL_NONADDRESSABLE_P field. Otherwise -1. */
- HOST_WIDE_INT alias_set;
+ alias_set_type alias_set;
};
#define SFT_PARENT_VAR(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.parent_var)
#define SFT_OFFSET(NODE) (STRUCT_FIELD_TAG_CHECK (NODE)->sft.offset)
(DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from)
/* Nonzero for a given ..._DECL node means that the name of this node should
- be ignored for symbolic debug purposes. Moreover, for a FUNCTION_DECL,
- the body of the function should also be ignored. */
+ be ignored for symbolic debug purposes. */
#define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
/* Nonzero for a given ..._DECL node means that this node represents an
tree attributes;
tree abstract_origin;
- HOST_WIDE_INT pointer_alias_set;
+ alias_set_type pointer_alias_set;
/* Points to a structure whose details depend on the language in use. */
struct lang_decl *lang_specific;
};
struct tree_label_decl GTY(())
{
struct tree_decl_with_rtl common;
- /* Java's verifier has some need to store information about labels,
- and was using fields that no longer exist on labels.
- Once the verifier doesn't need these anymore, they should be removed. */
- tree java_field_1;
- tree java_field_2;
- tree java_field_3;
- unsigned int java_field_4;
-
};
struct tree_result_decl GTY(())
#define DECL_DECLARED_INLINE_P(NODE) \
(FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
+/* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
+ disregarding size and cost heuristics. This is equivalent to using
+ the always_inline attribute without the required diagnostics if the
+ function cannot be inlined. */
+#define DECL_DISREGARD_INLINE_LIMITS(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.disregard_inline_limits)
+
/* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
that describes the status of this function. */
#define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
{
struct tree_decl_non_common common;
+ struct function *f;
+
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
- DECL_FUNCTION_CODE. Otherwise unused. */
- enum built_in_function function_code;
+ DECL_FUNCTION_CODE. Otherwise unused.
+ ??? The bitfield needs to be able to hold all target function
+ codes as well. */
+ ENUM_BITFIELD(built_in_function) function_code : 11;
+ ENUM_BITFIELD(built_in_class) built_in_class : 2;
unsigned static_ctor_flag : 1;
unsigned static_dtor_flag : 1;
unsigned uninlinable : 1;
+
unsigned possibly_inlined : 1;
unsigned novops_flag : 1;
unsigned returns_twice_flag : 1;
unsigned malloc_flag : 1;
unsigned pure_flag : 1;
-
unsigned declared_inline_flag : 1;
unsigned regdecl_flag : 1;
unsigned inline_flag : 1;
+
unsigned no_instrument_function_entry_exit : 1;
unsigned no_limit_stack : 1;
- ENUM_BITFIELD(built_in_class) built_in_class : 2;
+ unsigned disregard_inline_limits : 1;
- struct function *f;
+ /* 5 bits left */
};
/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
struct tree_common GTY ((tag ("TS_COMMON"))) common;
struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
+ struct tree_fixed_cst GTY ((tag ("TS_FIXED_CST"))) fixed_cst;
struct tree_vector GTY ((tag ("TS_VECTOR"))) vector;
struct tree_string GTY ((tag ("TS_STRING"))) string;
struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex;
TI_MAIN_IDENTIFIER,
+ TI_SAT_SFRACT_TYPE,
+ TI_SAT_FRACT_TYPE,
+ TI_SAT_LFRACT_TYPE,
+ TI_SAT_LLFRACT_TYPE,
+ TI_SAT_USFRACT_TYPE,
+ TI_SAT_UFRACT_TYPE,
+ TI_SAT_ULFRACT_TYPE,
+ TI_SAT_ULLFRACT_TYPE,
+ TI_SFRACT_TYPE,
+ TI_FRACT_TYPE,
+ TI_LFRACT_TYPE,
+ TI_LLFRACT_TYPE,
+ TI_USFRACT_TYPE,
+ TI_UFRACT_TYPE,
+ TI_ULFRACT_TYPE,
+ TI_ULLFRACT_TYPE,
+ TI_SAT_SACCUM_TYPE,
+ TI_SAT_ACCUM_TYPE,
+ TI_SAT_LACCUM_TYPE,
+ TI_SAT_LLACCUM_TYPE,
+ TI_SAT_USACCUM_TYPE,
+ TI_SAT_UACCUM_TYPE,
+ TI_SAT_ULACCUM_TYPE,
+ TI_SAT_ULLACCUM_TYPE,
+ TI_SACCUM_TYPE,
+ TI_ACCUM_TYPE,
+ TI_LACCUM_TYPE,
+ TI_LLACCUM_TYPE,
+ TI_USACCUM_TYPE,
+ TI_UACCUM_TYPE,
+ TI_ULACCUM_TYPE,
+ TI_ULLACCUM_TYPE,
+ TI_QQ_TYPE,
+ TI_HQ_TYPE,
+ TI_SQ_TYPE,
+ TI_DQ_TYPE,
+ TI_TQ_TYPE,
+ TI_UQQ_TYPE,
+ TI_UHQ_TYPE,
+ TI_USQ_TYPE,
+ TI_UDQ_TYPE,
+ TI_UTQ_TYPE,
+ TI_SAT_QQ_TYPE,
+ TI_SAT_HQ_TYPE,
+ TI_SAT_SQ_TYPE,
+ TI_SAT_DQ_TYPE,
+ TI_SAT_TQ_TYPE,
+ TI_SAT_UQQ_TYPE,
+ TI_SAT_UHQ_TYPE,
+ TI_SAT_USQ_TYPE,
+ TI_SAT_UDQ_TYPE,
+ TI_SAT_UTQ_TYPE,
+ TI_HA_TYPE,
+ TI_SA_TYPE,
+ TI_DA_TYPE,
+ TI_TA_TYPE,
+ TI_UHA_TYPE,
+ TI_USA_TYPE,
+ TI_UDA_TYPE,
+ TI_UTA_TYPE,
+ TI_SAT_HA_TYPE,
+ TI_SAT_SA_TYPE,
+ TI_SAT_DA_TYPE,
+ TI_SAT_TA_TYPE,
+ TI_SAT_UHA_TYPE,
+ TI_SAT_USA_TYPE,
+ TI_SAT_UDA_TYPE,
+ TI_SAT_UTA_TYPE,
+
TI_MAX
};
#define dfloat64_ptr_type_node global_trees[TI_DFLOAT64_PTR_TYPE]
#define dfloat128_ptr_type_node global_trees[TI_DFLOAT128_PTR_TYPE]
+/* The fixed-point types. */
+#define sat_short_fract_type_node global_trees[TI_SAT_SFRACT_TYPE]
+#define sat_fract_type_node global_trees[TI_SAT_FRACT_TYPE]
+#define sat_long_fract_type_node global_trees[TI_SAT_LFRACT_TYPE]
+#define sat_long_long_fract_type_node global_trees[TI_SAT_LLFRACT_TYPE]
+#define sat_unsigned_short_fract_type_node \
+ global_trees[TI_SAT_USFRACT_TYPE]
+#define sat_unsigned_fract_type_node global_trees[TI_SAT_UFRACT_TYPE]
+#define sat_unsigned_long_fract_type_node \
+ global_trees[TI_SAT_ULFRACT_TYPE]
+#define sat_unsigned_long_long_fract_type_node \
+ global_trees[TI_SAT_ULLFRACT_TYPE]
+#define short_fract_type_node global_trees[TI_SFRACT_TYPE]
+#define fract_type_node global_trees[TI_FRACT_TYPE]
+#define long_fract_type_node global_trees[TI_LFRACT_TYPE]
+#define long_long_fract_type_node global_trees[TI_LLFRACT_TYPE]
+#define unsigned_short_fract_type_node global_trees[TI_USFRACT_TYPE]
+#define unsigned_fract_type_node global_trees[TI_UFRACT_TYPE]
+#define unsigned_long_fract_type_node global_trees[TI_ULFRACT_TYPE]
+#define unsigned_long_long_fract_type_node \
+ global_trees[TI_ULLFRACT_TYPE]
+#define sat_short_accum_type_node global_trees[TI_SAT_SACCUM_TYPE]
+#define sat_accum_type_node global_trees[TI_SAT_ACCUM_TYPE]
+#define sat_long_accum_type_node global_trees[TI_SAT_LACCUM_TYPE]
+#define sat_long_long_accum_type_node global_trees[TI_SAT_LLACCUM_TYPE]
+#define sat_unsigned_short_accum_type_node \
+ global_trees[TI_SAT_USACCUM_TYPE]
+#define sat_unsigned_accum_type_node global_trees[TI_SAT_UACCUM_TYPE]
+#define sat_unsigned_long_accum_type_node \
+ global_trees[TI_SAT_ULACCUM_TYPE]
+#define sat_unsigned_long_long_accum_type_node \
+ global_trees[TI_SAT_ULLACCUM_TYPE]
+#define short_accum_type_node global_trees[TI_SACCUM_TYPE]
+#define accum_type_node global_trees[TI_ACCUM_TYPE]
+#define long_accum_type_node global_trees[TI_LACCUM_TYPE]
+#define long_long_accum_type_node global_trees[TI_LLACCUM_TYPE]
+#define unsigned_short_accum_type_node global_trees[TI_USACCUM_TYPE]
+#define unsigned_accum_type_node global_trees[TI_UACCUM_TYPE]
+#define unsigned_long_accum_type_node global_trees[TI_ULACCUM_TYPE]
+#define unsigned_long_long_accum_type_node \
+ global_trees[TI_ULLACCUM_TYPE]
+#define qq_type_node global_trees[TI_QQ_TYPE]
+#define hq_type_node global_trees[TI_HQ_TYPE]
+#define sq_type_node global_trees[TI_SQ_TYPE]
+#define dq_type_node global_trees[TI_DQ_TYPE]
+#define tq_type_node global_trees[TI_TQ_TYPE]
+#define uqq_type_node global_trees[TI_UQQ_TYPE]
+#define uhq_type_node global_trees[TI_UHQ_TYPE]
+#define usq_type_node global_trees[TI_USQ_TYPE]
+#define udq_type_node global_trees[TI_UDQ_TYPE]
+#define utq_type_node global_trees[TI_UTQ_TYPE]
+#define sat_qq_type_node global_trees[TI_SAT_QQ_TYPE]
+#define sat_hq_type_node global_trees[TI_SAT_HQ_TYPE]
+#define sat_sq_type_node global_trees[TI_SAT_SQ_TYPE]
+#define sat_dq_type_node global_trees[TI_SAT_DQ_TYPE]
+#define sat_tq_type_node global_trees[TI_SAT_TQ_TYPE]
+#define sat_uqq_type_node global_trees[TI_SAT_UQQ_TYPE]
+#define sat_uhq_type_node global_trees[TI_SAT_UHQ_TYPE]
+#define sat_usq_type_node global_trees[TI_SAT_USQ_TYPE]
+#define sat_udq_type_node global_trees[TI_SAT_UDQ_TYPE]
+#define sat_utq_type_node global_trees[TI_SAT_UTQ_TYPE]
+#define ha_type_node global_trees[TI_HA_TYPE]
+#define sa_type_node global_trees[TI_SA_TYPE]
+#define da_type_node global_trees[TI_DA_TYPE]
+#define ta_type_node global_trees[TI_TA_TYPE]
+#define uha_type_node global_trees[TI_UHA_TYPE]
+#define usa_type_node global_trees[TI_USA_TYPE]
+#define uda_type_node global_trees[TI_UDA_TYPE]
+#define uta_type_node global_trees[TI_UTA_TYPE]
+#define sat_ha_type_node global_trees[TI_SAT_HA_TYPE]
+#define sat_sa_type_node global_trees[TI_SAT_SA_TYPE]
+#define sat_da_type_node global_trees[TI_SAT_DA_TYPE]
+#define sat_ta_type_node global_trees[TI_SAT_TA_TYPE]
+#define sat_uha_type_node global_trees[TI_SAT_UHA_TYPE]
+#define sat_usa_type_node global_trees[TI_SAT_USA_TYPE]
+#define sat_uda_type_node global_trees[TI_SAT_UDA_TYPE]
+#define sat_uta_type_node global_trees[TI_SAT_UTA_TYPE]
+
/* The node that should be placed at the end of a parameter list to
indicate that the function does not take a variable number of
arguments. The TREE_VALUE will be void_type_node and there will be
extern tree value_member (tree, tree);
extern tree purpose_member (const_tree, tree);
-extern int attribute_list_equal (tree, tree);
-extern int attribute_list_contained (tree, tree);
+extern int attribute_list_equal (const_tree, const_tree);
+extern int attribute_list_contained (const_tree, const_tree);
extern int tree_int_cst_equal (const_tree, const_tree);
extern int tree_int_cst_lt (const_tree, const_tree);
extern int tree_int_cst_compare (const_tree, const_tree);
extern bool may_negate_without_overflow_p (const_tree);
extern tree get_inner_array_type (const_tree);
+/* Construct various nodes representing fract or accum data types. */
+
+extern tree make_fract_type (int, int, int);
+extern tree make_accum_type (int, int, int);
+
+#define make_signed_fract_type(P) make_fract_type (P, 0, 0)
+#define make_unsigned_fract_type(P) make_fract_type (P, 1, 0)
+#define make_sat_signed_fract_type(P) make_fract_type (P, 0, 1)
+#define make_sat_unsigned_fract_type(P) make_fract_type (P, 1, 1)
+#define make_signed_accum_type(P) make_accum_type (P, 0, 0)
+#define make_unsigned_accum_type(P) make_accum_type (P, 1, 0)
+#define make_sat_signed_accum_type(P) make_accum_type (P, 0, 1)
+#define make_sat_unsigned_accum_type(P) make_accum_type (P, 1, 1)
+
+#define make_or_reuse_signed_fract_type(P) \
+ make_or_reuse_fract_type (P, 0, 0)
+#define make_or_reuse_unsigned_fract_type(P) \
+ make_or_reuse_fract_type (P, 1, 0)
+#define make_or_reuse_sat_signed_fract_type(P) \
+ make_or_reuse_fract_type (P, 0, 1)
+#define make_or_reuse_sat_unsigned_fract_type(P) \
+ make_or_reuse_fract_type (P, 1, 1)
+#define make_or_reuse_signed_accum_type(P) \
+ make_or_reuse_accum_type (P, 0, 0)
+#define make_or_reuse_unsigned_accum_type(P) \
+ make_or_reuse_accum_type (P, 1, 0)
+#define make_or_reuse_sat_signed_accum_type(P) \
+ make_or_reuse_accum_type (P, 0, 1)
+#define make_or_reuse_sat_unsigned_accum_type(P) \
+ make_or_reuse_accum_type (P, 1, 1)
+
/* From expmed.c. Since rtl.h is included after tree.h, we can't
put the prototype here. Rtl.h does declare the prototype if
tree.h had been included. */
extern tree expr_first (tree);
extern tree expr_last (tree);
extern tree expr_only (tree);
-extern tree size_in_bytes (tree);
+extern tree size_in_bytes (const_tree);
extern HOST_WIDE_INT int_size_in_bytes (const_tree);
-extern HOST_WIDE_INT max_int_size_in_bytes (tree);
+extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
extern tree bit_position (const_tree);
extern HOST_WIDE_INT int_bit_position (const_tree);
extern tree byte_position (const_tree);
extern bool cst_and_fits_in_hwi (const_tree);
extern tree num_ending_zeros (const_tree);
+/* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
+ value 0. */
+
+extern int fixed_zerop (const_tree);
+
/* staticp (tree x) is nonzero if X is a reference to data allocated
at a fixed address in memory. Returns the outermost data. */
/* Nonzero means a FUNC_BEGIN label was emitted. */
extern GTY(()) const char * current_function_func_begin_label;
\f
+/* Iterator for going through the function arguments. */
+typedef struct {
+ tree fntype; /* function type declaration */
+ tree next; /* TREE_LIST pointing to the next argument */
+} function_args_iterator;
+
+/* Initialize the iterator I with arguments from function FNDECL */
+
+static inline void
+function_args_iter_init (function_args_iterator *i, tree fntype)
+{
+ i->fntype = fntype;
+ i->next = TYPE_ARG_TYPES (fntype);
+}
+
+/* Return a pointer that holds the next argument if there are more arguments to
+ handle, otherwise return NULL. */
+
+static inline tree *
+function_args_iter_cond_ptr (function_args_iterator *i)
+{
+ return (i->next) ? &TREE_VALUE (i->next) : NULL;
+}
+
+/* Return the next argument if there are more arguments to handle, otherwise
+ return NULL. */
+
+static inline tree
+function_args_iter_cond (function_args_iterator *i)
+{
+ return (i->next) ? TREE_VALUE (i->next) : NULL_TREE;
+}
+
+/* Advance to the next argument. */
+static inline void
+function_args_iter_next (function_args_iterator *i)
+{
+ gcc_assert (i->next != NULL_TREE);
+ i->next = TREE_CHAIN (i->next);
+}
+
+/* Loop over all function arguments of FNTYPE. In each iteration, PTR is set
+ to point to the next tree element. ITER is an instance of
+ function_args_iterator used to iterate the arguments. */
+#define FOREACH_FUNCTION_ARGS_PTR(FNTYPE, PTR, ITER) \
+ for (function_args_iter_init (&(ITER), (FNTYPE)); \
+ (PTR = function_args_iter_cond_ptr (&(ITER))) != NULL; \
+ function_args_iter_next (&(ITER)))
+
+/* Loop over all function arguments of FNTYPE. In each iteration, TREE is set
+ to the next tree element. ITER is an instance of function_args_iterator
+ used to iterate the arguments. */
+#define FOREACH_FUNCTION_ARGS(FNTYPE, TREE, ITER) \
+ for (function_args_iter_init (&(ITER), (FNTYPE)); \
+ (TREE = function_args_iter_cond (&(ITER))) != NULL_TREE; \
+ function_args_iter_next (&(ITER)))
+
+
+\f
/* In tree.c */
extern unsigned crc32_string (unsigned, const char *);
extern void clean_symbol_name (char *);
extern tree call_expr_arg (tree, int);
extern tree *call_expr_argp (tree, int);
extern tree call_expr_arglist (tree);
+extern bool stdarg_p (tree);
+extern bool prototype_p (tree);
+extern int function_args_count (tree);
+extern bool auto_var_in_fn_p (const_tree, const_tree);
\f
/* In stmt.c */
extern tree fold_abs_const (tree, tree);
extern tree fold_indirect_ref_1 (tree, tree);
extern void fold_defer_overflow_warnings (void);
-extern void fold_undefer_overflow_warnings (bool, tree, int);
+extern void fold_undefer_overflow_warnings (bool, const_tree, int);
extern void fold_undefer_and_ignore_overflow_warnings (void);
extern bool fold_deferring_overflow_warnings_p (void);
extern tree maybe_fold_offset_to_reference (tree, tree, tree);
};
extern int operand_equal_p (const_tree, const_tree, unsigned int);
-extern int multiple_of_p (tree, tree, tree);
+extern int multiple_of_p (tree, const_tree, const_tree);
extern tree omit_one_operand (tree, tree, tree);
extern tree omit_two_operands (tree, tree, tree, tree);
extern tree invert_truthvalue (tree);
extern bool tree_expr_nonzero_p (tree);
extern bool tree_expr_nonzero_warnv_p (tree, bool *);
-extern int multiple_of_p (tree, tree, tree);
/* In builtins.c */
extern tree fold_call_expr (tree, bool);
extern bool fold_builtin_next_arg (tree, bool);
extern enum built_in_function builtin_mathfn_code (const_tree);
extern tree build_function_call_expr (tree, tree);
-extern tree fold_build_call_expr (tree, tree, tree, tree);
extern tree fold_builtin_call_array (tree, tree, int, tree *);
-extern void debug_fold_checksum (tree);
+extern void debug_fold_checksum (const_tree);
extern tree build_call_expr (tree, int, ...);
extern tree mathfn_built_in (tree, enum built_in_function fn);
extern tree strip_float_extensions (tree);
/* In alias.c */
extern void record_component_aliases (tree);
-extern HOST_WIDE_INT get_alias_set (tree);
-extern int alias_sets_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
-extern int alias_sets_must_conflict_p (HOST_WIDE_INT, HOST_WIDE_INT);
+extern alias_set_type get_alias_set (tree);
+extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
+extern int alias_sets_must_conflict_p (alias_set_type, alias_set_type);
extern int objects_must_conflict_p (tree, tree);
/* In tree.c */
extern int really_constant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);
-extern void get_type_static_bounds (tree, mpz_t, mpz_t);
+extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
extern bool variably_modified_type_p (tree, tree);
extern int tree_log2 (const_tree);
extern int tree_floor_log2 (const_tree);
extern void stack_protect_prologue (void);
extern void stack_protect_epilogue (void);
extern void recompute_tree_invariant_for_addr_expr (tree);
-extern bool needs_to_live_in_memory (tree);
+extern bool needs_to_live_in_memory (const_tree);
extern tree reconstruct_complex_type (tree, tree);
extern int real_onep (const_tree);
extern location_t expr_location (const_tree);
extern void set_expr_location (tree, location_t);
extern bool expr_has_location (const_tree);
-extern
-#ifdef USE_MAPPED_LOCATION
-source_location *
-#else
-source_locus
-#endif
-expr_locus (const_tree);
-extern void set_expr_locus (tree,
+
#ifdef USE_MAPPED_LOCATION
- source_location *loc
+extern source_locus *expr_locus (const_tree);
+extern void set_expr_locus (tree, source_location *);
#else
- source_locus loc
+extern source_locus expr_locus (const_tree);
+extern void set_expr_locus (tree, source_locus loc);
#endif
- );
-extern const char **expr_filename (const_tree);
-extern int *expr_lineno (const_tree);
+extern const char *expr_filename (const_tree);
+extern int expr_lineno (const_tree);
+
extern tree *tree_block (tree);
extern tree *generic_tree_operand (tree, int);
extern tree *generic_tree_type (tree);
+extern location_t *block_nonartificial_location (tree);
/* In function.c */
extern void expand_main_function (void);
extern void expand_dummy_function_end (void);
extern unsigned int init_function_for_compilation (void);
extern void allocate_struct_function (tree);
+extern void push_struct_function (tree fndecl);
extern void init_function_start (tree);
extern bool use_register_for_decl (const_tree);
extern void generate_setjmp_warnings (void);
extern void pop_temp_slots (void);
extern void push_temp_slots (void);
extern void preserve_temp_slots (rtx);
-extern int aggregate_value_p (tree, tree);
+extern int aggregate_value_p (const_tree, const_tree);
extern void push_function_context (void);
extern void pop_function_context (void);
extern void push_function_context_to (tree);
extern int setjmp_call_p (const_tree);
extern bool alloca_call_p (const_tree);
-extern bool must_pass_in_stack_var_size (enum machine_mode, tree);
-extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, tree);
+extern bool must_pass_in_stack_var_size (enum machine_mode, const_tree);
+extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree);
/* In attribs.c. */
+extern const struct attribute_spec *lookup_attribute_spec (tree);
+
/* Process the attributes listed in ATTRIBUTES and install them in *NODE,
which is either a DECL (including a TYPE_DECL) or a TYPE. If a DECL,
it should be modified in place; if a TYPE, a copy should be created
/* The type of a callback function for walking over tree structure. */
typedef tree (*walk_tree_fn) (tree *, int *, void *);
-extern tree walk_tree (tree*, walk_tree_fn, void*, struct pointer_set_t*);
-extern tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*);
+
+/* The type of a callback function that represents a custom walk_tree. */
+
+typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *),
+ void *, struct pointer_set_t*);
+
+extern tree walk_tree_1 (tree*, walk_tree_fn, void*, struct pointer_set_t*,
+ walk_tree_lh);
+extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
+ walk_tree_lh);
+#define walk_tree(a,b,c,d) \
+ walk_tree_1 (a, b, c, d, NULL)
+#define walk_tree_without_duplicates(a,b,c) \
+ walk_tree_without_duplicates_1 (a, b, c, NULL)
/* Assign the RTX to declaration. */
extern void copy_mem_ref_info (tree, tree);
/* In tree-vrp.c */
-extern bool ssa_name_nonzero_p (tree);
-extern bool ssa_name_nonnegative_p (tree);
+extern bool ssa_name_nonzero_p (const_tree);
+extern bool ssa_name_nonnegative_p (const_tree);
/* In tree-object-size.c. */
extern void init_object_sizes (void);