diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-25 15:10:40 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-25 15:10:40 +0000 |
commit | 9f627b1adf36cc4e91bd313e69193f83ed298c20 (patch) | |
tree | 3105bdbb1aedf2d08116e9eaf8cfef646a9bfb77 /gcc | |
parent | bc831fe302cc3a72a8a440f4dbc228ce8b65d65d (diff) | |
download | gcc-9f627b1adf36cc4e91bd313e69193f83ed298c20.tar.gz |
* c-common.c (vector_types_convertible_p,
decl_with_nonnull_addr_p, c_promoting_integer_type_p,
self_promoting_args_p): Constify.
* c-common.h (has_c_linkage, decl_with_nonnull_addr_p,
c_promoting_integer_type_p, self_promoting_args_p,
anon_aggr_type_p, vector_types_convertible_p): Likewise.
* c-decl.c (anon_aggr_type_p): Likewise.
* * c-dump.c (dump_stmt): Likewise.
* c-objc-common.c (has_c_linkage): Likewise.
* c-tree.h (same_translation_unit_p): Likewise.
* c-typeck.c (null_pointer_constant_p,
tagged_types_tu_compatible_p, function_types_compatible_p,
type_lists_compatible_p, lvalue_or_else, lvalue_p,
comptypes_internal, struct tagged_tu_seen_cache,
same_translation_unit_p, alloc_tagged_tu_seen_cache,
c_size_in_bytes): Likewise.
* ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor,
hash_ptr, eq_ptr): Likewise.
* langhooks-def.h (lhd_decl_ok_for_sibcall,
LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise.
* langhooks.c (lhd_decl_ok_for_sibcall): Likewise.
* langhooks.h (ok_for_sibcall, omp_privatize_by_reference):
Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.h (optab_for_tree_code): Likewise.
* rtl.h (simplify_rtx): Likewise.
* simplify-rtx.c (simplify_rtx): Likewise.
* tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type,
dump_flag, dump_node): Likewise.
* tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index,
queue_and_dump_type, dump_flag): Likewise.
* tree-flow.h (vect_can_force_dr_alignment_p): Likewise.
* tree-pass.h (dump_node): Likewise.
* tree-vectorizer.c (vect_can_force_dr_alignment_p,
supportable_narrowing_operation): Likewise.
* tree-vectorizer.h (vect_can_force_dr_alignment_p,
supportable_narrowing_operation): Likewise.
* tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity,
is_negative_overflow_infinity, is_positive_overflow_infinity,
is_overflow_infinity, vrp_val_is_max, vrp_val_is_min,
nonnull_arg_p, get_value_range, vrp_operand_equal_p,
update_value_range, add_equivalence, ssa_name_nonnegative_p,
ssa_name_nonzero_p, fp_predicate): Likewise.
* tree.c (auto_var_in_fn_p, empty_body_p): Likewise.
* tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p,
ssa_name_nonnegative_p): Likewise.
cp:
* call.c (sufficient_parms_p): Constify.
* class.c (same_signature_p): Likewise.
* cp-gimplify.c (is_invisiref_parm,
cxx_omp_privatize_by_reference): Likewise.
* cp-objcp-common.c (has_c_linkage): Likewise.
* cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
num_artificial_parms_for, comp_template_parms,
template_parameter_pack_p, any_dependent_template_arguments_p,
any_type_dependent_arguments_p, any_value_dependent_elements_p,
repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
zero_init_p, member_p, cp_lvalue_kind,
builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
varargs_function_p, is_dummy_object, special_function_kind,
string_conv_p, type_unknown_p, comp_except_specs, compparms,
comp_cv_qualification, is_bitfield_expr_with_lowered_type,
unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
cp_has_mutable_p, at_least_as_qualified_p,
invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
* decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
* except.c (nothrow_libfn_p): Likewise.
* method.c (skip_artificial_parms_for, num_artificial_parms_for):
Likewise.
* pt.c (comp_template_parms, template_parameter_pack_p,
any_type_dependent_arguments_p, any_value_dependent_elements_p,
any_dependent_template_arguments_p): Likewise.
* repo.c (repo_export_class_p): Likewise.
* semantics.c (anon_aggr_type_p): Likewise.
* tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
varargs_function_p, member_p, is_dummy_object, pod_type_p,
zero_init_p, special_function_p): Likewise.
* typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
compparms, invalid_nonstatic_memfn_p,
is_bitfield_expr_with_lowered_type, unlowered_expr_type,
string_conv_p, ptr_reasonably_similar, cp_type_readonly,
cp_has_mutable_p, lvalue_or_else): Likewise.
fortran:
* trans-openmp.c (gfc_omp_privatize_by_reference): Constify.
* trans.h (gfc_omp_privatize_by_reference): Likewise.
java:
* lang.c (java_decl_ok_for_sibcall): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127799 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
44 files changed, 299 insertions, 199 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17f4802f535..c3b4ff9018b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,52 @@ +2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * c-common.c (vector_types_convertible_p, + decl_with_nonnull_addr_p, c_promoting_integer_type_p, + self_promoting_args_p): Constify. + * c-common.h (has_c_linkage, decl_with_nonnull_addr_p, + c_promoting_integer_type_p, self_promoting_args_p, + anon_aggr_type_p, vector_types_convertible_p): Likewise. + * c-decl.c (anon_aggr_type_p): Likewise. + * * c-dump.c (dump_stmt): Likewise. + * c-objc-common.c (has_c_linkage): Likewise. + * c-tree.h (same_translation_unit_p): Likewise. + * c-typeck.c (null_pointer_constant_p, + tagged_types_tu_compatible_p, function_types_compatible_p, + type_lists_compatible_p, lvalue_or_else, lvalue_p, + comptypes_internal, struct tagged_tu_seen_cache, + same_translation_unit_p, alloc_tagged_tu_seen_cache, + c_size_in_bytes): Likewise. + * ggc-common.c (compare_ptr_data, hash_descriptor, eq_descriptor, + hash_ptr, eq_ptr): Likewise. + * langhooks-def.h (lhd_decl_ok_for_sibcall, + LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Likewise. + * langhooks.c (lhd_decl_ok_for_sibcall): Likewise. + * langhooks.h (ok_for_sibcall, omp_privatize_by_reference): + Likewise. + * optabs.c (optab_for_tree_code): Likewise. + * optabs.h (optab_for_tree_code): Likewise. + * rtl.h (simplify_rtx): Likewise. + * simplify-rtx.c (simplify_rtx): Likewise. + * tree-dump.c (queue, queue_and_dump_index, queue_and_dump_type, + dump_flag, dump_node): Likewise. + * tree-dump.h (struct dump_info, dump_stmt, queue_and_dump_index, + queue_and_dump_type, dump_flag): Likewise. + * tree-flow.h (vect_can_force_dr_alignment_p): Likewise. + * tree-pass.h (dump_node): Likewise. + * tree-vectorizer.c (vect_can_force_dr_alignment_p, + supportable_narrowing_operation): Likewise. + * tree-vectorizer.h (vect_can_force_dr_alignment_p, + supportable_narrowing_operation): Likewise. + * tree-vrp.c (needs_overflow_infinity, supports_overflow_infinity, + is_negative_overflow_infinity, is_positive_overflow_infinity, + is_overflow_infinity, vrp_val_is_max, vrp_val_is_min, + nonnull_arg_p, get_value_range, vrp_operand_equal_p, + update_value_range, add_equivalence, ssa_name_nonnegative_p, + ssa_name_nonzero_p, fp_predicate): Likewise. + * tree.c (auto_var_in_fn_p, empty_body_p): Likewise. + * tree.h (empty_body_p, auto_var_in_fn_p, ssa_name_nonzero_p, + ssa_name_nonnegative_p): Likewise. + 2007-08-25 Hans Kester <hans.kester@ellips.nl> * config.gcc : Add x86_64-elf target. diff --git a/gcc/c-common.c b/gcc/c-common.c index 6c088302e46..30d381625b0 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1172,7 +1172,7 @@ check_main_parameter_types (tree decl) in effect, emit a note telling the user about that option if such a note has not previously been emitted. */ bool -vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note) +vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note) { static bool emitted_lax_note = false; bool convertible_lax; @@ -2896,7 +2896,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) NULL. */ bool -decl_with_nonnull_addr_p (tree expr) +decl_with_nonnull_addr_p (const_tree expr) { return (DECL_P (expr) && (TREE_CODE (expr) == PARM_DECL @@ -4097,7 +4097,7 @@ def_builtin_1 (enum built_in_function fncode, integral promotions defined in ISO C99 6.3.1.1/2. */ bool -c_promoting_integer_type_p (tree t) +c_promoting_integer_type_p (const_tree t) { switch (TREE_CODE (t)) { @@ -4127,9 +4127,9 @@ c_promoting_integer_type_p (tree t) and none of their types is affected by default promotions. */ int -self_promoting_args_p (tree parms) +self_promoting_args_p (const_tree parms) { - tree t; + const_tree t; for (t = parms; t; t = TREE_CHAIN (t)) { tree type = TREE_VALUE (t); diff --git a/gcc/c-common.h b/gcc/c-common.h index a41cf6f245f..5a27eec5e6f 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -319,7 +319,7 @@ extern int c_expand_decl (tree); extern int field_decl_cmp (const void *, const void *); extern void resort_sorted_fields (void *, void *, gt_pointer_operator, void *); -extern bool has_c_linkage (tree decl); +extern bool has_c_linkage (const_tree decl); /* Switches common to the C front ends. */ @@ -677,7 +677,7 @@ extern tree c_common_unsigned_type (tree); extern tree c_common_signed_type (tree); extern tree c_common_signed_or_unsigned_type (int, tree); extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); -extern bool decl_with_nonnull_addr_p (tree); +extern bool decl_with_nonnull_addr_p (const_tree); extern tree c_common_truthvalue_conversion (tree); extern void c_apply_type_quals_to_decl (int, tree); extern tree c_sizeof_or_alignof_type (tree, bool, int); @@ -731,8 +731,8 @@ extern void c_common_finish (void); extern void c_common_parse_file (int); extern alias_set_type c_common_get_alias_set (tree); extern void c_register_builtin_type (tree, const char*); -extern bool c_promoting_integer_type_p (tree); -extern int self_promoting_args_p (tree); +extern bool c_promoting_integer_type_p (const_tree); +extern int self_promoting_args_p (const_tree); extern tree strip_array_types (tree); extern const_tree const_strip_array_types (const_tree); extern tree strip_pointer_operator (tree); @@ -772,7 +772,7 @@ enum c_tree_code { #undef DEFTREECODE -extern int anon_aggr_type_p (tree); +extern int anon_aggr_type_p (const_tree); /* For a VAR_DECL that is an anonymous union, these are the various sub-variables that make up the anonymous union. */ @@ -830,7 +830,7 @@ extern tree finish_label_address_expr (tree); extern tree lookup_label (tree); extern tree lookup_name (tree); -extern bool vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note); +extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note); extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *); extern void c_expand_body (tree); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 1625046a64f..98489b13a37 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6973,7 +6973,7 @@ current_stmt_tree (void) C. */ int -anon_aggr_type_p (tree ARG_UNUSED (node)) +anon_aggr_type_p (const_tree ARG_UNUSED (node)) { return 0; } diff --git a/gcc/c-dump.c b/gcc/c-dump.c index 42f5486163b..f970b39f9f8 100644 --- a/gcc/c-dump.c +++ b/gcc/c-dump.c @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see /* Dump information common to statements from STMT. */ void -dump_stmt (dump_info_p di, tree t) +dump_stmt (dump_info_p di, const_tree t) { if (EXPR_HAS_LOCATION (t)) dump_int (di, "line", EXPR_LINENO (t)); diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index 746e1196923..274f2701c96 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -166,7 +166,7 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, /* In C and ObjC, all decls have "C" linkage. */ bool -has_c_linkage (tree decl ATTRIBUTE_UNUSED) +has_c_linkage (const_tree decl ATTRIBUTE_UNUSED) { return true; } diff --git a/gcc/c-tree.h b/gcc/c-tree.h index f2727f82c37..57b19f69857 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -543,7 +543,7 @@ extern struct c_label_context_se *label_context_stack_se; extern struct c_label_context_vm *label_context_stack_vm; extern tree require_complete_type (tree); -extern int same_translation_unit_p (tree, tree); +extern int same_translation_unit_p (const_tree, const_tree); extern int comptypes (tree, tree); extern bool c_vla_type_p (const_tree); extern bool c_mark_addressable (tree); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 61b0e2ee9ff..4d4c4d1f4e5 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -74,12 +74,12 @@ static int missing_braces_mentioned; static int require_constant_value; static int require_constant_elements; -static bool null_pointer_constant_p (tree); +static bool null_pointer_constant_p (const_tree); static tree qualify_type (tree, tree); -static int tagged_types_tu_compatible_p (tree, tree); +static int tagged_types_tu_compatible_p (const_tree, const_tree); static int comp_target_types (tree, tree); -static int function_types_compatible_p (tree, tree); -static int type_lists_compatible_p (tree, tree); +static int function_types_compatible_p (const_tree, const_tree); +static int type_lists_compatible_p (const_tree, const_tree); static tree decl_constant_value_for_broken_optimization (tree); static tree lookup_field (tree, tree); static int convert_arguments (int, tree *, tree, tree, tree, tree); @@ -102,15 +102,15 @@ static void set_nonincremental_init (void); static void set_nonincremental_init_from_string (tree); static tree find_init_member (tree); static void readonly_error (tree, enum lvalue_use); -static int lvalue_or_else (tree, enum lvalue_use); -static int lvalue_p (tree); +static int lvalue_or_else (const_tree, enum lvalue_use); +static int lvalue_p (const_tree); static void record_maybe_used_decl (tree); -static int comptypes_internal (tree, tree); +static int comptypes_internal (const_tree, const_tree); /* Return true if EXP is a null pointer constant, false otherwise. */ static bool -null_pointer_constant_p (tree expr) +null_pointer_constant_p (const_tree expr) { /* This should really operate on c_expr structures, but they aren't yet available everywhere required. */ @@ -127,8 +127,8 @@ null_pointer_constant_p (tree expr) struct tagged_tu_seen_cache { const struct tagged_tu_seen_cache * next; - tree t1; - tree t2; + const_tree t1; + const_tree t2; /* The return value of tagged_types_tu_compatible_p if we had seen these two types already. */ int val; @@ -869,10 +869,10 @@ comptypes (tree type1, tree type2) differs from comptypes, in that we don't free the seen types. */ static int -comptypes_internal (tree type1, tree type2) +comptypes_internal (const_tree type1, const_tree type2) { - tree t1 = type1; - tree t2 = type2; + const_tree t1 = type1; + const_tree t2 = type2; int attrval, val; /* Suppress errors caused by previously reported errors. */ @@ -1045,7 +1045,7 @@ comp_target_types (tree ttl, tree ttr) being parsed, so if two trees have context chains ending in null, they're in the same translation unit. */ int -same_translation_unit_p (tree t1, tree t2) +same_translation_unit_p (const_tree t1, const_tree t2) { while (t1 && TREE_CODE (t1) != TRANSLATION_UNIT_DECL) switch (TREE_CODE_CLASS (TREE_CODE (t1))) @@ -1077,7 +1077,7 @@ same_translation_unit_p (tree t1, tree t2) /* Allocate the seen two types, assuming that they are compatible. */ static struct tagged_tu_seen_cache * -alloc_tagged_tu_seen_cache (tree t1, tree t2) +alloc_tagged_tu_seen_cache (const_tree t1, const_tree t2) { struct tagged_tu_seen_cache *tu = XNEW (struct tagged_tu_seen_cache); tu->next = tagged_tu_seen_base; @@ -1125,7 +1125,7 @@ free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *tu_til) rules. */ static int -tagged_types_tu_compatible_p (tree t1, tree t2) +tagged_types_tu_compatible_p (const_tree t1, const_tree t2) { tree s1, s2; bool needs_warning = false; @@ -1339,7 +1339,7 @@ tagged_types_tu_compatible_p (tree t1, tree t2) Otherwise, the argument types must match. */ static int -function_types_compatible_p (tree f1, tree f2) +function_types_compatible_p (const_tree f1, const_tree f2) { tree args1, args2; /* 1 if no need for warning yet, 2 if warning cause has been seen. */ @@ -1402,7 +1402,7 @@ function_types_compatible_p (tree f1, tree f2) or 2 for compatible with warning. */ static int -type_lists_compatible_p (tree args1, tree args2) +type_lists_compatible_p (const_tree args1, const_tree args2) { /* 1 if no need for warning yet, 2 if warning cause has been seen. */ int val = 1; @@ -1503,7 +1503,7 @@ type_lists_compatible_p (tree args1, tree args2) /* Compute the size to increment a pointer by. */ static tree -c_size_in_bytes (tree type) +c_size_in_bytes (const_tree type) { enum tree_code code = TREE_CODE (type); @@ -3198,9 +3198,9 @@ build_unary_op (enum tree_code code, tree xarg, int flag) Lvalues can have their address taken, unless they have C_DECL_REGISTER. */ static int -lvalue_p (tree ref) +lvalue_p (const_tree ref) { - enum tree_code code = TREE_CODE (ref); + const enum tree_code code = TREE_CODE (ref); switch (code) { @@ -3274,7 +3274,7 @@ readonly_error (tree arg, enum lvalue_use use) how the lvalue is being used and so selects the error message. */ static int -lvalue_or_else (tree ref, enum lvalue_use use) +lvalue_or_else (const_tree ref, enum lvalue_use use) { int win = lvalue_p (ref); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3c608d6bd09..d073d38e152 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,45 @@ +2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * call.c (sufficient_parms_p): Constify. + * class.c (same_signature_p): Likewise. + * cp-gimplify.c (is_invisiref_parm, + cxx_omp_privatize_by_reference): Likewise. + * cp-objcp-common.c (has_c_linkage): Likewise. + * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK, + sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p, + grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for, + num_artificial_parms_for, comp_template_parms, + template_parameter_pack_p, any_dependent_template_arguments_p, + any_type_dependent_arguments_p, any_value_dependent_elements_p, + repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p, + zero_init_p, member_p, cp_lvalue_kind, + builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, + varargs_function_p, is_dummy_object, special_function_kind, + string_conv_p, type_unknown_p, comp_except_specs, compparms, + comp_cv_qualification, is_bitfield_expr_with_lowered_type, + unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly, + cp_has_mutable_p, at_least_as_qualified_p, + invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise. + * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise. + * except.c (nothrow_libfn_p): Likewise. + * method.c (skip_artificial_parms_for, num_artificial_parms_for): + Likewise. + * pt.c (comp_template_parms, template_parameter_pack_p, + any_type_dependent_arguments_p, any_value_dependent_elements_p, + any_dependent_template_arguments_p): Likewise. + * repo.c (repo_export_class_p): Likewise. + * semantics.c (anon_aggr_type_p): Likewise. + * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p, + builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p, + varargs_function_p, member_p, is_dummy_object, pod_type_p, + zero_init_p, special_function_p): Likewise. + * typeck.c (comp_array_types, type_unknown_p, comp_except_specs, + comp_array_types, at_least_as_qualified_p, comp_cv_qualification, + compparms, invalid_nonstatic_memfn_p, + is_bitfield_expr_with_lowered_type, unlowered_expr_type, + string_conv_p, ptr_reasonably_similar, cp_type_readonly, + cp_has_mutable_p, lvalue_or_else): Likewise. + 2007-08-25 Paolo Bonzini <bonzini@gnu.org> * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index a504dc84abc..4dae84a082e 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -467,7 +467,7 @@ null_ptr_cst_p (tree t) ellipsis. */ bool -sufficient_parms_p (tree parmlist) +sufficient_parms_p (const_tree parmlist) { for (; parmlist && parmlist != void_list_node; parmlist = TREE_CHAIN (parmlist)) diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 07dc9545141..4e051e3b688 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1774,7 +1774,7 @@ layout_vtable_decl (tree binfo, int n) have the same signature. */ int -same_signature_p (tree fndecl, tree base_fndecl) +same_signature_p (const_tree fndecl, const_tree base_fndecl) { /* One destructor overrides another if they are the same kind of destructor. */ diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 6fcc9b02e40..f9d800ea388 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -590,7 +590,7 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p) } static inline bool -is_invisiref_parm (tree t) +is_invisiref_parm (const_tree t) { return ((TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL) && DECL_BY_REFERENCE (t)); @@ -928,7 +928,7 @@ cxx_omp_clause_dtor (tree clause, tree decl) than the DECL itself. */ bool -cxx_omp_privatize_by_reference (tree decl) +cxx_omp_privatize_by_reference (const_tree decl) { return is_invisiref_parm (decl); } diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 04fc4a8de78..42b0054055b 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -228,7 +228,7 @@ pop_file_scope (void) /* c-pragma.c needs to query whether a decl has extern "C" linkage. */ bool -has_c_linkage (tree decl) +has_c_linkage (const_tree decl) { return DECL_EXTERN_C_P (decl); } diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9a44dffd5c4..d196ddca1e3 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -182,14 +182,14 @@ struct diagnostic_context; #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) #define NON_THUNK_FUNCTION_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ +({ __typeof(NODE) const __t = (NODE); \ if (TREE_CODE (__t) != FUNCTION_DECL && \ TREE_CODE (__t) != TEMPLATE_DECL && __t->decl_common.lang_specific \ && __t->decl_common.lang_specific->decl_flags.thunk_p) \ tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ __t; }) #define THUNK_FUNCTION_CHECK(NODE) __extension__ \ -({ const tree __t = (NODE); \ +({ __typeof (NODE) const __t = (NODE); \ if (TREE_CODE (__t) != FUNCTION_DECL || !__t->decl_common.lang_specific \ || !__t->decl_common.lang_specific->decl_flags.thunk_p) \ tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, 0); \ @@ -4067,7 +4067,7 @@ extern tree build_addr_func (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); extern bool null_ptr_cst_p (tree); -extern bool sufficient_parms_p (tree); +extern bool sufficient_parms_p (const_tree); extern tree type_decays_to (tree); extern tree build_user_type_conversion (tree, tree, int); extern tree build_new_function_call (tree, tree, bool); @@ -4135,7 +4135,7 @@ extern void cxx_print_identifier (FILE *, tree, int); extern void cxx_print_error_function (struct diagnostic_context *, const char *); extern void build_self_reference (void); -extern int same_signature_p (tree, tree); +extern int same_signature_p (const_tree, const_tree); extern void maybe_add_class_template_decl_list (tree, tree, int); extern void unreverse_member_declarations (tree); extern void invalidate_class_lookup_cache (void); @@ -4212,11 +4212,11 @@ extern tree build_ptrmemfunc_type (tree); extern tree build_ptrmem_type (tree, tree); /* the grokdeclarator prototype is in decl.h */ extern tree build_this_parm (tree, cp_cv_quals); -extern int copy_fn_p (tree); -extern bool move_fn_p (tree); +extern int copy_fn_p (const_tree); +extern bool move_fn_p (const_tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); -extern int grok_ctor_properties (tree, tree); +extern int grok_ctor_properties (const_tree, const_tree); extern bool grok_op_properties (tree, bool); extern tree xref_tag (enum tag_types, tree, tag_scope, bool); extern tree xref_tag_from_type (tree, tree, tag_scope); @@ -4318,7 +4318,7 @@ extern tree expand_start_catch_block (tree); extern void expand_end_catch_block (void); extern tree build_exc_ptr (void); extern tree build_throw (tree); -extern int nothrow_libfn_p (tree); +extern int nothrow_libfn_p (const_tree); extern void check_handlers (tree); extern void choose_personality_routine (enum languages); extern tree eh_type_info (tree); @@ -4382,8 +4382,8 @@ extern void use_thunk (tree, bool); extern void synthesize_method (tree); extern tree lazily_declare_fn (special_function_kind, tree); -extern tree skip_artificial_parms_for (tree, tree); -extern int num_artificial_parms_for (tree); +extern tree skip_artificial_parms_for (const_tree, tree); +extern int num_artificial_parms_for (const_tree); extern tree make_alias_for (tree, tree); extern tree locate_copy (tree, void *); extern tree locate_ctor (tree, void *); @@ -4426,9 +4426,9 @@ extern int more_specialized_fn (tree, tree, int); extern void do_decl_instantiation (tree, tree); extern void do_type_instantiation (tree, tree, tsubst_flags_t); extern tree instantiate_decl (tree, int, bool); -extern int comp_template_parms (tree, tree); +extern int comp_template_parms (const_tree, const_tree); extern bool uses_parameter_packs (tree); -extern bool template_parameter_pack_p (tree); +extern bool template_parameter_pack_p (const_tree); extern tree make_pack_expansion (tree); extern bool check_for_bare_parameter_packs (tree); extern int template_class_depth (tree); @@ -4450,13 +4450,13 @@ extern struct tinst_level *current_instantiation(void); extern tree maybe_get_template_decl_from_type_decl (tree); extern int processing_template_parmlist; extern bool dependent_type_p (tree); -extern bool any_dependent_template_arguments_p (tree); +extern bool any_dependent_template_arguments_p (const_tree); extern bool dependent_template_p (tree); extern bool dependent_template_id_p (tree, tree); extern bool type_dependent_expression_p (tree); -extern bool any_type_dependent_arguments_p (tree); +extern bool any_type_dependent_arguments_p (const_tree); extern bool value_dependent_expression_p (tree); -extern bool any_value_dependent_elements_p (tree); +extern bool any_value_dependent_elements_p (const_tree); extern tree resolve_typename_type (tree, bool); extern tree template_for_substitution (tree); extern tree build_non_dependent_expr (tree); @@ -4469,7 +4469,7 @@ extern struct tinst_level *outermost_tinst_level(void); /* in repo.c */ extern void init_repo (void); extern int repo_emit_p (tree); -extern bool repo_export_class_p (tree); +extern bool repo_export_class_p (const_tree); extern void finish_repo (void); /* in rtti.c */ @@ -4662,7 +4662,7 @@ extern tree cxx_omp_clause_default_ctor (tree, tree); extern tree cxx_omp_clause_copy_ctor (tree, tree, tree); extern tree cxx_omp_clause_assign_op (tree, tree, tree); extern tree cxx_omp_clause_dtor (tree, tree); -extern bool cxx_omp_privatize_by_reference (tree); +extern bool cxx_omp_privatize_by_reference (const_tree); extern tree baselink_for_fns (tree); extern void finish_static_assert (tree, tree, location_t, bool); @@ -4679,15 +4679,15 @@ extern bool stabilize_init (tree, tree *); extern tree add_stmt_to_compound (tree, tree); extern tree cxx_maybe_build_cleanup (tree); extern void init_tree (void); -extern int pod_type_p (tree); +extern int pod_type_p (const_tree); extern bool class_tmpl_impl_spec_p (const_tree); -extern int zero_init_p (tree); +extern int zero_init_p (const_tree); extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, tree *, int); -extern int member_p (tree); -extern cp_lvalue_kind real_lvalue_p (tree); -extern bool builtin_valid_in_constant_expr_p (tree); +extern int member_p (const_tree); +extern cp_lvalue_kind real_lvalue_p (const_tree); +extern bool builtin_valid_in_constant_expr_p (const_tree); extern tree build_min (enum tree_code, tree, ...); extern tree build_min_nt (enum tree_code, ...); extern tree build_min_non_dep (enum tree_code, tree, ...); @@ -4710,17 +4710,17 @@ extern tree array_type_nelts_top (tree); extern tree break_out_target_exprs (tree); extern tree get_type_decl (tree); extern tree decl_namespace_context (tree); -extern bool decl_anon_ns_mem_p (tree); +extern bool decl_anon_ns_mem_p (const_tree); extern tree lvalue_type (tree); extern tree error_type (tree); -extern int varargs_function_p (tree); +extern int varargs_function_p (const_tree); extern bool really_overloaded_fn (tree); extern bool cp_tree_equal (tree, tree); extern tree no_linkage_check (tree, bool); extern void debug_binfo (tree); extern tree build_dummy_object (tree); extern tree maybe_dummy_object (tree, tree *); -extern int is_dummy_object (tree); +extern int is_dummy_object (const_tree); extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); @@ -4728,7 +4728,7 @@ extern tree cp_build_reference_type (tree, bool); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) -extern special_function_kind special_function_p (tree); +extern special_function_kind special_function_p (const_tree); extern int count_trees (tree); extern int char_type_p (tree); extern void verify_stmt_tree (tree); @@ -4746,24 +4746,24 @@ extern tree cp_save_expr (tree); extern bool cast_valid_in_integral_constant_expression_p (tree); /* in typeck.c */ -extern int string_conv_p (tree, tree, int); +extern int string_conv_p (const_tree, const_tree, int); extern tree cp_truthvalue_conversion (tree); extern tree condition_conversion (tree); extern tree require_complete_type (tree); extern tree complete_type (tree); extern tree complete_type_or_else (tree, tree); -extern int type_unknown_p (tree); -extern bool comp_except_specs (tree, tree, bool); +extern int type_unknown_p (const_tree); +extern bool comp_except_specs (const_tree, const_tree, bool); extern bool comptypes (tree, tree, int); -extern bool compparms (tree, tree); -extern int comp_cv_qualification (tree, tree); +extern bool compparms (const_tree, const_tree); +extern int comp_cv_qualification (const_tree, const_tree); extern int comp_cv_qual_signature (tree, tree); extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code); extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) extern tree inline_conversion (tree); -extern tree is_bitfield_expr_with_lowered_type (tree); -extern tree unlowered_expr_type (tree); +extern tree is_bitfield_expr_with_lowered_type (const_tree); +extern tree unlowered_expr_type (const_tree); extern tree decay_conversion (tree); extern tree build_class_member_access_expr (tree, tree, tree, bool); extern tree finish_class_member_access_expr (tree, tree, bool); @@ -4790,12 +4790,12 @@ extern tree convert_for_initialization (tree, tree, tree, int, const char *, tree, int); extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); -extern int ptr_reasonably_similar (tree, tree); +extern int ptr_reasonably_similar (const_tree, const_tree); extern tree build_ptrmemfunc (tree, tree, int, bool); extern int cp_type_quals (const_tree); -extern bool cp_type_readonly (tree); -extern bool cp_has_mutable_p (tree); -extern bool at_least_as_qualified_p (tree, tree); +extern bool cp_type_readonly (const_tree); +extern bool cp_has_mutable_p (const_tree); +extern bool at_least_as_qualified_p (const_tree, const_tree); extern void cp_apply_type_quals_to_decl (int, tree); extern tree build_ptrmemfunc1 (tree, tree, tree); extern void expand_ptrmemfunc_cst (tree, tree *, tree *); @@ -4812,11 +4812,11 @@ extern tree build_address (tree); extern tree build_nop (tree, tree); extern tree non_reference (tree); extern tree lookup_anon_field (tree, tree); -extern bool invalid_nonstatic_memfn_p (tree); +extern bool invalid_nonstatic_memfn_p (const_tree); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); -extern int lvalue_or_else (tree, enum lvalue_use); -extern int lvalue_p (tree); +extern int lvalue_or_else (const_tree, enum lvalue_use); +extern int lvalue_p (const_tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index be20b12e1be..f054b662c26 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9204,7 +9204,7 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms) operator. */ int -copy_fn_p (tree d) +copy_fn_p (const_tree d) { tree args; tree arg_type; @@ -9260,7 +9260,7 @@ copy_fn_p (tree d) operator, false otherwise. */ bool -move_fn_p (tree d) +move_fn_p (const_tree d) { tree args; tree arg_type; @@ -9359,7 +9359,7 @@ void grok_special_member_properties (tree decl) if the class has a constructor of the form X(X). */ int -grok_ctor_properties (tree ctype, tree decl) +grok_ctor_properties (const_tree ctype, const_tree decl) { int ctor_parm = copy_fn_p (decl); diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 2fe0be1afc0..b6e8eeac710 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -905,7 +905,7 @@ is_admissible_throw_operand (tree expr) #include "cfns.h" int -nothrow_libfn_p (tree fn) +nothrow_libfn_p (const_tree fn) { tree id; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index f4b43a2285d..efb223780da 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1185,7 +1185,7 @@ lazily_declare_fn (special_function_kind sfk, tree type) as there are artificial parms in FN. */ tree -skip_artificial_parms_for (tree fn, tree list) +skip_artificial_parms_for (const_tree fn, tree list) { if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)) list = TREE_CHAIN (list); @@ -1203,7 +1203,7 @@ skip_artificial_parms_for (tree fn, tree list) artificial parms in FN. */ int -num_artificial_parms_for (tree fn) +num_artificial_parms_for (const_tree fn) { int count = 0; diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 190d07651de..1bbe6cb80c6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2264,10 +2264,10 @@ check_explicit_specialization (tree declarator, DECL_TEMPLATE_PARMS. */ int -comp_template_parms (tree parms1, tree parms2) +comp_template_parms (const_tree parms1, const_tree parms2) { - tree p1; - tree p2; + const_tree p1; + const_tree p2; if (parms1 == parms2) return 1; @@ -2318,7 +2318,7 @@ comp_template_parms (tree parms1, tree parms2) /* Determine whether PARM is a parameter pack. */ bool -template_parameter_pack_p (tree parm) +template_parameter_pack_p (const_tree parm) { /* Determine if we have a non-type template parameter pack. */ if (TREE_CODE (parm) == PARM_DECL) @@ -15320,7 +15320,7 @@ type_dependent_expression_p (tree expression) contains a type-dependent expression. */ bool -any_type_dependent_arguments_p (tree args) +any_type_dependent_arguments_p (const_tree args) { while (args) { @@ -15337,7 +15337,7 @@ any_type_dependent_arguments_p (tree args) expressions) contains any value-dependent expressions. */ bool -any_value_dependent_elements_p (tree list) +any_value_dependent_elements_p (const_tree list) { for (; list; list = TREE_CHAIN (list)) if (value_dependent_expression_p (TREE_VALUE (list))) @@ -15432,7 +15432,7 @@ any_template_arguments_need_structural_equality_p (tree args) any dependent arguments. */ bool -any_dependent_template_arguments_p (tree args) +any_dependent_template_arguments_p (const_tree args) { int i; int j; @@ -15444,7 +15444,7 @@ any_dependent_template_arguments_p (tree args) for (i = 0; i < TMPL_ARGS_DEPTH (args); ++i) { - tree level = TMPL_ARGS_LEVEL (args, i + 1); + const_tree level = TMPL_ARGS_LEVEL (args, i + 1); for (j = 0; j < TREE_VEC_LENGTH (level); ++j) if (dependent_template_arg_p (TREE_VEC_ELT (level, j))) return true; diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 227c1ea11aa..624d6d7bd35 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -347,7 +347,7 @@ repo_emit_p (tree decl) export from this translation unit. */ bool -repo_export_class_p (tree class_type) +repo_export_class_p (const_tree class_type) { if (!flag_use_repository) return false; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 176e6bea11a..583ce33a23b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -436,7 +436,7 @@ add_decl_expr (tree decl) declared is not an anonymous union" [class.union]. */ int -anon_aggr_type_p (tree node) +anon_aggr_type_p (const_tree node) { return ANON_AGGR_TYPE_P (node); } diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 12589c330d7..4ee3f886d25 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -43,7 +43,7 @@ static tree build_cplus_array_type_1 (tree, tree); static int list_hash_eq (const void *, const void *); static hashval_t list_hash_pieces (tree, tree, tree); static hashval_t list_hash (const void *); -static cp_lvalue_kind lvalue_p_1 (tree, int); +static cp_lvalue_kind lvalue_p_1 (const_tree, int); static tree build_target_expr (tree, tree); static tree count_trees_r (tree *, int *, void *); static tree verify_stmt_tree_r (tree *, int *, void *); @@ -58,7 +58,7 @@ static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *); nonzero, rvalues of class type are considered lvalues. */ static cp_lvalue_kind -lvalue_p_1 (tree ref, +lvalue_p_1 (const_tree ref, int treat_class_rvalues_as_lvalues) { cp_lvalue_kind op1_lvalue_kind = clk_none; @@ -223,7 +223,7 @@ lvalue_p_1 (tree ref, computes the C++ definition of lvalue. */ cp_lvalue_kind -real_lvalue_p (tree ref) +real_lvalue_p (const_tree ref) { return lvalue_p_1 (ref, /*treat_class_rvalues_as_lvalues=*/0); @@ -233,7 +233,7 @@ real_lvalue_p (tree ref) considered lvalues. */ int -lvalue_p (tree ref) +lvalue_p (const_tree ref) { return (lvalue_p_1 (ref, /*class rvalue ok*/ 1) != clk_none); @@ -243,7 +243,7 @@ lvalue_p (tree ref) constant-expression. */ bool -builtin_valid_in_constant_expr_p (tree decl) +builtin_valid_in_constant_expr_p (const_tree decl) { /* At present BUILT_IN_CONSTANT_P is the only builtin we're allowing in constant-expressions. We may want to add other builtins later. */ @@ -1673,7 +1673,7 @@ decl_namespace_context (tree decl) nested, or false otherwise. */ bool -decl_anon_ns_mem_p (tree decl) +decl_anon_ns_mem_p (const_tree decl) { while (1) { @@ -1971,9 +1971,9 @@ error_type (tree arg) /* Does FUNCTION use a variable-length argument list? */ int -varargs_function_p (tree function) +varargs_function_p (const_tree function) { - tree parm = TYPE_ARG_TYPES (TREE_TYPE (function)); + const_tree parm = TYPE_ARG_TYPES (TREE_TYPE (function)); for (; parm; parm = TREE_CHAIN (parm)) if (TREE_VALUE (parm) == void_type_node) return 0; @@ -1983,9 +1983,9 @@ varargs_function_p (tree function) /* Returns 1 if decl is a member of a class. */ int -member_p (tree decl) +member_p (const_tree decl) { - const tree ctx = DECL_CONTEXT (decl); + const_tree const ctx = DECL_CONTEXT (decl); return (ctx && TYPE_P (ctx)); } @@ -2039,7 +2039,7 @@ maybe_dummy_object (tree type, tree* binfop) /* Returns 1 if OB is a placeholder object, or a pointer to one. */ int -is_dummy_object (tree ob) +is_dummy_object (const_tree ob) { if (TREE_CODE (ob) == INDIRECT_REF) ob = TREE_OPERAND (ob, 0); @@ -2050,9 +2050,9 @@ is_dummy_object (tree ob) /* Returns 1 iff type T is a POD type, as defined in [basic.types]. */ int -pod_type_p (tree t) +pod_type_p (const_tree t) { - t = strip_array_types (t); + t = const_strip_array_types (t); if (t == error_mark_node) return 1; @@ -2087,9 +2087,9 @@ class_tmpl_impl_spec_p (const_tree t) zeros in it. */ int -zero_init_p (tree t) +zero_init_p (const_tree t) { - t = strip_array_types (t); + t = const_strip_array_types (t); if (t == error_mark_node) return 1; @@ -2420,7 +2420,7 @@ init_tree (void) predicate to test whether or not DECL is a special function. */ special_function_kind -special_function_p (tree decl) +special_function_p (const_tree decl) { /* Rather than doing all this stuff with magic names, we should probably have a field of type `special_function_kind' in diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index dce4d590c96..e996df97f1b 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -51,7 +51,7 @@ static tree cp_pointer_int_sum (enum tree_code, tree, tree); static tree rationalize_conditional_expr (enum tree_code, tree); static int comp_ptr_ttypes_real (tree, tree, int); static bool comp_except_types (tree, tree, bool); -static bool comp_array_types (tree, tree, bool); +static bool comp_array_types (const_tree, const_tree, bool); static tree pointer_diff (tree, tree, tree); static tree get_delta_difference (tree, tree, bool, bool); static void casts_away_constness_r (tree *, tree *); @@ -151,7 +151,7 @@ complete_type_or_else (tree type, tree value) /* Return truthvalue of whether type of EXP is instantiated. */ int -type_unknown_p (tree exp) +type_unknown_p (const_tree exp) { return (TREE_CODE (exp) == TREE_LIST || TREE_TYPE (exp) == unknown_type_node); @@ -820,10 +820,10 @@ comp_except_types (tree a, tree b, bool exact) we should try to make use of that. */ bool -comp_except_specs (tree t1, tree t2, bool exact) +comp_except_specs (const_tree t1, const_tree t2, bool exact) { - tree probe; - tree base; + const_tree probe; + const_tree base; int length = 0; if (t1 == t2) @@ -867,7 +867,7 @@ comp_except_specs (tree t1, tree t2, bool exact) [] can match [size]. */ static bool -comp_array_types (tree t1, tree t2, bool allow_redeclaration) +comp_array_types (const_tree t1, const_tree t2, bool allow_redeclaration) { tree d1; tree d2; @@ -1154,7 +1154,7 @@ comptypes (tree t1, tree t2, int strict) /* Returns 1 if TYPE1 is at least as qualified as TYPE2. */ bool -at_least_as_qualified_p (tree type1, tree type2) +at_least_as_qualified_p (const_tree type1, const_tree type2) { int q1 = cp_type_quals (type1); int q2 = cp_type_quals (type2); @@ -1167,7 +1167,7 @@ at_least_as_qualified_p (tree type1, tree type2) more cv-qualified that TYPE1, and 0 otherwise. */ int -comp_cv_qualification (tree type1, tree type2) +comp_cv_qualification (const_tree type1, const_tree type2) { int q1 = cp_type_quals (type1); int q2 = cp_type_quals (type2); @@ -1206,9 +1206,9 @@ comp_cv_qual_signature (tree type1, tree type2) element by element. */ bool -compparms (tree parms1, tree parms2) +compparms (const_tree parms1, const_tree parms2) { - tree t1, t2; + const_tree t1, t2; /* An unspecified parmlist matches any specified parmlist whose argument types don't need default promotions. */ @@ -1398,7 +1398,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op) violates these rules. */ bool -invalid_nonstatic_memfn_p (tree expr) +invalid_nonstatic_memfn_p (const_tree expr) { if (TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE) { @@ -1413,7 +1413,7 @@ invalid_nonstatic_memfn_p (tree expr) of the bitfield. Otherwise, return NULL_TREE. */ tree -is_bitfield_expr_with_lowered_type (tree exp) +is_bitfield_expr_with_lowered_type (const_tree exp) { switch (TREE_CODE (exp)) { @@ -1452,7 +1452,7 @@ is_bitfield_expr_with_lowered_type (tree exp) than NULL_TREE. */ tree -unlowered_expr_type (tree exp) +unlowered_expr_type (const_tree exp) { tree type; @@ -1633,7 +1633,7 @@ inline_conversion (tree exp) decay_conversion to one. */ int -string_conv_p (tree totype, tree exp, int warn) +string_conv_p (const_tree totype, const_tree exp, int warn) { tree t; @@ -6853,7 +6853,7 @@ comp_ptr_ttypes (tree to, tree from) type or inheritance-related types, regardless of cv-quals. */ int -ptr_reasonably_similar (tree to, tree from) +ptr_reasonably_similar (const_tree to, const_tree from) { for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from)) { @@ -6927,18 +6927,18 @@ cp_type_quals (const_tree type) arrays. */ bool -cp_type_readonly (tree type) +cp_type_readonly (const_tree type) { - type = strip_array_types (type); + type = const_strip_array_types (type); return TYPE_READONLY (type); } /* Returns nonzero if the TYPE contains a mutable member. */ bool -cp_has_mutable_p (tree type) +cp_has_mutable_p (const_tree type) { - type = strip_array_types (type); + type = const_strip_array_types (type); return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type); } @@ -7110,7 +7110,7 @@ non_reference (tree t) how the lvalue is being used and so selects the error message. */ int -lvalue_or_else (tree ref, enum lvalue_use use) +lvalue_or_else (const_tree ref, enum lvalue_use use) { int win = lvalue_p (ref); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 95726ff159c..590258a4740 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * trans-openmp.c (gfc_omp_privatize_by_reference): Constify. + * trans.h (gfc_omp_privatize_by_reference): Likewise. + 2007-08-24 Tobias Burnus <burnus@net-b.de> PR fortran/33178 diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 1af10369824..047c2b82ca5 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see than the DECL itself. */ bool -gfc_omp_privatize_by_reference (tree decl) +gfc_omp_privatize_by_reference (const_tree decl) { tree type = TREE_TYPE (decl); diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 829551e7b45..48bc9fce8cb 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -474,7 +474,7 @@ tree gfc_truthvalue_conversion (tree); tree gfc_builtin_function (tree); /* In trans-openmp.c */ -bool gfc_omp_privatize_by_reference (tree); +bool gfc_omp_privatize_by_reference (const_tree); enum omp_clause_default_kind gfc_omp_predetermined_sharing (tree); tree gfc_omp_clause_default_ctor (tree, tree); bool gfc_omp_disregard_value_expr (tree, bool); diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index a8702a61efb..ac7c8429fb0 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -357,8 +357,8 @@ call_alloc (void **slot, void *state_p) static int compare_ptr_data (const void *p1_p, const void *p2_p) { - struct ptr_data *p1 = *(struct ptr_data *const *)p1_p; - struct ptr_data *p2 = *(struct ptr_data *const *)p2_p; + const struct ptr_data *const p1 = *(const struct ptr_data *const *)p1_p; + const struct ptr_data *const p2 = *(const struct ptr_data *const *)p2_p; return (((size_t)p1->new_addr > (size_t)p2->new_addr) - ((size_t)p1->new_addr < (size_t)p2->new_addr)); } @@ -794,7 +794,7 @@ static htab_t loc_hash; static hashval_t hash_descriptor (const void *p) { - const struct loc_descriptor *d = p; + const struct loc_descriptor *const d = p; return htab_hash_pointer (d->function) | d->line; } @@ -802,8 +802,8 @@ hash_descriptor (const void *p) static int eq_descriptor (const void *p1, const void *p2) { - const struct loc_descriptor *d = p1; - const struct loc_descriptor *d2 = p2; + const struct loc_descriptor *const d = p1; + const struct loc_descriptor *const d2 = p2; return (d->file == d2->file && d->line == d2->line && d->function == d2->function); @@ -822,7 +822,7 @@ struct ptr_hash_entry static hashval_t hash_ptr (const void *p) { - const struct ptr_hash_entry *d = p; + const struct ptr_hash_entry *const d = p; return htab_hash_pointer (d->ptr); } @@ -830,7 +830,7 @@ hash_ptr (const void *p) static int eq_ptr (const void *p1, const void *p2) { - const struct ptr_hash_entry *p = p1; + const struct ptr_hash_entry *const p = p1; return (p->ptr == p2); } diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index ade35fc2f40..38db65f9c24 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,7 @@ +2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * lang.c (java_decl_ok_for_sibcall): Likewise. + 2007-08-21 Paul Brook <paul@codesourcery.com> Nathan Sidwell <nathan@codesourcery.com> Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/java/lang.c b/gcc/java/lang.c index dc685eb75dc..3dd7017997d 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -59,7 +59,7 @@ static int merge_init_test_initialization (void * *, void *); static int inline_init_test_initialization (void * *, void *); static bool java_dump_tree (void *, tree); static void dump_compound_expr (dump_info_p, tree); -static bool java_decl_ok_for_sibcall (tree); +static bool java_decl_ok_for_sibcall (const_tree); static tree java_get_callee_fndecl (const_tree); static void java_clear_binding_stack (void); @@ -894,7 +894,7 @@ java_dump_tree (void *dump_info, tree t) SecurityManager.getClassContext(). */ static bool -java_decl_ok_for_sibcall (tree decl) +java_decl_ok_for_sibcall (const_tree decl) { return (decl != NULL && DECL_CONTEXT (decl) == output_class && DECL_INLINE (decl)); diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 66a65a6c21e..4c4be49581d 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -59,7 +59,7 @@ extern bool lhd_warn_unused_global_decl (const_tree); extern void lhd_incomplete_type_error (const_tree, const_tree); extern tree lhd_type_promotes_to (tree); extern void lhd_register_builtin_type (tree, const char *); -extern bool lhd_decl_ok_for_sibcall (tree); +extern bool lhd_decl_ok_for_sibcall (const_tree); extern const char *lhd_comdat_group (tree); extern tree lhd_expr_size (const_tree); extern size_t lhd_tree_size (enum tree_code); @@ -204,7 +204,7 @@ extern tree lhd_make_node (enum tree_code); #define LANG_HOOKS_WRITE_GLOBALS write_global_declarations #define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall #define LANG_HOOKS_COMDAT_GROUP lhd_comdat_group -#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_tree_false +#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_const_tree_false #define LANG_HOOKS_OMP_PREDETERMINED_SHARING lhd_omp_predetermined_sharing #define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR hook_bool_tree_bool_false #define LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE hook_bool_tree_bool_false diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 8653e3abff3..2635efef6f9 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -330,7 +330,7 @@ lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED) sibcall. */ bool -lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED) +lhd_decl_ok_for_sibcall (const_tree decl ATTRIBUTE_UNUSED) { return true; } diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 338e931c6bc..2b3517e5072 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -166,7 +166,7 @@ struct lang_hooks_for_decls void (*final_write_globals) (void); /* True if this decl may be called via a sibcall. */ - bool (*ok_for_sibcall) (tree); + bool (*ok_for_sibcall) (const_tree); /* Return the COMDAT group into which this DECL should be placed. It is known that the DECL belongs in *some* COMDAT group when @@ -179,7 +179,7 @@ struct lang_hooks_for_decls /* True if OpenMP should privatize what this DECL points to rather than the DECL itself. */ - bool (*omp_privatize_by_reference) (tree); + bool (*omp_privatize_by_reference) (const_tree); /* Return sharing kind if OpenMP sharing attribute of DECL is predetermined, OMP_CLAUSE_DEFAULT_UNSPECIFIED otherwise. */ diff --git a/gcc/optabs.c b/gcc/optabs.c index bf15d4f925b..4ef28aa7c2f 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -256,7 +256,7 @@ widen_operand (rtx op, enum machine_mode mode, enum machine_mode oldmode, or division) but probably ought to be relied on more widely throughout the expander. */ optab -optab_for_tree_code (enum tree_code code, tree type) +optab_for_tree_code (enum tree_code code, const_tree type) { bool trapv; switch (code) diff --git a/gcc/optabs.h b/gcc/optabs.h index 57cc4ff2361..c5b4a3db415 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -667,7 +667,7 @@ enum can_compare_purpose /* Return the optab used for computing the given operation on the type given by the second argument. */ -extern optab optab_for_tree_code (enum tree_code, tree); +extern optab optab_for_tree_code (enum tree_code, const_tree); /* Nonzero if a compare of mode MODE can be done straightforwardly (without splitting it into pieces). */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 386013fdfde..734cd87dffd 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1663,7 +1663,7 @@ extern rtx simplify_subreg (enum machine_mode, rtx, enum machine_mode, extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode, unsigned int); extern rtx simplify_replace_rtx (rtx, const_rtx, rtx); -extern rtx simplify_rtx (rtx); +extern rtx simplify_rtx (const_rtx); extern rtx avoid_constant_pool_reference (rtx); extern bool mode_signbit_p (enum machine_mode, const_rtx); diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index d9cf023c7c2..40337a5a197 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -5019,10 +5019,10 @@ simplify_gen_subreg (enum machine_mode outermode, rtx op, simplification and 1 for tree simplification. */ rtx -simplify_rtx (rtx x) +simplify_rtx (const_rtx x) { - enum rtx_code code = GET_CODE (x); - enum machine_mode mode = GET_MODE (x); + const enum rtx_code code = GET_CODE (x); + const enum machine_mode mode = GET_MODE (x); switch (GET_RTX_CLASS (code)) { diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index f370bcd738e..6821e363bb3 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see #include "real.h" #include "fixed-value.h" -static unsigned int queue (dump_info_p, tree, int); +static unsigned int queue (dump_info_p, const_tree, int); static void dump_index (dump_info_p, unsigned int); static void dequeue_and_dump (dump_info_p); static void dump_new_line (dump_info_p); @@ -45,7 +45,7 @@ static int dump_enable_all (int, int); assigned to T. */ static unsigned int -queue (dump_info_p di, tree t, int flags) +queue (dump_info_p di, const_tree t, int flags) { dump_queue_p dq; dump_node_info_p dni; @@ -94,7 +94,7 @@ dump_index (dump_info_p di, unsigned int index) index of T is printed. */ void -queue_and_dump_index (dump_info_p di, const char *field, tree t, int flags) +queue_and_dump_index (dump_info_p di, const char *field, const_tree t, int flags) { unsigned int index; splay_tree_node n; @@ -122,7 +122,7 @@ queue_and_dump_index (dump_info_p di, const char *field, tree t, int flags) /* Dump the type of T. */ void -queue_and_dump_type (dump_info_p di, tree t) +queue_and_dump_type (dump_info_p di, const_tree t) { queue_and_dump_index (di, "type", TREE_TYPE (t), DUMP_NONE); } @@ -735,7 +735,7 @@ dequeue_and_dump (dump_info_p di) /* Return nonzero if FLAG has been specified for the dump, and NODE is not the root node of the dump. */ -int dump_flag (dump_info_p di, int flag, tree node) +int dump_flag (dump_info_p di, int flag, const_tree node) { return (di->flags & flag) && (node != di->node); } @@ -743,7 +743,7 @@ int dump_flag (dump_info_p di, int flag, tree node) /* Dump T, and all its children, on STREAM. */ void -dump_node (tree t, int flags, FILE *stream) +dump_node (const_tree t, int flags, FILE *stream) { struct dump_info di; dump_queue_p dq; diff --git a/gcc/tree-dump.h b/gcc/tree-dump.h index 311f3e1dfad..30efb10d413 100644 --- a/gcc/tree-dump.h +++ b/gcc/tree-dump.h @@ -58,7 +58,7 @@ struct dump_info /* The stream on which to dump the information. */ FILE *stream; /* The original node. */ - tree node; + const_tree node; /* User flags. */ int flags; /* The next unused node index. */ @@ -85,13 +85,13 @@ extern void dump_pointer (dump_info_p, const char *, void *); extern void dump_int (dump_info_p, const char *, int); extern void dump_string (dump_info_p, const char *); extern void dump_string_field (dump_info_p, const char *, const char *); -extern void dump_stmt (dump_info_p, tree); -extern void queue_and_dump_index (dump_info_p, const char *, tree, int); -extern void queue_and_dump_type (dump_info_p, tree); +extern void dump_stmt (dump_info_p, const_tree); +extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int); +extern void queue_and_dump_type (dump_info_p, const_tree); extern void dump_function (enum tree_dump_index, tree); extern void dump_function_to_file (tree, FILE *, int); extern void debug_function (tree, int); -extern int dump_flag (dump_info_p, int, tree); +extern int dump_flag (dump_info_p, int, const_tree); extern unsigned int dump_register (const char *, const char *, const char *, int, int); diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 339baeba349..248233553d4 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -961,7 +961,7 @@ struct tree_niter_desc /* In tree-vectorizer.c */ unsigned vectorize_loops (void); -extern bool vect_can_force_dr_alignment_p (tree, unsigned int); +extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); extern tree get_vectype_for_scalar_type (tree); /* In tree-ssa-phiopt.c */ diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 5a20772339e..fc6f1359c4d 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -78,7 +78,7 @@ extern int dump_enabled_p (enum tree_dump_index); extern int dump_initialized_p (enum tree_dump_index); extern FILE *dump_begin (enum tree_dump_index, int *); extern void dump_end (enum tree_dump_index, FILE *); -extern void dump_node (tree, int, FILE *); +extern void dump_node (const_tree, int, FILE *); extern int dump_switch_p (const char *); extern const char *dump_flag_name (enum tree_dump_index); diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 3323dc3825d..2c525eaaa71 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1583,7 +1583,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts) on ALIGNMENT bit boundary. */ bool -vect_can_force_dr_alignment_p (tree decl, unsigned int alignment) +vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment) { if (TREE_CODE (decl) != VAR_DECL) return false; @@ -2061,7 +2061,7 @@ supportable_widening_operation (enum tree_code code, tree stmt, tree vectype, bool supportable_narrowing_operation (enum tree_code code, - tree stmt, tree vectype, + const_tree stmt, const_tree vectype, enum tree_code *code1) { enum machine_mode vec_mode; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index ad7ccea4b23..1dd472c3e2d 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -506,14 +506,14 @@ extern bool vect_is_simple_use (tree, loop_vec_info, tree *, tree *, enum vect_def_type *); extern bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *); extern tree vect_is_simple_reduction (loop_vec_info, tree); -extern bool vect_can_force_dr_alignment_p (tree, unsigned int); +extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int); extern enum dr_alignment_support vect_supportable_dr_alignment (struct data_reference *); extern bool reduction_code_for_scalar_code (enum tree_code, enum tree_code *); extern bool supportable_widening_operation (enum tree_code, tree, tree, tree *, tree *, enum tree_code *, enum tree_code *); -extern bool supportable_narrowing_operation (enum tree_code, tree, tree, - enum tree_code *); +extern bool supportable_narrowing_operation (enum tree_code, const_tree, + const_tree, enum tree_code *); /* Creation and deletion of loop and stmt info structs. */ extern loop_vec_info new_loop_vec_info (struct loop *loop); diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 40d2264dfdd..dfb28203948 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -107,7 +107,7 @@ static int *vr_phi_edge_counts; TYPE_{MIN,MAX}_VALUE. */ static inline bool -needs_overflow_infinity (tree type) +needs_overflow_infinity (const_tree type) { return INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type); } @@ -119,7 +119,7 @@ needs_overflow_infinity (tree type) VARYING. */ static inline bool -supports_overflow_infinity (tree type) +supports_overflow_infinity (const_tree type) { #ifdef ENABLE_CHECKING gcc_assert (needs_overflow_infinity (type)); @@ -169,7 +169,7 @@ positive_overflow_infinity (tree type) /* Return whether VAL is a negative overflow infinity. */ static inline bool -is_negative_overflow_infinity (tree val) +is_negative_overflow_infinity (const_tree val) { return (needs_overflow_infinity (TREE_TYPE (val)) && CONSTANT_CLASS_P (val) @@ -180,7 +180,7 @@ is_negative_overflow_infinity (tree val) /* Return whether VAL is a positive overflow infinity. */ static inline bool -is_positive_overflow_infinity (tree val) +is_positive_overflow_infinity (const_tree val) { return (needs_overflow_infinity (TREE_TYPE (val)) && CONSTANT_CLASS_P (val) @@ -191,7 +191,7 @@ is_positive_overflow_infinity (tree val) /* Return whether VAL is a positive or negative overflow infinity. */ static inline bool -is_overflow_infinity (tree val) +is_overflow_infinity (const_tree val) { return (needs_overflow_infinity (TREE_TYPE (val)) && CONSTANT_CLASS_P (val) @@ -229,7 +229,7 @@ avoid_overflow_infinity (tree val) to the integer constant with the same value in the type. */ static inline bool -vrp_val_is_max (tree val) +vrp_val_is_max (const_tree val) { tree type_max = TYPE_MAX_VALUE (TREE_TYPE (val)); @@ -242,7 +242,7 @@ vrp_val_is_max (tree val) will be true for a negative overflow infinity. */ static inline bool -vrp_val_is_min (tree val) +vrp_val_is_min (const_tree val) { tree type_min = TYPE_MIN_VALUE (TREE_TYPE (val)); @@ -256,7 +256,7 @@ vrp_val_is_min (tree val) current function signature. */ static bool -nonnull_arg_p (tree arg) +nonnull_arg_p (const_tree arg) { tree t, attrs, fntype; unsigned HOST_WIDE_INT arg_num; @@ -462,7 +462,7 @@ set_value_range_to_undefined (value_range_t *vr) return NULL. Otherwise create an empty range if none existed for VAR. */ static value_range_t * -get_value_range (tree var) +get_value_range (const_tree var) { value_range_t *vr; tree sym; @@ -504,7 +504,7 @@ get_value_range (tree var) /* Return true, if VAL1 and VAL2 are equal values for VRP purposes. */ static inline bool -vrp_operand_equal_p (tree val1, tree val2) +vrp_operand_equal_p (const_tree val1, const_tree val2) { if (val1 == val2) return true; @@ -536,7 +536,7 @@ vrp_bitmap_equal_p (const_bitmap b1, const_bitmap b2) is the range object associated with another SSA name. */ static inline bool -update_value_range (tree var, value_range_t *new_vr) +update_value_range (const_tree var, value_range_t *new_vr) { value_range_t *old_vr; bool is_new; @@ -562,7 +562,7 @@ update_value_range (tree var, value_range_t *new_vr) point where equivalence processing can be turned on/off. */ static void -add_equivalence (bitmap *equiv, tree var) +add_equivalence (bitmap *equiv, const_tree var) { unsigned ver = SSA_NAME_VERSION (var); value_range_t *vr = vr_value[ver]; @@ -1044,7 +1044,7 @@ range_includes_zero_p (value_range_t *vr) false otherwise or if no value range information is available. */ bool -ssa_name_nonnegative_p (tree t) +ssa_name_nonnegative_p (const_tree t) { value_range_t *vr = get_value_range (t); @@ -1066,7 +1066,7 @@ ssa_name_nonnegative_p (tree t) false otherwise or if no value range information is available. */ bool -ssa_name_nonzero_p (tree t) +ssa_name_nonzero_p (const_tree t) { value_range_t *vr = get_value_range (t); @@ -3252,7 +3252,7 @@ build_assert_expr_for (tree cond, tree v) point values. */ static inline bool -fp_predicate (tree expr) +fp_predicate (const_tree expr) { return (COMPARISON_CLASS_P (expr) && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0)))); diff --git a/gcc/tree.c b/gcc/tree.c index dbc13af71b1..febe90d5cc3 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -6359,7 +6359,7 @@ get_type_static_bounds (const_tree type, mpz_t min, mpz_t max) variable defined in function FN. */ bool -auto_var_in_fn_p (tree var, tree fn) +auto_var_in_fn_p (const_tree var, const_tree fn) { return (DECL_P (var) && DECL_CONTEXT (var) == fn && (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL) @@ -8642,10 +8642,10 @@ walk_tree_without_duplicates_1 (tree *tp, walk_tree_fn func, void *data, empty statements. */ bool -empty_body_p (tree stmt) +empty_body_p (const_tree stmt) { - tree_stmt_iterator i; - tree body; + const_tree_stmt_iterator i; + const_tree body; if (IS_EMPTY_STMT (stmt)) return true; @@ -8656,8 +8656,8 @@ empty_body_p (tree stmt) else return false; - for (i = tsi_start (body); !tsi_end_p (i); tsi_next (&i)) - if (!empty_body_p (tsi_stmt (i))) + for (i = ctsi_start (body); !ctsi_end_p (i); ctsi_next (&i)) + if (!empty_body_p (ctsi_stmt (i))) return false; return true; diff --git a/gcc/tree.h b/gcc/tree.h index 921bfad66a3..45dd8d17890 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4606,11 +4606,11 @@ extern bool commutative_tree_code (enum tree_code); extern tree upper_bound_in_type (tree, tree); extern tree lower_bound_in_type (tree, tree); extern int operand_equal_for_phi_arg_p (const_tree, const_tree); -extern bool empty_body_p (tree); +extern bool empty_body_p (const_tree); extern tree call_expr_arg (tree, int); extern tree *call_expr_argp (tree, int); extern tree call_expr_arglist (tree); -extern bool auto_var_in_fn_p (tree, tree); +extern bool auto_var_in_fn_p (const_tree, const_tree); /* In stmt.c */ @@ -5142,8 +5142,8 @@ extern tree tree_mem_ref_addr (tree, tree); extern void copy_mem_ref_info (tree, tree); /* In tree-vrp.c */ -extern bool ssa_name_nonzero_p (tree); -extern bool ssa_name_nonnegative_p (tree); +extern bool ssa_name_nonzero_p (const_tree); +extern bool ssa_name_nonnegative_p (const_tree); /* In tree-object-size.c. */ extern void init_object_sizes (void); |