diff options
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.c | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 18 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/cp/tree.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 4 |
7 files changed, 33 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6e7bd96..c2b043f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size): + Constify. + * cp-tree.h (local_variable_p, nonstatic_local_decl_p, + class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals, + cxx_incomplete_type_diagnostic, cxx_incomplete_type_error, + cxx_warn_unused_global_decl, cp_expr_size): Likewise. + * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise. + * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise. + * typeck.c (cp_type_quals): Likewise. + * typeck2.c (cxx_incomplete_type_diagnostic, + cxx_incomplete_type_error): Likewise. + 2007-08-16 Paolo Carlini <pcarlini@suse.de> PR c++/31132 diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index a4c63f1..b83ef36 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -53,7 +53,7 @@ cxx_get_alias_set (tree t) /* Called from check_global_declarations. */ bool -cxx_warn_unused_global_decl (tree decl) +cxx_warn_unused_global_decl (const_tree decl) { if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) return false; @@ -72,7 +72,7 @@ cxx_warn_unused_global_decl (tree decl) might have allocated something there. */ tree -cp_expr_size (tree exp) +cp_expr_size (const_tree exp) { tree type = TREE_TYPE (exp); diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9a28ac1..a80fbad 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4250,8 +4250,8 @@ extern tree create_implicit_typedef (tree, tree); extern tree maybe_push_decl (tree); extern tree force_target_expr (tree, tree); extern tree build_target_expr_with_type (tree, tree); -extern int local_variable_p (tree); -extern int nonstatic_local_decl_p (tree); +extern int local_variable_p (const_tree); +extern int nonstatic_local_decl_p (const_tree); extern tree register_dtor_fn (tree); extern tmpl_spec_kind current_tmpl_spec_kind (int); extern tree cp_fname_init (const char *, tree *); @@ -4681,7 +4681,7 @@ 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 bool class_tmpl_impl_spec_p (tree); +extern bool class_tmpl_impl_spec_p (const_tree); extern int zero_init_p (tree); extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, @@ -4737,7 +4737,7 @@ extern linkage_kind decl_linkage (tree); extern tree cp_walk_subtrees (tree*, int*, walk_tree_fn, void*, struct pointer_set_t*); extern int cp_cannot_inline_tree_fn (tree*); -extern int cp_auto_var_in_fn_p (tree,tree); +extern int cp_auto_var_in_fn_p (const_tree, const_tree); extern tree fold_if_not_in_template (tree); extern tree rvalue (tree); extern tree convert_bitfield_to_declared_type (tree); @@ -4791,7 +4791,7 @@ extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (tree, tree); extern tree build_ptrmemfunc (tree, tree, int, bool); -extern int cp_type_quals (tree); +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); @@ -4819,9 +4819,9 @@ extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); -extern void cxx_incomplete_type_diagnostic (tree, tree, int); +extern void cxx_incomplete_type_diagnostic (const_tree, const_tree, int); #undef cxx_incomplete_type_error -extern void cxx_incomplete_type_error (tree, tree); +extern void cxx_incomplete_type_error (const_tree, const_tree); #define cxx_incomplete_type_error(V,T) \ (cxx_incomplete_type_diagnostic ((V), (T), 0)) extern tree error_not_base_type (tree, tree); @@ -4859,8 +4859,8 @@ extern bool cp_dump_tree (void *, tree); /* In cp/cp-objcp-common.c. */ extern alias_set_type cxx_get_alias_set (tree); -extern bool cxx_warn_unused_global_decl (tree); -extern tree cp_expr_size (tree); +extern bool cxx_warn_unused_global_decl (const_tree); +extern tree cp_expr_size (const_tree); extern size_t cp_tree_size (enum tree_code); extern bool cp_var_mod_type_p (tree, tree); extern void cxx_initialize_diagnostics (struct diagnostic_context *); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b04fda3..6172296 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8962,7 +8962,7 @@ require_complete_types_for_parms (tree parms) /* Returns nonzero if T is a local variable. */ int -local_variable_p (tree t) +local_variable_p (const_tree t) { if ((TREE_CODE (t) == VAR_DECL /* A VAR_DECL with a context that is a _TYPE is a static data @@ -8981,7 +8981,7 @@ local_variable_p (tree t) containing them is duplicated.) */ int -nonstatic_local_decl_p (tree t) +nonstatic_local_decl_p (const_tree t) { return ((local_variable_p (t) && !TREE_STATIC (t)) || TREE_CODE (t) == LABEL_DECL diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 081a454..792f1fd 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2077,7 +2077,7 @@ pod_type_p (tree t) /* Nonzero iff type T is a class template implicit specialization. */ bool -class_tmpl_impl_spec_p (tree t) +class_tmpl_impl_spec_p (const_tree t) { return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t); } @@ -2453,7 +2453,7 @@ cp_cannot_inline_tree_fn (tree* fnp) function FN. */ int -cp_auto_var_in_fn_p (tree var, tree fn) +cp_auto_var_in_fn_p (const_tree var, const_tree fn) { return (DECL_P (var) && DECL_CONTEXT (var) == fn && nonstatic_local_decl_p (var)); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a79f6e2..b4d7016 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6910,9 +6910,9 @@ comp_ptr_ttypes_const (tree to, tree from) elements for an array type. */ int -cp_type_quals (tree type) +cp_type_quals (const_tree type) { - type = strip_array_types (type); + type = const_strip_array_types (type); if (type == error_mark_node) return TYPE_UNQUALIFIED; return TYPE_QUALS (type); diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index f1c3c32..53e2202 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -336,7 +336,7 @@ abstract_virtuals_error (tree decl, tree type) pedwarn. */ void -cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) +cxx_incomplete_type_diagnostic (const_tree value, const_tree type, int diag_type) { int decl = 0; void (*p_msg) (const char *, ...) ATTRIBUTE_GCC_CXXDIAG(1,2); @@ -427,7 +427,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) required by ../tree.c. */ #undef cxx_incomplete_type_error void -cxx_incomplete_type_error (tree value, tree type) +cxx_incomplete_type_error (const_tree value, const_tree type) { cxx_incomplete_type_diagnostic (value, type, 0); } |