while (region) {
switch (region->type) {
case ERT_CLEANUP:
- if(gimple_code (stmt) == GIMPLE_RESX){
- gimple_resx_set_region(stmt, region->index);
+ if (gimple_code (stmt) == GIMPLE_RESX){
+ gresx *resx_stmt = as_a <gresx *> (stmt);
+ gimple_resx_set_region (resx_stmt, region->index);
}
- *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
+ else *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
return;
case ERT_TRY:
if (match_lp (lp, &exception_types)) {
- if(gimple_code (stmt) == GIMPLE_RESX){
- gimple_resx_set_region(stmt, region->index);
+ if (gimple_code (stmt) == GIMPLE_RESX){
+ gresx *resx_stmt = as_a <gresx *> (stmt);
+ gimple_resx_set_region (resx_stmt, region->index);
}
- *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
+ else *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
return;
}
break;
region = region->outer;
}
- if(gimple_code (stmt) == GIMPLE_RESX){
- gimple_resx_set_region(stmt, -1);
+ if (gimple_code (stmt) == GIMPLE_RESX){
+ gresx *resx_stmt = as_a <gresx *> (stmt);
+ gimple_resx_set_region (resx_stmt, 0);
}
else remove_stmt_from_eh_lp_fn (cfun, stmt);
}
basic_block bb = gimple_bb (resx_stmt);
// Iterate over edges to walk up the basic blocks
- FOR_EACH_EDGE (e, ei, bb->pred)
+ FOR_EACH_EDGE (e, ei, bb->preds)
{
// Get the last stmt of the basic block as it is an EH stmt
bb = e->src;
gimple *stmt = gsi_stmt (gsi);
vec<tree> *ret_vector;
- if (stmt_can_throw_external (stmt)){
+ if (stmt_can_throw_external (fun, stmt)){
if (gimple_code (stmt) == GIMPLE_RESX){
extract_types_for_resx (stmt, ret_vector);
}
extern void extract_exception_types_for_call (gcall *, vec<tree> *);
extern bool stmt_throw_types (function *, gimple *, vec<tree> *);
extern void extract_types_for_resx (gimple *, vec<tree> *);
-extern void extract_fun_resx_types (function *);
+extern void extract_fun_resx_types (function *, vec<tree> *);
extern bool stmt_could_throw_p (function *, gimple *);
extern bool stmt_unremovable_because_of_non_call_eh_p (function *, gimple *);
extern bool tree_could_throw_p (tree);