Mercurial > hg > CbC > CbC_gcc
diff gcc/c-family/c-common.h @ 146:351920fa3827
merge
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 01 Mar 2020 16:13:28 +0900 |
parents | d34655255c78 1830386684a0 |
children |
line wrap: on
line diff
--- a/gcc/c-family/c-common.h Sun Dec 23 21:23:56 2018 +0900 +++ b/gcc/c-family/c-common.h Sun Mar 01 16:13:28 2020 +0900 @@ -1,5 +1,5 @@ /* Definitions for c-common.c. - Copyright (C) 1987-2018 Free Software Foundation, Inc. + Copyright (C) 1987-2020 Free Software Foundation, Inc. This file is part of GCC. @@ -102,7 +102,8 @@ RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG, RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, RID_TYPES_COMPATIBLE_P, RID_BUILTIN_COMPLEX, RID_BUILTIN_SHUFFLE, - RID_BUILTIN_TGMATH, + RID_BUILTIN_CONVERTVECTOR, RID_BUILTIN_TGMATH, + RID_BUILTIN_HAS_ATTRIBUTE, RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, /* TS 18661-3 keywords, in the same sequence as the TI_* values. */ @@ -179,9 +180,18 @@ /* C++11 */ RID_CONSTEXPR, RID_DECLTYPE, RID_NOEXCEPT, RID_NULLPTR, RID_STATIC_ASSERT, + /* C++20 */ + RID_CONSTINIT, RID_CONSTEVAL, + + /* char8_t */ + RID_CHAR8, + /* C++ concepts */ RID_CONCEPT, RID_REQUIRES, + /* C++ coroutines */ + RID_CO_AWAIT, RID_CO_YIELD, RID_CO_RETURN, + /* C++ transactional memory. */ RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED, @@ -250,6 +260,8 @@ RID_FIRST_CXX11 = RID_CONSTEXPR, RID_LAST_CXX11 = RID_STATIC_ASSERT, + RID_FIRST_CXX20 = RID_CONSTINIT, + RID_LAST_CXX20 = RID_CONSTINIT, RID_FIRST_AT = RID_AT_ENCODE, RID_LAST_AT = RID_AT_IMPLEMENTATION, RID_FIRST_PQ = RID_IN, @@ -290,6 +302,7 @@ enum c_tree_index { + CTI_CHAR8_TYPE, CTI_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_WCHAR_TYPE, @@ -333,6 +346,7 @@ CTI_UINTPTR_TYPE, CTI_CHAR_ARRAY_TYPE, + CTI_CHAR8_ARRAY_TYPE, CTI_CHAR16_ARRAY_TYPE, CTI_CHAR32_ARRAY_TYPE, CTI_WCHAR_ARRAY_TYPE, @@ -412,20 +426,25 @@ mask) is _true_. Thus for keywords which are present in all languages the disable field is zero. */ -#define D_CONLY 0x001 /* C only (not in C++). */ -#define D_CXXONLY 0x002 /* C++ only (not in C). */ -#define D_C99 0x004 /* In C, C99 only. */ -#define D_CXX11 0x008 /* In C++, C++11 only. */ -#define D_EXT 0x010 /* GCC extension. */ -#define D_EXT89 0x020 /* GCC extension incorporated in C99. */ -#define D_ASM 0x040 /* Disabled by -fno-asm. */ -#define D_OBJC 0x080 /* In Objective C and neither C nor C++. */ -#define D_CXX_OBJC 0x100 /* In Objective C, and C++, but not C. */ -#define D_CXXWARN 0x200 /* In C warn with -Wcxx-compat. */ -#define D_CXX_CONCEPTS 0x400 /* In C++, only with concepts. */ -#define D_TRANSMEM 0X800 /* C++ transactional memory TS. */ +#define D_CONLY 0x0001 /* C only (not in C++). */ +#define D_CXXONLY 0x0002 /* C++ only (not in C). */ +#define D_C99 0x0004 /* In C, C99 only. */ +#define D_CXX11 0x0008 /* In C++, C++11 only. */ +#define D_EXT 0x0010 /* GCC extension. */ +#define D_EXT89 0x0020 /* GCC extension incorporated in C99. */ +#define D_ASM 0x0040 /* Disabled by -fno-asm. */ +#define D_OBJC 0x0080 /* In Objective C and neither C nor C++. */ +#define D_CXX_OBJC 0x0100 /* In Objective C, and C++, but not C. */ +#define D_CXXWARN 0x0200 /* In C warn with -Wcxx-compat. */ +#define D_CXX_CONCEPTS 0x0400 /* In C++, only with concepts. */ +#define D_TRANSMEM 0X0800 /* C++ transactional memory TS. */ +#define D_CXX_CHAR8_T 0X1000 /* In C++, only with -fchar8_t. */ +#define D_CXX20 0x2000 /* In C++, C++20 only. */ +#define D_CXX_COROUTINES 0x4000 /* In C++, only with coroutines. */ #define D_CXX_CONCEPTS_FLAGS D_CXXONLY | D_CXX_CONCEPTS +#define D_CXX_CHAR8_T_FLAGS D_CXXONLY | D_CXX_CHAR8_T +#define D_CXX_COROUTINES_FLAGS (D_CXXONLY | D_CXX_COROUTINES) /* The reserved keyword table. */ extern const struct c_common_resword c_common_reswords[]; @@ -433,6 +452,7 @@ /* The number of items in the reserved keyword table. */ extern const unsigned int num_c_common_reswords; +#define char8_type_node c_global_trees[CTI_CHAR8_TYPE] #define char16_type_node c_global_trees[CTI_CHAR16_TYPE] #define char32_type_node c_global_trees[CTI_CHAR32_TYPE] #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE] @@ -478,6 +498,7 @@ #define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE] #define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE] +#define char8_array_type_node c_global_trees[CTI_CHAR8_ARRAY_TYPE] #define char16_array_type_node c_global_trees[CTI_CHAR16_ARRAY_TYPE] #define char32_array_type_node c_global_trees[CTI_CHAR32_ARRAY_TYPE] #define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE] @@ -689,11 +710,6 @@ != (warn_abi_version == 0 \ || warn_abi_version >= (N))) -/* Nonzero means generate separate instantiation control files and - juggle them at link time. */ - -extern int flag_use_repository; - /* The supported C++ dialects. */ enum cxx_dialect { @@ -750,6 +766,16 @@ #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \ (!C_TYPE_FUNCTION_P (type)) +/* Return true if TYPE is a vector type that should be subject to the GNU + vector extensions (as opposed to a vector type that is used only for + the purposes of defining target-specific built-in functions). */ + +inline bool +gnu_vector_type_p (const_tree type) +{ + return TREE_CODE (type) == VECTOR_TYPE && !TYPE_INDIVISIBLE_P (type); +} + struct visibility_flags { unsigned inpragma : 1; /* True when in #pragma GCC visibility. */ @@ -762,8 +788,7 @@ SAFE_CONVERSION = 0, /* Another type of conversion with problems. */ UNSAFE_OTHER, - /* Conversion between signed and unsigned integers - which are all warned about immediately, so this is unused. */ + /* Conversion between signed and unsigned integers. */ UNSAFE_SIGN, /* Conversions that reduce the precision of reals including conversions from reals to integers. */ @@ -794,6 +819,8 @@ extern bool in_late_binary_op; extern const char *c_addr_space_name (addr_space_t as); extern tree identifier_global_value (tree); +extern tree identifier_global_tag (tree); +extern bool names_builtin_p (const char *); extern tree c_linkage_bindings (tree); extern void record_builtin_type (enum rid, const char *, tree); extern tree build_void_list_node (void); @@ -802,7 +829,7 @@ extern const char *fname_as_string (int); extern tree fname_decl (location_t, unsigned, tree); -extern int check_user_alignment (const_tree, bool); +extern int check_user_alignment (const_tree, bool, bool); extern bool check_function_arguments (location_t loc, const_tree, const_tree, int, tree *, vec<location_t> *); extern void check_function_arguments_recurse (void (*) @@ -811,8 +838,9 @@ void *, tree, unsigned HOST_WIDE_INT); extern bool check_builtin_function_arguments (location_t, vec<location_t>, - tree, int, tree *); -extern void check_function_format (tree, int, tree *, vec<location_t> *); + tree, tree, int, tree *); +extern void check_function_format (const_tree, tree, int, tree *, + vec<location_t> *); extern bool attribute_fallthrough_p (tree); extern tree handle_format_attribute (tree *, tree, tree, int, bool *); extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); @@ -829,8 +857,7 @@ extern tree c_common_signed_or_unsigned_type (int, tree); extern void c_common_init_ts (void); extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); -extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree, - bool); +extern enum conversion_safety unsafe_conversion_p (tree, tree, tree, bool); extern bool decl_with_nonnull_addr_p (const_tree); extern tree c_fully_fold (tree, bool, bool *, bool = false); extern tree c_wrap_maybe_const (tree, bool); @@ -861,7 +888,7 @@ extern bool bool_promoted_to_int_p (tree); extern tree fold_for_warn (tree); extern tree c_common_get_narrower (tree, int *); -extern bool get_nonnull_operand (tree, unsigned HOST_WIDE_INT *); +extern bool get_attribute_operand (tree, unsigned HOST_WIDE_INT *); #define c_sizeof(LOC, T) c_sizeof_or_alignof_type (LOC, T, true, false, 1) #define c_alignof(LOC, T) c_sizeof_or_alignof_type (LOC, T, false, false, 1) @@ -981,14 +1008,14 @@ extern int case_compare (splay_tree_key, splay_tree_key); -extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree, - bool *); +extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree); extern bool c_switch_covers_all_cases_p (splay_tree, tree); extern tree build_function_call (location_t, tree, tree); extern tree build_function_call_vec (location_t, vec<location_t>, tree, - vec<tree, va_gc> *, vec<tree, va_gc> *); + vec<tree, va_gc> *, vec<tree, va_gc> *, + tree = NULL_TREE); extern tree resolve_overloaded_builtin (location_t, tree, vec<tree, va_gc> *); @@ -1003,6 +1030,7 @@ extern bool vector_targets_convertible_p (const_tree t1, const_tree t2); extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); extern tree c_build_vec_perm_expr (location_t, tree, tree, tree, bool = true); +extern tree c_build_vec_convert (location_t, tree, location_t, tree, bool = true); extern void init_c_lex (void); @@ -1013,6 +1041,7 @@ const char *, va_list *) ATTRIBUTE_GCC_DIAG(5,0); extern int c_common_has_attribute (cpp_reader *); +extern int c_common_has_builtin (cpp_reader *); extern bool parse_optimize_options (tree, bool); @@ -1054,6 +1083,7 @@ extern void c_common_mark_addressable_vec (tree); extern void set_underlying_type (tree); +extern bool user_facing_original_type_p (const_tree); extern void record_types_used_by_current_var_decl (tree); extern vec<tree, va_gc> *make_tree_vector (void); extern void release_tree_vector (vec<tree, va_gc> *); @@ -1141,7 +1171,8 @@ C_OMP_CLAUSE_SPLIT_SIMD, C_OMP_CLAUSE_SPLIT_COUNT, C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR, - C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR + C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR, + C_OMP_CLAUSE_SPLIT_LOOP = C_OMP_CLAUSE_SPLIT_FOR }; enum c_omp_region_type @@ -1153,18 +1184,21 @@ }; extern tree c_finish_omp_master (location_t, tree); -extern tree c_finish_omp_taskgroup (location_t, tree); +extern tree c_finish_omp_taskgroup (location_t, tree, tree); extern tree c_finish_omp_critical (location_t, tree, tree, tree); extern tree c_finish_omp_ordered (location_t, tree, tree); extern void c_finish_omp_barrier (location_t); extern tree c_finish_omp_atomic (location_t, enum tree_code, enum tree_code, - tree, tree, tree, tree, tree, bool, bool, - bool = false); -extern void c_finish_omp_flush (location_t); + tree, tree, tree, tree, tree, bool, + enum omp_memory_order, bool = false); +extern bool c_omp_depend_t_p (tree); +extern void c_finish_omp_depobj (location_t, tree, enum omp_clause_depend_kind, + tree); +extern void c_finish_omp_flush (location_t, int); extern void c_finish_omp_taskwait (location_t); extern void c_finish_omp_taskyield (location_t); extern tree c_finish_omp_for (location_t, enum tree_code, tree, tree, tree, - tree, tree, tree, tree); + tree, tree, tree, tree, bool); extern bool c_omp_check_loop_iv (tree, tree, walk_tree_lh); extern bool c_omp_check_loop_iv_exprs (location_t, tree, tree, tree, tree, walk_tree_lh); @@ -1174,7 +1208,11 @@ tree, tree *); extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree); extern void c_omp_declare_simd_clauses_to_decls (tree, tree); +extern bool c_omp_predefined_variable (tree); extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree); +extern tree c_omp_check_context_selector (location_t, tree); +extern void c_omp_mark_declare_variant (location_t, tree, tree); +extern const char *c_omp_map_clause_name (tree, bool); /* Return next tree in the chain for chain_next walking of tree nodes. */ static inline tree @@ -1259,7 +1297,9 @@ extern tree replace_inv_trees (tree *, int *, void *); extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION); -extern bool valid_array_size_p (location_t, tree, tree, bool = true); +extern bool valid_array_size_p (location_t, const_tree, tree, bool = true); +extern void invalid_array_size_error (location_t, cst_size_error, + const_tree, const_tree); /* In c-warn.c. */ extern void constant_expression_warning (tree); @@ -1267,7 +1307,8 @@ extern void overflow_warning (location_t, tree, tree = NULL_TREE); extern void warn_logical_operator (location_t, enum tree_code, tree, enum tree_code, tree, enum tree_code, tree); -extern void warn_tautological_cmp (location_t, enum tree_code, tree, tree); +extern void warn_tautological_cmp (const op_location_t &, enum tree_code, + tree, tree); extern void warn_logical_not_parentheses (location_t, enum tree_code, tree, tree); extern bool warn_if_unused_value (const_tree, location_t); @@ -1277,10 +1318,10 @@ bool (*) (tree, tree)); extern void check_main_parameter_types (tree decl); extern void warnings_for_convert_and_check (location_t, tree, tree, tree); -extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, - bool); +extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool); extern void warn_for_omitted_condop (location_t, tree); extern bool warn_for_restrict (unsigned, tree *, unsigned); +extern void warn_for_address_or_pointer_of_packed_member (tree, tree); /* Places where an lvalue, or modifiable lvalue, may be required. Used to select diagnostic messages in lvalue_error and @@ -1325,11 +1366,31 @@ /* In c-attribs.c. */ extern bool attribute_takes_identifier_p (const_tree); +extern tree handle_deprecated_attribute (tree *, tree, tree, int, bool *); extern tree handle_unused_attribute (tree *, tree, tree, int, bool *); +extern tree handle_fallthrough_attribute (tree *, tree, tree, int, bool *); extern int parse_tm_stmt_attr (tree, int); extern int tm_attr_to_mask (tree); extern tree tm_mask_to_attr (int); extern tree find_tm_attribute (tree); +extern const struct attribute_spec::exclusions attr_cold_hot_exclusions[]; +extern const struct attribute_spec::exclusions attr_noreturn_exclusions[]; +extern tree handle_noreturn_attribute (tree *, tree, tree, int, bool *); + +/* In c-format.c. */ +extern bool valid_format_string_type_p (tree); + +/* A bitmap of flags to positional_argument. */ +enum posargflags { + /* Consider positional attribute argument value zero valid. */ + POSARG_ZERO = 1, + /* Consider positional attribute argument value valid if it refers + to the ellipsis (i.e., beyond the last typed argument). */ + POSARG_ELLIPSIS = 2 +}; + +extern tree positional_argument (const_tree, const_tree, tree, tree_code, + int = 0, int = posargflags ()); extern enum flt_eval_method excess_precision_mode_join (enum flt_eval_method, enum flt_eval_method); @@ -1341,7 +1402,9 @@ extern void maybe_suggest_missing_token_insertion (rich_location *richloc, enum cpp_ttype token_type, location_t prev_token_loc); -extern tree braced_list_to_string (tree, tree); +extern tree braced_lists_to_strings (tree, tree); + +extern bool has_attribute (location_t, tree, tree, tree (*)(tree)); #if CHECKING_P namespace selftest {