From 596981c8fa329037fcb1297eaa219a36ad323e3e Mon Sep 17 00:00:00 2001 From: steven Date: Mon, 28 Jun 2010 10:52:46 +0000 Subject: gcc/ChangeLog: 2010-06-28 Steven Bosscher * system.h: Poison GCC_EXCEPT_H for front-end files. * langhooks.h (struct lang_hooks): Add eh_protect_cleanup_actions langhook. * langhooks-def.h (LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS) New. Define to NULL by default. * except.h: Define GCC_EXCEPT_H. (doing_eh): Remove prototype. (init_eh, init_eh_for_function): Move prototypes to toplev.h. (lang_protect_cleanup_actions): Remove. * except.c (lang_protect_cleanup_actions): Remove. (doing_eh): Remove. (gen_eh_region): Don't check doing_eh here. * toplev.h (init_eh, init_eh_for_function_): Moved from except.h. * tree-eh.c (honor_protect_cleanup_actions): Use new langhook instead of lang_protect_cleanup_actions. * omp-low.c (maybe_catch_exception): Likewise. * Makefile.in: Update dependencies. gcc/c-family/ChangeLog: 2010-06-28 Steven Bosscher * c-cppbuiltin.c: Do not include except.h. gcc/objc/ChangeLog: 2010-06-28 Steven Bosscher * objc-act.c: Do not include except.h. gcc/cp/ChangeLog: 2010-06-28 Steven Bosscher * init.c: Do not include except.h. * decl.c: Likewise. * expr.c: Likewise. * cp-lang.c: Likewise. * pt.c: Likewise. * semantics.c: Likewise. * decl2.c: Likewise. * except.c: Likewise. (init_exception_processing): Do not set the removed lang_protect_cleanup_actions here. (cp_protect_cleanup_actions): Make non-static and remove prototype. (doing_eh): New, moved from except.c but removed the do_warning flag. (expand_start_catch_block): Update doing_eh call. (expand_end_catch_block): Likewise. (build_throw): Likewise. * cp-tree.h: Prototype cp_protect_cleanup_actions. * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to cp_protect_cleanup_actions. * Make-lang.in: Update dependencies. gcc/objcp/ChangeLog: 2010-06-28 Steven Bosscher * objcp-lang.c: Do not include except.h. * Make-lang.in: Update dependencies. gcc/java/ChangeLog: 2010-06-28 Steven Bosscher * lang.c: Do not include except.h * except.c: Likewise. (doing_eh): New, moved from except.c (in gcc/) but removed the do_warning flag. (maybe_start_try): Update doing_eh call. * Make-lang.in: Update dependencies. gcc/ada/ChangeLog: 2010-06-28 Steven Bosscher * gcc-interface/misc.c: Do not include except.h. * gcc-interface/Make-lang.in: Update dependencies. gcc/fortran/ChangeLog: 2010-06-28 Steven Bosscher * Make-lang.in: Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161484 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/Makefile.in | 14 +++++++------- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/Make-lang.in | 2 +- gcc/ada/gcc-interface/misc.c | 3 +-- gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c-cppbuiltin.c | 1 - gcc/cp/ChangeLog | 22 ++++++++++++++++++++++ gcc/cp/Make-lang.in | 16 +++++++--------- gcc/cp/cp-lang.c | 1 - gcc/cp/cp-objcp-common.h | 3 +++ gcc/cp/cp-tree.h | 1 + gcc/cp/decl.c | 1 - gcc/cp/decl2.c | 1 - gcc/cp/except.c | 36 ++++++++++++++++++++++++++++-------- gcc/cp/expr.c | 1 - gcc/cp/init.c | 1 - gcc/cp/pt.c | 1 - gcc/cp/semantics.c | 1 - gcc/except.c | 34 +--------------------------------- gcc/except.h | 19 +++++++------------ gcc/fortran/ChangeLog | 4 ++++ gcc/fortran/Make-lang.in | 2 +- gcc/java/ChangeLog | 9 +++++++++ gcc/java/Make-lang.in | 4 ++-- gcc/java/except.c | 26 ++++++++++++++++++++++++-- gcc/java/lang.c | 1 - gcc/langhooks-def.h | 2 ++ gcc/langhooks.h | 8 ++++++++ gcc/objc/ChangeLog | 4 ++++ gcc/objc/objc-act.c | 1 - gcc/objcp/ChangeLog | 5 +++++ gcc/objcp/Make-lang.in | 2 +- gcc/objcp/objcp-lang.c | 1 - gcc/omp-low.c | 4 ++-- gcc/system.h | 2 +- gcc/toplev.h | 5 +++++ gcc/tree-eh.c | 16 ++++++++-------- 38 files changed, 184 insertions(+), 100 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fef5c987ba2..7b5976187e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2010-06-28 Steven Bosscher + + * system.h: Poison GCC_EXCEPT_H for front-end files. + + * langhooks.h (struct lang_hooks): Add eh_protect_cleanup_actions + langhook. + * langhooks-def.h (LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS) New. + Define to NULL by default. + * except.h: Define GCC_EXCEPT_H. + (doing_eh): Remove prototype. + (init_eh, init_eh_for_function): Move prototypes to toplev.h. + (lang_protect_cleanup_actions): Remove. + * except.c (lang_protect_cleanup_actions): Remove. + (doing_eh): Remove. + (gen_eh_region): Don't check doing_eh here. + * toplev.h (init_eh, init_eh_for_function_): Moved from except.h. + * tree-eh.c (honor_protect_cleanup_actions): Use new langhook + instead of lang_protect_cleanup_actions. + * omp-low.c (maybe_catch_exception): Likewise. + * Makefile.in: Update dependencies. + 2010-06-28 Bingfeng Mei * cgraph.h (struct varpool_node): new used_from_object_file flag. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 2075cf3360e..aa3f74d2683 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -2081,7 +2081,7 @@ c-family/c-common.o : c-family/c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ c-family/c-cppbuiltin.o : c-family/c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) \ - $(FLAGS_H) $(TOPLEV_H) output.h $(EXCEPT_H) $(TREE_H) $(TARGET_H) \ + $(FLAGS_H) $(TOPLEV_H) output.h $(TREE_H) $(TARGET_H) \ $(TM_P_H) $(BASEVER) debug.h $(CPP_ID_DATA_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ -DBASEVER=$(BASEVER_s) $< $(OUTPUT_OPTION) @@ -2283,26 +2283,26 @@ lto-cgraph.o: lto-cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \ $(HASHTAB_H) langhooks.h $(BASIC_BLOCK_H) \ $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_CORE_H) \ - except.h $(TIMEVAR_H) output.h pointer-set.h $(LTO_STREAMER_H) $(GCOV_IO_H) + $(EXCEPT_H) $(TIMEVAR_H) output.h pointer-set.h $(LTO_STREAMER_H) $(GCOV_IO_H) lto-streamer-in.o: lto-streamer-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \ $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) \ $(FUNCTION_H) $(GGC_H) $(DIAGNOSTIC_H) libfuncs.h $(EXCEPT_H) debug.h \ - $(TIMEVAR_H) output.h $(IPA_UTILS_H) $(LTO_STREAMER_H) + $(TIMEVAR_H) output.h $(IPA_UTILS_H) $(LTO_STREAMER_H) toplev.h lto-streamer-out.o : lto-streamer-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \ $(HASHTAB_H) $(BASIC_BLOCK_H) tree-iterator.h \ $(TREE_FLOW_H) $(TREE_PASS_H) $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) \ - $(DIAGNOSTIC_CORE_H) except.h $(LTO_STREAMER_H) $(TOPLEV_H) + $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(LTO_STREAMER_H) $(TOPLEV_H) lto-section-in.o: lto-section-in.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TOPLEV_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h \ $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(CGRAPH_H) $(FUNCTION_H) \ - $(GGC_H) $(DIAGNOSTIC_CORE_H) except.h $(TIMEVAR_H) output.h \ + $(GGC_H) $(DIAGNOSTIC_CORE_H) $(EXCEPT_H) $(TIMEVAR_H) output.h \ $(LTO_STREAMER_H) lto-compress.h lto-section-out.o : lto-section-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TOPLEV_H) $(TREE_H) $(EXPR_H) $(PARAMS_H) input.h \ $(HASHTAB_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TREE_PASS_H) \ - $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) except.h pointer-set.h \ + $(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(EXCEPT_H) pointer-set.h \ $(BITMAP_H) langhooks.h $(LTO_STREAMER_H) lto-compress.h lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ toplev.h $(TREE_H) $(GIMPLE_H) $(GGC_H) $(LAMBDA_H) $(HASHTAB_H) \ @@ -4419,7 +4419,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \ intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) $(C_COMMON_H) $(C_PRETTY_PRINT_H) \ tree-iterator.h $(PLUGIN_H) $(TREE_FLOW_H) langhooks.h incpath.h debug.h \ - except.h tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \ + $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \ $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \ cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h \ $(IPA_PROP_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) version.h diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1c702a4e216..4046a3a1e89 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Steven Bosscher + + * gcc-interface/misc.c: Do not include except.h. + * gcc-interface/Make-lang.in: Update dependencies. + 2010-06-27 Eric Botcazou * gcc-interface/trans.c: Include tree-flow.h. diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index d4f37fe5374..095ae08bbad 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -1244,7 +1244,7 @@ ada/decl.o : ada/gcc-interface/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ ada/misc.o : ada/gcc-interface/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TREE_H) $(DIAGNOSTIC_H) $(TARGET_H) $(FUNCTION_H) \ - $(FLAGS_H) debug.h toplev.h $(EXCEPT_H) langhooks.h \ + $(FLAGS_H) debug.h toplev.h langhooks.h \ $(LANGHOOKS_DEF_H) opts.h options.h $(TREE_INLINE_H) $(PLUGIN_H) \ ada/gcc-interface/ada.h ada/adadecode.h ada/types.h ada/atree.h \ ada/elists.h ada/namet.h ada/nlists.h ada/stringt.h ada/uintp.h ada/fe.h \ diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 3716f1a631f..4033173d782 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -25,7 +25,7 @@ /* This file contains parts of the compiler that are required for interfacing with GCC but otherwise do nothing and parts of Gigi that need to know - about RTL. */ + about GIMPLE. */ #include "config.h" #include "system.h" @@ -44,7 +44,6 @@ #include "options.h" #include "plugin.h" #include "function.h" /* For pass_by_reference. */ -#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ #include "ada.h" #include "adadecode.h" diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 0d54b2d01fc..5b575ee1b3d 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2010-06-28 Steven Bosscher + + * c-cppbuiltin.c: Do not include except.h. + 2010-06-24 Andi Kleen * c-common.c (warn_for_omitted_condop): New. diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 1105ce59f81..fbace227195 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "c-common.h" #include "c-pragma.h" #include "output.h" -#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ #include "debug.h" /* For dwarf2out_do_cfi_asm. */ #include "toplev.h" #include "tm_p.h" /* For TARGET_CPU_CPP_BUILTINS & friends. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e9d85c30ffe..3b5f1bd82de 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,25 @@ +2010-06-28 Steven Bosscher + + * init.c: Do not include except.h. + * decl.c: Likewise. + * expr.c: Likewise. + * cp-lang.c: Likewise. + * pt.c: Likewise. + * semantics.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + (init_exception_processing): Do not set the removed + lang_protect_cleanup_actions here. + (cp_protect_cleanup_actions): Make non-static and remove prototype. + (doing_eh): New, moved from except.c but removed the do_warning flag. + (expand_start_catch_block): Update doing_eh call. + (expand_end_catch_block): Likewise. + (build_throw): Likewise. + * cp-tree.h: Prototype cp_protect_cleanup_actions. + * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to + cp_protect_cleanup_actions. + * Make-lang.in: Update dependencies. + 2010-06-26 Jason Merrill * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index bfccd72d5d8..f664c78f12f 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -249,14 +249,14 @@ cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ $(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H) cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h \ $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \ - cp/cp-objcp-common.h $(EXPR_H) $(EXCEPT_H) + cp/cp-objcp-common.h $(EXPR_H) cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \ - output.h $(EXCEPT_H) toplev.h $(HASHTAB_H) $(RTL_H) \ + output.h toplev.h $(HASHTAB_H) $(RTL_H) \ cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \ debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H) $(PLUGIN_H) \ intl.h tree-iterator.h $(SPLAY_TREE_H) cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \ - output.h $(EXCEPT_H) toplev.h $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ + output.h toplev.h $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \ $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) $(GIMPLE_H) $(POINTER_SET_H) \ $(SPLAY_TREE_H) c-family/c-ada-spec.h cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \ @@ -288,19 +288,17 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \ cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ $(TARGET_H) $(C_PRAGMA_H) gt-cp-rtti.h intl.h -cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(EXCEPT_H) \ +cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ toplev.h cp/cfns.h $(TREE_INLINE_H) $(TARGET_H) -cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ - toplev.h $(EXCEPT_H) $(TM_P_H) +cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(TM_P_H) cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \ - toplev.h $(EXCEPT_H) $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h \ - vecprim.h intl.h + toplev.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h vecprim.h intl.h cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) \ tree-diagnostic.h tree-pretty-print.h cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) \ gt-cp-repo.h -cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) $(EXCEPT_H) toplev.h \ +cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) toplev.h \ $(FLAGS_H) output.h $(RTL_H) $(TIMEVAR_H) \ $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) $(GIMPLE_H) \ bitmap.h gt-cp-semantics.h diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index 541e9adcdeb..fb687b81685 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -32,7 +32,6 @@ along with GCC; see the file COPYING3. If not see #include "debug.h" #include "cp-objcp-common.h" #include "hashtab.h" -#include "except.h" enum c_language_kind c_language = clk_cxx; static void cp_init_ts (void); diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 1a97ad2b119..f2d4aa1cceb 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -143,4 +143,7 @@ extern bool cp_function_decl_explicit_p (tree decl); #undef LANG_HOOKS_EH_USE_CXA_END_CLEANUP #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP true +#undef LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS +#define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS cp_protect_cleanup_actions + #endif /* GCC_CP_OBJCP_COMMON */ diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f63ec2e795c..285dac73c81 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4855,6 +4855,7 @@ extern tree eh_type_info (tree); extern tree begin_eh_spec_block (void); extern void finish_eh_spec_block (tree, tree); extern tree build_eh_type_type (tree); +extern tree cp_protect_cleanup_actions (void); /* in expr.c */ extern tree cplus_expand_constant (tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9541252125a..48d2b690752 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see #include "decl.h" #include "intl.h" #include "output.h" -#include "except.h" #include "toplev.h" #include "hashtab.h" #include "tm_p.h" diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 691c1dbc0f3..1e088e0464a 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -37,7 +37,6 @@ along with GCC; see the file COPYING3. If not see #include "cp-tree.h" #include "decl.h" #include "output.h" -#include "except.h" #include "toplev.h" #include "timevar.h" #include "cpplib.h" diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 64f417154ce..79bab76cc5a 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see #include "cp-tree.h" #include "flags.h" #include "output.h" -#include "except.h" #include "toplev.h" #include "tree-inline.h" #include "tree-iterator.h" @@ -50,7 +49,6 @@ static tree wrap_cleanups_r (tree *, int *, void *); static int complete_ptr_ref_or_void_ptr_p (tree, tree); static bool is_admissible_throw_operand (tree); static int can_convert_eh (tree, tree); -static tree cp_protect_cleanup_actions (void); /* Sets up all the global eh stuff that needs to be initialized at the start of compilation. */ @@ -72,14 +70,12 @@ init_exception_processing (void) tmp = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE); call_unexpected_node = push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp); - - lang_protect_cleanup_actions = &cp_protect_cleanup_actions; } /* Returns an expression to be executed if an unhandled exception is propagated out of a cleanup region. */ -static tree +tree cp_protect_cleanup_actions (void) { /* [except.terminate] @@ -407,6 +403,30 @@ initialize_handler_parm (tree decl, tree exp) LOOKUP_ONLYCONVERTING|DIRECT_BIND); } + +/* Routine to see if exception handling is turned on. + DO_WARN is nonzero if we want to inform the user that exception + handling is turned off. + + This is used to ensure that -fexceptions has been specified if the + compiler tries to use any exception-specific functions. */ + +static inline int +doing_eh (void) +{ + if (! flag_exceptions) + { + static int warned = 0; + if (! warned) + { + error ("exception handling disabled, use -fexceptions to enable"); + warned = 1; + } + return 0; + } + return 1; +} + /* Call this to start a catch block. DECL is the catch parameter. */ tree @@ -415,7 +435,7 @@ expand_start_catch_block (tree decl) tree exp; tree type, init; - if (! doing_eh (1)) + if (! doing_eh ()) return NULL_TREE; /* Make sure this declaration is reasonable. */ @@ -494,7 +514,7 @@ expand_start_catch_block (tree decl) void expand_end_catch_block (void) { - if (! doing_eh (1)) + if (! doing_eh ()) return; /* The exception being handled is rethrown if control reaches the end of @@ -641,7 +661,7 @@ build_throw (tree exp) return error_mark_node; } - if (! doing_eh (1)) + if (! doing_eh ()) return error_mark_node; if (exp && decl_is_java_type (TREE_TYPE (exp), 1)) diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 0a0ba534063..681834d9a37 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "cp-tree.h" #include "toplev.h" -#include "except.h" #include "tm_p.h" /* Expand C++-specific constants. Currently, this means PTRMEM_CST. */ diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 84e486cea46..30808b233ce 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "cp-tree.h" #include "flags.h" #include "output.h" -#include "except.h" #include "toplev.h" #include "target.h" diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b97d3f5cc09..863218d68a9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -40,7 +40,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "decl.h" #include "output.h" -#include "except.h" #include "toplev.h" #include "timevar.h" #include "tree-iterator.h" diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 4869cfc47e9..e750937dfe1 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-common.h" #include "tree-inline.h" #include "tree-mudflap.h" -#include "except.h" #include "toplev.h" #include "flags.h" #include "output.h" diff --git a/gcc/except.c b/gcc/except.c index 16a02473a12..285d4a657e8 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see During pass_lower_eh (tree-eh.c) we record the nested structure of the TRY nodes in EH_REGION nodes in CFUN->EH->REGION_TREE. - We expand the lang_protect_cleanup_actions hook into MUST_NOT_THROW + We expand the eh_protect_cleanup_actions langhook into MUST_NOT_THROW regions at this time. We can then flatten the statements within the TRY nodes to straight-line code. Statements that had been within TRY nodes that can throw are recorded within CFUN->EH->THROW_STMT_TABLE, @@ -150,10 +150,6 @@ along with GCC; see the file COPYING3. If not see #define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM #endif -/* Protect cleanup actions with must-not-throw regions, with a call - to the given failure handler. */ -tree (*lang_protect_cleanup_actions) (void); - static GTY(()) int call_site_base; static GTY ((param_is (union tree_node))) htab_t type_to_runtime_map; @@ -203,30 +199,6 @@ static void dw2_output_call_site_table (int, int); static void sjlj_output_call_site_table (void); -/* Routine to see if exception handling is turned on. - DO_WARN is nonzero if we want to inform the user that exception - handling is turned off. - - This is used to ensure that -fexceptions has been specified if the - compiler tries to use any exception-specific functions. */ - -int -doing_eh (int do_warn) -{ - if (! flag_exceptions) - { - static int warned = 0; - if (! warned && do_warn) - { - error ("exception handling disabled, use -fexceptions to enable"); - warned = 1; - } - return 0; - } - return 1; -} - - void init_eh (void) { @@ -345,10 +317,6 @@ gen_eh_region (enum eh_region_type type, eh_region outer) { eh_region new_eh; -#ifdef ENABLE_CHECKING - gcc_assert (doing_eh (0)); -#endif - /* Insert a new blank region as a leaf in the tree. */ new_eh = ggc_alloc_cleared_eh_region_d (); new_eh->type = type; diff --git a/gcc/except.h b/gcc/except.h index 068a444c9b1..72fd76ef646 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -19,6 +19,13 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see . */ +/* No include guards here, but define an include file marker anyway, so + that the compiler can keep track of where this file is included. This + is e.g. used to avoid including this file in front-end specific files. */ +#ifndef GCC_EXCEPT_H +# define GCC_EXCEPT_H +#endif + #include "hashtab.h" #include "vecprim.h" #include "vecir.h" @@ -222,14 +229,10 @@ struct GTY(()) eh_status }; -/* Test: is exception handling turned on? */ -extern int doing_eh (int); - /* Invokes CALLBACK for every exception handler label. Only used by old loop hackery; should not be used by new code. */ extern void for_each_eh_label (void (*) (rtx)); -extern void init_eh (void); extern void init_eh_for_function (void); extern void remove_eh_landing_pad (eh_landing_pad); @@ -287,14 +290,6 @@ extern void assign_filter_values (void); extern eh_region get_eh_region_from_rtx (const_rtx); extern eh_landing_pad get_eh_landing_pad_from_rtx (const_rtx); -/* If non-NULL, this is a function that returns a function decl to be - executed if an unhandled exception is propagated out of a cleanup - region. For example, in C++, an exception thrown by a destructor - during stack unwinding is required to result in a call to - `std::terminate', so the C++ version of this function returns a - FUNCTION_DECL for `std::terminate'. */ -extern tree (*lang_protect_cleanup_actions) (void); - struct GTY(()) throw_stmt_node { gimple stmt; int lp_nr; diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d58299dc4d5..fc8445c784d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2010-06-28 Steven Bosscher + + * Make-lang.in: Update dependencies. + 2010-06-27 Nathan Froyd * gfortran.h (gfc_code): Split backend_decl field into cycle_label diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index b74f9e99d0b..2a8c791c445 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -336,7 +336,7 @@ GFORTRAN_TRANS_DEPS = fortran/gfortran.h fortran/libgfortran.h \ fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \ gt-fortran-f95-lang.h gtype-fortran.h $(CGRAPH_H) $(TARGET_H) fortran/cpp.h \ $(BUILTINS_DEF) fortran/types.def \ - libfuncs.h expr.h except.h + libfuncs.h expr.h fortran/scanner.o: toplev.h fortran/cpp.h fortran/convert.o: $(GFORTRAN_TRANS_DEPS) fortran/trans.o: $(GFORTRAN_TRANS_DEPS) tree-iterator.h diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e1135318f1b..0d50a7f4439 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,12 @@ +2010-06-28 Steven Bosscher + + * lang.c: Do not include except.h + * except.c: Likewise. + (doing_eh): New, moved from except.c (in gcc/) but removed the + do_warning flag. + (maybe_start_try): Update doing_eh call. + * Make-lang.in: Update dependencies. + 2010-06-23 Anatoly Sokolov * decl.c (java_init_decl_processing): Use double_int_to_tree instead diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index 26a81bab79a..5e240ed0743 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -285,7 +285,7 @@ java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ libfuncs.h java/java-except.h $(GGC_H) $(REAL_H) gt-java-decl.h \ $(TARGET_H) $(CGRAPH_H) langhooks.h java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \ - java/javaop.h java/java-opcodes.h except.h java/java-except.h \ + java/javaop.h java/java-opcodes.h java/java-except.h \ toplev.h $(SYSTEM_H) coretypes.h java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \ java/javaop.h java/java-opcodes.h \ @@ -302,7 +302,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) $(DIAGNOSTIC_H) \ - langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.h $(EXCEPT_H) + langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.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/except.c b/gcc/java/except.c index f5a64071204..2c3aead1a4c 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -31,7 +31,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "javaop.h" #include "java-opcodes.h" #include "jcf.h" -#include "except.h" /* for doing_eh. */ #include "java-except.h" #include "toplev.h" #include "tree-iterator.h" @@ -565,6 +564,29 @@ check_start_handlers (struct eh_range *range, int pc) } +/* Routine to see if exception handling is turned on. + DO_WARN is nonzero if we want to inform the user that exception + handling is turned off. + + This is used to ensure that -fexceptions has been specified if the + compiler tries to use any exception-specific functions. */ + +static inline int +doing_eh (void) +{ + if (! flag_exceptions) + { + static int warned = 0; + if (! warned) + { + error ("exception handling disabled, use -fexceptions to enable"); + warned = 1; + } + return 0; + } + return 1; +} + static struct eh_range *current_range; /* Emit any start-of-try-range starting at start_pc and ending after @@ -574,7 +596,7 @@ void maybe_start_try (int start_pc, int end_pc) { struct eh_range *range; - if (! doing_eh (1)) + if (! doing_eh ()) return; range = find_handler (start_pc); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 351952de1a6..6c31947c6a4 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -43,7 +43,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "tree-dump.h" #include "opts.h" #include "options.h" -#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ static bool java_init (void); static void java_finish (void); diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 92755e24880..68085c72c9e 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -110,6 +110,7 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, #define LANG_HOOKS_INIT_TS lhd_do_nothing #define LANG_HOOKS_EH_PERSONALITY lhd_gcc_personality #define LANG_HOOKS_EH_RUNTIME_TYPE lhd_pass_through_t +#define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS NULL #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false #define LANG_HOOKS_DEEP_UNSHARING false @@ -299,6 +300,7 @@ extern void lhd_end_section (void); LANG_HOOKS_EXPR_TO_DECL, \ LANG_HOOKS_EH_PERSONALITY, \ LANG_HOOKS_EH_RUNTIME_TYPE, \ + LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \ LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \ LANG_HOOKS_DEEP_UNSHARING \ } diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 535529a08f0..483a8dcdd77 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -446,6 +446,14 @@ struct lang_hooks /* Map a type to a runtime object to match type. */ tree (*eh_runtime_type) (tree); + /* If non-NULL, this is a function that returns a function decl to be + executed if an unhandled exception is propagated out of a cleanup + region. For example, in C++, an exception thrown by a destructor + during stack unwinding is required to result in a call to + `std::terminate', so the C++ version of this function returns a + FUNCTION_DECL for `std::terminate'. */ + tree (*eh_protect_cleanup_actions) (void); + /* True if this language uses __cxa_end_cleanup when the ARM EABI is enabled. */ bool eh_use_cxa_end_cleanup; diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index a05a140c7cb..099bc6595ac 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,7 @@ +2010-06-28 Steven Bosscher + + * objc-act.c: Do not include except.h. + 2010-06-08 Laurynas Biveinis * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 2ec9ca04009..45b10207629 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -59,7 +59,6 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "objc-act.h" #include "input.h" -#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ #include "function.h" #include "output.h" #include "toplev.h" diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index cfb27f413cd..109d2327ed6 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,8 @@ +2010-06-28 Steven Bosscher + + * objcp-lang.c: Do not include except.h. + * Make-lang.in: Update dependencies. + 2010-06-25 Joseph Myers * lang-specs.h: Remove +e handling. diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in index 873b9080ebf..22dc30f366e 100644 --- a/gcc/objcp/Make-lang.in +++ b/gcc/objcp/Make-lang.in @@ -73,7 +73,7 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) objcp/objcp-lang.o : objcp/objcp-lang.c \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \ $(C_COMMON_H) $(LANGHOOKS_DEF_H) objc/objc-act.h cp/cp-objcp-common.h \ - gtype-objcp.h $(EXCEPT_H) + gtype-objcp.h objcp/objcp-decl.o : objcp/objcp-decl.c \ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \ diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c index 91e5c7e693c..70a605bb87e 100644 --- a/gcc/objcp/objcp-lang.c +++ b/gcc/objcp/objcp-lang.c @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "langhooks-def.h" #include "cp-objcp-common.h" -#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */ enum c_language_kind c_language = clk_objcxx; static void objcxx_init_ts (void); diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 52ecd0fbe48..53309ad02a9 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3112,8 +3112,8 @@ maybe_catch_exception (gimple_seq body) if (!flag_exceptions) return body; - if (lang_protect_cleanup_actions) - decl = lang_protect_cleanup_actions (); + if (lang_hooks.eh_protect_cleanup_actions != NULL) + decl = lang_hooks.eh_protect_cleanup_actions (); else decl = built_in_decls[BUILT_IN_TRAP]; diff --git a/gcc/system.h b/gcc/system.h index 256ebb1f502..af3dd3a64e7 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -799,7 +799,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; /* Front ends should never have to include middle-end headers. Enforce this by poisoning the header double-include protection defines. */ #ifdef IN_GCC_FRONTEND -#pragma GCC poison GCC_RTL_H +#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H #endif /* Note: not all uses of the `index' token (e.g. variable names and diff --git a/gcc/toplev.h b/gcc/toplev.h index a7ded4c47ad..2424fd17695 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -49,6 +49,11 @@ extern void init_optimization_passes (void); extern void finish_optimization_passes (void); extern bool enable_rtl_dump_file (void); +/* In except.c. Initialize exception handling. This is used by the Ada + and LTO front ends to initialize EH "on demand". See lto-streamer-in.c + and ada/gcc-interface/misc.c. */ +extern void init_eh (void); + extern void announce_function (tree); extern void error_for_asm (const_rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 872d4241dc8..3a6292c1b2f 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -951,12 +951,12 @@ lower_try_finally_fallthru_label (struct leh_tf_state *tf) return label; } -/* A subroutine of lower_try_finally. If lang_protect_cleanup_actions - returns non-null, then the language requires that the exception path out - of a try_finally be treated specially. To wit: the code within the - finally block may not itself throw an exception. We have two choices here. - First we can duplicate the finally block and wrap it in a must_not_throw - region. Second, we can generate code like +/* A subroutine of lower_try_finally. If the eh_protect_cleanup_actions + langhook returns non-null, then the language requires that the exception + path out of a try_finally be treated specially. To wit: the code within + the finally block may not itself throw an exception. We have two choices + here. First we can duplicate the finally block and wrap it in a + must_not_throw region. Second, we can generate code like try { finally_block; @@ -983,9 +983,9 @@ honor_protect_cleanup_actions (struct leh_state *outer_state, gimple x; /* First check for nothing to do. */ - if (lang_protect_cleanup_actions == NULL) + if (lang_hooks.eh_protect_cleanup_actions == NULL) return; - protect_cleanup_actions = lang_protect_cleanup_actions (); + protect_cleanup_actions = lang_hooks.eh_protect_cleanup_actions (); if (protect_cleanup_actions == NULL) return; -- cgit v1.2.1