Mercurial > hg > CbC > CbC_gcc
comparison gcc/c-family/c-common.h @ 132:d34655255c78
update gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 10:21:07 +0900 |
parents | bdf41c9fa0b7 84e7813d76e9 |
children | 351920fa3827 |
comparison
equal
deleted
inserted
replaced
130:e108057fa461 | 132:d34655255c78 |
---|---|
1 /* Definitions for c-common.c. | 1 /* Definitions for c-common.c. |
2 Copyright (C) 1987-2017 Free Software Foundation, Inc. | 2 Copyright (C) 1987-2018 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 |
23 #include "splay-tree.h" | 23 #include "splay-tree.h" |
24 #include "cpplib.h" | 24 #include "cpplib.h" |
25 #include "alias.h" | 25 #include "alias.h" |
26 #include "tree.h" | 26 #include "tree.h" |
27 #include "fold-const.h" | 27 #include "fold-const.h" |
28 #include "wide-int-bitmask.h" | |
28 | 29 |
29 /* In order for the format checking to accept the C frontend | 30 /* In order for the format checking to accept the C frontend |
30 diagnostic framework extensions, you must include this file before | 31 diagnostic framework extensions, you must include this file before |
31 diagnostic-core.h, not after. The C front end formats are a subset of those | 32 diagnostic-core.h, not after. The C front end formats are a subset of those |
32 for C++, so they are the appropriate set to use in common code; | 33 for C++, so they are the appropriate set to use in common code; |
99 | 100 |
100 /* C extensions */ | 101 /* C extensions */ |
101 RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG, | 102 RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG, |
102 RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, | 103 RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_CHOOSE_EXPR, |
103 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, | |
104 RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, | 106 RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, |
105 | 107 |
106 /* TS 18661-3 keywords, in the same sequence as the TI_* values. */ | 108 /* TS 18661-3 keywords, in the same sequence as the TI_* values. */ |
107 RID_FLOAT16, | 109 RID_FLOAT16, |
108 RID_FLOATN_NX_FIRST = RID_FLOAT16, | 110 RID_FLOATN_NX_FIRST = RID_FLOAT16, |
181 RID_CONCEPT, RID_REQUIRES, | 183 RID_CONCEPT, RID_REQUIRES, |
182 | 184 |
183 /* C++ transactional memory. */ | 185 /* C++ transactional memory. */ |
184 RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED, | 186 RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED, |
185 | 187 |
186 /* Cilk Plus keywords. */ | |
187 RID_CILK_SPAWN, RID_CILK_SYNC, RID_CILK_FOR, | |
188 | |
189 /* Objective-C ("AT" reserved words - they are only keywords when | 188 /* Objective-C ("AT" reserved words - they are only keywords when |
190 they follow '@') */ | 189 they follow '@') */ |
191 RID_AT_ENCODE, RID_AT_END, | 190 RID_AT_ENCODE, RID_AT_END, |
192 RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS, | 191 RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS, |
193 RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, RID_AT_PACKAGE, | 192 RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC, RID_AT_PACKAGE, |
501 These may be shadowed, and may be referenced from nested functions. */ | 500 These may be shadowed, and may be referenced from nested functions. */ |
502 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) | 501 #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) |
503 | 502 |
504 enum c_language_kind | 503 enum c_language_kind |
505 { | 504 { |
506 clk_c = 0, /* C90, C94, C99 or C11 */ | 505 clk_c = 0, /* C90, C94, C99, C11 or C2X */ |
507 clk_objc = 1, /* clk_c with ObjC features. */ | 506 clk_objc = 1, /* clk_c with ObjC features. */ |
508 clk_cxx = 2, /* ANSI/ISO C++ */ | 507 clk_cxx = 2, /* ANSI/ISO C++ */ |
509 clk_objcxx = 3 /* clk_cxx with ObjC features. */ | 508 clk_objcxx = 3 /* clk_cxx with ObjC features. */ |
510 }; | 509 }; |
511 | 510 |
587 extern tree add_stmt (tree); | 586 extern tree add_stmt (tree); |
588 extern void push_cleanup (tree, tree, bool); | 587 extern void push_cleanup (tree, tree, bool); |
589 | 588 |
590 extern tree build_modify_expr (location_t, tree, tree, enum tree_code, | 589 extern tree build_modify_expr (location_t, tree, tree, enum tree_code, |
591 location_t, tree, tree); | 590 location_t, tree, tree); |
592 extern tree build_array_notation_expr (location_t, tree, tree, enum tree_code, | |
593 location_t, tree, tree); | |
594 extern tree build_array_notation_ref (location_t, tree, tree, tree, tree, tree); | |
595 extern tree build_indirect_ref (location_t, tree, ref_operator); | 591 extern tree build_indirect_ref (location_t, tree, ref_operator); |
596 | 592 |
597 extern bool has_c_linkage (const_tree decl); | 593 extern bool has_c_linkage (const_tree decl); |
598 extern bool c_decl_implicit (const_tree); | 594 extern bool c_decl_implicit (const_tree); |
599 | 595 |
641 | 637 |
642 /* Nonzero means enable C89 Amendment 1 features. */ | 638 /* Nonzero means enable C89 Amendment 1 features. */ |
643 | 639 |
644 extern int flag_isoc94; | 640 extern int flag_isoc94; |
645 | 641 |
646 /* Nonzero means use the ISO C99 (or C11) dialect of C. */ | 642 /* Nonzero means use the ISO C99 (or later) dialect of C. */ |
647 | 643 |
648 extern int flag_isoc99; | 644 extern int flag_isoc99; |
649 | 645 |
650 /* Nonzero means use the ISO C11 dialect of C. */ | 646 /* Nonzero means use the ISO C11 (or later) dialect of C. */ |
651 | 647 |
652 extern int flag_isoc11; | 648 extern int flag_isoc11; |
649 | |
650 /* Nonzero means use the ISO C2X dialect of C. */ | |
651 | |
652 extern int flag_isoc2x; | |
653 | 653 |
654 /* Nonzero means that we have builtin functions, and main is an int. */ | 654 /* Nonzero means that we have builtin functions, and main is an int. */ |
655 | 655 |
656 extern int flag_hosted; | 656 extern int flag_hosted; |
657 | 657 |
814 tree, int, tree *); | 814 tree, int, tree *); |
815 extern void check_function_format (tree, int, tree *, vec<location_t> *); | 815 extern void check_function_format (tree, int, tree *, vec<location_t> *); |
816 extern bool attribute_fallthrough_p (tree); | 816 extern bool attribute_fallthrough_p (tree); |
817 extern tree handle_format_attribute (tree *, tree, tree, int, bool *); | 817 extern tree handle_format_attribute (tree *, tree, tree, int, bool *); |
818 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); | 818 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); |
819 extern bool c_common_handle_option (size_t, const char *, int, int, location_t, | 819 extern bool c_common_handle_option (size_t, const char *, HOST_WIDE_INT, int, |
820 location_t, | |
820 const struct cl_option_handlers *); | 821 const struct cl_option_handlers *); |
821 extern bool default_handle_c_option (size_t, const char *, int); | 822 extern bool default_handle_c_option (size_t, const char *, int); |
822 extern tree c_common_type_for_mode (machine_mode, int); | 823 extern tree c_common_type_for_mode (machine_mode, int); |
823 extern tree c_common_type_for_size (unsigned int, int); | 824 extern tree c_common_type_for_size (unsigned int, int); |
824 extern tree c_common_fixed_point_type_for_size (unsigned int, unsigned int, | 825 extern tree c_common_fixed_point_type_for_size (unsigned int, unsigned int, |
829 extern void c_common_init_ts (void); | 830 extern void c_common_init_ts (void); |
830 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); | 831 extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); |
831 extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree, | 832 extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree, |
832 bool); | 833 bool); |
833 extern bool decl_with_nonnull_addr_p (const_tree); | 834 extern bool decl_with_nonnull_addr_p (const_tree); |
834 extern tree c_fully_fold (tree, bool, bool *); | 835 extern tree c_fully_fold (tree, bool, bool *, bool = false); |
835 extern tree c_wrap_maybe_const (tree, bool); | 836 extern tree c_wrap_maybe_const (tree, bool); |
836 extern tree c_common_truthvalue_conversion (location_t, tree); | 837 extern tree c_common_truthvalue_conversion (location_t, tree); |
837 extern void c_apply_type_quals_to_decl (int, tree); | 838 extern void c_apply_type_quals_to_decl (int, tree); |
838 extern tree c_sizeof_or_alignof_type (location_t, tree, bool, bool, int); | 839 extern tree c_sizeof_or_alignof_type (location_t, tree, bool, bool, int); |
839 extern tree c_alignof_expr (location_t, tree); | 840 extern tree c_alignof_expr (location_t, tree); |
946 #define SET_DECL_C_BIT_FIELD(NODE) \ | 947 #define SET_DECL_C_BIT_FIELD(NODE) \ |
947 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1) | 948 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1) |
948 #define CLEAR_DECL_C_BIT_FIELD(NODE) \ | 949 #define CLEAR_DECL_C_BIT_FIELD(NODE) \ |
949 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) | 950 (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) |
950 | 951 |
952 /* True if the decl was an unnamed bitfield. */ | |
953 #define DECL_UNNAMED_BIT_FIELD(NODE) \ | |
954 (DECL_C_BIT_FIELD (NODE) && !DECL_NAME (NODE)) | |
955 | |
951 extern tree do_case (location_t, tree, tree); | 956 extern tree do_case (location_t, tree, tree); |
952 extern tree build_stmt (location_t, enum tree_code, ...); | 957 extern tree build_stmt (location_t, enum tree_code, ...); |
953 extern tree build_real_imag_expr (location_t, enum tree_code, tree); | 958 extern tree build_real_imag_expr (location_t, enum tree_code, tree); |
954 | 959 |
955 /* These functions must be defined by each front-end which implements | 960 /* These functions must be defined by each front-end which implements |
976 | 981 |
977 extern int case_compare (splay_tree_key, splay_tree_key); | 982 extern int case_compare (splay_tree_key, splay_tree_key); |
978 | 983 |
979 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree, | 984 extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree, |
980 bool *); | 985 bool *); |
986 extern bool c_switch_covers_all_cases_p (splay_tree, tree); | |
981 | 987 |
982 extern tree build_function_call (location_t, tree, tree); | 988 extern tree build_function_call (location_t, tree, tree); |
983 | 989 |
984 extern tree build_function_call_vec (location_t, vec<location_t>, tree, | 990 extern tree build_function_call_vec (location_t, vec<location_t>, tree, |
985 vec<tree, va_gc> *, vec<tree, va_gc> *); | 991 vec<tree, va_gc> *, vec<tree, va_gc> *); |
992 different implementations. Used in c-common.c. */ | 998 different implementations. Used in c-common.c. */ |
993 extern tree lookup_label (tree); | 999 extern tree lookup_label (tree); |
994 extern tree lookup_name (tree); | 1000 extern tree lookup_name (tree); |
995 extern bool lvalue_p (const_tree); | 1001 extern bool lvalue_p (const_tree); |
996 | 1002 |
997 enum lookup_name_fuzzy_kind { | |
998 /* Names of types. */ | |
999 FUZZY_LOOKUP_TYPENAME, | |
1000 | |
1001 /* Names of function decls. */ | |
1002 FUZZY_LOOKUP_FUNCTION_NAME, | |
1003 | |
1004 /* Any name. */ | |
1005 FUZZY_LOOKUP_NAME | |
1006 }; | |
1007 extern const char *lookup_name_fuzzy (tree, enum lookup_name_fuzzy_kind); | |
1008 | |
1009 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2); | 1003 extern bool vector_targets_convertible_p (const_tree t1, const_tree t2); |
1010 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); | 1004 extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); |
1011 extern tree c_build_vec_perm_expr (location_t, tree, tree, tree, bool = true); | 1005 extern tree c_build_vec_perm_expr (location_t, tree, tree, tree, bool = true); |
1012 | 1006 |
1013 extern void init_c_lex (void); | 1007 extern void init_c_lex (void); |
1014 | 1008 |
1015 extern void c_cpp_builtins (cpp_reader *); | 1009 extern void c_cpp_builtins (cpp_reader *); |
1016 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree); | 1010 extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree); |
1017 extern bool c_cpp_error (cpp_reader *, int, int, rich_location *, | 1011 extern bool c_cpp_diagnostic (cpp_reader *, enum cpp_diagnostic_level, |
1018 const char *, va_list *) | 1012 enum cpp_warning_reason, rich_location *, |
1013 const char *, va_list *) | |
1019 ATTRIBUTE_GCC_DIAG(5,0); | 1014 ATTRIBUTE_GCC_DIAG(5,0); |
1020 extern int c_common_has_attribute (cpp_reader *); | 1015 extern int c_common_has_attribute (cpp_reader *); |
1021 | 1016 |
1022 extern bool parse_optimize_options (tree, bool); | 1017 extern bool parse_optimize_options (tree, bool); |
1023 | 1018 |
1046 | 1041 |
1047 extern bool c_dump_tree (void *, tree); | 1042 extern bool c_dump_tree (void *, tree); |
1048 | 1043 |
1049 extern void verify_sequence_points (tree); | 1044 extern void verify_sequence_points (tree); |
1050 | 1045 |
1051 extern tree fold_offsetof_1 (tree, tree_code ctx = ERROR_MARK); | 1046 extern tree fold_offsetof (tree, tree = size_type_node, |
1052 extern tree fold_offsetof (tree); | 1047 tree_code ctx = ERROR_MARK); |
1053 | 1048 |
1054 extern int complete_array_type (tree *, tree, bool); | 1049 extern int complete_array_type (tree *, tree, bool); |
1050 extern void complete_flexible_array_elts (tree); | |
1055 | 1051 |
1056 extern tree builtin_type_for_size (int, bool); | 1052 extern tree builtin_type_for_size (int, bool); |
1057 | 1053 |
1058 extern void c_common_mark_addressable_vec (tree); | 1054 extern void c_common_mark_addressable_vec (tree); |
1059 | 1055 |
1129 extern void pp_file_change (const line_map_ordinary *); | 1125 extern void pp_file_change (const line_map_ordinary *); |
1130 extern void pp_dir_change (cpp_reader *, const char *); | 1126 extern void pp_dir_change (cpp_reader *, const char *); |
1131 extern bool check_missing_format_attribute (tree, tree); | 1127 extern bool check_missing_format_attribute (tree, tree); |
1132 | 1128 |
1133 /* In c-omp.c */ | 1129 /* In c-omp.c */ |
1134 struct omp_clause_mask | 1130 typedef wide_int_bitmask omp_clause_mask; |
1135 { | |
1136 inline omp_clause_mask (); | |
1137 inline omp_clause_mask (uint64_t l); | |
1138 inline omp_clause_mask (uint64_t l, uint64_t h); | |
1139 inline omp_clause_mask &operator &= (omp_clause_mask); | |
1140 inline omp_clause_mask &operator |= (omp_clause_mask); | |
1141 inline omp_clause_mask operator ~ () const; | |
1142 inline omp_clause_mask operator & (omp_clause_mask) const; | |
1143 inline omp_clause_mask operator | (omp_clause_mask) const; | |
1144 inline omp_clause_mask operator >> (int); | |
1145 inline omp_clause_mask operator << (int); | |
1146 inline bool operator == (omp_clause_mask) const; | |
1147 inline bool operator != (omp_clause_mask) const; | |
1148 uint64_t low, high; | |
1149 }; | |
1150 | |
1151 inline | |
1152 omp_clause_mask::omp_clause_mask () | |
1153 { | |
1154 } | |
1155 | |
1156 inline | |
1157 omp_clause_mask::omp_clause_mask (uint64_t l) | |
1158 : low (l), high (0) | |
1159 { | |
1160 } | |
1161 | |
1162 inline | |
1163 omp_clause_mask::omp_clause_mask (uint64_t l, uint64_t h) | |
1164 : low (l), high (h) | |
1165 { | |
1166 } | |
1167 | |
1168 inline omp_clause_mask & | |
1169 omp_clause_mask::operator &= (omp_clause_mask b) | |
1170 { | |
1171 low &= b.low; | |
1172 high &= b.high; | |
1173 return *this; | |
1174 } | |
1175 | |
1176 inline omp_clause_mask & | |
1177 omp_clause_mask::operator |= (omp_clause_mask b) | |
1178 { | |
1179 low |= b.low; | |
1180 high |= b.high; | |
1181 return *this; | |
1182 } | |
1183 | |
1184 inline omp_clause_mask | |
1185 omp_clause_mask::operator ~ () const | |
1186 { | |
1187 omp_clause_mask ret (~low, ~high); | |
1188 return ret; | |
1189 } | |
1190 | |
1191 inline omp_clause_mask | |
1192 omp_clause_mask::operator | (omp_clause_mask b) const | |
1193 { | |
1194 omp_clause_mask ret (low | b.low, high | b.high); | |
1195 return ret; | |
1196 } | |
1197 | |
1198 inline omp_clause_mask | |
1199 omp_clause_mask::operator & (omp_clause_mask b) const | |
1200 { | |
1201 omp_clause_mask ret (low & b.low, high & b.high); | |
1202 return ret; | |
1203 } | |
1204 | |
1205 inline omp_clause_mask | |
1206 omp_clause_mask::operator << (int amount) | |
1207 { | |
1208 omp_clause_mask ret; | |
1209 if (amount >= 64) | |
1210 { | |
1211 ret.low = 0; | |
1212 ret.high = low << (amount - 64); | |
1213 } | |
1214 else if (amount == 0) | |
1215 ret = *this; | |
1216 else | |
1217 { | |
1218 ret.low = low << amount; | |
1219 ret.high = (low >> (64 - amount)) | (high << amount); | |
1220 } | |
1221 return ret; | |
1222 } | |
1223 | |
1224 inline omp_clause_mask | |
1225 omp_clause_mask::operator >> (int amount) | |
1226 { | |
1227 omp_clause_mask ret; | |
1228 if (amount >= 64) | |
1229 { | |
1230 ret.low = high >> (amount - 64); | |
1231 ret.high = 0; | |
1232 } | |
1233 else if (amount == 0) | |
1234 ret = *this; | |
1235 else | |
1236 { | |
1237 ret.low = (high << (64 - amount)) | (low >> amount); | |
1238 ret.high = high >> amount; | |
1239 } | |
1240 return ret; | |
1241 } | |
1242 | |
1243 inline bool | |
1244 omp_clause_mask::operator == (omp_clause_mask b) const | |
1245 { | |
1246 return low == b.low && high == b.high; | |
1247 } | |
1248 | |
1249 inline bool | |
1250 omp_clause_mask::operator != (omp_clause_mask b) const | |
1251 { | |
1252 return low != b.low || high != b.high; | |
1253 } | |
1254 | 1131 |
1255 #define OMP_CLAUSE_MASK_1 omp_clause_mask (1) | 1132 #define OMP_CLAUSE_MASK_1 omp_clause_mask (1) |
1256 | 1133 |
1257 enum c_omp_clause_split | 1134 enum c_omp_clause_split |
1258 { | 1135 { |
1268 }; | 1145 }; |
1269 | 1146 |
1270 enum c_omp_region_type | 1147 enum c_omp_region_type |
1271 { | 1148 { |
1272 C_ORT_OMP = 1 << 0, | 1149 C_ORT_OMP = 1 << 0, |
1273 C_ORT_CILK = 1 << 1, | 1150 C_ORT_ACC = 1 << 1, |
1274 C_ORT_ACC = 1 << 2, | 1151 C_ORT_DECLARE_SIMD = 1 << 2, |
1275 C_ORT_DECLARE_SIMD = 1 << 3, | |
1276 C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD | 1152 C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD |
1277 }; | 1153 }; |
1278 | 1154 |
1279 extern tree c_finish_omp_master (location_t, tree); | 1155 extern tree c_finish_omp_master (location_t, tree); |
1280 extern tree c_finish_omp_taskgroup (location_t, tree); | 1156 extern tree c_finish_omp_taskgroup (location_t, tree); |
1377 }; | 1253 }; |
1378 | 1254 |
1379 extern enum stv_conv scalar_to_vector (location_t loc, enum tree_code code, | 1255 extern enum stv_conv scalar_to_vector (location_t loc, enum tree_code code, |
1380 tree op0, tree op1, bool); | 1256 tree op0, tree op1, bool); |
1381 | 1257 |
1382 /* In c-cilkplus.c */ | |
1383 extern tree c_validate_cilk_plus_loop (tree *, int *, void *); | |
1384 extern bool c_check_cilk_loop (location_t, tree); | |
1385 | |
1386 /* These #defines allow users to access different operands of the | |
1387 array notation tree. */ | |
1388 | |
1389 #define ARRAY_NOTATION_CHECK(NODE) TREE_CHECK (NODE, ARRAY_NOTATION_REF) | |
1390 #define ARRAY_NOTATION_ARRAY(NODE) \ | |
1391 TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 0) | |
1392 #define ARRAY_NOTATION_START(NODE) \ | |
1393 TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 1) | |
1394 #define ARRAY_NOTATION_LENGTH(NODE) \ | |
1395 TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 2) | |
1396 #define ARRAY_NOTATION_STRIDE(NODE) \ | |
1397 TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 3) | |
1398 | |
1399 /* This structure holds all the scalar values and its appropriate variable | |
1400 replacment. It is mainly used by the function that pulls all the invariant | |
1401 parts that should be executed only once, which comes with array notation | |
1402 expressions. */ | |
1403 struct inv_list | |
1404 { | |
1405 vec<tree, va_gc> *list_values; | |
1406 vec<tree, va_gc> *replacement; | |
1407 vec<enum tree_code, va_gc> *additional_tcodes; | |
1408 }; | |
1409 | |
1410 /* This structure holds all the important components that can be extracted | |
1411 from an ARRAY_NOTATION_REF expression. It is used to pass array notation | |
1412 information between the functions that are responsible for expansion. */ | |
1413 typedef struct cilkplus_an_parts | |
1414 { | |
1415 tree value; | |
1416 tree start; | |
1417 tree length; | |
1418 tree stride; | |
1419 bool is_vector; | |
1420 } an_parts; | |
1421 | |
1422 /* This structure holds the components necessary to create the loop around | |
1423 the ARRAY_REF that is created using the ARRAY_NOTATION information. */ | |
1424 | |
1425 typedef struct cilkplus_an_loop_parts | |
1426 { | |
1427 tree var; /* Loop induction variable. */ | |
1428 tree incr; /* Loop increment/decrement expression. */ | |
1429 tree cmp; /* Loop condition. */ | |
1430 tree ind_init; /* Initialization of the loop induction variable. */ | |
1431 } an_loop_parts; | |
1432 | |
1433 /* In array-notation-common.c. */ | |
1434 extern HOST_WIDE_INT extract_sec_implicit_index_arg (location_t, tree); | |
1435 extern bool is_sec_implicit_index_fn (tree); | |
1436 extern void array_notation_init_builtins (void); | |
1437 extern struct c_expr fix_array_notation_expr (location_t, enum tree_code, | |
1438 struct c_expr); | |
1439 extern bool contains_array_notation_expr (tree); | |
1440 extern tree expand_array_notation_exprs (tree); | |
1441 extern tree fix_conditional_array_notations (tree); | |
1442 extern tree find_correct_array_notation_type (tree); | |
1443 extern bool length_mismatch_in_expr_p (location_t, vec<vec<an_parts> >); | |
1444 extern enum built_in_function is_cilkplus_reduce_builtin (tree); | |
1445 extern bool find_rank (location_t, tree, tree, bool, size_t *); | |
1446 extern void extract_array_notation_exprs (tree, bool, vec<tree, va_gc> **); | |
1447 extern void replace_array_notations (tree *, bool, vec<tree, va_gc> *, | |
1448 vec<tree, va_gc> *); | |
1449 extern tree find_inv_trees (tree *, int *, void *); | 1258 extern tree find_inv_trees (tree *, int *, void *); |
1450 extern tree replace_inv_trees (tree *, int *, void *); | 1259 extern tree replace_inv_trees (tree *, int *, void *); |
1451 extern tree find_correct_array_notation_type (tree op); | 1260 |
1452 extern void cilkplus_extract_an_triplets (vec<tree, va_gc> *, size_t, size_t, | |
1453 vec<vec<an_parts> > *); | |
1454 extern vec <tree, va_gc> *fix_sec_implicit_args | |
1455 (location_t, vec <tree, va_gc> *, vec<an_loop_parts>, size_t, tree); | |
1456 extern bool is_cilkplus_vector_p (tree); | |
1457 | |
1458 /* In cilk.c. */ | |
1459 extern tree insert_cilk_frame (tree); | |
1460 extern void cilk_init_builtins (void); | |
1461 extern int gimplify_cilk_spawn (tree *); | |
1462 extern void cilk_install_body_with_frame_cleanup (tree, tree, void *); | |
1463 extern bool cilk_detect_spawn_and_unwrap (tree *); | |
1464 extern bool cilk_set_spawn_marker (location_t, tree); | |
1465 extern tree build_cilk_sync (void); | |
1466 extern tree build_cilk_spawn (location_t, tree); | |
1467 extern tree make_cilk_frame (tree); | |
1468 extern tree create_cilk_function_exit (tree, bool, bool); | |
1469 extern void cilk_outline (tree, tree *, void *); | |
1470 extern bool contains_cilk_spawn_stmt (tree); | |
1471 extern tree cilk_for_number_of_iterations (tree); | |
1472 extern bool check_no_cilk (tree, const char *, const char *, | |
1473 location_t loc = UNKNOWN_LOCATION); | |
1474 extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION); | 1261 extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION); |
1475 extern bool valid_array_size_p (location_t, tree, tree); | 1262 extern bool valid_array_size_p (location_t, tree, tree, bool = true); |
1476 | |
1477 extern bool cilk_ignorable_spawn_rhs_op (tree); | |
1478 extern bool cilk_recognize_spawn (tree, tree *); | |
1479 | 1263 |
1480 /* In c-warn.c. */ | 1264 /* In c-warn.c. */ |
1481 extern void constant_expression_warning (tree); | 1265 extern void constant_expression_warning (tree); |
1482 extern void constant_expression_error (tree); | 1266 extern void constant_expression_error (tree); |
1483 extern void overflow_warning (location_t, tree, tree = NULL_TREE); | 1267 extern void overflow_warning (location_t, tree, tree = NULL_TREE); |
1485 enum tree_code, tree, enum tree_code, tree); | 1269 enum tree_code, tree, enum tree_code, tree); |
1486 extern void warn_tautological_cmp (location_t, enum tree_code, tree, tree); | 1270 extern void warn_tautological_cmp (location_t, enum tree_code, tree, tree); |
1487 extern void warn_logical_not_parentheses (location_t, enum tree_code, tree, | 1271 extern void warn_logical_not_parentheses (location_t, enum tree_code, tree, |
1488 tree); | 1272 tree); |
1489 extern bool warn_if_unused_value (const_tree, location_t); | 1273 extern bool warn_if_unused_value (const_tree, location_t); |
1490 extern bool strict_aliasing_warning (tree, tree, tree); | 1274 extern bool strict_aliasing_warning (location_t, tree, tree); |
1491 extern void sizeof_pointer_memaccess_warning (location_t *, tree, | 1275 extern void sizeof_pointer_memaccess_warning (location_t *, tree, |
1492 vec<tree, va_gc> *, tree *, | 1276 vec<tree, va_gc> *, tree *, |
1493 bool (*) (tree, tree)); | 1277 bool (*) (tree, tree)); |
1494 extern void check_main_parameter_types (tree decl); | 1278 extern void check_main_parameter_types (tree decl); |
1495 extern void warnings_for_convert_and_check (location_t, tree, tree, tree); | 1279 extern void warnings_for_convert_and_check (location_t, tree, tree, tree); |
1496 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, | 1280 extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, |
1497 bool); | 1281 bool); |
1498 extern void warn_for_omitted_condop (location_t, tree); | 1282 extern void warn_for_omitted_condop (location_t, tree); |
1499 extern void warn_for_restrict (unsigned, tree *, unsigned); | 1283 extern bool warn_for_restrict (unsigned, tree *, unsigned); |
1500 | 1284 |
1501 /* Places where an lvalue, or modifiable lvalue, may be required. | 1285 /* Places where an lvalue, or modifiable lvalue, may be required. |
1502 Used to select diagnostic messages in lvalue_error and | 1286 Used to select diagnostic messages in lvalue_error and |
1503 readonly_error. */ | 1287 readonly_error. */ |
1504 enum lvalue_use { | 1288 enum lvalue_use { |
1551 excess_precision_mode_join (enum flt_eval_method, enum flt_eval_method); | 1335 excess_precision_mode_join (enum flt_eval_method, enum flt_eval_method); |
1552 | 1336 |
1553 extern int c_flt_eval_method (bool ts18661_p); | 1337 extern int c_flt_eval_method (bool ts18661_p); |
1554 extern void add_no_sanitize_value (tree node, unsigned int flags); | 1338 extern void add_no_sanitize_value (tree node, unsigned int flags); |
1555 | 1339 |
1556 extern void maybe_add_include_fixit (rich_location *, const char *); | 1340 extern void maybe_add_include_fixit (rich_location *, const char *, bool); |
1557 extern void maybe_suggest_missing_token_insertion (rich_location *richloc, | 1341 extern void maybe_suggest_missing_token_insertion (rich_location *richloc, |
1558 enum cpp_ttype token_type, | 1342 enum cpp_ttype token_type, |
1559 location_t prev_token_loc); | 1343 location_t prev_token_loc); |
1344 extern tree braced_list_to_string (tree, tree); | |
1560 | 1345 |
1561 #if CHECKING_P | 1346 #if CHECKING_P |
1562 namespace selftest { | 1347 namespace selftest { |
1563 /* Declarations for specific families of tests within c-family, | 1348 /* Declarations for specific families of tests within c-family, |
1564 by source file, in alphabetical order. */ | 1349 by source file, in alphabetical order. */ |
1565 extern void c_format_c_tests (void); | 1350 extern void c_format_c_tests (void); |
1351 extern void c_indentation_c_tests (void); | |
1352 extern void c_pretty_print_c_tests (void); | |
1353 extern void c_spellcheck_cc_tests (void); | |
1566 | 1354 |
1567 /* The entrypoint for running all of the above tests. */ | 1355 /* The entrypoint for running all of the above tests. */ |
1568 extern void c_family_tests (void); | 1356 extern void c_family_tests (void); |
1569 } // namespace selftest | 1357 } // namespace selftest |
1570 #endif /* #if CHECKING_P */ | 1358 #endif /* #if CHECKING_P */ |