From 58d82cd04d30e16e38e5fcac6d2d120fa55d64ed Mon Sep 17 00:00:00 2001 From: rguenth Date: Sun, 13 Sep 2009 19:40:33 +0000 Subject: 2009-09-13 Richard Guenther Rafael Avila de Espindola * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151676 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/libfuncs.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'gcc/libfuncs.h') diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h index 70621cf2889..997ecb03641 100644 --- a/gcc/libfuncs.h +++ b/gcc/libfuncs.h @@ -31,7 +31,6 @@ enum libfunc_index LTI_setbits, LTI_unwind_resume, - LTI_eh_personality, LTI_setjmp, LTI_longjmp, LTI_unwind_sjlj_register, @@ -61,7 +60,6 @@ extern GTY(()) rtx libfunc_table[LTI_MAX]; #define setbits_libfunc (libfunc_table[LTI_setbits]) #define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume]) -#define eh_personality_libfunc (libfunc_table[LTI_eh_personality]) #define setjmp_libfunc (libfunc_table[LTI_setjmp]) #define longjmp_libfunc (libfunc_table[LTI_longjmp]) #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register]) -- cgit v1.2.1 From e38def9ca7953bb5611d08ce8617249516ba5a99 Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 14 Sep 2009 19:18:58 +0000 Subject: Squash commit of EH in gimple git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151696 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/libfuncs.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'gcc/libfuncs.h') diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h index 997ecb03641..d3e69e3e241 100644 --- a/gcc/libfuncs.h +++ b/gcc/libfuncs.h @@ -30,7 +30,6 @@ enum libfunc_index LTI_memset, LTI_setbits, - LTI_unwind_resume, LTI_setjmp, LTI_longjmp, LTI_unwind_sjlj_register, @@ -59,7 +58,6 @@ extern GTY(()) rtx libfunc_table[LTI_MAX]; #define memset_libfunc (libfunc_table[LTI_memset]) #define setbits_libfunc (libfunc_table[LTI_setbits]) -#define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume]) #define setjmp_libfunc (libfunc_table[LTI_setjmp]) #define longjmp_libfunc (libfunc_table[LTI_longjmp]) #define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register]) -- cgit v1.2.1 From e3805e9e84e92aeb06a20ecb868d818905ba0e9c Mon Sep 17 00:00:00 2001 From: steven Date: Wed, 26 May 2010 21:46:22 +0000 Subject: gcc/ChangeLog: * explow.c (set_stack_check_libfunc): Adjust to accept name as a string instead of SYMBOL_REF rtx. * rtl.h (set_stack_check_libfunc): Move prototype from here... * libfuncs.h: ...to here. Adjust for explow.c change. ada/ChangeLog: * gcc-interface/trans.c: Do not include rtl.h, insclude libfuncs.h. (gigi): Adjust call to set_stack_check_libfunc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159900 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/libfuncs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/libfuncs.h') diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h index d3e69e3e241..9916d2f94f0 100644 --- a/gcc/libfuncs.h +++ b/gcc/libfuncs.h @@ -71,4 +71,7 @@ extern GTY(()) rtx libfunc_table[LTI_MAX]; #define gcov_flush_libfunc (libfunc_table[LTI_gcov_flush]) +/* In explow.c */ +extern void set_stack_check_libfunc (const char *); + #endif /* GCC_LIBFUNCS_H */ -- cgit v1.2.1 From d0f03375468f173a33fe2f655e260c0ff6209e25 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Mon, 12 Jul 2010 18:55:48 +0000 Subject: gcc/ * Makefile.in (LIBFUNCS_H): Add $(HASHTAB_H). (target-globals.o): Depend on $(LIBFUNCS_H). * libfuncs.h: Include hashtab.h. (libfunc_entry): Moved from optabs.c. (target_libfuncs): New structure. (default_target_libfuncs): Declare. (this_target_libfuncs): Declare as a variable or define as a macro. (libfunc_table): Redefine as a macro. * optabs.c (default_target_libfuncs): New variable. (this_target_libfuncs): New conditional variable. (libfunc_table): Delete. (libfunc_entry): Moved to optabs.h. (libfunc_hash): Redefine as a macro. (hash_libfunc, eq_libfunc): Fix comments. (init_optabs): Use libfunc_hash to detect cases where the function has already been called. Clear the hash table instead of recreating it. * target-globals.h (this_target_libfuncs): Declare. (target_globals): Add a libfuncs field. (restore_target_globals): Copy the libfuncs field to this_target_libfuncs. * target-globals.c: Include libfuncs.h. (default_target_globals): Initialize the libfuncs field. (save_target_globals): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162099 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/libfuncs.h | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'gcc/libfuncs.h') diff --git a/gcc/libfuncs.h b/gcc/libfuncs.h index 9916d2f94f0..68b090eaad1 100644 --- a/gcc/libfuncs.h +++ b/gcc/libfuncs.h @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_LIBFUNCS_H #define GCC_LIBFUNCS_H +#include "hashtab.h" + /* Enumeration of indexes into libfunc_table. */ enum libfunc_index { @@ -45,9 +47,34 @@ enum libfunc_index LTI_MAX }; -/* SYMBOL_REF rtx's for the library functions that are called - implicitly and not via optabs. */ -extern GTY(()) rtx libfunc_table[LTI_MAX]; +/* Information about an optab-related libfunc. We use the same hashtable + for normal optabs and conversion optabs. In the first case mode2 + is unused. */ +struct GTY(()) libfunc_entry { + size_t optab; + enum machine_mode mode1, mode2; + rtx libfunc; +}; + +/* Target-dependent globals. */ +struct GTY(()) target_libfuncs { + /* SYMBOL_REF rtx's for the library functions that are called + implicitly and not via optabs. */ + rtx x_libfunc_table[LTI_MAX]; + + /* Hash table used to convert declarations into nodes. */ + htab_t GTY((param_is (struct libfunc_entry))) x_libfunc_hash; +}; + +extern GTY(()) struct target_libfuncs default_target_libfuncs; +#if SWITCHABLE_TARGET +extern struct target_libfuncs *this_target_libfuncs; +#else +#define this_target_libfuncs (&default_target_libfuncs) +#endif + +#define libfunc_table \ + (this_target_libfuncs->x_libfunc_table) /* Accessor macros for libfunc_table. */ -- cgit v1.2.1