comparison 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
comparison
equal deleted inserted replaced
144:8f4e72ab4e11 146:351920fa3827
1 /* Definitions for c-common.c. 1 /* Definitions for c-common.c.
2 Copyright (C) 1987-2018 Free Software Foundation, Inc. 2 Copyright (C) 1987-2020 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
100 100
101 /* C extensions */ 101 /* C extensions */
102 RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG, 102 RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG,
103 RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, 103 RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR,
104 RID_TYPES_COMPATIBLE_P, RID_BUILTIN_COMPLEX, RID_BUILTIN_SHUFFLE, 104 RID_TYPES_COMPATIBLE_P, RID_BUILTIN_COMPLEX, RID_BUILTIN_SHUFFLE,
105 RID_BUILTIN_TGMATH, 105 RID_BUILTIN_CONVERTVECTOR, RID_BUILTIN_TGMATH,
106 RID_BUILTIN_HAS_ATTRIBUTE,
106 RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, 107 RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128,
107 108
108 /* TS 18661-3 keywords, in the same sequence as the TI_* values. */ 109 /* TS 18661-3 keywords, in the same sequence as the TI_* values. */
109 RID_FLOAT16, 110 RID_FLOAT16,
110 RID_FLOATN_NX_FIRST = RID_FLOAT16, 111 RID_FLOATN_NX_FIRST = RID_FLOAT16,
177 RID_IS_ASSIGNABLE, RID_IS_CONSTRUCTIBLE, 178 RID_IS_ASSIGNABLE, RID_IS_CONSTRUCTIBLE,
178 179
179 /* C++11 */ 180 /* C++11 */
180 RID_CONSTEXPR, RID_DECLTYPE, RID_NOEXCEPT, RID_NULLPTR, RID_STATIC_ASSERT, 181 RID_CONSTEXPR, RID_DECLTYPE, RID_NOEXCEPT, RID_NULLPTR, RID_STATIC_ASSERT,
181 182
183 /* C++20 */
184 RID_CONSTINIT, RID_CONSTEVAL,
185
186 /* char8_t */
187 RID_CHAR8,
188
182 /* C++ concepts */ 189 /* C++ concepts */
183 RID_CONCEPT, RID_REQUIRES, 190 RID_CONCEPT, RID_REQUIRES,
191
192 /* C++ coroutines */
193 RID_CO_AWAIT, RID_CO_YIELD, RID_CO_RETURN,
184 194
185 /* C++ transactional memory. */ 195 /* C++ transactional memory. */
186 RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED, 196 RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED,
187 197
188 /* Objective-C ("AT" reserved words - they are only keywords when 198 /* Objective-C ("AT" reserved words - they are only keywords when
248 RID_FIRST_MODIFIER = RID_STATIC, 258 RID_FIRST_MODIFIER = RID_STATIC,
249 RID_LAST_MODIFIER = RID_ONEWAY, 259 RID_LAST_MODIFIER = RID_ONEWAY,
250 260
251 RID_FIRST_CXX11 = RID_CONSTEXPR, 261 RID_FIRST_CXX11 = RID_CONSTEXPR,
252 RID_LAST_CXX11 = RID_STATIC_ASSERT, 262 RID_LAST_CXX11 = RID_STATIC_ASSERT,
263 RID_FIRST_CXX20 = RID_CONSTINIT,
264 RID_LAST_CXX20 = RID_CONSTINIT,
253 RID_FIRST_AT = RID_AT_ENCODE, 265 RID_FIRST_AT = RID_AT_ENCODE,
254 RID_LAST_AT = RID_AT_IMPLEMENTATION, 266 RID_LAST_AT = RID_AT_IMPLEMENTATION,
255 RID_FIRST_PQ = RID_IN, 267 RID_FIRST_PQ = RID_IN,
256 RID_LAST_PQ = RID_ONEWAY, 268 RID_LAST_PQ = RID_ONEWAY,
257 RID_FIRST_PATTR = RID_GETTER, 269 RID_FIRST_PATTR = RID_GETTER,
288 300
289 /* Standard named or nameless data types of the C compiler. */ 301 /* Standard named or nameless data types of the C compiler. */
290 302
291 enum c_tree_index 303 enum c_tree_index
292 { 304 {
305 CTI_CHAR8_TYPE,
293 CTI_CHAR16_TYPE, 306 CTI_CHAR16_TYPE,
294 CTI_CHAR32_TYPE, 307 CTI_CHAR32_TYPE,
295 CTI_WCHAR_TYPE, 308 CTI_WCHAR_TYPE,
296 CTI_UNDERLYING_WCHAR_TYPE, 309 CTI_UNDERLYING_WCHAR_TYPE,
297 CTI_WINT_TYPE, 310 CTI_WINT_TYPE,
331 CTI_UINT_FAST64_TYPE, 344 CTI_UINT_FAST64_TYPE,
332 CTI_INTPTR_TYPE, 345 CTI_INTPTR_TYPE,
333 CTI_UINTPTR_TYPE, 346 CTI_UINTPTR_TYPE,
334 347
335 CTI_CHAR_ARRAY_TYPE, 348 CTI_CHAR_ARRAY_TYPE,
349 CTI_CHAR8_ARRAY_TYPE,
336 CTI_CHAR16_ARRAY_TYPE, 350 CTI_CHAR16_ARRAY_TYPE,
337 CTI_CHAR32_ARRAY_TYPE, 351 CTI_CHAR32_ARRAY_TYPE,
338 CTI_WCHAR_ARRAY_TYPE, 352 CTI_WCHAR_ARRAY_TYPE,
339 CTI_STRING_TYPE, 353 CTI_STRING_TYPE,
340 CTI_CONST_STRING_TYPE, 354 CTI_CONST_STRING_TYPE,
410 424
411 /* Disable mask. Keywords are disabled if (reswords[i].disable & 425 /* Disable mask. Keywords are disabled if (reswords[i].disable &
412 mask) is _true_. Thus for keywords which are present in all 426 mask) is _true_. Thus for keywords which are present in all
413 languages the disable field is zero. */ 427 languages the disable field is zero. */
414 428
415 #define D_CONLY 0x001 /* C only (not in C++). */ 429 #define D_CONLY 0x0001 /* C only (not in C++). */
416 #define D_CXXONLY 0x002 /* C++ only (not in C). */ 430 #define D_CXXONLY 0x0002 /* C++ only (not in C). */
417 #define D_C99 0x004 /* In C, C99 only. */ 431 #define D_C99 0x0004 /* In C, C99 only. */
418 #define D_CXX11 0x008 /* In C++, C++11 only. */ 432 #define D_CXX11 0x0008 /* In C++, C++11 only. */
419 #define D_EXT 0x010 /* GCC extension. */ 433 #define D_EXT 0x0010 /* GCC extension. */
420 #define D_EXT89 0x020 /* GCC extension incorporated in C99. */ 434 #define D_EXT89 0x0020 /* GCC extension incorporated in C99. */
421 #define D_ASM 0x040 /* Disabled by -fno-asm. */ 435 #define D_ASM 0x0040 /* Disabled by -fno-asm. */
422 #define D_OBJC 0x080 /* In Objective C and neither C nor C++. */ 436 #define D_OBJC 0x0080 /* In Objective C and neither C nor C++. */
423 #define D_CXX_OBJC 0x100 /* In Objective C, and C++, but not C. */ 437 #define D_CXX_OBJC 0x0100 /* In Objective C, and C++, but not C. */
424 #define D_CXXWARN 0x200 /* In C warn with -Wcxx-compat. */ 438 #define D_CXXWARN 0x0200 /* In C warn with -Wcxx-compat. */
425 #define D_CXX_CONCEPTS 0x400 /* In C++, only with concepts. */ 439 #define D_CXX_CONCEPTS 0x0400 /* In C++, only with concepts. */
426 #define D_TRANSMEM 0X800 /* C++ transactional memory TS. */ 440 #define D_TRANSMEM 0X0800 /* C++ transactional memory TS. */
441 #define D_CXX_CHAR8_T 0X1000 /* In C++, only with -fchar8_t. */
442 #define D_CXX20 0x2000 /* In C++, C++20 only. */
443 #define D_CXX_COROUTINES 0x4000 /* In C++, only with coroutines. */
427 444
428 #define D_CXX_CONCEPTS_FLAGS D_CXXONLY | D_CXX_CONCEPTS 445 #define D_CXX_CONCEPTS_FLAGS D_CXXONLY | D_CXX_CONCEPTS
446 #define D_CXX_CHAR8_T_FLAGS D_CXXONLY | D_CXX_CHAR8_T
447 #define D_CXX_COROUTINES_FLAGS (D_CXXONLY | D_CXX_COROUTINES)
429 448
430 /* The reserved keyword table. */ 449 /* The reserved keyword table. */
431 extern const struct c_common_resword c_common_reswords[]; 450 extern const struct c_common_resword c_common_reswords[];
432 451
433 /* The number of items in the reserved keyword table. */ 452 /* The number of items in the reserved keyword table. */
434 extern const unsigned int num_c_common_reswords; 453 extern const unsigned int num_c_common_reswords;
435 454
455 #define char8_type_node c_global_trees[CTI_CHAR8_TYPE]
436 #define char16_type_node c_global_trees[CTI_CHAR16_TYPE] 456 #define char16_type_node c_global_trees[CTI_CHAR16_TYPE]
437 #define char32_type_node c_global_trees[CTI_CHAR32_TYPE] 457 #define char32_type_node c_global_trees[CTI_CHAR32_TYPE]
438 #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE] 458 #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
439 #define underlying_wchar_type_node c_global_trees[CTI_UNDERLYING_WCHAR_TYPE] 459 #define underlying_wchar_type_node c_global_trees[CTI_UNDERLYING_WCHAR_TYPE]
440 #define wint_type_node c_global_trees[CTI_WINT_TYPE] 460 #define wint_type_node c_global_trees[CTI_WINT_TYPE]
476 #define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE] 496 #define truthvalue_type_node c_global_trees[CTI_TRUTHVALUE_TYPE]
477 #define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE] 497 #define truthvalue_true_node c_global_trees[CTI_TRUTHVALUE_TRUE]
478 #define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE] 498 #define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE]
479 499
480 #define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE] 500 #define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
501 #define char8_array_type_node c_global_trees[CTI_CHAR8_ARRAY_TYPE]
481 #define char16_array_type_node c_global_trees[CTI_CHAR16_ARRAY_TYPE] 502 #define char16_array_type_node c_global_trees[CTI_CHAR16_ARRAY_TYPE]
482 #define char32_array_type_node c_global_trees[CTI_CHAR32_ARRAY_TYPE] 503 #define char32_array_type_node c_global_trees[CTI_CHAR32_ARRAY_TYPE]
483 #define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE] 504 #define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE]
484 #define string_type_node c_global_trees[CTI_STRING_TYPE] 505 #define string_type_node c_global_trees[CTI_STRING_TYPE]
485 #define const_string_type_node c_global_trees[CTI_CONST_STRING_TYPE] 506 #define const_string_type_node c_global_trees[CTI_CONST_STRING_TYPE]
687 #define abi_version_crosses(N) \ 708 #define abi_version_crosses(N) \
688 (abi_version_at_least(N) \ 709 (abi_version_at_least(N) \
689 != (warn_abi_version == 0 \ 710 != (warn_abi_version == 0 \
690 || warn_abi_version >= (N))) 711 || warn_abi_version >= (N)))
691 712
692 /* Nonzero means generate separate instantiation control files and
693 juggle them at link time. */
694
695 extern int flag_use_repository;
696
697 /* The supported C++ dialects. */ 713 /* The supported C++ dialects. */
698 714
699 enum cxx_dialect { 715 enum cxx_dialect {
700 cxx_unset, 716 cxx_unset,
701 /* C++98 with TC1 */ 717 /* C++98 with TC1 */
748 /* For convenience we define a single macro to identify the class of 764 /* For convenience we define a single macro to identify the class of
749 object or incomplete types. */ 765 object or incomplete types. */
750 #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \ 766 #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \
751 (!C_TYPE_FUNCTION_P (type)) 767 (!C_TYPE_FUNCTION_P (type))
752 768
769 /* Return true if TYPE is a vector type that should be subject to the GNU
770 vector extensions (as opposed to a vector type that is used only for
771 the purposes of defining target-specific built-in functions). */
772
773 inline bool
774 gnu_vector_type_p (const_tree type)
775 {
776 return TREE_CODE (type) == VECTOR_TYPE && !TYPE_INDIVISIBLE_P (type);
777 }
778
753 struct visibility_flags 779 struct visibility_flags
754 { 780 {
755 unsigned inpragma : 1; /* True when in #pragma GCC visibility. */ 781 unsigned inpragma : 1; /* True when in #pragma GCC visibility. */
756 unsigned inlines_hidden : 1; /* True when -finlineshidden in effect. */ 782 unsigned inlines_hidden : 1; /* True when -finlineshidden in effect. */
757 }; 783 };
760 enum conversion_safety { 786 enum conversion_safety {
761 /* The conversion is safe. */ 787 /* The conversion is safe. */
762 SAFE_CONVERSION = 0, 788 SAFE_CONVERSION = 0,
763 /* Another type of conversion with problems. */ 789 /* Another type of conversion with problems. */
764 UNSAFE_OTHER, 790 UNSAFE_OTHER,
765 /* Conversion between signed and unsigned integers 791 /* Conversion between signed and unsigned integers. */
766 which are all warned about immediately, so this is unused. */
767 UNSAFE_SIGN, 792 UNSAFE_SIGN,
768 /* Conversions that reduce the precision of reals including conversions 793 /* Conversions that reduce the precision of reals including conversions
769 from reals to integers. */ 794 from reals to integers. */
770 UNSAFE_REAL, 795 UNSAFE_REAL,
771 /* Conversions from complex to reals or integers, that discard imaginary 796 /* Conversions from complex to reals or integers, that discard imaginary
792 817
793 /* In c-common.c. */ 818 /* In c-common.c. */
794 extern bool in_late_binary_op; 819 extern bool in_late_binary_op;
795 extern const char *c_addr_space_name (addr_space_t as); 820 extern const char *c_addr_space_name (addr_space_t as);
796 extern tree identifier_global_value (tree); 821 extern tree identifier_global_value (tree);
822 extern tree identifier_global_tag (tree);
823 extern bool names_builtin_p (const char *);
797 extern tree c_linkage_bindings (tree); 824 extern tree c_linkage_bindings (tree);
798 extern void record_builtin_type (enum rid, const char *, tree); 825 extern void record_builtin_type (enum rid, const char *, tree);
799 extern tree build_void_list_node (void); 826 extern tree build_void_list_node (void);
800 extern void start_fname_decls (void); 827 extern void start_fname_decls (void);
801 extern void finish_fname_decls (void); 828 extern void finish_fname_decls (void);
802 extern const char *fname_as_string (int); 829 extern const char *fname_as_string (int);
803 extern tree fname_decl (location_t, unsigned, tree); 830 extern tree fname_decl (location_t, unsigned, tree);
804 831
805 extern int check_user_alignment (const_tree, bool); 832 extern int check_user_alignment (const_tree, bool, bool);
806 extern bool check_function_arguments (location_t loc, const_tree, const_tree, 833 extern bool check_function_arguments (location_t loc, const_tree, const_tree,
807 int, tree *, vec<location_t> *); 834 int, tree *, vec<location_t> *);
808 extern void check_function_arguments_recurse (void (*) 835 extern void check_function_arguments_recurse (void (*)
809 (void *, tree, 836 (void *, tree,
810 unsigned HOST_WIDE_INT), 837 unsigned HOST_WIDE_INT),
811 void *, tree, 838 void *, tree,
812 unsigned HOST_WIDE_INT); 839 unsigned HOST_WIDE_INT);
813 extern bool check_builtin_function_arguments (location_t, vec<location_t>, 840 extern bool check_builtin_function_arguments (location_t, vec<location_t>,
814 tree, int, tree *); 841 tree, tree, int, tree *);
815 extern void check_function_format (tree, int, tree *, vec<location_t> *); 842 extern void check_function_format (const_tree, tree, int, tree *,
843 vec<location_t> *);
816 extern bool attribute_fallthrough_p (tree); 844 extern bool attribute_fallthrough_p (tree);
817 extern tree handle_format_attribute (tree *, tree, tree, int, bool *); 845 extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
818 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); 846 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
819 extern bool c_common_handle_option (size_t, const char *, HOST_WIDE_INT, int, 847 extern bool c_common_handle_option (size_t, const char *, HOST_WIDE_INT, int,
820 location_t, 848 location_t,
827 extern tree c_common_unsigned_type (tree); 855 extern tree c_common_unsigned_type (tree);
828 extern tree c_common_signed_type (tree); 856 extern tree c_common_signed_type (tree);
829 extern tree c_common_signed_or_unsigned_type (int, tree); 857 extern tree c_common_signed_or_unsigned_type (int, tree);
830 extern void c_common_init_ts (void); 858 extern void c_common_init_ts (void);
831 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); 859 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
832 extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree, 860 extern enum conversion_safety unsafe_conversion_p (tree, tree, tree, bool);
833 bool);
834 extern bool decl_with_nonnull_addr_p (const_tree); 861 extern bool decl_with_nonnull_addr_p (const_tree);
835 extern tree c_fully_fold (tree, bool, bool *, bool = false); 862 extern tree c_fully_fold (tree, bool, bool *, bool = false);
836 extern tree c_wrap_maybe_const (tree, bool); 863 extern tree c_wrap_maybe_const (tree, bool);
837 extern tree c_common_truthvalue_conversion (location_t, tree); 864 extern tree c_common_truthvalue_conversion (location_t, tree);
838 extern void c_apply_type_quals_to_decl (int, tree); 865 extern void c_apply_type_quals_to_decl (int, tree);
859 extern bool cxx_fundamental_alignment_p (unsigned); 886 extern bool cxx_fundamental_alignment_p (unsigned);
860 extern bool pointer_to_zero_sized_aggr_p (tree); 887 extern bool pointer_to_zero_sized_aggr_p (tree);
861 extern bool bool_promoted_to_int_p (tree); 888 extern bool bool_promoted_to_int_p (tree);
862 extern tree fold_for_warn (tree); 889 extern tree fold_for_warn (tree);
863 extern tree c_common_get_narrower (tree, int *); 890 extern tree c_common_get_narrower (tree, int *);
864 extern bool get_nonnull_operand (tree, unsigned HOST_WIDE_INT *); 891 extern bool get_attribute_operand (tree, unsigned HOST_WIDE_INT *);
865 892
866 #define c_sizeof(LOC, T) c_sizeof_or_alignof_type (LOC, T, true, false, 1) 893 #define c_sizeof(LOC, T) c_sizeof_or_alignof_type (LOC, T, true, false, 1)
867 #define c_alignof(LOC, T) c_sizeof_or_alignof_type (LOC, T, false, false, 1) 894 #define c_alignof(LOC, T) c_sizeof_or_alignof_type (LOC, T, false, false, 1)
868 895
869 /* Subroutine of build_binary_op, used for certain operations. */ 896 /* Subroutine of build_binary_op, used for certain operations. */
979 /* Handle increment and decrement of boolean types. */ 1006 /* Handle increment and decrement of boolean types. */
980 extern tree boolean_increment (enum tree_code, tree); 1007 extern tree boolean_increment (enum tree_code, tree);
981 1008
982 extern int case_compare (splay_tree_key, splay_tree_key); 1009 extern int case_compare (splay_tree_key, splay_tree_key);
983 1010
984 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree, 1011 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree);
985 bool *);
986 extern bool c_switch_covers_all_cases_p (splay_tree, tree); 1012 extern bool c_switch_covers_all_cases_p (splay_tree, tree);
987 1013
988 extern tree build_function_call (location_t, tree, tree); 1014 extern tree build_function_call (location_t, tree, tree);
989 1015
990 extern tree build_function_call_vec (location_t, vec<location_t>, tree, 1016 extern tree build_function_call_vec (location_t, vec<location_t>, tree,
991 vec<tree, va_gc> *, vec<tree, va_gc> *); 1017 vec<tree, va_gc> *, vec<tree, va_gc> *,
1018 tree = NULL_TREE);
992 1019
993 extern tree resolve_overloaded_builtin (location_t, tree, vec<tree, va_gc> *); 1020 extern tree resolve_overloaded_builtin (location_t, tree, vec<tree, va_gc> *);
994 1021
995 extern tree finish_label_address_expr (tree, location_t); 1022 extern tree finish_label_address_expr (tree, location_t);
996 1023
1001 extern bool lvalue_p (const_tree); 1028 extern bool lvalue_p (const_tree);
1002 1029
1003 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2); 1030 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2);
1004 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); 1031 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note);
1005 extern tree c_build_vec_perm_expr (location_t, tree, tree, tree, bool = true); 1032 extern tree c_build_vec_perm_expr (location_t, tree, tree, tree, bool = true);
1033 extern tree c_build_vec_convert (location_t, tree, location_t, tree, bool = true);
1006 1034
1007 extern void init_c_lex (void); 1035 extern void init_c_lex (void);
1008 1036
1009 extern void c_cpp_builtins (cpp_reader *); 1037 extern void c_cpp_builtins (cpp_reader *);
1010 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree); 1038 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree);
1011 extern bool c_cpp_diagnostic (cpp_reader *, enum cpp_diagnostic_level, 1039 extern bool c_cpp_diagnostic (cpp_reader *, enum cpp_diagnostic_level,
1012 enum cpp_warning_reason, rich_location *, 1040 enum cpp_warning_reason, rich_location *,
1013 const char *, va_list *) 1041 const char *, va_list *)
1014 ATTRIBUTE_GCC_DIAG(5,0); 1042 ATTRIBUTE_GCC_DIAG(5,0);
1015 extern int c_common_has_attribute (cpp_reader *); 1043 extern int c_common_has_attribute (cpp_reader *);
1044 extern int c_common_has_builtin (cpp_reader *);
1016 1045
1017 extern bool parse_optimize_options (tree, bool); 1046 extern bool parse_optimize_options (tree, bool);
1018 1047
1019 /* Positive if an implicit `extern "C"' scope has just been entered; 1048 /* Positive if an implicit `extern "C"' scope has just been entered;
1020 negative if such a scope has just been exited. */ 1049 negative if such a scope has just been exited. */
1052 extern tree builtin_type_for_size (int, bool); 1081 extern tree builtin_type_for_size (int, bool);
1053 1082
1054 extern void c_common_mark_addressable_vec (tree); 1083 extern void c_common_mark_addressable_vec (tree);
1055 1084
1056 extern void set_underlying_type (tree); 1085 extern void set_underlying_type (tree);
1086 extern bool user_facing_original_type_p (const_tree);
1057 extern void record_types_used_by_current_var_decl (tree); 1087 extern void record_types_used_by_current_var_decl (tree);
1058 extern vec<tree, va_gc> *make_tree_vector (void); 1088 extern vec<tree, va_gc> *make_tree_vector (void);
1059 extern void release_tree_vector (vec<tree, va_gc> *); 1089 extern void release_tree_vector (vec<tree, va_gc> *);
1060 extern vec<tree, va_gc> *make_tree_vector_single (tree); 1090 extern vec<tree, va_gc> *make_tree_vector_single (tree);
1061 extern vec<tree, va_gc> *make_tree_vector_from_list (tree); 1091 extern vec<tree, va_gc> *make_tree_vector_from_list (tree);
1139 C_OMP_CLAUSE_SPLIT_PARALLEL, 1169 C_OMP_CLAUSE_SPLIT_PARALLEL,
1140 C_OMP_CLAUSE_SPLIT_FOR, 1170 C_OMP_CLAUSE_SPLIT_FOR,
1141 C_OMP_CLAUSE_SPLIT_SIMD, 1171 C_OMP_CLAUSE_SPLIT_SIMD,
1142 C_OMP_CLAUSE_SPLIT_COUNT, 1172 C_OMP_CLAUSE_SPLIT_COUNT,
1143 C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR, 1173 C_OMP_CLAUSE_SPLIT_SECTIONS = C_OMP_CLAUSE_SPLIT_FOR,
1144 C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR 1174 C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR,
1175 C_OMP_CLAUSE_SPLIT_LOOP = C_OMP_CLAUSE_SPLIT_FOR
1145 }; 1176 };
1146 1177
1147 enum c_omp_region_type 1178 enum c_omp_region_type
1148 { 1179 {
1149 C_ORT_OMP = 1 << 0, 1180 C_ORT_OMP = 1 << 0,
1151 C_ORT_DECLARE_SIMD = 1 << 2, 1182 C_ORT_DECLARE_SIMD = 1 << 2,
1152 C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD 1183 C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD
1153 }; 1184 };
1154 1185
1155 extern tree c_finish_omp_master (location_t, tree); 1186 extern tree c_finish_omp_master (location_t, tree);
1156 extern tree c_finish_omp_taskgroup (location_t, tree); 1187 extern tree c_finish_omp_taskgroup (location_t, tree, tree);
1157 extern tree c_finish_omp_critical (location_t, tree, tree, tree); 1188 extern tree c_finish_omp_critical (location_t, tree, tree, tree);
1158 extern tree c_finish_omp_ordered (location_t, tree, tree); 1189 extern tree c_finish_omp_ordered (location_t, tree, tree);
1159 extern void c_finish_omp_barrier (location_t); 1190 extern void c_finish_omp_barrier (location_t);
1160 extern tree c_finish_omp_atomic (location_t, enum tree_code, enum tree_code, 1191 extern tree c_finish_omp_atomic (location_t, enum tree_code, enum tree_code,
1161 tree, tree, tree, tree, tree, bool, bool, 1192 tree, tree, tree, tree, tree, bool,
1162 bool = false); 1193 enum omp_memory_order, bool = false);
1163 extern void c_finish_omp_flush (location_t); 1194 extern bool c_omp_depend_t_p (tree);
1195 extern void c_finish_omp_depobj (location_t, tree, enum omp_clause_depend_kind,
1196 tree);
1197 extern void c_finish_omp_flush (location_t, int);
1164 extern void c_finish_omp_taskwait (location_t); 1198 extern void c_finish_omp_taskwait (location_t);
1165 extern void c_finish_omp_taskyield (location_t); 1199 extern void c_finish_omp_taskyield (location_t);
1166 extern tree c_finish_omp_for (location_t, enum tree_code, tree, tree, tree, 1200 extern tree c_finish_omp_for (location_t, enum tree_code, tree, tree, tree,
1167 tree, tree, tree, tree); 1201 tree, tree, tree, tree, bool);
1168 extern bool c_omp_check_loop_iv (tree, tree, walk_tree_lh); 1202 extern bool c_omp_check_loop_iv (tree, tree, walk_tree_lh);
1169 extern bool c_omp_check_loop_iv_exprs (location_t, tree, tree, tree, tree, 1203 extern bool c_omp_check_loop_iv_exprs (location_t, tree, tree, tree, tree,
1170 walk_tree_lh); 1204 walk_tree_lh);
1171 extern tree c_finish_oacc_wait (location_t, tree, tree); 1205 extern tree c_finish_oacc_wait (location_t, tree, tree);
1172 extern tree c_oacc_split_loop_clauses (tree, tree *, bool); 1206 extern tree c_oacc_split_loop_clauses (tree, tree *, bool);
1173 extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask, 1207 extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask,
1174 tree, tree *); 1208 tree, tree *);
1175 extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree); 1209 extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree);
1176 extern void c_omp_declare_simd_clauses_to_decls (tree, tree); 1210 extern void c_omp_declare_simd_clauses_to_decls (tree, tree);
1211 extern bool c_omp_predefined_variable (tree);
1177 extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree); 1212 extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree);
1213 extern tree c_omp_check_context_selector (location_t, tree);
1214 extern void c_omp_mark_declare_variant (location_t, tree, tree);
1215 extern const char *c_omp_map_clause_name (tree, bool);
1178 1216
1179 /* Return next tree in the chain for chain_next walking of tree nodes. */ 1217 /* Return next tree in the chain for chain_next walking of tree nodes. */
1180 static inline tree 1218 static inline tree
1181 c_tree_chain_next (tree t) 1219 c_tree_chain_next (tree t)
1182 { 1220 {
1257 1295
1258 extern tree find_inv_trees (tree *, int *, void *); 1296 extern tree find_inv_trees (tree *, int *, void *);
1259 extern tree replace_inv_trees (tree *, int *, void *); 1297 extern tree replace_inv_trees (tree *, int *, void *);
1260 1298
1261 extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION); 1299 extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION);
1262 extern bool valid_array_size_p (location_t, tree, tree, bool = true); 1300 extern bool valid_array_size_p (location_t, const_tree, tree, bool = true);
1301 extern void invalid_array_size_error (location_t, cst_size_error,
1302 const_tree, const_tree);
1263 1303
1264 /* In c-warn.c. */ 1304 /* In c-warn.c. */
1265 extern void constant_expression_warning (tree); 1305 extern void constant_expression_warning (tree);
1266 extern void constant_expression_error (tree); 1306 extern void constant_expression_error (tree);
1267 extern void overflow_warning (location_t, tree, tree = NULL_TREE); 1307 extern void overflow_warning (location_t, tree, tree = NULL_TREE);
1268 extern void warn_logical_operator (location_t, enum tree_code, tree, 1308 extern void warn_logical_operator (location_t, enum tree_code, tree,
1269 enum tree_code, tree, enum tree_code, tree); 1309 enum tree_code, tree, enum tree_code, tree);
1270 extern void warn_tautological_cmp (location_t, enum tree_code, tree, tree); 1310 extern void warn_tautological_cmp (const op_location_t &, enum tree_code,
1311 tree, tree);
1271 extern void warn_logical_not_parentheses (location_t, enum tree_code, tree, 1312 extern void warn_logical_not_parentheses (location_t, enum tree_code, tree,
1272 tree); 1313 tree);
1273 extern bool warn_if_unused_value (const_tree, location_t); 1314 extern bool warn_if_unused_value (const_tree, location_t);
1274 extern bool strict_aliasing_warning (location_t, tree, tree); 1315 extern bool strict_aliasing_warning (location_t, tree, tree);
1275 extern void sizeof_pointer_memaccess_warning (location_t *, tree, 1316 extern void sizeof_pointer_memaccess_warning (location_t *, tree,
1276 vec<tree, va_gc> *, tree *, 1317 vec<tree, va_gc> *, tree *,
1277 bool (*) (tree, tree)); 1318 bool (*) (tree, tree));
1278 extern void check_main_parameter_types (tree decl); 1319 extern void check_main_parameter_types (tree decl);
1279 extern void warnings_for_convert_and_check (location_t, tree, tree, tree); 1320 extern void warnings_for_convert_and_check (location_t, tree, tree, tree);
1280 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, 1321 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool);
1281 bool);
1282 extern void warn_for_omitted_condop (location_t, tree); 1322 extern void warn_for_omitted_condop (location_t, tree);
1283 extern bool warn_for_restrict (unsigned, tree *, unsigned); 1323 extern bool warn_for_restrict (unsigned, tree *, unsigned);
1324 extern void warn_for_address_or_pointer_of_packed_member (tree, tree);
1284 1325
1285 /* Places where an lvalue, or modifiable lvalue, may be required. 1326 /* Places where an lvalue, or modifiable lvalue, may be required.
1286 Used to select diagnostic messages in lvalue_error and 1327 Used to select diagnostic messages in lvalue_error and
1287 readonly_error. */ 1328 readonly_error. */
1288 enum lvalue_use { 1329 enum lvalue_use {
1323 extern void warn_for_multistatement_macros (location_t, location_t, 1364 extern void warn_for_multistatement_macros (location_t, location_t,
1324 location_t, enum rid); 1365 location_t, enum rid);
1325 1366
1326 /* In c-attribs.c. */ 1367 /* In c-attribs.c. */
1327 extern bool attribute_takes_identifier_p (const_tree); 1368 extern bool attribute_takes_identifier_p (const_tree);
1369 extern tree handle_deprecated_attribute (tree *, tree, tree, int, bool *);
1328 extern tree handle_unused_attribute (tree *, tree, tree, int, bool *); 1370 extern tree handle_unused_attribute (tree *, tree, tree, int, bool *);
1371 extern tree handle_fallthrough_attribute (tree *, tree, tree, int, bool *);
1329 extern int parse_tm_stmt_attr (tree, int); 1372 extern int parse_tm_stmt_attr (tree, int);
1330 extern int tm_attr_to_mask (tree); 1373 extern int tm_attr_to_mask (tree);
1331 extern tree tm_mask_to_attr (int); 1374 extern tree tm_mask_to_attr (int);
1332 extern tree find_tm_attribute (tree); 1375 extern tree find_tm_attribute (tree);
1376 extern const struct attribute_spec::exclusions attr_cold_hot_exclusions[];
1377 extern const struct attribute_spec::exclusions attr_noreturn_exclusions[];
1378 extern tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
1379
1380 /* In c-format.c. */
1381 extern bool valid_format_string_type_p (tree);
1382
1383 /* A bitmap of flags to positional_argument. */
1384 enum posargflags {
1385 /* Consider positional attribute argument value zero valid. */
1386 POSARG_ZERO = 1,
1387 /* Consider positional attribute argument value valid if it refers
1388 to the ellipsis (i.e., beyond the last typed argument). */
1389 POSARG_ELLIPSIS = 2
1390 };
1391
1392 extern tree positional_argument (const_tree, const_tree, tree, tree_code,
1393 int = 0, int = posargflags ());
1333 1394
1334 extern enum flt_eval_method 1395 extern enum flt_eval_method
1335 excess_precision_mode_join (enum flt_eval_method, enum flt_eval_method); 1396 excess_precision_mode_join (enum flt_eval_method, enum flt_eval_method);
1336 1397
1337 extern int c_flt_eval_method (bool ts18661_p); 1398 extern int c_flt_eval_method (bool ts18661_p);
1339 1400
1340 extern void maybe_add_include_fixit (rich_location *, const char *, bool); 1401 extern void maybe_add_include_fixit (rich_location *, const char *, bool);
1341 extern void maybe_suggest_missing_token_insertion (rich_location *richloc, 1402 extern void maybe_suggest_missing_token_insertion (rich_location *richloc,
1342 enum cpp_ttype token_type, 1403 enum cpp_ttype token_type,
1343 location_t prev_token_loc); 1404 location_t prev_token_loc);
1344 extern tree braced_list_to_string (tree, tree); 1405 extern tree braced_lists_to_strings (tree, tree);
1406
1407 extern bool has_attribute (location_t, tree, tree, tree (*)(tree));
1345 1408
1346 #if CHECKING_P 1409 #if CHECKING_P
1347 namespace selftest { 1410 namespace selftest {
1348 /* Declarations for specific families of tests within c-family, 1411 /* Declarations for specific families of tests within c-family,
1349 by source file, in alphabetical order. */ 1412 by source file, in alphabetical order. */