diff options
author | Richard Guenther <rguenther@suse.de> | 2009-09-13 19:40:33 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-09-13 19:40:33 +0000 |
commit | f9417da1a250b18ea0ee2d493c0750e58aa87ab8 (patch) | |
tree | 5e937f9960fc5af8114c7b2d8943ecdd565debb2 /gcc/java | |
parent | 22f3450401afc7a025eec24ede6a947ffd7ad0f7 (diff) | |
download | gcc-f9417da1a250b18ea0ee2d493c0750e58aa87ab8.zip gcc-f9417da1a250b18ea0ee2d493c0750e58aa87ab8.tar.gz gcc-f9417da1a250b18ea0ee2d493c0750e58aa87ab8.tar.bz2 |
langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
2009-09-13 Richard Guenther <rguenther@suse.de>
Rafael Avila de Espindola <espindola@google.com>
* langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
(LANG_HOOKS_EH_PERSONALITY): Likewise.
(LANG_HOOKS_INITIALIZER): Adjust.
(lhd_pass_through_t): Declare.
* langhooks.h (struct lang_hooks): Add eh_runtime_type and
eh_personality.
* langhooks.c (lhd_pass_through_t): New function.
* dwarf2out.c (output_call_frame_info, dwarf2out_do_cfi_startproc,
dwarf2out_begin_prologue): Use personality from current_function_decl.
* expr.h (get_personality_function): Declare.
* expr.c (get_personality_function): New function.
(build_personality_function): Likewise.
* libfuncs.h (libfunc_index): Remove LTI_eh_personality.
(eh_personality_libfunc): Remove.
* optabs.c (build_libfunc_function): New function split out from ...
(init_one_libfunc): ... here.
* tree.h (DECL_FUNCTION_PERSONALITY): New.
(tree_function_decl): Add personality.
(lhd_gcc_personality): Declare.
(build_personality_function): Likewise.
* tree.c (gcc_eh_personality_decl): New.
(lhd_gcc_personality): New function.
* except.h (lang_eh_runtime_type): Remove.
(enum eh_personality_kind): New.
(build_personality_function): Declare.
(function_needs_eh_personality): Declare.
* except.c (lang_eh_runtime_type): Remove.
(function_needs_eh_personality): New function.
(add_type_for_runtime): Call lang_hooks.type_for_runtime instead.
(sjlj_emit_function_enter, output_function_exception_table):
Use personality from current_function_decl.
* tree-eh.c (lower_eh_constructs): Set DECL_FUNCTION_PERSONALITY.
* tree-inline.c (tree_can_inline_p): Do not inline across different
EH personalities.
(expand_call_inline): Likewise. Adjust the callers EH personality.
(tree_function_versioning): Copy DECL_FUNCTION_PERSONALITY.
* cgraph.c (cgraph_add_new_function): Set DECL_FUNCTION_PERSONALITY.
* Makefile.in (cgraph.o): Add $(EXCEPT_H) dependency.
(c-parser.o): Likewise
* c-tree.h (c_eh_initialized_p): Remove.
(c_maybe_initialize_eh): Likewise.
* c-decl.c (finish_decl): Don't call c_maybe_initialize_eh.
(finish_decl): Don't call c_maybe_initialize_eh.
(c_eh_initialized_p): Remove.
(c_maybe_initialize_eh): Likewise.
* c-parser.c (c_parser_omp_construct): Likewise.
(c_parse_file): Initialize exception handling.
objc/
* objc-act.c (objc_eh_runtime_type): Export.
(objc_init_exceptions): Remove. Move warning code ...
(objc_begin_try_stmt): ... here
(objc_build_throw_stmt): ... and here.
(objc_eh_personality_decl): New.
(objc_eh_personality): New function.
* objc-act.h (objc_eh_runtime_type): Declare.
(objc_eh_personality): Likewise.
* objc-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
(LANG_HOOKS_EH_PERSONALITY): Likewise.
cp/
* except.c (init_exception_processing): Do not set
lang_eh_runtime_type.
(choose_personality_routine): Do not set eh_personality_decl,
set pragma_java_exceptions.
* cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
(LANG_HOOKS_EH_PERSONALITY): Likewise.
(cp_eh_personality_decl): New.
(cp_eh_personality): Likewise.
* Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
dependencies.
java/
* decl.c (do_nothing): Remove.
(java_init_decl_processing): Do not set lang_eh_runtime_type.
* Make-lang.in (lang.o): Add $(EXCEPT_H) dependency.
* lang.c (java_eh_personality): New.
(java_eh_personality_decl): Likewise.
(LANG_HOOKS_EH_PERSONALITY): Define.
ada/
* gcc-interface/misc.c (gnat_init_gcc_eh): Do not set
lang_eh_runtime_type.
(LANG_HOOKS_EH_PERSONALITY): Define.
(gnat_eh_personality_decl): New.
(gnat_eh_personality): Likewise.
* Make-lang.in (misc.o): Add gt-ada-misc.h dependency.
* config-lang.in (gtfiles): Add misc.c.
fortran/
* f95-lang.c (gfc_maybe_initialize_eh): Do not init
eh_personality_libfunc.
Co-Authored-By: Rafael Avila de Espindola <espindola@google.com>
From-SVN: r151676
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/java/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/java/decl.c | 12 | ||||
-rw-r--r-- | gcc/java/lang.c | 20 |
4 files changed, 32 insertions, 12 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 569b5fe..6b7d930 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,13 @@ +2009-09-13 Richard Guenther <rguenther@suse.de> + Rafael Avila de Espindola <espindola@google.com> + + * decl.c (do_nothing): Remove. + (java_init_decl_processing): Do not set lang_eh_runtime_type. + * Make-lang.in (lang.o): Add $(EXCEPT_H) dependency. + * lang.c (java_eh_personality): New. + (java_eh_personality_decl): Likewise. + (LANG_HOOKS_EH_PERSONALITY): Define. + 2009-09-03 Diego Novillo <dnovillo@google.com> * lang.c (lang_hooks): Remove const qualifier. diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index ff330fd..a56e2b6 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -284,7 +284,7 @@ java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \ coretypes.h $(TM_H) intl.h java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(EXPR_H) $(DIAGNOSTIC_H) \ - langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.h + langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.h $(EXCEPT_H) java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \ coretypes.h $(TM_H) toplev.h $(GGC_H) gt-java-mangle.h $(LANGHOOKS_DEF_H) java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \ diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 4ab67d6..c9ccc9d 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -510,12 +510,6 @@ create_primitive_vtable (const char *name) return r; } -static tree -do_nothing (tree t) -{ - return t; -} - /* Parse the version string and compute the ABI version number. */ static void parse_version (void) @@ -1195,16 +1189,12 @@ java_init_decl_processing (void) 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Initialize variables for except.c. */ - eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS - ? "__gcj_personality_sj0" - : "__gcj_personality_v0"); + if (targetm.arm_eabi_unwinder) unwind_resume_libfunc = init_one_libfunc ("__cxa_end_cleanup"); else default_init_unwind_resume_libfunc (); - lang_eh_runtime_type = do_nothing; - initialize_builtins (); soft_fmod_node = built_in_decls[BUILT_IN_FMOD]; diff --git a/gcc/java/lang.c b/gcc/java/lang.c index d97b508..504d029 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -45,6 +45,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "tree-dump.h" #include "opts.h" #include "options.h" +#include "except.h" static bool java_init (void); static void java_finish (void); @@ -64,6 +65,8 @@ static bool java_decl_ok_for_sibcall (const_tree); static enum classify_record java_classify_record (tree type); +static tree java_eh_personality (void); + #ifndef TARGET_OBJECT_SUFFIX # define TARGET_OBJECT_SUFFIX ".o" #endif @@ -158,6 +161,9 @@ struct GTY(()) language_function { #undef LANG_HOOKS_ATTRIBUTE_TABLE #define LANG_HOOKS_ATTRIBUTE_TABLE java_attribute_table +#undef LANG_HOOKS_EH_PERSONALITY +#define LANG_HOOKS_EH_PERSONALITY java_eh_personality + /* Each front end provides its own. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -880,4 +886,18 @@ java_classify_record (tree type) return RECORD_IS_CLASS; } +static GTY(()) tree java_eh_personality_decl; + +static tree +java_eh_personality (void) +{ + if (!java_eh_personality_decl) + java_eh_personality_decl + = build_personality_function (USING_SJLJ_EXCEPTIONS + ? "__gcj_personality_sj0" + : "__gcj_personality_v0"); + + return java_eh_personality_decl; +} + #include "gt-java-lang.h" |