aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2009-09-28 09:44:32 -0700
committerRichard Henderson <rth@gcc.gnu.org>2009-09-28 09:44:32 -0700
commit384c400a82f70420e31fbdc7c1b0b9368fc53b5b (patch)
tree96758456da27013ac77e14db7add80d1de6fb85f /gcc/except.c
parentaa633255e79391140eaff46920861926a35a1eaa (diff)
downloadgcc-384c400a82f70420e31fbdc7c1b0b9368fc53b5b.zip
gcc-384c400a82f70420e31fbdc7c1b0b9368fc53b5b.tar.gz
gcc-384c400a82f70420e31fbdc7c1b0b9368fc53b5b.tar.bz2
except.h (struct eh_region_d): Add use_cxa_end_cleanup.
* except.h (struct eh_region_d): Add use_cxa_end_cleanup. * except.c (gen_eh_region): Set it. (duplicate_eh_regions_1): Copy it. * tree-eh.c (lower_resx): Use it to determine which function to call to resume. * langhooks.h (struct lang_hooks): Add eh_use_cxa_end_cleanup. * langhooks-def.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. * builtins.def (BUILT_IN_CXA_END_CLEANUP): New. * tree.c (build_common_builtin_nodes): Remove parameter. Build BUILT_IN_CXA_END_CLEANUP if necessary. * tree.h (build_common_builtin_nodes): Update decl. * c-common.c (c_define_builtins): Update call to build_common_builtin_nodes. gcc/ada/ * gcc-interface/utils.c (gnat_install_builtins): Update call to build_common_builtin_nodes. gcc/cp/ * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. gcc/fortran/ * f95-lang.c (gfc_init_builtin_functions): Update call to build_common_builtin_nodes. gcc/java/ * builtins.c (initialize_builtins): Update call to build_common_builtin_nodes. * lang.c (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New. From-SVN: r152241
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/except.c b/gcc/except.c
index c916a18..bb26bf4 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -369,6 +369,10 @@ gen_eh_region (enum eh_region_type type, eh_region outer)
new_eh->index = VEC_length (eh_region, cfun->eh->region_array);
VEC_safe_push (eh_region, gc, cfun->eh->region_array, new_eh);
+ /* Copy the language's notion of whether to use __cxa_end_cleanup. */
+ if (targetm.arm_eabi_unwinder && lang_hooks.eh_use_cxa_end_cleanup)
+ new_eh->use_cxa_end_cleanup = true;
+
return new_eh;
}
@@ -573,6 +577,9 @@ duplicate_eh_regions_1 (struct duplicate_eh_regions_data *data,
EH_LANDING_PAD_NR (new_lp->post_landing_pad) = new_lp->index;
}
+ /* Make sure to preserve the original use of __cxa_end_cleanup. */
+ new_r->use_cxa_end_cleanup = old_r->use_cxa_end_cleanup;
+
for (old_r = old_r->inner; old_r ; old_r = old_r->next_peer)
duplicate_eh_regions_1 (data, old_r, new_r);
}