Mercurial > hg > CbC > CbC_gcc
diff 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 |
line wrap: on
line diff
--- a/gcc/c-family/c-common.h Thu Oct 25 08:08:40 2018 +0900 +++ b/gcc/c-family/c-common.h Thu Oct 25 10:21:07 2018 +0900 @@ -1,5 +1,5 @@ /* Definitions for c-common.c. - Copyright (C) 1987-2017 Free Software Foundation, Inc. + Copyright (C) 1987-2018 Free Software Foundation, Inc. This file is part of GCC. @@ -25,6 +25,7 @@ #include "alias.h" #include "tree.h" #include "fold-const.h" +#include "wide-int-bitmask.h" /* In order for the format checking to accept the C frontend diagnostic framework extensions, you must include this file before @@ -101,6 +102,7 @@ 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_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128, /* TS 18661-3 keywords, in the same sequence as the TI_* values. */ @@ -183,9 +185,6 @@ /* C++ transactional memory. */ RID_ATOMIC_NOEXCEPT, RID_ATOMIC_CANCEL, RID_SYNCHRONIZED, - /* Cilk Plus keywords. */ - RID_CILK_SPAWN, RID_CILK_SYNC, RID_CILK_FOR, - /* Objective-C ("AT" reserved words - they are only keywords when they follow '@') */ RID_AT_ENCODE, RID_AT_END, @@ -503,7 +502,7 @@ enum c_language_kind { - clk_c = 0, /* C90, C94, C99 or C11 */ + clk_c = 0, /* C90, C94, C99, C11 or C2X */ clk_objc = 1, /* clk_c with ObjC features. */ clk_cxx = 2, /* ANSI/ISO C++ */ clk_objcxx = 3 /* clk_cxx with ObjC features. */ @@ -589,9 +588,6 @@ extern tree build_modify_expr (location_t, tree, tree, enum tree_code, location_t, tree, tree); -extern tree build_array_notation_expr (location_t, tree, tree, enum tree_code, - location_t, tree, tree); -extern tree build_array_notation_ref (location_t, tree, tree, tree, tree, tree); extern tree build_indirect_ref (location_t, tree, ref_operator); extern bool has_c_linkage (const_tree decl); @@ -643,14 +639,18 @@ extern int flag_isoc94; -/* Nonzero means use the ISO C99 (or C11) dialect of C. */ +/* Nonzero means use the ISO C99 (or later) dialect of C. */ extern int flag_isoc99; -/* Nonzero means use the ISO C11 dialect of C. */ +/* Nonzero means use the ISO C11 (or later) dialect of C. */ extern int flag_isoc11; +/* Nonzero means use the ISO C2X dialect of C. */ + +extern int flag_isoc2x; + /* Nonzero means that we have builtin functions, and main is an int. */ extern int flag_hosted; @@ -816,7 +816,8 @@ 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 *); -extern bool c_common_handle_option (size_t, const char *, int, int, location_t, +extern bool c_common_handle_option (size_t, const char *, HOST_WIDE_INT, int, + location_t, const struct cl_option_handlers *); extern bool default_handle_c_option (size_t, const char *, int); extern tree c_common_type_for_mode (machine_mode, int); @@ -831,7 +832,7 @@ extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree, bool); extern bool decl_with_nonnull_addr_p (const_tree); -extern tree c_fully_fold (tree, bool, bool *); +extern tree c_fully_fold (tree, bool, bool *, bool = false); extern tree c_wrap_maybe_const (tree, bool); extern tree c_common_truthvalue_conversion (location_t, tree); extern void c_apply_type_quals_to_decl (int, tree); @@ -948,6 +949,10 @@ #define CLEAR_DECL_C_BIT_FIELD(NODE) \ (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) +/* True if the decl was an unnamed bitfield. */ +#define DECL_UNNAMED_BIT_FIELD(NODE) \ + (DECL_C_BIT_FIELD (NODE) && !DECL_NAME (NODE)) + extern tree do_case (location_t, tree, tree); extern tree build_stmt (location_t, enum tree_code, ...); extern tree build_real_imag_expr (location_t, enum tree_code, tree); @@ -978,6 +983,7 @@ extern tree c_add_case_label (location_t, splay_tree, tree, tree, tree, tree, bool *); +extern bool c_switch_covers_all_cases_p (splay_tree, tree); extern tree build_function_call (location_t, tree, tree); @@ -994,18 +1000,6 @@ extern tree lookup_name (tree); extern bool lvalue_p (const_tree); -enum lookup_name_fuzzy_kind { - /* Names of types. */ - FUZZY_LOOKUP_TYPENAME, - - /* Names of function decls. */ - FUZZY_LOOKUP_FUNCTION_NAME, - - /* Any name. */ - FUZZY_LOOKUP_NAME -}; -extern const char *lookup_name_fuzzy (tree, enum lookup_name_fuzzy_kind); - 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); @@ -1014,8 +1008,9 @@ extern void c_cpp_builtins (cpp_reader *); extern void c_cpp_builtins_optimize_pragma (cpp_reader *, tree, tree); -extern bool c_cpp_error (cpp_reader *, int, int, rich_location *, - const char *, va_list *) +extern bool c_cpp_diagnostic (cpp_reader *, enum cpp_diagnostic_level, + enum cpp_warning_reason, rich_location *, + const char *, va_list *) ATTRIBUTE_GCC_DIAG(5,0); extern int c_common_has_attribute (cpp_reader *); @@ -1048,10 +1043,11 @@ extern void verify_sequence_points (tree); -extern tree fold_offsetof_1 (tree, tree_code ctx = ERROR_MARK); -extern tree fold_offsetof (tree); +extern tree fold_offsetof (tree, tree = size_type_node, + tree_code ctx = ERROR_MARK); extern int complete_array_type (tree *, tree, bool); +extern void complete_flexible_array_elts (tree); extern tree builtin_type_for_size (int, bool); @@ -1131,126 +1127,7 @@ extern bool check_missing_format_attribute (tree, tree); /* In c-omp.c */ -struct omp_clause_mask -{ - inline omp_clause_mask (); - inline omp_clause_mask (uint64_t l); - inline omp_clause_mask (uint64_t l, uint64_t h); - inline omp_clause_mask &operator &= (omp_clause_mask); - inline omp_clause_mask &operator |= (omp_clause_mask); - inline omp_clause_mask operator ~ () const; - inline omp_clause_mask operator & (omp_clause_mask) const; - inline omp_clause_mask operator | (omp_clause_mask) const; - inline omp_clause_mask operator >> (int); - inline omp_clause_mask operator << (int); - inline bool operator == (omp_clause_mask) const; - inline bool operator != (omp_clause_mask) const; - uint64_t low, high; -}; - -inline -omp_clause_mask::omp_clause_mask () -{ -} - -inline -omp_clause_mask::omp_clause_mask (uint64_t l) -: low (l), high (0) -{ -} - -inline -omp_clause_mask::omp_clause_mask (uint64_t l, uint64_t h) -: low (l), high (h) -{ -} - -inline omp_clause_mask & -omp_clause_mask::operator &= (omp_clause_mask b) -{ - low &= b.low; - high &= b.high; - return *this; -} - -inline omp_clause_mask & -omp_clause_mask::operator |= (omp_clause_mask b) -{ - low |= b.low; - high |= b.high; - return *this; -} - -inline omp_clause_mask -omp_clause_mask::operator ~ () const -{ - omp_clause_mask ret (~low, ~high); - return ret; -} - -inline omp_clause_mask -omp_clause_mask::operator | (omp_clause_mask b) const -{ - omp_clause_mask ret (low | b.low, high | b.high); - return ret; -} - -inline omp_clause_mask -omp_clause_mask::operator & (omp_clause_mask b) const -{ - omp_clause_mask ret (low & b.low, high & b.high); - return ret; -} - -inline omp_clause_mask -omp_clause_mask::operator << (int amount) -{ - omp_clause_mask ret; - if (amount >= 64) - { - ret.low = 0; - ret.high = low << (amount - 64); - } - else if (amount == 0) - ret = *this; - else - { - ret.low = low << amount; - ret.high = (low >> (64 - amount)) | (high << amount); - } - return ret; -} - -inline omp_clause_mask -omp_clause_mask::operator >> (int amount) -{ - omp_clause_mask ret; - if (amount >= 64) - { - ret.low = high >> (amount - 64); - ret.high = 0; - } - else if (amount == 0) - ret = *this; - else - { - ret.low = (high << (64 - amount)) | (low >> amount); - ret.high = high >> amount; - } - return ret; -} - -inline bool -omp_clause_mask::operator == (omp_clause_mask b) const -{ - return low == b.low && high == b.high; -} - -inline bool -omp_clause_mask::operator != (omp_clause_mask b) const -{ - return low != b.low || high != b.high; -} +typedef wide_int_bitmask omp_clause_mask; #define OMP_CLAUSE_MASK_1 omp_clause_mask (1) @@ -1270,9 +1147,8 @@ enum c_omp_region_type { C_ORT_OMP = 1 << 0, - C_ORT_CILK = 1 << 1, - C_ORT_ACC = 1 << 2, - C_ORT_DECLARE_SIMD = 1 << 3, + C_ORT_ACC = 1 << 1, + C_ORT_DECLARE_SIMD = 1 << 2, C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD }; @@ -1379,103 +1255,11 @@ extern enum stv_conv scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1, bool); -/* In c-cilkplus.c */ -extern tree c_validate_cilk_plus_loop (tree *, int *, void *); -extern bool c_check_cilk_loop (location_t, tree); - -/* These #defines allow users to access different operands of the - array notation tree. */ - -#define ARRAY_NOTATION_CHECK(NODE) TREE_CHECK (NODE, ARRAY_NOTATION_REF) -#define ARRAY_NOTATION_ARRAY(NODE) \ - TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 0) -#define ARRAY_NOTATION_START(NODE) \ - TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 1) -#define ARRAY_NOTATION_LENGTH(NODE) \ - TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 2) -#define ARRAY_NOTATION_STRIDE(NODE) \ - TREE_OPERAND (ARRAY_NOTATION_CHECK (NODE), 3) - -/* This structure holds all the scalar values and its appropriate variable - replacment. It is mainly used by the function that pulls all the invariant - parts that should be executed only once, which comes with array notation - expressions. */ -struct inv_list -{ - vec<tree, va_gc> *list_values; - vec<tree, va_gc> *replacement; - vec<enum tree_code, va_gc> *additional_tcodes; -}; - -/* This structure holds all the important components that can be extracted - from an ARRAY_NOTATION_REF expression. It is used to pass array notation - information between the functions that are responsible for expansion. */ -typedef struct cilkplus_an_parts -{ - tree value; - tree start; - tree length; - tree stride; - bool is_vector; -} an_parts; - -/* This structure holds the components necessary to create the loop around - the ARRAY_REF that is created using the ARRAY_NOTATION information. */ - -typedef struct cilkplus_an_loop_parts -{ - tree var; /* Loop induction variable. */ - tree incr; /* Loop increment/decrement expression. */ - tree cmp; /* Loop condition. */ - tree ind_init; /* Initialization of the loop induction variable. */ -} an_loop_parts; - -/* In array-notation-common.c. */ -extern HOST_WIDE_INT extract_sec_implicit_index_arg (location_t, tree); -extern bool is_sec_implicit_index_fn (tree); -extern void array_notation_init_builtins (void); -extern struct c_expr fix_array_notation_expr (location_t, enum tree_code, - struct c_expr); -extern bool contains_array_notation_expr (tree); -extern tree expand_array_notation_exprs (tree); -extern tree fix_conditional_array_notations (tree); -extern tree find_correct_array_notation_type (tree); -extern bool length_mismatch_in_expr_p (location_t, vec<vec<an_parts> >); -extern enum built_in_function is_cilkplus_reduce_builtin (tree); -extern bool find_rank (location_t, tree, tree, bool, size_t *); -extern void extract_array_notation_exprs (tree, bool, vec<tree, va_gc> **); -extern void replace_array_notations (tree *, bool, vec<tree, va_gc> *, - vec<tree, va_gc> *); extern tree find_inv_trees (tree *, int *, void *); extern tree replace_inv_trees (tree *, int *, void *); -extern tree find_correct_array_notation_type (tree op); -extern void cilkplus_extract_an_triplets (vec<tree, va_gc> *, size_t, size_t, - vec<vec<an_parts> > *); -extern vec <tree, va_gc> *fix_sec_implicit_args - (location_t, vec <tree, va_gc> *, vec<an_loop_parts>, size_t, tree); -extern bool is_cilkplus_vector_p (tree); -/* In cilk.c. */ -extern tree insert_cilk_frame (tree); -extern void cilk_init_builtins (void); -extern int gimplify_cilk_spawn (tree *); -extern void cilk_install_body_with_frame_cleanup (tree, tree, void *); -extern bool cilk_detect_spawn_and_unwrap (tree *); -extern bool cilk_set_spawn_marker (location_t, tree); -extern tree build_cilk_sync (void); -extern tree build_cilk_spawn (location_t, tree); -extern tree make_cilk_frame (tree); -extern tree create_cilk_function_exit (tree, bool, bool); -extern void cilk_outline (tree, tree *, void *); -extern bool contains_cilk_spawn_stmt (tree); -extern tree cilk_for_number_of_iterations (tree); -extern bool check_no_cilk (tree, const char *, const char *, - location_t loc = UNKNOWN_LOCATION); extern bool reject_gcc_builtin (const_tree, location_t = UNKNOWN_LOCATION); -extern bool valid_array_size_p (location_t, tree, tree); - -extern bool cilk_ignorable_spawn_rhs_op (tree); -extern bool cilk_recognize_spawn (tree, tree *); +extern bool valid_array_size_p (location_t, tree, tree, bool = true); /* In c-warn.c. */ extern void constant_expression_warning (tree); @@ -1487,7 +1271,7 @@ extern void warn_logical_not_parentheses (location_t, enum tree_code, tree, tree); extern bool warn_if_unused_value (const_tree, location_t); -extern bool strict_aliasing_warning (tree, tree, tree); +extern bool strict_aliasing_warning (location_t, tree, tree); extern void sizeof_pointer_memaccess_warning (location_t *, tree, vec<tree, va_gc> *, tree *, bool (*) (tree, tree)); @@ -1496,7 +1280,7 @@ extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool, bool); extern void warn_for_omitted_condop (location_t, tree); -extern void warn_for_restrict (unsigned, tree *, unsigned); +extern bool warn_for_restrict (unsigned, tree *, unsigned); /* Places where an lvalue, or modifiable lvalue, may be required. Used to select diagnostic messages in lvalue_error and @@ -1553,16 +1337,20 @@ extern int c_flt_eval_method (bool ts18661_p); extern void add_no_sanitize_value (tree node, unsigned int flags); -extern void maybe_add_include_fixit (rich_location *, const char *); +extern void maybe_add_include_fixit (rich_location *, const char *, bool); 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); #if CHECKING_P namespace selftest { /* Declarations for specific families of tests within c-family, by source file, in alphabetical order. */ extern void c_format_c_tests (void); + extern void c_indentation_c_tests (void); + extern void c_pretty_print_c_tests (void); + extern void c_spellcheck_cc_tests (void); /* The entrypoint for running all of the above tests. */ extern void c_family_tests (void);