summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-25 19:06:06 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-25 19:06:06 +0000
commitaae87fc346d89bc5cf107a45dd5bade361b16533 (patch)
tree376f2dafdfe0716aa1dd01defc992cc04d880df7 /gcc/cp
parentcd1a57f0b0d38631f96e9828703588625e515cbe (diff)
downloadgcc-aae87fc346d89bc5cf107a45dd5bade361b16533.tar.gz
* c-common.c (fname_as_string, c_type_hash): Constify.
* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * cgraph.c (edge_hash, edge_eq): Likewise. * dwarf2out.c (decl_die_table_eq, decl_loc_table_eq): Likewise. * emit-rtl.c (mem_attrs_htab_eq, reg_attrs_htab_hash, reg_attrs_htab_eq): Likewise. * except.c (t2r_eq, t2r_hash, ttypes_filter_eq, ehl_hash, ehl_eq): Likewise. * genautomata.c (const_reserv_sets_t, const_unit_decl_t, const_decl_t, const_state_t, const_automata_list_el_t): New. (first_out_arc, DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, DECL_EXCL, DECL_PRESENCE, DECL_ABSENCE, DECL_RESERV, DECL_INSN_RESERV, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, alt_state_cmp, reserv_sets_cmp, reserv_sets_eq, state_hash, state_eq_p, automata_list_hash, automata_list_eq_p, compare_states_for_equiv, compare_max_occ_cycle_nums, out_state_arcs_num, compare_transition_els_num, units_cmp, state_reservs_cmp): Constify. * genmodes.c (cmp_modes): Likewise. * ggc-common.c (saving_htab_hash, saving_htab_eq): Likewise. * gimplify.c (compare_case_labels): Likewise. * ipa-type-escape.c (get_name_of_type, type_brand_s): Likewise. * loop-unroll.c (si_info_hash, ve_info_hash): Likewise. * matrix-reorg.c (mtt_info_hash): Likewise. * postreload-gcse.c (hash_expr_for_htab, expr_equiv_p): Likewise. * rtl-factoring.c (const_p_hash_bucket, const_p_hash_elem): New. (htab_hash_bucket, htab_hash_elem): Constify. * tree-browser.c (TB_parent_eq): Likewise. * tree-scalar-evolution.c (hash_scev_info): Likewise. * tree-ssa-alias.c (sort_tags_by_id): Likewise. * tree-ssa-coalesce.c (const_coalesce_pair_p): New. (coalesce_pair_map_hash, coalesce_pair_map_eq, compare_pairs): Constify. * tree-ssa-dom.c (avail_expr_hash, avail_expr_eq): Likewise. * tree-ssa-pre.c (const_expr_pred_trans_t): New. (expr_pred_trans_hash, expr_pred_trans_eq): Constify. * tree-ssa-sccvn.c (const_vn_binary_op_t, const_vn_unary_op_t, const_vn_phi_t, const_vn_reference_op_t, const_vn_reference_t): New. (vn_reference_op_eq, vn_reference_hash, vn_reference_eq, vn_unary_op_hash, vn_unary_op_eq, vn_binary_op_hash, vn_binary_op_eq, vn_phi_hash, vn_phi_eq): Constify. * tree-ssa-threadupdate.c (redirection_data_hash, redirection_data_eq): Likewise. * tree-ssa-uncprop.c (equiv_hash, equiv_eq): Likewise. * tree-ssa.c (var_ann_eq): Likewise. * tree-vrp.c (compare_case_labels): Likewise. * tree.c (int_cst_hash_hash, int_cst_hash_eq, tree_map_base_marked_p, type_hash_marked_p, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, omp_clause_check_failed, omp_clause_range_check_failed, tree_contains_struct_check_failed, tree_operand_check_failed): Likewise. * tree.h (tree_contains_struct_check_failed, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, tree_operand_check_failed, omp_clause_operand_check_failed, tree_operand_length): Likewise. * var-tracking.c (const_variable): New. (variable_htab_hash, variable_htab_eq): Constify. * varasm.c (const_desc_hash): Likewise. cp: * decl.c (typename_hash, typename_compare): Constify. * mangle.c (hash_type, compare_type): Likewise. * pt.c (eq_local_specializations, hash_local_specialization): Likewise. * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq, list_hash): Likewise. * typeck2.c (pat_compare): Likewise. fortran: * gfortran.h (generate_isocbinding_symbol): Constify. * symbol.c (gen_special_c_interop_ptr, gen_cptr_param, generate_isocbinding_symbol): Likewise. java: * class.c (java_treetreehash_hash, java_treetreehash_compare): Constify. * expr.c (type_assertion_eq): Likewise. * jcf-io.c (compare_path): Likewise. * jcf-parse.c (cmpstringp): Likewise. * verify-impl.c (get_one_type, compute_argument_types, compute_return_type): Likewise. objc: * objc-act.c (volatilized_hash, volatilized_eq, string_hash, string_eq): Constify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/decl.c9
-rw-r--r--gcc/cp/mangle.c4
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/cp/tree.c12
-rw-r--r--gcc/cp/typeck2.c4
6 files changed, 25 insertions, 18 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 456e5878790..cc423ede4ed 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * decl.c (typename_hash, typename_compare): Constify.
+ * mangle.c (hash_type, compare_type): Likewise.
+ * pt.c (eq_local_specializations, hash_local_specialization):
+ Likewise.
+ * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
+ list_hash): Likewise.
+ * typeck2.c (pat_compare): Likewise.
+
2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
* method.c (implicitly_declare_fn): Increase alignment if member
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e3c70a5c439..3262a310ca3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2716,7 +2716,7 @@ static hashval_t
typename_hash (const void* k)
{
hashval_t hash;
- tree t = (tree) k;
+ const_tree const t = (const_tree) k;
hash = (htab_hash_pointer (TYPE_CONTEXT (t))
^ htab_hash_pointer (DECL_NAME (TYPE_NAME (t))));
@@ -2738,11 +2738,8 @@ typedef struct typename_info {
static int
typename_compare (const void * k1, const void * k2)
{
- tree t1;
- const typename_info *t2;
-
- t1 = (tree) k1;
- t2 = (const typename_info *) k2;
+ const_tree const t1 = (const_tree) k1;
+ const typename_info *const t2 = (const typename_info *) k2;
return (DECL_NAME (TYPE_NAME (t1)) == t2->name
&& TYPE_CONTEXT (t1) == t2->scope
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 5452f6cce79..d708a2bf1f7 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2836,7 +2836,7 @@ static GTY ((param_is (union tree_node))) htab_t conv_type_names;
static hashval_t
hash_type (const void *val)
{
- return (hashval_t) TYPE_UID (TREE_TYPE ((tree) val));
+ return (hashval_t) TYPE_UID (TREE_TYPE ((const_tree) val));
}
/* Compare VAL1 (a node in the table) with VAL2 (a TYPE). */
@@ -2844,7 +2844,7 @@ hash_type (const void *val)
static int
compare_type (const void *val1, const void *val2)
{
- return TREE_TYPE ((tree) val1) == (tree) val2;
+ return TREE_TYPE ((const_tree) val1) == (const_tree) val2;
}
/* Return an identifier for the mangled unqualified name for a
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 86b8eee6a10..fc5af163e1c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1302,7 +1302,7 @@ reregister_specialization (tree spec, tree tmpl, tree new_spec)
static int
eq_local_specializations (const void *p1, const void *p2)
{
- return TREE_VALUE ((tree) p1) == (tree) p2;
+ return TREE_VALUE ((const_tree) p1) == (const_tree) p2;
}
/* Hash P1, an entry in the local specializations table. */
@@ -1310,7 +1310,7 @@ eq_local_specializations (const void *p1, const void *p2)
static hashval_t
hash_local_specialization (const void* p1)
{
- return htab_hash_pointer (TREE_VALUE ((tree) p1));
+ return htab_hash_pointer (TREE_VALUE ((const_tree) p1));
}
/* Like register_specialization, but for local declarations. We are
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index dceb3f9fff2..772df4cd8f8 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -489,7 +489,7 @@ static hashval_t
cplus_array_hash (const void* k)
{
hashval_t hash;
- tree t = (tree) k;
+ const_tree const t = (const_tree) k;
hash = (htab_hash_pointer (TREE_TYPE (t))
^ htab_hash_pointer (TYPE_DOMAIN (t)));
@@ -508,8 +508,8 @@ typedef struct cplus_array_info {
static int
cplus_array_compare (const void * k1, const void * k2)
{
- tree t1 = (tree) k1;
- const cplus_array_info *t2 = (const cplus_array_info*) k2;
+ const_tree const t1 = (const_tree) k1;
+ const cplus_array_info *const t2 = (const cplus_array_info*) k2;
if (!comptypes (TREE_TYPE (t1), t2->type, COMPARE_STRUCTURAL))
return 0;
@@ -967,8 +967,8 @@ struct list_proxy
static int
list_hash_eq (const void* entry, const void* data)
{
- tree t = (tree) entry;
- struct list_proxy *proxy = (struct list_proxy *) data;
+ const_tree const t = (const_tree) entry;
+ const struct list_proxy *const proxy = (const struct list_proxy *) data;
return (TREE_VALUE (t) == proxy->value
&& TREE_PURPOSE (t) == proxy->purpose
@@ -1003,7 +1003,7 @@ list_hash_pieces (tree purpose, tree value, tree chain)
static hashval_t
list_hash (const void* p)
{
- tree t = (tree) p;
+ const_tree const t = (const_tree) p;
return list_hash_pieces (TREE_PURPOSE (t),
TREE_VALUE (t),
TREE_CHAIN (t));
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 14d9963f61c..10f410c8ea8 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -149,9 +149,9 @@ pat_calc_hash (const void* val)
static int
pat_compare (const void* val1, const void* val2)
{
- const struct pending_abstract_type *pat1 =
+ const struct pending_abstract_type *const pat1 =
(const struct pending_abstract_type *) val1;
- tree type2 = (tree)val2;
+ const_tree const type2 = (const_tree)val2;
return (pat1->type == type2);
}