aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.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/tree.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/tree.c')
-rw-r--r--gcc/tree.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 846dd98..315df90 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8890,13 +8890,10 @@ local_define_builtin (const char *name, tree type, enum built_in_function code,
/* Call this function after instantiating all builtins that the language
front end cares about. This will build the rest of the builtins that
- are relied upon by the tree optimizers and the middle-end.
-
- ENABLE_CXA_END_CLEANUP should be true for C++ and Java, where the ARM
- EABI requires a slightly different implementation of _Unwind_Resume. */
+ are relied upon by the tree optimizers and the middle-end. */
void
-build_common_builtin_nodes (bool enable_cxa_end_cleanup)
+build_common_builtin_nodes (void)
{
tree tmp, tmp2, ftype;
@@ -9003,23 +9000,23 @@ build_common_builtin_nodes (bool enable_cxa_end_cleanup)
local_define_builtin ("__builtin_profile_func_exit", ftype,
BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit", 0);
- if (enable_cxa_end_cleanup && targetm.arm_eabi_unwinder)
+ /* If there's a possibility that we might use the ARM EABI, build the
+ alternate __cxa_end_cleanup node used to resume from C++ and Java. */
+ if (targetm.arm_eabi_unwinder)
{
ftype = build_function_type (void_type_node, void_list_node);
- local_define_builtin ("__builtin_unwind_resume", ftype,
- BUILT_IN_UNWIND_RESUME,
+ local_define_builtin ("__builtin_cxa_end_cleanup", ftype,
+ BUILT_IN_CXA_END_CLEANUP,
"__cxa_end_cleanup", ECF_NORETURN);
}
- else
- {
- tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- ftype = build_function_type (void_type_node, tmp);
- local_define_builtin ("__builtin_unwind_resume", ftype,
- BUILT_IN_UNWIND_RESUME,
- (USING_SJLJ_EXCEPTIONS
- ? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
- ECF_NORETURN);
- }
+
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ ftype = build_function_type (void_type_node, tmp);
+ local_define_builtin ("__builtin_unwind_resume", ftype,
+ BUILT_IN_UNWIND_RESUME,
+ (USING_SJLJ_EXCEPTIONS
+ ? "_Unwind_SjLj_Resume" : "_Unwind_Resume"),
+ ECF_NORETURN);
/* The exception object and filter values from the runtime. The argument
must be zero before exception lowering, i.e. from the front end. After