+2019-12-19 David Malcolm <dmalcolm@redhat.com>
+
+ * 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.
+
2019-12-19 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_simd_valid_immediate): When
gimple statement GS. */
static void
-do_niy (pretty_printer *buffer, gimple *gs)
+do_niy (pretty_printer *buffer, const gimple *gs)
{
pp_printf (buffer, "<<< Unknown GIMPLE statement: %s >>>\n",
gimple_code_name[(int) gimple_code (gs)]);
assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
static void
-dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+dump_unary_rhs (pretty_printer *buffer, const gassign *gs, int spc,
dump_flags_t flags)
{
enum tree_code rhs_code = gimple_assign_rhs_code (gs);
assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
static void
-dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+dump_binary_rhs (pretty_printer *buffer, const gassign *gs, int spc,
dump_flags_t flags)
{
const char *p;
assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */
static void
-dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc,
+dump_ternary_rhs (pretty_printer *buffer, const gassign *gs, int spc,
dump_flags_t flags)
{
const char *p;
pp_gimple_stmt_1. */
static void
-dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc,
+dump_gimple_assign (pretty_printer *buffer, const gassign *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
pp_gimple_stmt_1. */
static void
-dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc,
+dump_gimple_return (pretty_printer *buffer, const greturn *gs, int spc,
dump_flags_t flags)
{
tree t;
dump_gimple_call. */
static void
-dump_gimple_call_args (pretty_printer *buffer, gcall *gs, dump_flags_t flags)
+dump_gimple_call_args (pretty_printer *buffer, const gcall *gs,
+ dump_flags_t flags)
{
size_t i = 0;
/* Dump the points-to solution *PT to BUFFER. */
static void
-pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
+pp_points_to_solution (pretty_printer *buffer, const pt_solution *pt)
{
if (pt->anything)
{
pp_gimple_stmt_1. */
static void
-dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc,
+dump_gimple_call (pretty_printer *buffer, const gcall *gs, int spc,
dump_flags_t flags)
{
tree lhs = gimple_call_lhs (gs);
if (flags & TDF_ALIAS)
{
- struct pt_solution *pt;
+ const pt_solution *pt;
pt = gimple_call_use_set (gs);
if (!pt_solution_empty_p (pt))
{
pp_gimple_stmt_1. */
static void
-dump_gimple_switch (pretty_printer *buffer, gswitch *gs, int spc,
+dump_gimple_switch (pretty_printer *buffer, const gswitch *gs, int spc,
dump_flags_t flags)
{
unsigned int i;
pp_gimple_stmt_1. */
static void
-dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc,
+dump_gimple_cond (pretty_printer *buffer, const gcond *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
TDF_* in dumpfils.h). */
static void
-dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc,
+dump_gimple_label (pretty_printer *buffer, const glabel *gs, int spc,
dump_flags_t flags)
{
tree label = gimple_label_label (gs);
TDF_* in dumpfile.h). */
static void
-dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc,
+dump_gimple_goto (pretty_printer *buffer, const ggoto *gs, int spc,
dump_flags_t flags)
{
tree label = gimple_goto_dest (gs);
TDF_* in dumpfile.h). */
static void
-dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc,
+dump_gimple_bind (pretty_printer *buffer, const gbind *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
dumpfile.h). */
static void
-dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc,
+dump_gimple_try (pretty_printer *buffer, const gtry *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
dumpfile.h). */
static void
-dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc,
+dump_gimple_catch (pretty_printer *buffer, const gcatch *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
dumpfile.h). */
static void
-dump_gimple_eh_filter (pretty_printer *buffer, geh_filter *gs, int spc,
+dump_gimple_eh_filter (pretty_printer *buffer, const geh_filter *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
static void
dump_gimple_eh_must_not_throw (pretty_printer *buffer,
- geh_mnt *gs, int spc, dump_flags_t flags)
+ const geh_mnt *gs, int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs,
dumpfile.h). */
static void
-dump_gimple_eh_else (pretty_printer *buffer, geh_else *gs, int spc,
+dump_gimple_eh_else (pretty_printer *buffer, const geh_else *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
dumpfile.h). */
static void
-dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc,
+dump_gimple_resx (pretty_printer *buffer, const gresx *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc,
- dump_flags_t flags)
+dump_gimple_eh_dispatch (pretty_printer *buffer, const geh_dispatch *gs,
+ int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs,
in dumpfile.h). */
static void
-dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc,
+dump_gimple_debug (pretty_printer *buffer, const gdebug *gs, int spc,
dump_flags_t flags)
{
switch (gs->subcode)
/* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc,
+dump_gimple_omp_for (pretty_printer *buffer, const gomp_for *gs, int spc,
dump_flags_t flags)
{
size_t i;
/* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_continue (pretty_printer *buffer, gomp_continue *gs,
+dump_gimple_omp_continue (pretty_printer *buffer, const gomp_continue *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_single (pretty_printer *buffer, gomp_single *gs,
+dump_gimple_omp_single (pretty_printer *buffer, const gomp_single *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_TASKGROUP tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_taskgroup (pretty_printer *buffer, gimple *gs,
+dump_gimple_omp_taskgroup (pretty_printer *buffer, const gimple *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs,
+dump_gimple_omp_target (pretty_printer *buffer, const gomp_target *gs,
int spc, dump_flags_t flags)
{
const char *kind;
/* Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_teams (pretty_printer *buffer, gomp_teams *gs, int spc,
+dump_gimple_omp_teams (pretty_printer *buffer, const gomp_teams *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_sections (pretty_printer *buffer, gomp_sections *gs,
+dump_gimple_omp_sections (pretty_printer *buffer, const gomp_sections *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
pretty_printer BUFFER. */
static void
-dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc,
+dump_gimple_omp_block (pretty_printer *buffer, const gimple *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs,
+dump_gimple_omp_critical (pretty_printer *buffer, const gomp_critical *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs,
+dump_gimple_omp_ordered (pretty_printer *buffer, const gomp_ordered *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_SCAN tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_scan (pretty_printer *buffer, gomp_scan *gs,
+dump_gimple_omp_scan (pretty_printer *buffer, const gomp_scan *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc,
+dump_gimple_omp_return (pretty_printer *buffer, const gimple *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
/* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_transaction (pretty_printer *buffer, gtransaction *gs,
+dump_gimple_transaction (pretty_printer *buffer, const gtransaction *gs,
int spc, dump_flags_t flags)
{
unsigned subcode = gimple_transaction_subcode (gs);
dumpfile.h). */
static void
-dump_gimple_asm (pretty_printer *buffer, gasm *gs, int spc, dump_flags_t flags)
+dump_gimple_asm (pretty_printer *buffer, const gasm *gs, int spc,
+ dump_flags_t flags)
{
unsigned int i, n, f, fields;
pretty printer. If COMMENT is true, print this after #. */
static void
-dump_gimple_phi (pretty_printer *buffer, gphi *phi, int spc, bool comment,
+dump_gimple_phi (pretty_printer *buffer, const gphi *phi, int spc, bool comment,
dump_flags_t flags)
{
size_t i;
dumpfile.h). */
static void
-dump_gimple_omp_parallel (pretty_printer *buffer, gomp_parallel *gs,
+dump_gimple_omp_parallel (pretty_printer *buffer, const gomp_parallel *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
dumpfile.h). */
static void
-dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc,
+dump_gimple_omp_task (pretty_printer *buffer, const gomp_task *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
in dumpfile.h). */
static void
-dump_gimple_omp_atomic_load (pretty_printer *buffer, gomp_atomic_load *gs,
+dump_gimple_omp_atomic_load (pretty_printer *buffer, const gomp_atomic_load *gs,
int spc, dump_flags_t flags)
{
if (flags & TDF_RAW)
static void
dump_gimple_omp_atomic_store (pretty_printer *buffer,
- gomp_atomic_store *gs, int spc,
+ const gomp_atomic_store *gs, int spc,
dump_flags_t flags)
{
if (flags & TDF_RAW)
FLAGS are as in pp_gimple_stmt_1. */
static void
-dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc,
+dump_gimple_mem_ops (pretty_printer *buffer, const gimple *gs, int spc,
dump_flags_t flags)
{
tree vdef = gimple_vdef (gs);
pp_flush on BUFFER to finalize the pretty printer. */
void
-pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc,
+pp_gimple_stmt_1 (pretty_printer *buffer, const gimple *gs, int spc,
dump_flags_t flags)
{
if (!gs)
return;
if (flags & TDF_STMTADDR)
- pp_printf (buffer, "<&%p> ", (void *) gs);
+ pp_printf (buffer, "<&%p> ", (const void *) gs);
if ((flags & TDF_LINENO) && gimple_has_location (gs))
dump_location (buffer, gimple_location (gs));
switch (gimple_code (gs))
{
case GIMPLE_ASM:
- dump_gimple_asm (buffer, as_a <gasm *> (gs), spc, flags);
+ dump_gimple_asm (buffer, as_a <const gasm *> (gs), spc, flags);
break;
case GIMPLE_ASSIGN:
- dump_gimple_assign (buffer, as_a <gassign *> (gs), spc, flags);
+ dump_gimple_assign (buffer, as_a <const gassign *> (gs), spc, flags);
break;
case GIMPLE_BIND:
- dump_gimple_bind (buffer, as_a <gbind *> (gs), spc, flags);
+ dump_gimple_bind (buffer, as_a <const gbind *> (gs), spc, flags);
break;
case GIMPLE_CALL:
- dump_gimple_call (buffer, as_a <gcall *> (gs), spc, flags);
+ dump_gimple_call (buffer, as_a <const gcall *> (gs), spc, flags);
break;
case GIMPLE_COND:
- dump_gimple_cond (buffer, as_a <gcond *> (gs), spc, flags);
+ dump_gimple_cond (buffer, as_a <const gcond *> (gs), spc, flags);
break;
case GIMPLE_LABEL:
- dump_gimple_label (buffer, as_a <glabel *> (gs), spc, flags);
+ dump_gimple_label (buffer, as_a <const glabel *> (gs), spc, flags);
break;
case GIMPLE_GOTO:
- dump_gimple_goto (buffer, as_a <ggoto *> (gs), spc, flags);
+ dump_gimple_goto (buffer, as_a <const ggoto *> (gs), spc, flags);
break;
case GIMPLE_NOP:
break;
case GIMPLE_RETURN:
- dump_gimple_return (buffer, as_a <greturn *> (gs), spc, flags);
+ dump_gimple_return (buffer, as_a <const greturn *> (gs), spc, flags);
break;
case GIMPLE_SWITCH:
- dump_gimple_switch (buffer, as_a <gswitch *> (gs), spc, flags);
+ dump_gimple_switch (buffer, as_a <const gswitch *> (gs), spc, flags);
break;
case GIMPLE_TRY:
- dump_gimple_try (buffer, as_a <gtry *> (gs), spc, flags);
+ dump_gimple_try (buffer, as_a <const gtry *> (gs), spc, flags);
break;
case GIMPLE_PHI:
- dump_gimple_phi (buffer, as_a <gphi *> (gs), spc, false, flags);
+ dump_gimple_phi (buffer, as_a <const gphi *> (gs), spc, false, flags);
break;
case GIMPLE_OMP_PARALLEL:
- dump_gimple_omp_parallel (buffer, as_a <gomp_parallel *> (gs), spc,
+ dump_gimple_omp_parallel (buffer, as_a <const gomp_parallel *> (gs), spc,
flags);
break;
case GIMPLE_OMP_TASK:
- dump_gimple_omp_task (buffer, as_a <gomp_task *> (gs), spc, flags);
+ dump_gimple_omp_task (buffer, as_a <const gomp_task *> (gs), spc, flags);
break;
case GIMPLE_OMP_ATOMIC_LOAD:
- dump_gimple_omp_atomic_load (buffer, as_a <gomp_atomic_load *> (gs),
+ dump_gimple_omp_atomic_load (buffer, as_a <const gomp_atomic_load *> (gs),
spc, flags);
break;
case GIMPLE_OMP_ATOMIC_STORE:
dump_gimple_omp_atomic_store (buffer,
- as_a <gomp_atomic_store *> (gs),
+ as_a <const gomp_atomic_store *> (gs),
spc, flags);
break;
case GIMPLE_OMP_FOR:
- dump_gimple_omp_for (buffer, as_a <gomp_for *> (gs), spc, flags);
+ dump_gimple_omp_for (buffer, as_a <const gomp_for *> (gs), spc, flags);
break;
case GIMPLE_OMP_CONTINUE:
- dump_gimple_omp_continue (buffer, as_a <gomp_continue *> (gs), spc,
+ dump_gimple_omp_continue (buffer, as_a <const gomp_continue *> (gs), spc,
flags);
break;
case GIMPLE_OMP_SINGLE:
- dump_gimple_omp_single (buffer, as_a <gomp_single *> (gs), spc,
+ dump_gimple_omp_single (buffer, as_a <const gomp_single *> (gs), spc,
flags);
break;
case GIMPLE_OMP_TARGET:
- dump_gimple_omp_target (buffer, as_a <gomp_target *> (gs), spc,
+ dump_gimple_omp_target (buffer, as_a <const gomp_target *> (gs), spc,
flags);
break;
case GIMPLE_OMP_TEAMS:
- dump_gimple_omp_teams (buffer, as_a <gomp_teams *> (gs), spc,
+ dump_gimple_omp_teams (buffer, as_a <const gomp_teams *> (gs), spc,
flags);
break;
break;
case GIMPLE_OMP_SECTIONS:
- dump_gimple_omp_sections (buffer, as_a <gomp_sections *> (gs),
+ dump_gimple_omp_sections (buffer, as_a <const gomp_sections *> (gs),
spc, flags);
break;
break;
case GIMPLE_OMP_ORDERED:
- dump_gimple_omp_ordered (buffer, as_a <gomp_ordered *> (gs), spc,
+ dump_gimple_omp_ordered (buffer, as_a <const gomp_ordered *> (gs), spc,
flags);
break;
case GIMPLE_OMP_SCAN:
- dump_gimple_omp_scan (buffer, as_a <gomp_scan *> (gs), spc,
+ dump_gimple_omp_scan (buffer, as_a <const gomp_scan *> (gs), spc,
flags);
break;
case GIMPLE_OMP_CRITICAL:
- dump_gimple_omp_critical (buffer, as_a <gomp_critical *> (gs), spc,
+ dump_gimple_omp_critical (buffer, as_a <const gomp_critical *> (gs), spc,
flags);
break;
case GIMPLE_CATCH:
- dump_gimple_catch (buffer, as_a <gcatch *> (gs), spc, flags);
+ dump_gimple_catch (buffer, as_a <const gcatch *> (gs), spc, flags);
break;
case GIMPLE_EH_FILTER:
- dump_gimple_eh_filter (buffer, as_a <geh_filter *> (gs), spc, flags);
+ dump_gimple_eh_filter (buffer, as_a <const geh_filter *> (gs), spc,
+ flags);
break;
case GIMPLE_EH_MUST_NOT_THROW:
dump_gimple_eh_must_not_throw (buffer,
- as_a <geh_mnt *> (gs),
+ as_a <const geh_mnt *> (gs),
spc, flags);
break;
case GIMPLE_EH_ELSE:
- dump_gimple_eh_else (buffer, as_a <geh_else *> (gs), spc, flags);
+ dump_gimple_eh_else (buffer, as_a <const geh_else *> (gs), spc, flags);
break;
case GIMPLE_RESX:
- dump_gimple_resx (buffer, as_a <gresx *> (gs), spc, flags);
+ dump_gimple_resx (buffer, as_a <const gresx *> (gs), spc, flags);
break;
case GIMPLE_EH_DISPATCH:
- dump_gimple_eh_dispatch (buffer, as_a <geh_dispatch *> (gs), spc,
+ dump_gimple_eh_dispatch (buffer, as_a <const geh_dispatch *> (gs), spc,
flags);
break;
case GIMPLE_DEBUG:
- dump_gimple_debug (buffer, as_a <gdebug *> (gs), spc, flags);
+ dump_gimple_debug (buffer, as_a <const gdebug *> (gs), spc, flags);
break;
case GIMPLE_PREDICT:
break;
case GIMPLE_TRANSACTION:
- dump_gimple_transaction (buffer, as_a <gtransaction *> (gs), spc,
+ dump_gimple_transaction (buffer, as_a <const gtransaction *> (gs), spc,
flags);
break;
return gs->code == GIMPLE_DEBUG;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gdebug *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_DEBUG;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_GOTO;
}
+template <>
+template <>
+inline bool
+is_a_helper <const ggoto *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_GOTO;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_LABEL;
}
+template <>
+template <>
+inline bool
+is_a_helper <const glabel *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_LABEL;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_EH_ELSE;
}
+template <>
+template <>
+inline bool
+is_a_helper <const geh_else *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_EH_ELSE;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_EH_MUST_NOT_THROW;
}
+template <>
+template <>
+inline bool
+is_a_helper <const geh_mnt *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_EH_MUST_NOT_THROW;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_SWITCH;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gswitch *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_SWITCH;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_TRY;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gtry *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_TRY;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_PHI;
}
+template <>
+template <>
+inline bool
+is_a_helper <const greturn *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_RETURN;
+}
+
template <>
template <>
inline bool
/* Return true if GIMPLE_CALL S is marked as a tail call. */
static inline bool
-gimple_call_tail_p (gcall *s)
+gimple_call_tail_p (const gcall *s)
{
return (s->subcode & GF_CALL_TAILCALL) != 0;
}
/* Return true if S is marked for return slot optimization. */
static inline bool
-gimple_call_return_slot_opt_p (gcall *s)
+gimple_call_return_slot_opt_p (const gcall *s)
{
return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
}
argument pack in its argument list. */
static inline bool
-gimple_call_va_arg_pack_p (gcall *s)
+gimple_call_va_arg_pack_p (const gcall *s)
{
return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
}
return &call_stmt->call_used;
}
+/* As above, but const. */
+
+static inline const pt_solution *
+gimple_call_use_set (const gcall *call_stmt)
+{
+ return &call_stmt->call_used;
+}
/* Return a pointer to the points-to solution for the set of call-used
variables of the call CALL_STMT. */
return &call_stmt->call_clobbered;
}
+/* As above, but const. */
+
+static inline const pt_solution *
+gimple_call_clobber_set (const gcall *call_stmt)
+{
+ return &call_stmt->call_clobbered;
+}
+
/* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
non-NULL lhs. */
static inline bool
-gimple_has_lhs (gimple *stmt)
+gimple_has_lhs (const gimple *stmt)
{
if (is_gimple_assign (stmt))
return true;
- if (gcall *call = dyn_cast <gcall *> (stmt))
+ if (const gcall *call = dyn_cast <const gcall *> (stmt))
return gimple_call_lhs (call) != NULL_TREE;
return false;
}
/* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
static inline gimple_seq
-gimple_bind_body (gbind *gs)
+gimple_bind_body (const gbind *gs)
{
- return *gimple_bind_body_ptr (gs);
+ return *gimple_bind_body_ptr (const_cast <gbind *> (gs));
}
GIMPLE_CATCH statement CATCH_STMT. */
static inline gimple_seq
-gimple_catch_handler (gcatch *catch_stmt)
+gimple_catch_handler (const gcatch *catch_stmt)
{
- return *gimple_catch_handler_ptr (catch_stmt);
+ return *gimple_catch_handler_ptr (const_cast <gcatch *> (catch_stmt));
}
statement fails. */
static inline gimple_seq
-gimple_eh_filter_failure (gimple *gs)
+gimple_eh_filter_failure (const gimple *gs)
{
- return *gimple_eh_filter_failure_ptr (gs);
+ return *gimple_eh_filter_failure_ptr (const_cast <gimple *> (gs));
}
/* Get the function decl to be called by the MUST_NOT_THROW region. */
static inline tree
-gimple_eh_must_not_throw_fndecl (geh_mnt *eh_mnt_stmt)
+gimple_eh_must_not_throw_fndecl (const geh_mnt *eh_mnt_stmt)
{
return eh_mnt_stmt->fndecl;
}
}
static inline gimple_seq
-gimple_eh_else_n_body (geh_else *eh_else_stmt)
+gimple_eh_else_n_body (const geh_else *eh_else_stmt)
{
- return *gimple_eh_else_n_body_ptr (eh_else_stmt);
+ return *gimple_eh_else_n_body_ptr (const_cast <geh_else *> (eh_else_stmt));
}
static inline gimple_seq *
}
static inline gimple_seq
-gimple_eh_else_e_body (geh_else *eh_else_stmt)
+gimple_eh_else_e_body (const geh_else *eh_else_stmt)
{
- return *gimple_eh_else_e_body_ptr (eh_else_stmt);
+ return *gimple_eh_else_e_body_ptr (const_cast <geh_else *> (eh_else_stmt));
}
static inline void
/* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
static inline gimple_seq
-gimple_try_eval (gimple *gs)
+gimple_try_eval (const gimple *gs)
{
- return *gimple_try_eval_ptr (gs);
+ return *gimple_try_eval_ptr (const_cast <gimple *> (gs));
}
GIMPLE_TRY GS. */
static inline gimple_seq
-gimple_try_cleanup (gimple *gs)
+gimple_try_cleanup (const gimple *gs)
{
- return *gimple_try_cleanup_ptr (gs);
+ return *gimple_try_cleanup_ptr (const_cast <gimple *> (gs));
}
return &(gs->args[index]);
}
+static inline const phi_arg_d *
+gimple_phi_arg (const gphi *gs, unsigned index)
+{
+ gcc_gimple_checking_assert (index < gs->nargs);
+ return &(gs->args[index]);
+}
+
static inline struct phi_arg_d *
gimple_phi_arg (gimple *gs, unsigned index)
{
/* Return the tree operand for argument I of PHI node GS. */
static inline tree
-gimple_phi_arg_def (gphi *gs, size_t index)
+gimple_phi_arg_def (const gphi *gs, size_t index)
{
return gimple_phi_arg (gs, index)->def;
}
/* Return the edge associated with argument I of phi node PHI. */
static inline edge
-gimple_phi_arg_edge (gphi *phi, size_t i)
+gimple_phi_arg_edge (const gphi *phi, size_t i)
{
return EDGE_PRED (gimple_bb (phi), i);
}
/* Return the source location of gimple argument I of phi node PHI. */
static inline location_t
-gimple_phi_arg_location (gphi *phi, size_t i)
+gimple_phi_arg_location (const gphi *phi, size_t i)
{
return gimple_phi_arg (phi, i)->locus;
}
/* Return TRUE if argument I of phi node PHI has a location record. */
static inline bool
-gimple_phi_arg_has_location (gphi *phi, size_t i)
+gimple_phi_arg_has_location (const gphi *phi, size_t i)
{
return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
}
/* Return the variable bound in a GIMPLE_DEBUG bind statement. */
static inline tree
-gimple_debug_bind_get_var (gimple *dbg)
+gimple_debug_bind_get_var (const gimple *dbg)
{
GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
statement. */
static inline tree
-gimple_debug_bind_get_value (gimple *dbg)
+gimple_debug_bind_get_value (const gimple *dbg)
{
GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
/* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
static inline tree
-gimple_debug_source_bind_get_var (gimple *dbg)
+gimple_debug_source_bind_get_var (const gimple *dbg)
{
GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
statement. */
static inline tree
-gimple_debug_source_bind_get_value (gimple *dbg)
+gimple_debug_source_bind_get_value (const gimple *dbg)
{
GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
/* Return the body for the OMP statement GS. */
static inline gimple_seq
-gimple_omp_body (gimple *gs)
+gimple_omp_body (const gimple *gs)
{
- return *gimple_omp_body_ptr (gs);
+ return *gimple_omp_body_ptr (const_cast <gimple *> (gs));
}
/* Set BODY to be the body for the OMP statement GS. */
/* Get the collapse count of the OMP_FOR statement GS. */
static inline size_t
-gimple_omp_for_collapse (gimple *gs)
+gimple_omp_for_collapse (const gimple *gs)
{
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
+ const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
return omp_for_stmt->collapse;
}
statement GS starts. */
static inline gimple_seq
-gimple_omp_for_pre_body (gimple *gs)
+gimple_omp_for_pre_body (const gimple *gs)
{
- return *gimple_omp_for_pre_body_ptr (gs);
+ return *gimple_omp_for_pre_body_ptr (const_cast <gimple *> (gs));
}
/* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
static inline gimple_seq
-gimple_transaction_body (gtransaction *transaction_stmt)
+gimple_transaction_body (const gtransaction *transaction_stmt)
{
return transaction_stmt->body;
}