/* Front-end tree definitions for GNU compiler.
Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
See the accessor macros, defined below, for documentation of the
fields. */
-union tree_ann_d;
struct GTY(()) tree_base {
ENUM_BITFIELD(tree_code) code : 16;
unsigned packed_flag : 1;
unsigned user_align : 1;
- unsigned spare : 21;
+ unsigned spare : 13;
- union tree_ann_d *ann;
+ /* This field is only used with type nodes; the only 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. */
+ unsigned address_space : 8;
};
struct GTY(()) tree_common {
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.
- In ..._TYPE nodes, it means that objects of this type must
- be fully addressable. This means that pieces of this
- object cannot go into register parameters, for example.
+ In ..._TYPE nodes, it means that objects of this type must be fully
+ addressable. This means that pieces of this object cannot go into
+ register parameters, for example. If this a function type, this
+ means that the value must be returned in memory.
In IDENTIFIER_NODEs, this means that some extern decl for this name
had its address taken. That matters for inline functions. */
#define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
#define TREE_THIS_NOTRAP(NODE) ((NODE)->base.nothrow_flag)
/* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
- nonzero means it may not be the lhs of an assignment.
+ nonzero means it may not be the lhs of an assignment.
Nonzero in a FUNCTION_DECL means this function should be treated
as "const" function (can only read its arguments). */
#define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
(TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
RESULT_DECL)->decl_common.decl_restricted_flag)
+#define DECL_READ_P(NODE) \
+ (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_read_flag)
+
/* In a CALL_EXPR, means that the call is the jump from a thunk to the
thunked-to function. */
#define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->base.protected_flag)
#define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
for (IX = 0; (IX >= VEC_length (constructor_elt, V)) \
? false \
- : ((VAL = VEC_index (constructor_elt, V, IX)->value), \
+ : (((void) (VAL = VEC_index (constructor_elt, V, IX)->value)), \
(INDEX = VEC_index (constructor_elt, V, IX)->index), \
- true); \
+ true); \
(IX)++)
/* Append a new constructor element to V, with the specified INDEX and VAL. */
/* The "canonical" type for this type node, which can be used 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.
+ 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
the term. */
#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
+/* The address space the type is in. */
+#define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.address_space)
+
/* There is a TYPE_QUAL value for each type qualifier. They can be
combined by bitwise-or to form the complete set of qualifiers for a
type. */
#define TYPE_QUAL_VOLATILE 0x2
#define TYPE_QUAL_RESTRICT 0x4
+/* Encode/decode the named memory support as part of the qualifier. If more
+ than 8 qualifiers are added, these macros need to be adjusted. */
+#define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
+#define DECODE_QUAL_ADDR_SPACE(X) (((X) >> 8) & 0xFF)
+
+/* Return all qualifiers except for the address space qualifiers. */
+#define CLEAR_QUAL_ADDR_SPACE(X) ((X) & ~0xFF00)
+
+/* Only keep the address space out of the qualifiers and discard the other
+ qualifiers. */
+#define KEEP_QUAL_ADDR_SPACE(X) ((X) & 0xFF00)
+
/* The set of type qualifiers for this type. */
#define TYPE_QUALS(NODE) \
((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
| (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
+ | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
+ | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE))))
+
+/* The same as TYPE_QUALS without the address space qualifications. */
+#define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
+ ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
+ | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
| (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
/* These flags are available for each language front end to use internally. */
#define TYPE_NEEDS_CONSTRUCTING(NODE) \
(TYPE_CHECK (NODE)->type.needs_constructing_flag)
-/* Indicates that objects of this type (a UNION_TYPE), should be passed
- the same way that the first union alternative would be passed. */
-#define TYPE_TRANSPARENT_UNION(NODE) \
- (UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
+/* Indicates that a UNION_TYPE object should be passed the same way that
+ the first union alternative would be passed, or that a RECORD_TYPE
+ object should be passed the same way that the first (and only) member
+ would be passed. */
+#define TYPE_TRANSPARENT_AGGR(NODE) \
+ (RECORD_OR_UNION_CHECK (NODE)->type.transparent_aggr_flag)
/* For an ARRAY_TYPE, indicates that it is not permitted to take the
address of a component of the type. This is the counterpart of
DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
#define TYPE_NONALIASED_COMPONENT(NODE) \
- (ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
+ (ARRAY_TYPE_CHECK (NODE)->type.transparent_aggr_flag)
/* Indicated that objects of this type should be laid out in as
compact a way as possible. */
unsigned int precision : 10;
unsigned no_force_blk_flag : 1;
unsigned needs_constructing_flag : 1;
- unsigned transparent_union_flag : 1;
+ unsigned transparent_aggr_flag : 1;
unsigned restrict_flag : 1;
unsigned contains_placeholder_bits : 2;
|| TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
/* Nonzero for a decl that is decorated using attribute used.
- This indicates compiler tools that this decl needs to be preserved. */
+ This indicates to compiler tools that this decl needs to be preserved. */
#define DECL_PRESERVE_P(DECL) \
DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
/* In VAR_DECL, PARM_DECL and RESULT_DECL, this is DECL_RESTRICTED_P. */
unsigned decl_restricted_flag : 1;
+ /* In VAR_DECL and PARM_DECL set when the decl has been used except for
+ being set. */
+ unsigned decl_read_flag : 1;
+
/* Padding so that 'off_align' can be on a 32-bit boundary. */
- unsigned decl_common_unused : 2;
+ unsigned decl_common_unused : 1;
/* DECL_OFFSET_ALIGN, used only for FIELD_DECLs. */
unsigned int off_align : 8;
int eh_landing_pad_nr;
};
+struct var_ann_d;
struct GTY(()) tree_result_decl {
struct tree_decl_with_rtl common;
+ struct var_ann_d *ann;
};
struct GTY(()) tree_const_decl {
struct GTY(()) tree_parm_decl {
struct tree_decl_with_rtl common;
rtx incoming_rtl;
+ struct var_ann_d *ann;
};
/* A replaceable function is one which may be replaced at link-time
with an entirely different definition, provided that the
replacement has the same type. For example, functions declared
- with __attribute__((weak)) on most systems are replaceable.
+ with __attribute__((weak)) on most systems are replaceable.
COMDAT functions are not replaceable, since all definitions of the
function must be equivalent. It is important that COMDAT functions
not be treated as replaceable so that use of C++ template
- instantiations is not penalized.
+ instantiations is not penalized.
For example, DECL_REPLACEABLE is used to determine whether or not a
function (including a template instantiation) which is not
(VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
/* For a VAR_DECL or FUNCTION_DECL the initialization priority of
- NODE. */
+ NODE. */
#define DECL_INIT_PRIORITY(NODE) \
(decl_init_priority_lookup (NODE))
/* Set the initialization priority for NODE to VAL. */
#define DECL_THREAD_LOCAL_P(NODE) \
(VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
+#define DECL_VAR_ANN_PTR(NODE) \
+ (TREE_CODE (NODE) == VAR_DECL ? &(NODE)->var_decl.ann \
+ : TREE_CODE (NODE) == PARM_DECL ? &(NODE)->parm_decl.ann \
+ : TREE_CODE (NODE) == RESULT_DECL ? &(NODE)->result_decl.ann \
+ : NULL)
+
struct GTY(()) tree_var_decl {
struct tree_decl_with_vis common;
+ struct var_ann_d *ann;
};
extern int fields_length (const_tree);
+/* Returns the first FIELD_DECL in a type. */
+
+extern tree first_field (const_tree);
+
/* Given an initializer INIT, return TRUE if INIT is zero or some
aggregate of zeros. Otherwise return FALSE. */
extern tree tree_strip_nop_conversions (tree);
extern tree tree_strip_sign_nop_conversions (tree);
extern tree lhd_gcc_personality (void);
+extern void assign_assembler_name_if_neeeded (tree);
+
\f
/* In cgraph.c */
extern void change_decl_assembler_name (tree, tree);
extern void fold_undefer_and_ignore_overflow_warnings (void);
extern bool fold_deferring_overflow_warnings_p (void);
-extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- int, bool);
-
-extern int fit_double_type (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, const_tree);
-extern int add_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
- bool);
-#define add_double(l1,h1,l2,h2,lv,hv) \
- add_double_with_sign (l1, h1, l2, h2, lv, hv, false)
-extern int neg_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-extern int mul_double_with_sign (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *,
- bool);
-#define mul_double(l1,h1,l2,h2,lv,hv) \
- mul_double_with_sign (l1, h1, l2, h2, lv, hv, false)
-extern void lshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
-extern void rshift_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *, int);
-extern void lrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-extern void rrotate_double (unsigned HOST_WIDE_INT, HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned int,
- unsigned HOST_WIDE_INT *, HOST_WIDE_INT *);
-
-extern int div_and_round_double (enum tree_code, int, unsigned HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned HOST_WIDE_INT,
- HOST_WIDE_INT, unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
- HOST_WIDE_INT *);
-
enum operand_equal_flag
{
OEP_ONLY_CONST = 1,
extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
extern tree make_range (tree, int *, tree *, tree *, bool *);
extern tree build_range_check (location_t, tree, tree, int, tree, tree);
-extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
+extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int,
tree, tree);
extern void set_builtin_user_assembler_name (tree decl, const char *asmspec);
unsigned int);
/* varasm.c */
extern void make_decl_rtl (tree);
+extern rtx make_decl_rtl_for_debug (tree);
extern void make_decl_one_only (tree, tree);
extern int supports_one_only (void);
extern void resolve_unique_section (tree, int, int);
extern void dwarf2out_window_save (const char *);
-/* Add a CFI to update the running total of the size of arguments pushed
- onto the stack. */
-
-extern void dwarf2out_args_size (const char *, HOST_WIDE_INT);
-
/* Entry point for saving a register to the stack. */
extern void dwarf2out_reg_save (const char *, unsigned, HOST_WIDE_INT);
/* 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
+/* 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. */
static inline int