From 471eff3649c0d9383213b2dfef646d0496d43e28 Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 28 Sep 2009 16:44:32 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152241 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/except.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/except.c') diff --git a/gcc/except.c b/gcc/except.c index c916a18089b..bb26bf4dc6f 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); } -- cgit v1.2.1