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/java/except.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'gcc/java/except.c') 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); -- cgit v1.2.1