diff options
author | David Malcolm <dmalcolm@redhat.com> | 2019-12-19 14:59:14 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2019-12-19 14:59:14 +0000 |
commit | 0e7b6a51df1f5ffa81bebbe492ce1418c9fdceab (patch) | |
tree | 08b3dd8b9ca2e3a924d780a80dde6e25d882d8ec /gcc/gimple-predict.h | |
parent | b23c6a2c604c0dccf14cc3461357a28ffb99ed88 (diff) | |
download | gcc-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/gimple-predict.h')
-rw-r--r-- | gcc/gimple-predict.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-predict.h b/gcc/gimple-predict.h index 761098b..d976317 100644 --- a/gcc/gimple-predict.h +++ b/gcc/gimple-predict.h @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see /* Return the predictor of GIMPLE_PREDICT statement GS. */ static inline enum br_predictor -gimple_predict_predictor (gimple *gs) +gimple_predict_predictor (const gimple *gs) { GIMPLE_CHECK (gs, GIMPLE_PREDICT); return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN); @@ -47,7 +47,7 @@ gimple_predict_set_predictor (gimple *gs, enum br_predictor predictor) /* Return the outcome of GIMPLE_PREDICT statement GS. */ static inline enum prediction -gimple_predict_outcome (gimple *gs) +gimple_predict_outcome (const gimple *gs) { GIMPLE_CHECK (gs, GIMPLE_PREDICT); return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN; |