aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2010-06-28 10:52:46 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2010-06-28 10:52:46 +0000
commit3b06d379028526625f4b9e0cf5d5f5137de950d4 (patch)
treee5d19eb8eea815fc1117fd2ff13d0744588da0cb /gcc/cp
parent6d41cd02387ab457b69206742af9edb8977f725d (diff)
downloadgcc-3b06d379028526625f4b9e0cf5d5f5137de950d4.zip
gcc-3b06d379028526625f4b9e0cf5d5f5137de950d4.tar.gz
gcc-3b06d379028526625f4b9e0cf5d5f5137de950d4.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog22
-rw-r--r--gcc/cp/Make-lang.in16
-rw-r--r--gcc/cp/cp-lang.c1
-rw-r--r--gcc/cp/cp-objcp-common.h3
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/decl2.c1
-rw-r--r--gcc/cp/except.c36
-rw-r--r--gcc/cp/expr.c1
-rw-r--r--gcc/cp/init.c1
-rw-r--r--gcc/cp/pt.c1
-rw-r--r--gcc/cp/semantics.c1
12 files changed, 61 insertions, 24 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e9d85c3..3b5f1bd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index bfccd72..f664c78 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 541e9ad..fb687b8 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 1a97ad2..f2d4aa1 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 f63ec2e..285dac7 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 9541252..48d2b69 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 691c1db..1e088e0 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 64f4171..79bab76 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 0a0ba53..681834d 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 84e486c..30808b2 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 b97d3f5..863218d 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 4869cfc..e750937 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"