diff options
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 92 |
1 files changed, 69 insertions, 23 deletions
@@ -625,6 +625,9 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define FUNC_OR_METHOD_TYPE_P(NODE) \ (TREE_CODE (NODE) == FUNCTION_TYPE || TREE_CODE (NODE) == METHOD_TYPE) +#define OPAQUE_TYPE_P(NODE) \ + (TREE_CODE (NODE) == OPAQUE_TYPE) + /* Define many boolean fields that all tree nodes have. */ /* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address @@ -1214,7 +1217,7 @@ get_expr_source_range (tree expr) extern void protected_set_expr_location (tree, location_t); extern void protected_set_expr_location_if_unset (tree, location_t); -extern tree maybe_wrap_with_location (tree, location_t); +WARN_UNUSED_RESULT extern tree maybe_wrap_with_location (tree, location_t); extern int suppress_location_wrappers; @@ -1731,6 +1734,16 @@ class auto_suppress_location_wrappers #define OMP_CLAUSE_ALIGNED_ALIGNMENT(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALIGNED), 1) +#define OMP_CLAUSE_ALLOCATE_ALLOCATOR(NODE) \ + OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALLOCATE), 1) + +/* True if an ALLOCATE clause was present on a combined or composite + construct and the code for splitting the clauses has already performed + checking if the listed variable has explicit privatization on the + construct. */ +#define OMP_CLAUSE_ALLOCATE_COMBINED(NODE) \ + (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALLOCATE)->base.public_flag) + #define OMP_CLAUSE_NUM_TEAMS_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TEAMS), 0) @@ -1974,8 +1987,10 @@ class auto_suppress_location_wrappers so they must be checked as well. */ #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type_common.uid) -/* Type size in bits as a tree expression. Need not be constant - and may be null. */ +/* Type size in bits as a tree expression. Need not be constant and may + be greater than TYPE_SIZE for a C++ FIELD_DECL representing a base + class subobject with its own virtual base classes (which are laid out + separately). */ #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type_common.size) /* Likewise, type size in bytes. */ #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type_common.size_unit) @@ -2446,11 +2461,12 @@ extern tree vector_element_bits_tree (const_tree); #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE)) #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE)) #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE)) -/* This accessor returns TRUE if the decl it operates on was created - by a front-end or back-end rather than by user code. In this case - builtin-ness is indicated by source location. */ -#define DECL_IS_BUILTIN(DECL) \ - (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION) +/* This decl was created by a front-end or back-end rather than by + user code, and has not been explicitly declared by the user -- when + that happens the source location is updated to the user's + source. This includes decls with no location (!). */ +#define DECL_IS_UNDECLARED_BUILTIN(DECL) \ + (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION) /* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL, @@ -2507,29 +2523,34 @@ extern tree vector_element_bits_tree (const_tree); #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial) /* Holds the size of the datum, in bits, as a tree expression. - Need not be constant and may be null. */ + Need not be constant and may be null. May be less than TYPE_SIZE + for a C++ FIELD_DECL representing a base class subobject with its + own virtual base classes (which are laid out separately). */ #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size) /* Likewise for the size in bytes. */ #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit) +#define DECL_ALIGN_RAW(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align) /* Returns the alignment required for the datum, in bits. It must be a power of two, but an "alignment" of zero is supported (e.g. as "uninitialized" sentinel). */ -#define DECL_ALIGN(NODE) \ - (DECL_COMMON_CHECK (NODE)->decl_common.align \ - ? ((unsigned)1) << ((NODE)->decl_common.align - 1) : 0) +#define DECL_ALIGN(NODE) \ + (DECL_ALIGN_RAW (NODE) \ + ? ((unsigned)1) << (DECL_ALIGN_RAW (NODE) - 1) : 0) /* Specify that DECL_ALIGN(NODE) is X. */ #define SET_DECL_ALIGN(NODE, X) \ - (DECL_COMMON_CHECK (NODE)->decl_common.align = ffs_hwi (X)) + (DECL_ALIGN_RAW (NODE) = ffs_hwi (X)) /* The minimum alignment necessary for the datum, in bits, without warning. */ -#define DECL_WARN_IF_NOT_ALIGN(NODE) \ - (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align \ - ? ((unsigned)1) << ((NODE)->decl_common.warn_if_not_align - 1) : 0) +#define DECL_WARN_IF_NOT_ALIGN_RAW(NODE) \ + (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align) +#define DECL_WARN_IF_NOT_ALIGN(NODE) \ + (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) \ + ? ((unsigned)1) << (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) - 1) : 0) /* Specify that DECL_WARN_IF_NOT_ALIGN(NODE) is X. */ -#define SET_DECL_WARN_IF_NOT_ALIGN(NODE, X) \ - (DECL_COMMON_CHECK (NODE)->decl_common.warn_if_not_align = ffs_hwi (X)) +#define SET_DECL_WARN_IF_NOT_ALIGN(NODE, X) \ + (DECL_WARN_IF_NOT_ALIGN_RAW (NODE) = ffs_hwi (X)) /* The alignment of NODE, in bytes. */ #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT) @@ -2648,6 +2669,20 @@ extern tree vector_element_bits_tree (const_tree); #define DECL_PRESERVE_P(DECL) \ DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag +/* Nonzero for a decl that is decorated with the "noinit" attribute. + decls with this attribute are placed into the ".noinit" section, so they are + not initialized by the target's startup code. */ +#define DECL_NOINIT_P(DECL) \ + (DECL_P (DECL) \ + && (lookup_attribute ("noinit", DECL_ATTRIBUTES (DECL)) != NULL_TREE)) + +/* Nonzero for a decl that is decorated with the "persistent" attribute. + decls with this attribute are placed into the ".persistent" section, so they + are not initialized by the target's startup code. */ +#define DECL_PERSISTENT_P(DECL) \ + (DECL_P (DECL) \ + && (lookup_attribute ("persistent", DECL_ATTRIBUTES (DECL)) != NULL_TREE)) + /* For function local variables of COMPLEX and VECTOR types, indicates that the variable is not aliased, and that all modifications to the variable have been adjusted so that @@ -3849,7 +3884,7 @@ id_equal (const_tree id, const char *str) inline bool id_equal (const char *str, const_tree id) { - return !strcmp (str, IDENTIFIER_POINTER (id)); + return id_equal (id, str); } /* Return the number of elements in the VECTOR_TYPE given by NODE. */ @@ -4270,6 +4305,7 @@ extern tree decl_comdat_group (const_tree); extern tree decl_comdat_group_id (const_tree); extern const char *decl_section_name (const_tree); extern void set_decl_section_name (tree, const char *); +extern void set_decl_section_name (tree, const_tree); extern enum tls_model decl_tls_model (const_tree); extern void set_decl_tls_model (tree, enum tls_model); @@ -4419,6 +4455,7 @@ extern tree build_constructor_from_vec (tree, const vec<tree, va_gc> *); extern tree build_constructor_va (tree, int, ...); extern tree build_clobber (tree); extern tree build_real_from_int_cst (tree, const_tree); +extern tree build_real_from_wide (tree, const wide_int_ref &, signop); extern tree build_complex (tree, tree, tree); extern tree build_complex_inf (tree, bool); extern tree build_each_one_cst (tree); @@ -5108,7 +5145,7 @@ extern const_tree strip_invariant_refs (const_tree); extern tree lhd_gcc_personality (void); extern void assign_assembler_name_if_needed (tree); extern bool warn_deprecated_use (tree, tree); -extern void cache_integer_cst (tree); +extern tree cache_integer_cst (tree, bool might_duplicate = false); extern const char *combined_fn_name (combined_fn); /* Compare and hash for any structure which begins with a canonical @@ -5241,6 +5278,7 @@ extern tree tree_block (tree); extern void tree_set_block (tree, tree); extern location_t *block_nonartificial_location (tree); extern location_t tree_nonartificial_location (tree); +extern location_t tree_inlined_location (tree, bool = true); extern tree block_ultimate_origin (const_tree); extern tree get_binfo_at_offset (tree, poly_int64, tree); extern bool virtual_method_call_p (const_tree, bool = false); @@ -5318,6 +5356,7 @@ extern bool gimple_canonical_types_compatible_p (const_tree, const_tree, extern bool type_with_interoperable_signedness (const_tree); extern bitmap get_nonnull_args (const_tree); extern int get_range_pos_neg (tree); +extern bool valid_new_delete_pair_p (tree, tree); /* Return simplified tree code of type that is used for canonical type merging. */ @@ -5566,6 +5605,13 @@ is_lang_specific (const_tree t) #define BUILTIN_VALID_P(FNCODE) \ (IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1)) +/* Obtain a pointer to the identifier string holding the asm name for + BUILTIN, a BUILT_IN code. This is handy if the target + mangles/overrides the function name that implements the + builtin. */ +#define BUILTIN_ASM_NAME_PTR(BUILTIN) \ + (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (builtin_decl_explicit (BUILTIN)))) + /* Return the tree node for an explicit standard builtin function or NULL. */ static inline tree builtin_decl_explicit (enum built_in_function fncode) @@ -6220,6 +6266,7 @@ extern void gt_pch_nx (tree &); extern void gt_pch_nx (tree &, gt_pointer_operator, void *); extern bool nonnull_arg_p (const_tree); +extern bool is_empty_type (const_tree); extern bool default_is_empty_record (const_tree); extern bool flexible_array_type_p (const_tree); extern HOST_WIDE_INT arg_int_size_in_bytes (const_tree); @@ -6267,9 +6314,8 @@ type_has_mode_precision_p (const_tree t) /* Return true if a FUNCTION_DECL NODE is a GCC built-in function. - Note that it is different from the DECL_IS_BUILTIN accessor. For - instance, user declared prototypes of C library functions are not - DECL_IS_BUILTIN but may be fndecl_built_in_p. */ + Note that it is different from the DECL_IS_UNDECLARED_BUILTIN + accessor, as this is impervious to user declaration. */ inline bool fndecl_built_in_p (const_tree node) |