diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-28 16:44:32 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-28 16:44:32 +0000 |
commit | 471eff3649c0d9383213b2dfef646d0496d43e28 (patch) | |
tree | 96758456da27013ac77e14db7add80d1de6fb85f /gcc/tree-eh.c | |
parent | fcc31b99b0edd859f7a4624e661eaebfd15fc7bc (diff) | |
download | gcc-471eff3649c0d9383213b2dfef646d0496d43e28.tar.gz |
* 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
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 70c009d6bb2..0f5931e0b75 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2949,21 +2949,16 @@ lower_resx (basic_block bb, gimple stmt, struct pointer_map_t *mnt_map) up the call chain. We resolve this by generating a call to the _Unwind_Resume library function. */ - /* ??? The ARM EABI redefines _Unwind_Resume as __cxa_end_cleanup + /* The ARM EABI redefines _Unwind_Resume as __cxa_end_cleanup with no arguments for C++ and Java. Check for that. */ - switch (targetm.arm_eabi_unwinder) + if (src_r->use_cxa_end_cleanup) + { + fn = implicit_built_in_decls[BUILT_IN_CXA_END_CLEANUP]; + x = gimple_build_call (fn, 0); + gsi_insert_before (&gsi, x, GSI_SAME_STMT); + } + else { - default: - fn = implicit_built_in_decls[BUILT_IN_UNWIND_RESUME]; - if (TYPE_ARG_TYPES (TREE_TYPE (fn)) == void_list_node) - { - x = gimple_build_call (fn, 0); - gsi_insert_before (&gsi, x, GSI_SAME_STMT); - break; - } - /* FALLTHRU */ - - case 0: fn = implicit_built_in_decls[BUILT_IN_EH_POINTER]; src_nr = build_int_cst (NULL, src_r->index); x = gimple_build_call (fn, 1, src_nr); @@ -2975,7 +2970,6 @@ lower_resx (basic_block bb, gimple stmt, struct pointer_map_t *mnt_map) fn = implicit_built_in_decls[BUILT_IN_UNWIND_RESUME]; x = gimple_build_call (fn, 1, var); gsi_insert_before (&gsi, x, GSI_SAME_STMT); - break; } gcc_assert (EDGE_COUNT (bb->succs) == 0); |