summaryrefslogtreecommitdiff
path: root/gcc/tree.c
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/tree.c
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/tree.c')
-rw-r--r--gcc/tree.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 8a1b242924c..2bd45b7e959 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -811,7 +811,7 @@ build_int_cst_wide_type (tree type,
static hashval_t
int_cst_hash_hash (const void *x)
{
- tree t = (tree) x;
+ const_tree const t = (const_tree) x;
return (TREE_INT_CST_HIGH (t) ^ TREE_INT_CST_LOW (t)
^ htab_hash_pointer (TREE_TYPE (t)));
@@ -823,8 +823,8 @@ int_cst_hash_hash (const void *x)
static int
int_cst_hash_eq (const void *x, const void *y)
{
- tree xt = (tree) x;
- tree yt = (tree) y;
+ const_tree const xt = (const_tree) x;
+ const_tree const yt = (const_tree) y;
return (TREE_TYPE (xt) == TREE_TYPE (yt)
&& TREE_INT_CST_HIGH (xt) == TREE_INT_CST_HIGH (yt)
@@ -4263,7 +4263,7 @@ tree_map_base_hash (const void *item)
int
tree_map_base_marked_p (const void *p)
{
- return ggc_marked_p (((struct tree_map_base *) p)->from);
+ return ggc_marked_p (((const struct tree_map_base *) p)->from);
}
unsigned int
@@ -4686,7 +4686,7 @@ type_hash_canon (unsigned int hashcode, tree type)
static int
type_hash_marked_p (const void *p)
{
- tree type = ((struct type_hash *) p)->type;
+ const_tree const type = ((const struct type_hash *) p)->type;
return ggc_marked_p (type) || TYPE_SYMTAB_POINTER (type);
}
@@ -6707,11 +6707,11 @@ get_file_function_name (const char *type)
are of the caller. */
void
-tree_check_failed (const tree node, const char *file,
+tree_check_failed (const_tree node, const char *file,
int line, const char *function, ...)
{
va_list args;
- char *buffer;
+ const char *buffer;
unsigned length = 0;
int code;
@@ -6721,23 +6721,24 @@ tree_check_failed (const tree node, const char *file,
va_end (args);
if (length)
{
+ char *tmp;
va_start (args, function);
length += strlen ("expected ");
- buffer = alloca (length);
+ buffer = tmp = alloca (length);
length = 0;
while ((code = va_arg (args, int)))
{
const char *prefix = length ? " or " : "expected ";
- strcpy (buffer + length, prefix);
+ strcpy (tmp + length, prefix);
length += strlen (prefix);
- strcpy (buffer + length, tree_code_name[code]);
+ strcpy (tmp + length, tree_code_name[code]);
length += strlen (tree_code_name[code]);
}
va_end (args);
}
else
- buffer = (char *)"unexpected node";
+ buffer = "unexpected node";
internal_error ("tree check: %s, have %s in %s, at %s:%d",
buffer, tree_code_name[TREE_CODE (node)],
@@ -6749,7 +6750,7 @@ tree_check_failed (const tree node, const char *file,
the caller. */
void
-tree_not_check_failed (const tree node, const char *file,
+tree_not_check_failed (const_tree node, const char *file,
int line, const char *function, ...)
{
va_list args;
@@ -6785,7 +6786,7 @@ tree_not_check_failed (const tree node, const char *file,
code, given in CL. */
void
-tree_class_check_failed (const tree node, const enum tree_code_class cl,
+tree_class_check_failed (const_tree node, const enum tree_code_class cl,
const char *file, int line, const char *function)
{
internal_error
@@ -6799,7 +6800,7 @@ tree_class_check_failed (const tree node, const enum tree_code_class cl,
dozen codes, use the knowledge that they're all sequential. */
void
-tree_range_check_failed (const tree node, const char *file, int line,
+tree_range_check_failed (const_tree node, const char *file, int line,
const char *function, enum tree_code c1,
enum tree_code c2)
{
@@ -6834,7 +6835,7 @@ tree_range_check_failed (const tree node, const char *file, int line,
not have the specified code, given in CL. */
void
-tree_not_class_check_failed (const tree node, const enum tree_code_class cl,
+tree_not_class_check_failed (const_tree node, const enum tree_code_class cl,
const char *file, int line, const char *function)
{
internal_error
@@ -6848,7 +6849,7 @@ tree_not_class_check_failed (const tree node, const enum tree_code_class cl,
/* Similar to tree_check_failed but applied to OMP_CLAUSE codes. */
void
-omp_clause_check_failed (const tree node, const char *file, int line,
+omp_clause_check_failed (const_tree node, const char *file, int line,
const char *function, enum omp_clause_code code)
{
internal_error ("tree check: expected omp_clause %s, have %s in %s, at %s:%d",
@@ -6860,7 +6861,7 @@ omp_clause_check_failed (const tree node, const char *file, int line,
/* Similar to tree_range_check_failed but applied to OMP_CLAUSE codes. */
void
-omp_clause_range_check_failed (const tree node, const char *file, int line,
+omp_clause_range_check_failed (const_tree node, const char *file, int line,
const char *function, enum omp_clause_code c1,
enum omp_clause_code c2)
{
@@ -6905,7 +6906,7 @@ static const char *ts_enum_names[] = {
whether CODE contains the tree structure identified by EN. */
void
-tree_contains_struct_check_failed (const tree node,
+tree_contains_struct_check_failed (const_tree node,
const enum tree_node_structure_enum en,
const char *file, int line,
const char *function)
@@ -6945,7 +6946,7 @@ phi_node_elt_check_failed (int idx, int len, const char *file, int line,
vector of an expression node EXP. */
void
-tree_operand_check_failed (int idx, tree exp, const char *file,
+tree_operand_check_failed (int idx, const_tree exp, const char *file,
int line, const char *function)
{
int code = TREE_CODE (exp);