aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-07-25 18:14:57 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-07-25 18:14:57 +0000
commit5f754896d3ba9d28ba6bf94923e5e1564cbf4e36 (patch)
tree91c0ebb0129c4f641a66d0cade0a407bc339ef78 /gcc/dwarf2out.c
parentd6076cee31d17b12ff898b4084a4184e646dbfc3 (diff)
downloadgcc-5f754896d3ba9d28ba6bf94923e5e1564cbf4e36.zip
gcc-5f754896d3ba9d28ba6bf94923e5e1564cbf4e36.tar.gz
gcc-5f754896d3ba9d28ba6bf94923e5e1564cbf4e36.tar.bz2
c-lex.c (c_lex_with_flags, lex_string): Constify.
* c-lex.c (c_lex_with_flags, lex_string): Constify. * c-ppoutput.c (print_line, pp_dir_change): Likewise. * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * cfg.c (bb_copy_original_hash, bb_copy_original_eq): Likewise. * cfgloop.c (loop_exit_hash, loop_exit_eq): Likewise. * ddg.c (compare_sccs): Likewise. * df-scan.c (df_ref_compare, df_mw_compare): Likewise. * dfp.c (decimal_real_from_string, decimal_to_decnumber, decimal_to_binary, decimal_do_compare, decimal_real_to_decimal, decimal_do_fix_trunc, decimal_real_to_integer, decimal_real_to_integer2, decimal_real_maxval): Likewise. * dse.c (const_group_info_t): New. (invariant_group_base_eq, invariant_group_base_hash): Constify. * dwarf2out.c (const_dw_die_ref): New. (decl_die_table_hash, decl_die_table_eq, file_info_cmp): Constify. * tree-browser.c (TB_parent_eq): Likewise. * unwind-dw2-fde.c (__register_frame_info_bases, __deregister_frame_info_bases, fde_unencoded_compare, fde_split, add_fdes, linear_search_fdes, binary_search_unencoded_fdes): Likewise. * unwind-dw2-fde.h (get_cie, next_fde): Likewise. * unwind-dw2.c (uw_frame_state_for): Likewise. * value-prof.c (histogram_hash, histogram_eq): Likewise. * value-prof.h (const_histogram_value): New. From-SVN: r126920
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 974419f..5b67962 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2700,6 +2700,7 @@ struct dwarf_file_data GTY(())
typedef struct dw_val_struct *dw_val_ref;
typedef struct die_struct *dw_die_ref;
+typedef const struct die_struct *const_dw_die_ref;
typedef struct dw_loc_descr_struct *dw_loc_descr_ref;
typedef struct dw_loc_list_struct *dw_loc_list_ref;
@@ -5685,7 +5686,7 @@ equate_type_number_to_die (tree type, dw_die_ref type_die)
static hashval_t
decl_die_table_hash (const void *x)
{
- return (hashval_t) ((const dw_die_ref) x)->decl_id;
+ return (hashval_t) ((const_dw_die_ref) x)->decl_id;
}
/* Return nonzero if decl_id of die_struct X is the same as UID of decl *Y. */
@@ -5693,7 +5694,7 @@ decl_die_table_hash (const void *x)
static int
decl_die_table_eq (const void *x, const void *y)
{
- return (((const dw_die_ref) x)->decl_id == DECL_UID ((const tree) y));
+ return (((const_dw_die_ref) x)->decl_id == DECL_UID ((const tree) y));
}
/* Return the DIE associated with a given declaration. */
@@ -7778,8 +7779,8 @@ file_info_cmp (const void *p1, const void *p2)
{
const struct file_info *s1 = p1;
const struct file_info *s2 = p2;
- unsigned char *cp1;
- unsigned char *cp2;
+ const unsigned char *cp1;
+ const unsigned char *cp2;
/* Take care of file names without directories. We need to make sure that
we return consistent values to qsort since some will get confused if
@@ -7789,18 +7790,18 @@ file_info_cmp (const void *p1, const void *p2)
if ((s1->path == s1->fname || s2->path == s2->fname))
return (s2->path == s2->fname) - (s1->path == s1->fname);
- cp1 = (unsigned char *) s1->path;
- cp2 = (unsigned char *) s2->path;
+ cp1 = (const unsigned char *) s1->path;
+ cp2 = (const unsigned char *) s2->path;
while (1)
{
++cp1;
++cp2;
/* Reached the end of the first path? If so, handle like above. */
- if ((cp1 == (unsigned char *) s1->fname)
- || (cp2 == (unsigned char *) s2->fname))
- return ((cp2 == (unsigned char *) s2->fname)
- - (cp1 == (unsigned char *) s1->fname));
+ if ((cp1 == (const unsigned char *) s1->fname)
+ || (cp2 == (const unsigned char *) s2->fname))
+ return ((cp2 == (const unsigned char *) s2->fname)
+ - (cp1 == (const unsigned char *) s1->fname));
/* Character of current path component the same? */
else if (*cp1 != *cp2)