summaryrefslogtreecommitdiffstats
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog42
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/cp-gimplify.c4
-rw-r--r--gcc/cp/cp-objcp-common.c2
-rw-r--r--gcc/cp/cp-tree.h80
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/except.c2
-rw-r--r--gcc/cp/method.c4
-rw-r--r--gcc/cp/pt.c16
-rw-r--r--gcc/cp/repo.c2
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/tree.c32
-rw-r--r--gcc/cp/typeck.c40
14 files changed, 139 insertions, 97 deletions
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);
OpenPOWER on IntegriCloud