system.h: Poison GCC_EXCEPT_H for front-end files.

gcc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* 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  <steven@gcc.gnu.org>

	* c-cppbuiltin.c: Do not include except.h.

gcc/objc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* objc-act.c: Do not include except.h.

gcc/cp/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* 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  <steven@gcc.gnu.org>

	* objcp-lang.c: Do not include except.h.
	* Make-lang.in: Update dependencies.

gcc/java/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* 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  <steven@gcc.gnu.org>

	* gcc-interface/misc.c: Do not include except.h.
	* gcc-interface/Make-lang.in: Update dependencies.

gcc/fortran/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* Make-lang.in: Update dependencies.

From-SVN: r161484
This commit is contained in:
Steven Bosscher 2010-06-28 10:52:46 +00:00
parent 6d41cd0238
commit 3b06d37902
38 changed files with 184 additions and 100 deletions

View File

@ -1,3 +1,24 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* 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 <bmei@broadcom.com>
* cgraph.h (struct varpool_node): new used_from_object_file flag.

View File

@ -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

View File

@ -1,3 +1,8 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* gcc-interface/misc.c: Do not include except.h.
* gcc-interface/Make-lang.in: Update dependencies.
2010-06-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c: Include tree-flow.h.

View File

@ -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 \

View File

@ -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"

View File

@ -1,3 +1,7 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* c-cppbuiltin.c: Do not include except.h.
2010-06-24 Andi Kleen <ak@linux.intel.com>
* c-common.c (warn_for_omitted_condop): New.

View File

@ -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. */

View File

@ -1,3 +1,25 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* 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 <jason@redhat.com>
* call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any

View File

@ -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

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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"

View File

@ -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"

View File

@ -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))

View File

@ -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. */

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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;
@ -202,30 +198,6 @@ static int sjlj_size_of_call_site_table (void);
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;

View File

@ -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
<http://www.gnu.org/licenses/>. */
/* 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;

View File

@ -1,3 +1,7 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* Make-lang.in: Update dependencies.
2010-06-27 Nathan Froyd <froydnj@codesourcery.com>
* gfortran.h (gfc_code): Split backend_decl field into cycle_label

View File

@ -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

View File

@ -1,3 +1,12 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* 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 <aesok@post.ru>
* decl.c (java_init_decl_processing): Use double_int_to_tree instead

View File

@ -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) \

View File

@ -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);

View File

@ -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);

View File

@ -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 \
}

View File

@ -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;

View File

@ -1,3 +1,7 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* objc-act.c: Do not include except.h.
2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC

View File

@ -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"

View File

@ -1,3 +1,8 @@
2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
* objcp-lang.c: Do not include except.h.
* Make-lang.in: Update dependencies.
2010-06-25 Joseph Myers <joseph@codesourcery.com>
* lang-specs.h: Remove +e handling.

View File

@ -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) \

View File

@ -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);

View File

@ -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];

View File

@ -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

View File

@ -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);

View File

@ -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;