/* Helper function for walk_gimple_stmt. Walk operands of a GIMPLE_ASM. */
static tree
-walk_gimple_asm (gimple stmt, walk_tree_fn callback_op,
+walk_gimple_asm (gasm *stmt, walk_tree_fn callback_op,
struct walk_stmt_info *wi)
{
tree ret, op;
wi->val_only = true;
}
- ret = walk_tree (gimple_call_chain_ptr (stmt), callback_op, wi, pset);
+ ret = walk_tree (gimple_call_chain_ptr (as_a <gcall *> (stmt)),
+ callback_op, wi, pset);
if (ret)
return ret;
break;
case GIMPLE_CATCH:
- ret = walk_tree (gimple_catch_types_ptr (stmt), callback_op, wi,
- pset);
+ ret = walk_tree (gimple_catch_types_ptr (as_a <gcatch *> (stmt)),
+ callback_op, wi, pset);
if (ret)
return ret;
break;
break;
case GIMPLE_ASM:
- ret = walk_gimple_asm (stmt, callback_op, wi);
+ ret = walk_gimple_asm (as_a <gasm *> (stmt), callback_op, wi);
if (ret)
return ret;
break;
case GIMPLE_OMP_CONTINUE:
- ret = walk_tree (gimple_omp_continue_control_def_ptr (stmt),
- callback_op, wi, pset);
- if (ret)
- return ret;
-
- ret = walk_tree (gimple_omp_continue_control_use_ptr (stmt),
- callback_op, wi, pset);
- if (ret)
- return ret;
+ {
+ gomp_continue *cont_stmt = as_a <gomp_continue *> (stmt);
+ ret = walk_tree (gimple_omp_continue_control_def_ptr (cont_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+
+ ret = walk_tree (gimple_omp_continue_control_use_ptr (cont_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+ }
break;
case GIMPLE_OMP_CRITICAL:
- ret = walk_tree (gimple_omp_critical_name_ptr (stmt), callback_op, wi,
- pset);
+ ret = walk_tree (gimple_omp_critical_name_ptr (
+ as_a <gomp_critical *> (stmt)),
+ callback_op, wi, pset);
if (ret)
return ret;
break;
break;
case GIMPLE_OMP_PARALLEL:
- ret = walk_tree (gimple_omp_parallel_clauses_ptr (stmt), callback_op,
- wi, pset);
- if (ret)
- return ret;
- ret = walk_tree (gimple_omp_parallel_child_fn_ptr (stmt), callback_op,
- wi, pset);
- if (ret)
- return ret;
- ret = walk_tree (gimple_omp_parallel_data_arg_ptr (stmt), callback_op,
- wi, pset);
- if (ret)
- return ret;
+ {
+ gomp_parallel *omp_par_stmt = as_a <gomp_parallel *> (stmt);
+ ret = walk_tree (gimple_omp_parallel_clauses_ptr (omp_par_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+ ret = walk_tree (gimple_omp_parallel_child_fn_ptr (omp_par_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+ ret = walk_tree (gimple_omp_parallel_data_arg_ptr (omp_par_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+ }
break;
case GIMPLE_OMP_TASK:
break;
case GIMPLE_OMP_ATOMIC_LOAD:
- ret = walk_tree (gimple_omp_atomic_load_lhs_ptr (stmt), callback_op, wi,
- pset);
- if (ret)
- return ret;
-
- ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (stmt), callback_op, wi,
- pset);
- if (ret)
- return ret;
+ {
+ gomp_atomic_load *omp_stmt = as_a <gomp_atomic_load *> (stmt);
+ ret = walk_tree (gimple_omp_atomic_load_lhs_ptr (omp_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+
+ ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (omp_stmt),
+ callback_op, wi, pset);
+ if (ret)
+ return ret;
+ }
break;
case GIMPLE_OMP_ATOMIC_STORE:
- ret = walk_tree (gimple_omp_atomic_store_val_ptr (stmt), callback_op,
- wi, pset);
+ ret = walk_tree (gimple_omp_atomic_store_val_ptr (
+ as_a <gomp_atomic_store *> (stmt)),
+ callback_op, wi, pset);
if (ret)
return ret;
break;
case GIMPLE_TRANSACTION:
- ret = walk_tree (gimple_transaction_label_ptr (stmt), callback_op,
- wi, pset);
+ ret = walk_tree (gimple_transaction_label_ptr (
+ as_a <gtransaction *> (stmt)),
+ callback_op, wi, pset);
if (ret)
return ret;
break;
switch (gimple_code (stmt))
{
case GIMPLE_BIND:
- ret = walk_gimple_seq_mod (gimple_bind_body_ptr (stmt), callback_stmt,
- callback_op, wi);
+ ret = walk_gimple_seq_mod (gimple_bind_body_ptr (as_a <gbind *> (stmt)),
+ callback_stmt, callback_op, wi);
if (ret)
return wi->callback_result;
break;
case GIMPLE_CATCH:
- ret = walk_gimple_seq_mod (gimple_catch_handler_ptr (stmt), callback_stmt,
- callback_op, wi);
+ ret = walk_gimple_seq_mod (gimple_catch_handler_ptr (
+ as_a <gcatch *> (stmt)),
+ callback_stmt, callback_op, wi);
if (ret)
return wi->callback_result;
break;
break;
case GIMPLE_EH_ELSE:
- ret = walk_gimple_seq_mod (gimple_eh_else_n_body_ptr (stmt),
- callback_stmt, callback_op, wi);
- if (ret)
- return wi->callback_result;
- ret = walk_gimple_seq_mod (gimple_eh_else_e_body_ptr (stmt),
- callback_stmt, callback_op, wi);
- if (ret)
- return wi->callback_result;
+ {
+ geh_else *eh_else_stmt = as_a <geh_else *> (stmt);
+ ret = walk_gimple_seq_mod (gimple_eh_else_n_body_ptr (eh_else_stmt),
+ callback_stmt, callback_op, wi);
+ if (ret)
+ return wi->callback_result;
+ ret = walk_gimple_seq_mod (gimple_eh_else_e_body_ptr (eh_else_stmt),
+ callback_stmt, callback_op, wi);
+ if (ret)
+ return wi->callback_result;
+ }
break;
case GIMPLE_TRY:
break;
case GIMPLE_TRANSACTION:
- ret = walk_gimple_seq_mod (gimple_transaction_body_ptr (stmt),
+ ret = walk_gimple_seq_mod (gimple_transaction_body_ptr (
+ as_a <gtransaction *> (stmt)),
callback_stmt, callback_op, wi);
if (ret)
return wi->callback_result;
}
}
}
- else if (is_gimple_call (stmt))
+ else if (gcall *call_stmt = dyn_cast <gcall *> (stmt))
{
if (visit_store)
{
- tree arg = gimple_call_lhs (stmt);
+ tree arg = gimple_call_lhs (call_stmt);
if (arg)
{
tree lhs = get_base_loadstore (arg);
}
}
if (visit_load || visit_addr)
- for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ for (i = 0; i < gimple_call_num_args (call_stmt); ++i)
{
- tree arg = gimple_call_arg (stmt, i);
+ tree arg = gimple_call_arg (call_stmt, i);
if (visit_addr
&& TREE_CODE (arg) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (arg, 0), arg, data);
}
}
if (visit_addr
- && gimple_call_chain (stmt)
- && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR)
- ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0),
- gimple_call_chain (stmt), data);
+ && gimple_call_chain (call_stmt)
+ && TREE_CODE (gimple_call_chain (call_stmt)) == ADDR_EXPR)
+ ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (call_stmt), 0),
+ gimple_call_chain (call_stmt), data);
if (visit_addr
- && gimple_call_return_slot_opt_p (stmt)
- && gimple_call_lhs (stmt) != NULL_TREE
- && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt))))
- ret |= visit_addr (stmt, gimple_call_lhs (stmt),
- gimple_call_lhs (stmt), data);
+ && gimple_call_return_slot_opt_p (call_stmt)
+ && gimple_call_lhs (call_stmt) != NULL_TREE
+ && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (call_stmt))))
+ ret |= visit_addr (stmt, gimple_call_lhs (call_stmt),
+ gimple_call_lhs (call_stmt), data);
}
- else if (gimple_code (stmt) == GIMPLE_ASM)
+ else if (gasm *asm_stmt = dyn_cast <gasm *> (stmt))
{
unsigned noutputs;
const char *constraint;
const char **oconstraints;
bool allows_mem, allows_reg, is_inout;
- noutputs = gimple_asm_noutputs (stmt);
+ noutputs = gimple_asm_noutputs (asm_stmt);
oconstraints = XALLOCAVEC (const char *, noutputs);
if (visit_store || visit_addr)
- for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+ for (i = 0; i < gimple_asm_noutputs (asm_stmt); ++i)
{
- tree link = gimple_asm_output_op (stmt, i);
+ tree link = gimple_asm_output_op (asm_stmt, i);
tree op = get_base_loadstore (TREE_VALUE (link));
if (op && visit_store)
ret |= visit_store (stmt, op, TREE_VALUE (link), data);
}
}
if (visit_load || visit_addr)
- for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
+ for (i = 0; i < gimple_asm_ninputs (asm_stmt); ++i)
{
- tree link = gimple_asm_input_op (stmt, i);
+ tree link = gimple_asm_input_op (asm_stmt, i);
tree op = TREE_VALUE (link);
if (visit_addr
&& TREE_CODE (op) == ADDR_EXPR)
}
}
}
- else if (gimple_code (stmt) == GIMPLE_RETURN)
+ else if (greturn *return_stmt = dyn_cast <greturn *> (stmt))
{
- tree op = gimple_return_retval (stmt);
+ tree op = gimple_return_retval (return_stmt);
if (op)
{
if (visit_addr