}
void unlink_eh_region(eh_region region) {
- gcc_assert(!region->inner);
eh_region *link;
// Check if region is root
eh_region region = lp->region;
eh_region prev_region = NULL;
+ bool update = false;
+ if (gimple_code (stmt) == GIMPLE_RESX)
+ region = region->outer;
+
// Walk up the region tree
while (region) {
switch (region->type) {
case ERT_CLEANUP:
+ if (!update)
+ return;
+
if (gimple_code (stmt) == GIMPLE_RESX){
gresx *resx_stmt = as_a <gresx *> (stmt);
gimple_resx_set_region (resx_stmt, region->index);
}
+
else *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
unlink_eh_region (region);
return;
case ERT_TRY:
+ if (update)
+ return;
+
if (match_lp (lp, &exception_types)) {
if (gimple_code (stmt) == GIMPLE_RESX){
gresx *resx_stmt = as_a <gresx *> (stmt);
gimple_resx_set_region (resx_stmt, region->index);
}
+
else *cfun->eh->throw_stmt_table->get (const_cast<gimple *> (stmt)) = lp->index;
unlink_eh_region (region);
}
prev_region = region;
region = region->outer;
+ update = true;
}
+ if (!update)
+ return;
+
if (gimple_code (stmt) == GIMPLE_RESX){
gresx *resx_stmt = as_a <gresx *> (stmt);
gimple_resx_set_region (resx_stmt, 0);
bool type_exists = true;
switch (gimple_code (stmt)) {
- // case GIMPLE_RESX:
- // extract_fun_resx_types (fun, ret_vector);
- // return !ret_vector->is_empty ();
+ case GIMPLE_RESX:
+ extract_fun_resx_types (fun, ret_vector);
+ return !ret_vector->is_empty ();
case GIMPLE_CALL:
type_exists = extract_types_for_call (as_a<gcall*> (stmt), ret_vector);