diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2007-07-25 18:14:57 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2007-07-25 18:14:57 +0000 |
commit | 5f754896d3ba9d28ba6bf94923e5e1564cbf4e36 (patch) | |
tree | 91c0ebb0129c4f641a66d0cade0a407bc339ef78 /gcc/unwind-dw2-fde.c | |
parent | d6076cee31d17b12ff898b4084a4184e646dbfc3 (diff) | |
download | gcc-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/unwind-dw2-fde.c')
-rw-r--r-- | gcc/unwind-dw2-fde.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c index 880ba51..d5dcad7 100644 --- a/gcc/unwind-dw2-fde.c +++ b/gcc/unwind-dw2-fde.c @@ -79,7 +79,7 @@ __register_frame_info_bases (const void *begin, struct object *ob, void *tbase, void *dbase) { /* If .eh_frame is empty, don't register at all. */ - if ((uword *) begin == 0 || *(uword *) begin == 0) + if ((const uword *) begin == 0 || *(const uword *) begin == 0) return; ob->pc_begin = (void *)-1; @@ -177,7 +177,7 @@ __deregister_frame_info_bases (const void *begin) struct object *ob = 0; /* If .eh_frame is empty, we haven't registered. */ - if ((uword *) begin == 0 || *(uword *) begin == 0) + if ((const uword *) begin == 0 || *(const uword *) begin == 0) return ob; init_object_mutex_once (); @@ -323,8 +323,8 @@ static int fde_unencoded_compare (struct object *ob __attribute__((unused)), const fde *x, const fde *y) { - _Unwind_Ptr x_ptr = *(_Unwind_Ptr *) x->pc_begin; - _Unwind_Ptr y_ptr = *(_Unwind_Ptr *) y->pc_begin; + const _Unwind_Ptr x_ptr = *(const _Unwind_Ptr *) x->pc_begin; + const _Unwind_Ptr y_ptr = *(const _Unwind_Ptr *) y->pc_begin; if (x_ptr > y_ptr) return 1; @@ -434,7 +434,7 @@ fde_split (struct object *ob, fde_compare_t fde_compare, { static const fde *marker; size_t count = linear->count; - const fde **chain_end = ▮ + const fde *const *chain_end = ▮ size_t i, j, k; /* This should optimize out, but it is wise to make sure this assumption @@ -444,13 +444,13 @@ fde_split (struct object *ob, fde_compare_t fde_compare, for (i = 0; i < count; i++) { - const fde **probe; + const fde *const *probe; for (probe = chain_end; probe != &marker && fde_compare (ob, linear->array[i], *probe) < 0; probe = chain_end) { - chain_end = (const fde **) erratic->array[probe - linear->array]; + chain_end = (const fde *const*) erratic->array[probe - linear->array]; erratic->array[probe - linear->array] = NULL; } erratic->array[i] = (const fde *) chain_end; @@ -679,7 +679,7 @@ add_fdes (struct object *ob, struct fde_accumulator *accu, const fde *this_fde) if (encoding == DW_EH_PE_absptr) { - if (*(_Unwind_Ptr *) this_fde->pc_begin == 0) + if (*(const _Unwind_Ptr *) this_fde->pc_begin == 0) continue; } else @@ -797,8 +797,8 @@ linear_search_fdes (struct object *ob, const fde *this_fde, void *pc) if (encoding == DW_EH_PE_absptr) { - pc_begin = ((_Unwind_Ptr *) this_fde->pc_begin)[0]; - pc_range = ((_Unwind_Ptr *) this_fde->pc_begin)[1]; + pc_begin = ((const _Unwind_Ptr *) this_fde->pc_begin)[0]; + pc_range = ((const _Unwind_Ptr *) this_fde->pc_begin)[1]; if (pc_begin == 0) continue; } @@ -844,12 +844,9 @@ binary_search_unencoded_fdes (struct object *ob, void *pc) for (lo = 0, hi = vec->count; lo < hi; ) { size_t i = (lo + hi) / 2; - const fde *f = vec->array[i]; - void *pc_begin; - uaddr pc_range; - - pc_begin = ((void **) f->pc_begin)[0]; - pc_range = ((uaddr *) f->pc_begin)[1]; + const fde *const f = vec->array[i]; + const void *pc_begin = ((const void *const*) f->pc_begin)[0]; + const uaddr pc_range = ((const uaddr *) f->pc_begin)[1]; if (pc < pc_begin) hi = i; |