aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2013-11-08 17:46:16 -0500
committerDiego Novillo <dnovillo@gcc.gnu.org>2013-11-08 17:46:16 -0500
commit862d0b359fb98790d5fad654eecf471228d8bb77 (patch)
tree956d82c4131695b3b703c5ba7a83a02ad61d5928 /gcc/tree.h
parentf0e56cd667259c3bc4234cb75c5137136af7b25d (diff)
downloadgcc-862d0b359fb98790d5fad654eecf471228d8bb77.zip
gcc-862d0b359fb98790d5fad654eecf471228d8bb77.tar.gz
gcc-862d0b359fb98790d5fad654eecf471228d8bb77.tar.bz2
Re-factor tree.h - Part 1.
This is the first patch in a series of patches to cleanup tree.h to reduce the exposure it has all over the compiler. In this patch, I'm moving functions that are used once into the files that use them, and make them private to that file. These functions were declared extern in tree.h and called from exactly one place. The patch does not move EVERY function. This usually happens when the function uses private state from its original file, and moving that private state would mean moving other functions that made no sense to move. Additionally, the patch removes functions that were never used. In subsequent patches, I will be moving out of tree.h extern definitions that should be grouped in other files (e.g., all functions defined in some FOO.c will be moved to the corresponding FOO.h). This will allow me to remove the inclusion of tree.h from some files. * attribs.c (lookup_scoped_attribute_spec): Make static. (get_attribute_namespace): Likewise. * builtins.c (more_const_call_expr_args_p): Move from tree.h. (validate_arglist): Move earlier in the file. Make static. (expand_stack_restore): Move from stmt.c (expand_stack_save): Move from stmt.c (rewrite_call_expr_array): Move earlier in the file. (rewrite_call_expr_valist): Likewise. * cfgexpand.c: Include hard-reg-set.h before tree.h Include recog.h. Include output.h. (expand_asm_loc): Move from stmt.c. (n_occurrences): Move from stmt.c. (check_operand_nalternatives): Move from stmt.c. (tree_conflicts_with_clobbers_p): Move from stmt.c. (expand_asm_operands): Move from stmt.c (expand_asm_stmt): Move from stmt.c (expand_computed_goto): Move from stmt.c (expand_goto): Move from stmt.c (expand_null_return_1): Move from stmt.c (expand_null_return): Move from stmt.c (expand_value_return): Move from stmt.c (expand_return): Move from stmt.c (expand_main_function): Move from function.c (stack_protect_prologue): Move from function.c * cgraphclones.c (build_function_type_skip_args): Move from tree.c. (build_function_decl_skip_args): Move from tree.c. * explow.c (tree_expr_size): Move from tree.c. * expr.c (addr_expr_of_non_mem_decl_p): Remove. (fields_length): Move from tree.c. * fold-const.c (size_low_cst): Move from tree.c. (tree_expr_nonzero_warnv_p): Make static. Move earlier in the file. (tree_expr_nonzero_p): Make static. Move earlier in the file. (fold_build3_initializer_loc): Remove. (tree_invalid_nonnegative_warnv_p): Make static. * function.c (expand_main_function): Move to cfgexpand.c. (stack_protect_prologue): Move to cfgexpand.c. (set_insn_locations): Move earlier in the file. * gimple-fold.c: Include langhooks.h. (truth_type_for): Move from tree.c. * print-tree.c (print_vec_tree): Remove. * stmt.c (expand_computed_goto): Move to cfgexpand.c. (expand_goto): Move to cfgexpand.c. (n_occurrences): Move to cfgexpand.c. (expand_asm_loc): Move to cfgexpand.c (tree_conflicts_with_clobbers_p): Move to cfgexpand.c. (expand_asm_operands): Move to cfgexpand.c. (expand_asm_stmt): Move to cfgexpand.c. (check_operand_nalternatives): Move to cfgexpand.c (expand_null_return): Move to cfgexpand.c. (expand_value_return): Move to cfgexpand.c. (expand_null_return_1): Move to cfgexpand.c. (expand_return): Move to cfgexpand.c. (expand_stack_save): Move to builtins.c. (expand_stack_restore): Move to builtins.c * symtab.c: Include output.h. (decl_assembler_name_hash): Move from tree.c. (decl_assembler_name_equal): Move from tree.c. * trans-mem.c (is_tm_safe_or_pure): Move from tree.h. * tree-eh.c (in_array_bounds_p): Move from tree.c. (range_in_array_bounds_p): Move from tree.c. * tree-object-size.c (fini_object_sizes): Make static. * tree-ssa-dom.c (iterative_hash_exprs_commutative): Move from tree.h. * tree-vrp.c (ssa_name_nonnegative_p): Remove. * tree.c (decl_assembler_name_equal): Move to symtab.c. (tree_expr_size): Move to explow.c. (decl_assembler_name_hash): Move to symtab.c. (real_twop): Remove. (tree_expr_size): Move to explow.c. (stabilize_reference_1): Move earlier in the file. Make static. (omp_remove_redundant_declare_simd_attrs): Remove. (simple_cst_list_equal): Move earlier in the file. Make static. (size_low_cst): Move to fold-const.c. (build_type_no_quals): Remove. (build_function_type_skip_args): Move to cgraphclones.c. (build_function_decl_skip_args): Move to cgraphclones.c. (in_array_bounds_p): Move to tree-eh.c. (range_in_array_bounds_p): Move to tree-eh.c. (truth_type_for): Move to gimple-fold.c. (list_equal_p): remove. * tree.h (decl_assembler_name_equal): Remove. (decl_assembler_name_hash): Remove. (truth_type_for): Remove. (build_type_no_quals): Remove. (build_function_decl_skip_args): Remove. (in_array_bounds_p): Remove. (range_in_array_bounds_p): Remove. (size_low_cst): Remove. (omp_remove_redundant_declare_simd_attrs): Remove. (tree_expr_size): Remove. (fields_length): Remove. (stabilize_reference_1): Remove. (expand_goto): Remove. (expand_stack_save): Remove. (expand_stack_restore): Remove. (expand_return): Remove. (fold_build3_initializer_loc): Remove. (tree_expr_nonzero_p): Remove. (tree_invalid_nonnegative_warnv_p): Remove. (tree_expr_nonzero_warnv_p): Remove. (fold_builtin_snprintf_chk): Remove. (validate_arglist): Remove. (iterative_hash_exprs_commutative): Move to tree-ssa-dom.c. (simple_cst_list_equal): Remove. (real_twop): Remove. (expand_main_function): Remove. (stack_protect_prologue): Remove. (print_vec_tree): Remove. (lookup_scoped_attribute_spec): Remove. (get_attribute_namespace): Remove. (expand_computed_goto): Remove. (expand_asm_stmt): Remove. (list_equal_p): Remove. (ssa_name_nonnegative_p): Remove. (fini_object_sizes): Remove. (addr_expr_of_non_mem_decl_p): Remove. (is_tm_safe_or_pure): Move to trans-mem.c. (more_const_call_expr_args_p): Remove. (save_vtable_map_decl): Remove. From-SVN: r204606
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 96948f1..c4b23d0 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3385,8 +3385,6 @@ tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
|| ((NODE) && TREE_TYPE ((NODE)) == error_mark_node))
extern tree decl_assembler_name (tree);
-extern bool decl_assembler_name_equal (tree decl, const_tree asmname);
-extern hashval_t decl_assembler_name_hash (const_tree asmname);
/* Compute the number of bytes occupied by 'node'. This routine only
looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */
@@ -3619,14 +3617,12 @@ extern tree build_reference_type (tree);
extern tree build_vector_type_for_mode (tree, enum machine_mode);
extern tree build_vector_type (tree innertype, int nunits);
extern tree build_opaque_vector_type (tree innertype, int nunits);
-extern tree build_type_no_quals (tree);
extern tree build_index_type (tree);
extern tree build_array_type (tree, tree);
extern tree build_nonshared_array_type (tree, tree);
extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
extern tree build_function_type (tree, tree);
extern tree build_function_type_list (tree, ...);
-extern tree build_function_decl_skip_args (tree, bitmap, bool);
extern tree build_varargs_function_type_list (tree, ...);
extern tree build_function_type_array (tree, int, tree *);
extern tree build_varargs_function_type_array (tree, int, tree *);
@@ -3640,8 +3636,6 @@ extern tree build_method_type (tree, tree);
extern tree build_offset_type (tree, tree);
extern tree build_complex_type (tree);
extern tree array_type_nelts (const_tree);
-extern bool in_array_bounds_p (tree);
-extern bool range_in_array_bounds_p (tree);
extern tree value_member (tree, tree);
extern tree purpose_member (const_tree, tree);
@@ -3667,7 +3661,6 @@ tree_low_cst (const_tree t, int pos)
return TREE_INT_CST_LOW (t);
}
#endif
-extern HOST_WIDE_INT size_low_cst (const_tree);
extern int tree_int_cst_sgn (const_tree);
extern int tree_int_cst_sign_bit (const_tree);
extern unsigned int tree_int_cst_min_precision (tree, bool);
@@ -3726,9 +3719,6 @@ extern tree build_type_attribute_variant (tree, tree);
extern tree build_decl_attribute_variant (tree, tree);
extern tree build_type_attribute_qual_variant (tree, tree, int);
-/* Remove redundant "omp declare simd" attributes from fndecl. */
-extern void omp_remove_redundant_declare_simd_attrs (tree);
-
/* Return 0 if the attributes for two types are incompatible, 1 if they
are compatible, and 2 if they are nearly compatible (which causes a
warning to be generated). */
@@ -3902,7 +3892,6 @@ extern tree expr_last (tree);
extern tree size_in_bytes (const_tree);
extern HOST_WIDE_INT int_size_in_bytes (const_tree);
extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
-extern tree tree_expr_size (const_tree);
extern tree bit_position (const_tree);
extern HOST_WIDE_INT int_bit_position (const_tree);
extern tree byte_position (const_tree);
@@ -3963,10 +3952,6 @@ extern tree nreverse (tree);
extern int list_length (const_tree);
-/* Returns the number of FIELD_DECLs in a type. */
-
-extern int fields_length (const_tree);
-
/* Returns the first FIELD_DECL in a type. */
extern tree first_field (const_tree);
@@ -4127,12 +4112,6 @@ extern tree variable_size (tree);
extern tree stabilize_reference (tree);
-/* Subroutine of stabilize_reference; this is called for subtrees of
- references. Any expression with side-effects must be put in a SAVE_EXPR
- to ensure that it is only evaluated once. */
-
-extern tree stabilize_reference_1 (tree);
-
/* Return EXP, stripped of any conversions to wider types
in such a way that the result of converting to type FOR_TYPE
is the same as if EXP were converted to FOR_TYPE.
@@ -4315,11 +4294,6 @@ extern tree unshare_expr_without_location (tree);
/* In stmt.c */
extern void expand_label (tree);
-extern void expand_goto (tree);
-
-extern rtx expand_stack_save (void);
-extern void expand_stack_restore (tree);
-extern void expand_return (tree);
/* Compare and hash for any structure which begins with a canonical
pointer. Assumes all pointers are interchangeable, which is sort
@@ -4389,7 +4363,6 @@ extern tree fold_build3_stat_loc (location_t, enum tree_code, tree, tree, tree,
tree MEM_STAT_DECL);
extern tree fold_build1_initializer_loc (location_t, enum tree_code, tree, tree);
extern tree fold_build2_initializer_loc (location_t, enum tree_code, tree, tree, tree);
-extern tree fold_build3_initializer_loc (location_t, enum tree_code, tree, tree, tree, tree);
#define fold_build_call_array(T1,T2,N,T4)\
fold_build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T4)
extern tree fold_build_call_array_loc (location_t, tree, tree, int, tree *);
@@ -4452,7 +4425,6 @@ extern enum tree_code swap_tree_comparison (enum tree_code);
extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
extern enum tree_code invert_tree_comparison (enum tree_code, bool);
-extern bool tree_expr_nonzero_p (tree);
extern bool tree_unary_nonzero_warnv_p (enum tree_code, tree, tree, bool *);
extern bool tree_binary_nonzero_warnv_p (enum tree_code, tree, tree, tree op1,
bool *);
@@ -4461,11 +4433,8 @@ extern bool tree_unary_nonnegative_warnv_p (enum tree_code, tree, tree, bool *);
extern bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree,
bool *);
extern bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
-extern bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
extern bool tree_call_nonnegative_warnv_p (tree, tree, tree, tree, bool *);
-extern bool tree_expr_nonzero_warnv_p (tree, bool *);
-
extern bool fold_real_zero_addition_p (const_tree, const_tree, int);
extern tree combine_comparisons (location_t, enum tree_code, enum tree_code,
enum tree_code, tree, tree, tree);
@@ -4536,7 +4505,6 @@ extern tree fold_builtin_stxcpy_chk (location_t, tree, tree, tree, tree, tree, b
enum built_in_function);
extern tree fold_builtin_stxncpy_chk (location_t, tree, tree, tree, tree, tree, bool,
enum built_in_function);
-extern tree fold_builtin_snprintf_chk (location_t, tree, tree, enum built_in_function);
extern bool fold_builtin_next_arg (tree, bool);
extern enum built_in_function builtin_mathfn_code (const_tree);
extern tree fold_builtin_call_array (location_t, tree, tree, int, tree *);
@@ -4547,7 +4515,6 @@ extern tree build_call_expr (tree, int, ...);
extern tree mathfn_built_in (tree, enum built_in_function fn);
extern tree c_strlen (tree, int);
extern tree build_string_literal (int, const char *);
-extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern bool is_builtin_fn (tree);
extern bool get_object_alignment_1 (tree, unsigned int *,
@@ -4585,22 +4552,18 @@ extern int tree_floor_log2 (const_tree);
extern unsigned int tree_ctz (const_tree);
extern int simple_cst_equal (const_tree, const_tree);
extern hashval_t iterative_hash_expr (const_tree, hashval_t);
-extern hashval_t iterative_hash_exprs_commutative (const_tree,
- const_tree, hashval_t);
extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t);
extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t);
extern hashval_t iterative_hash_host_wide_int (HOST_WIDE_INT, hashval_t);
extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
extern int type_list_equal (const_tree, const_tree);
extern int chain_member (const_tree, const_tree);
-extern int simple_cst_list_equal (const_tree, const_tree);
extern void dump_tree_statistics (void);
extern void recompute_tree_invariant_for_addr_expr (tree);
extern bool needs_to_live_in_memory (const_tree);
extern tree reconstruct_complex_type (tree, tree);
extern int real_onep (const_tree);
-extern int real_twop (const_tree);
extern int real_minus_onep (const_tree);
extern void init_ttree (void);
extern void build_common_tree_nodes (bool, bool);
@@ -4635,10 +4598,8 @@ extern const char *get_tree_code_name (enum tree_code);
extern tree build_addr (tree, tree);
/* In function.c */
-extern void expand_main_function (void);
extern void expand_function_end (void);
extern void expand_function_start (tree);
-extern void stack_protect_prologue (void);
extern void stack_protect_epilogue (void);
extern void init_dummy_function_start (void);
extern void expand_dummy_function_end (void);
@@ -4682,7 +4643,6 @@ extern void debug_raw (vec<tree, va_gc> *ptr);
#ifdef BUFSIZ
extern void dump_addr (FILE*, const char *, const void *);
extern void print_node (FILE *, const char *, tree, int);
-extern void print_vec_tree (FILE *, const char *, vec<tree, va_gc> *, int);
extern void print_node_brief (FILE *, const char *, const_tree, int);
extern void indent_to (FILE *, int);
#endif
@@ -4707,9 +4667,6 @@ extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree);
/* In attribs.c. */
extern const struct attribute_spec *lookup_attribute_spec (const_tree);
-extern const struct attribute_spec *lookup_scoped_attribute_spec (const_tree,
- const_tree);
-
extern void init_attributes (void);
/* Process the attributes listed in ATTRIBUTES and install them in *NODE,
@@ -4726,8 +4683,6 @@ extern bool cxx11_attribute_p (const_tree);
extern tree get_attribute_name (const_tree);
-extern tree get_attribute_namespace (const_tree);
-
extern void apply_tm_attr (tree, tree);
/* In stor-layout.c */
@@ -4783,12 +4738,10 @@ extern bool initializer_constant_valid_for_bitfield_p (tree);
extern bool constructor_static_from_elts_p (const_tree);
/* In stmt.c */
-extern void expand_computed_goto (tree);
extern bool parse_output_constraint (const char **, int, int, int,
bool *, bool *, bool *);
extern bool parse_input_constraint (const char **, int, int, int, int,
const char * const *, bool *, bool *);
-extern void expand_asm_stmt (gimple);
extern tree resolve_asm_operand_names (tree, tree, tree, tree);
#ifdef HARD_CONST
/* Silly ifdef to avoid having all includers depend on hard-reg-set.h. */
@@ -4822,7 +4775,6 @@ extern tree drop_tree_overflow (tree);
extern int tree_map_base_eq (const void *, const void *);
extern unsigned int tree_map_base_hash (const void *);
extern int tree_map_base_marked_p (const void *);
-extern bool list_equal_p (const_tree, const_tree);
#define tree_map_eq tree_map_base_eq
extern unsigned int tree_map_hash (const void *);
@@ -4844,12 +4796,8 @@ extern unsigned int tree_decl_map_hash (const void *);
#define tree_vec_map_hash tree_decl_map_hash
#define tree_vec_map_marked_p tree_map_base_marked_p
-/* In tree-vrp.c */
-extern bool ssa_name_nonnegative_p (const_tree);
-
/* In tree-object-size.c. */
extern void init_object_sizes (void);
-extern void fini_object_sizes (void);
extern unsigned HOST_WIDE_INT compute_builtin_object_size (tree, int);
/* In expr.c. */
@@ -4859,9 +4807,6 @@ extern unsigned HOST_WIDE_INT compute_builtin_object_size (tree, int);
succeed. */
extern int can_move_by_pieces (unsigned HOST_WIDE_INT, unsigned int);
-/* Is it an ADDR_EXPR of a DECL that's not in memory? */
-extern bool addr_expr_of_non_mem_decl_p (tree);
-
extern unsigned HOST_WIDE_INT highest_pow2_factor (const_tree);
extern tree build_personality_function (const char *);
@@ -4874,12 +4819,6 @@ extern bool is_tm_ending_fndecl (tree);
extern void record_tm_replacement (tree, tree);
extern void tm_malloc_replacement (tree);
-static inline bool
-is_tm_safe_or_pure (const_tree x)
-{
- return is_tm_safe (x) || is_tm_pure (x);
-}
-
/* In tree-inline.c. */
void init_inline_once (void);
@@ -4952,12 +4891,6 @@ more_call_expr_args_p (const call_expr_arg_iterator *iter)
return (iter->i < iter->n);
}
-static inline bool
-more_const_call_expr_args_p (const const_call_expr_arg_iterator *iter)
-{
- return (iter->i < iter->n);
-}
-
/* Iterate through each argument ARG of CALL_EXPR CALL, using variable ITER
(of type call_expr_arg_iterator) to hold the iteration state. */
#define FOR_EACH_CALL_EXPR_ARG(arg, iter, call) \
@@ -4975,9 +4908,6 @@ is_lang_specific (tree t)
return TREE_CODE (t) == LANG_TYPE || TREE_CODE (t) >= NUM_TREE_CODES;
}
-/* In vtable-verify.c. */
-extern void save_vtable_map_decl (tree);
-
/* Valid builtin number. */
#define BUILTIN_VALID_P(FNCODE) \
(IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1))