From cf76ef1a4605c24827dad764ea5791207458668c Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 22 Sep 2009 13:49:03 +0000 Subject: re PR objc++/41430 (exception handling testsuite failures in objc++) 2009-09-22 Richard Guenther PR objc++/41430 * Make-lang.in (objcp-lang.o): Add $(EXCEPT_H) dependency. * objcp-lang.c (LANG_HOOKS_EH_PERSONALITY): Define. (LANG_HOOKS_EH_RUNTIME_TYPE): Likewise. (objcxx_eh_personality): New function. From-SVN: r151979 --- gcc/objcp/ChangeLog | 8 ++++++++ gcc/objcp/Make-lang.in | 2 +- gcc/objcp/objcp-lang.c | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'gcc/objcp') diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index 9acf08b..97eba61 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,11 @@ +2009-09-22 Richard Guenther + + PR objc++/41430 + * Make-lang.in (objcp-lang.o): Add $(EXCEPT_H) dependency. + * objcp-lang.c (LANG_HOOKS_EH_PERSONALITY): Define. + (LANG_HOOKS_EH_RUNTIME_TYPE): Likewise. + (objcxx_eh_personality): New function. + 2009-09-03 Diego Novillo * objcp-lang.c (lang_hooks): Remove const qualifier. diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in index 0f549d0..09af104 100644 --- a/gcc/objcp/Make-lang.in +++ b/gcc/objcp/Make-lang.in @@ -72,7 +72,7 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) objcp/objcp-lang.o : objcp/objcp-lang.c \ $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \ $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objcp.h \ - $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(GIMPLE_H) + $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(GIMPLE_H) $(EXCEPT_H) objcp/objcp-decl.o : objcp/objcp-decl.c \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \ diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c index 1b54ba8..47bff9a 100644 --- a/gcc/objcp/objcp-lang.c +++ b/gcc/objcp/objcp-lang.c @@ -33,9 +33,11 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic.h" #include "debug.h" #include "cp-objcp-common.h" +#include "except.h" enum c_language_kind c_language = clk_objcxx; static void objcxx_init_ts (void); +static tree objcxx_eh_personality (void); /* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h; consequently, there should be very few hooks below. */ @@ -50,6 +52,10 @@ static void objcxx_init_ts (void); #define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS objcxx_init_ts +#undef LANG_HOOKS_EH_PERSONALITY +#define LANG_HOOKS_EH_PERSONALITY objcxx_eh_personality +#undef LANG_HOOKS_EH_RUNTIME_TYPE +#define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type /* Each front end provides its own lang hook initializer. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -138,6 +144,20 @@ objcxx_init_ts (void) init_shadowed_var_for_decl (); } +static GTY(()) tree objcp_eh_personality_decl; + +static tree +objcxx_eh_personality (void) +{ + if (!objcp_eh_personality_decl) + objcp_eh_personality_decl + = build_personality_function (USING_SJLJ_EXCEPTIONS + ? "__gxx_personality_sj0" + : "__gxx_personality_v0"); + + return objcp_eh_personality_decl; +} + void finish_file (void) -- cgit v1.1