aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2019-12-19 14:59:14 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2019-12-19 14:59:14 +0000
commit0e7b6a51df1f5ffa81bebbe492ce1418c9fdceab (patch)
tree08b3dd8b9ca2e3a924d780a80dde6e25d882d8ec /gcc/tree-eh.c
parentb23c6a2c604c0dccf14cc3461357a28ffb99ed88 (diff)
downloadgcc-0e7b6a51df1f5ffa81bebbe492ce1418c9fdceab.zip
gcc-0e7b6a51df1f5ffa81bebbe492ce1418c9fdceab.tar.gz
gcc-0e7b6a51df1f5ffa81bebbe492ce1418c9fdceab.tar.bz2
gimple const-correctness fixes
This patch converts various "gimple *" to "const gimple *" and similar fixes for gimple subclasses, adding is_a_helper for gimple subclasses to support the const form of as_a, and adding a few "const" overloads of accessors. This is enough to make pp_gimple_stmt_1's stmt const. gcc/ChangeLog: * gimple-predict.h (gimple_predict_predictor): Make "gs" param const. (gimple_predict_outcome): Likewise. * gimple-pretty-print.c (do_niy): Likewise. (dump_unary_rhs): Likewise. (dump_binary_rhs): Likewise. (dump_ternary_rhs): Likewise. (dump_gimple_assign): Likewise. (dump_gimple_return): Likewise. (dump_gimple_call_args): Likewise. (pp_points_to_solution): Make "pt" param const. (dump_gimple_call): Make "gs" param const. (dump_gimple_switch): Likewise. (dump_gimple_cond): Likewise. (dump_gimple_label): Likewise. (dump_gimple_goto): Likewise. (dump_gimple_bind): Likewise. (dump_gimple_try): Likewise. (dump_gimple_catch): Likewise. (dump_gimple_eh_filter): Likewise. (dump_gimple_eh_must_not_throw): Likewise. (dump_gimple_eh_else): Likewise. (dump_gimple_resx): Likewise. (dump_gimple_eh_dispatch): Likewise. (dump_gimple_debug): Likewise. (dump_gimple_omp_for): Likewise. (dump_gimple_omp_continue): Likewise. (dump_gimple_omp_single): Likewise. (dump_gimple_omp_taskgroup): Likewise. (dump_gimple_omp_target): Likewise. (dump_gimple_omp_teams): Likewise. (dump_gimple_omp_sections): Likewise. (dump_gimple_omp_block): Likewise. (dump_gimple_omp_critical): Likewise. (dump_gimple_omp_ordered): Likewise. (dump_gimple_omp_scan): Likewise. (dump_gimple_omp_return): Likewise. (dump_gimple_transaction): Likewise. (dump_gimple_asm): Likewise. (dump_gimple_phi): Make "phi" param const. (dump_gimple_omp_parallel): Make "gs" param const. (dump_gimple_omp_task): Likewise. (dump_gimple_omp_atomic_load): Likewise. (dump_gimple_omp_atomic_store): Likewise. (dump_gimple_mem_ops): Likewise. (pp_gimple_stmt_1): Likewise. Add "const" to the various as_a <> casts throughout. * gimple-pretty-print.h (gimple_stmt_1): Make gimple * param const. * gimple.h (is_a_helper <const gdebug *>::test): New. (is_a_helper <const ggoto *>::test): New. (is_a_helper <const glabel *>::test): New. (is_a_helper <const geh_else *>::test): New. (is_a_helper <const geh_mnt *>::test): New. (is_a_helper <const gswitch *>::test): New. (is_a_helper <const gtry *>::test): New. (is_a_helper <const greturn *>::test): New. (gimple_call_tail_p): Make param const. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_use_set): Add const overload. (gimple_call_clobber_set): Likewise. (gimple_has_lhs): Make param const. (gimple_bind_body): Likewise. (gimple_catch_handler): Likewise. (gimple_eh_filter_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Likewise. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_try_eval): Likewise. (gimple_try_cleanup): Likewise. (gimple_phi_arg): Add const overload. (gimple_phi_arg_def): Make param const. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_debug_bind_get_var): Likewise. (gimple_debug_bind_get_value): Likewise. (gimple_debug_source_bind_get_var): Likewise. (gimple_debug_source_bind_get_value): Likewise. (gimple_omp_body): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_transaction_body): Likewise. * tree-eh.c (lookup_stmt_eh_lp_fn): Make param "t" const. (lookup_stmt_eh_lp): Likewise. * tree-eh.h (lookup_stmt_eh_lp_fn): Make param const. (lookup_stmt_eh_lp): Likewise. * tree-ssa-alias.h (pt_solution_empty_p): Make param const. * tree-ssa-structalias.c (pt_solution_empty_p): Likewise. From-SVN: r279581
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 54502e6..b996f49 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -139,19 +139,19 @@ remove_stmt_from_eh_lp (gimple *t)
statement is not recorded in the region table. */
int
-lookup_stmt_eh_lp_fn (struct function *ifun, gimple *t)
+lookup_stmt_eh_lp_fn (struct function *ifun, const gimple *t)
{
if (ifun->eh->throw_stmt_table == NULL)
return 0;
- int *lp_nr = ifun->eh->throw_stmt_table->get (t);
+ int *lp_nr = ifun->eh->throw_stmt_table->get (const_cast <gimple *> (t));
return lp_nr ? *lp_nr : 0;
}
/* Likewise, but always use the current function. */
int
-lookup_stmt_eh_lp (gimple *t)
+lookup_stmt_eh_lp (const gimple *t)
{
/* We can get called from initialized data when -fnon-call-exceptions
is on; prevent crash. */