diff options
author | Andrew MacLeod <amacleod@cygnus.com> | 1998-12-08 14:04:03 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 1998-12-08 14:04:03 +0000 |
commit | e6cfb550ab17484da95c0a3e94773fa42dccd27c (patch) | |
tree | 7f21607b0446aa635cee54fb52e2f750bc2be0d5 /gcc/cp | |
parent | 2bfdc2d4e73144131b2e2de7ccfc1183f63175ac (diff) | |
download | gcc-e6cfb550ab17484da95c0a3e94773fa42dccd27c.zip gcc-e6cfb550ab17484da95c0a3e94773fa42dccd27c.tar.gz gcc-e6cfb550ab17484da95c0a3e94773fa42dccd27c.tar.bz2 |
See ChangeLog..
Tue Dec 8 15:32:56 EST 1998 Andrew MacLeod <amacleod@cygnus.com>
See ChangeLog.. These are the files that were changed:
* eh-common.h (struct eh_context): Add table_index for rethrows.
* rtl.h (enum reg_note): Add REG_EH_REGION and REG_EH_RETHROW reg notes.
* rtl.c (reg_note_name): Add strings for new reg_note enums.
* expr.h (rethrow_libfunc): New library decl.
* optabs.c (rethrow_libfunc): Initialize.
* except.h (struct eh_entry): Add new field 'rethrow_label'.
* except.c (create_rethrow_ref): New function to create a single
* flow.c (make_edges): Add different edges for rethrow calls,
* integrate.c (save_for_inline_eh_labelmap): New callback routine to
* libgcc2.c (find_exception_handler): Generalize to enable it to
* cp/except.c
* cp/exception.cc
From-SVN: r24194
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/cp/except.c | 14 | ||||
-rw-r--r-- | gcc/cp/exception.cc | 26 |
3 files changed, 42 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cedcc62..40280af 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,19 @@ +1998-12-08 Andrew MacLeod <amacleod@cygnus.com> + + * cp/except.c (call_eh_info): use __start_cp_handler instead of + __cp_eh_info for getting the eh info pointer. Add table_index to + field list. + (push_eh_cleanup): Don't increment 'handlers' data field. + (process_start_catch_block): Don't set the 'caught' field. + + * cp/exception.cc (CP_EH_INFO): New macro for getting the + exception info pointer within library routines. + (__cp_eh_info): Use CP_EH_INFO. + (__start_cp_handler): Get exception info pointer, set caught field, + and increment the handlers field. Avoids this being done by handlers. + (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro. + (uncaught_exception): Use CP_EH_INFO macro. + Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com) * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 7198689..a2c2c51 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -249,14 +249,14 @@ call_eh_info () { tree fn; - fn = get_identifier ("__cp_eh_info"); + fn = get_identifier ("__start_cp_handler"); if (IDENTIFIER_GLOBAL_VALUE (fn)) fn = IDENTIFIER_GLOBAL_VALUE (fn); else { tree t1, t, fields[7]; - /* Declare cp_eh_info * __cp_eh_info (void), + /* Declare cp_eh_info * __start_cp_handler (void), as defined in exception.cc. */ push_obstacks_nochange (); end_temporary_allocation (); @@ -270,9 +270,11 @@ call_eh_info () get_identifier ("dynamic_handler_chain"), ptr_type_node); fields[2] = build_lang_field_decl (FIELD_DECL, get_identifier ("info"), ptr_type_node); + fields[3] = build_lang_field_decl (FIELD_DECL, + get_identifier ("table_index"), ptr_type_node); /* N.B.: The fourth field LEN is expected to be the number of fields - 1, not the total number of fields. */ - finish_builtin_type (t1, "eh_context", fields, 2, ptr_type_node); + finish_builtin_type (t1, "eh_context", fields, 3, ptr_type_node); t1 = build_pointer_type (t1); t1= make_lang_type (RECORD_TYPE); @@ -547,9 +549,6 @@ push_eh_cleanup () { int yes; - expand_expr (build_unary_op (PREINCREMENT_EXPR, get_eh_handlers (), 1), - const0_rtx, VOIDmode, EXPAND_NORMAL); - yes = suspend_momentary (); /* All cleanups must last longer than normal. */ expand_decl_cleanup (NULL_TREE, do_pop_exception ()); @@ -701,9 +700,6 @@ process_start_catch_block (declspecs, declarator) /* Fall into the catch all section. */ } - init = build_modify_expr (get_eh_caught (), NOP_EXPR, integer_one_node); - expand_expr (init, const0_rtx, VOIDmode, EXPAND_NORMAL); - emit_line_note (input_filename, lineno); } diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc index d0533aa..8e8f35f 100644 --- a/gcc/cp/exception.cc +++ b/gcc/cp/exception.cc @@ -117,13 +117,29 @@ __cp_exception_info (void) return &((*__get_eh_info ())->value); } -/* Compiler hook to return a pointer to the info for the current exception. +#define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ()) + +/* Old Compiler hook to return a pointer to the info for the current exception. Used by get_eh_info (). */ extern "C" cp_eh_info * __cp_eh_info (void) { - return *__get_eh_info (); + cp_eh_info *p = CP_EH_INFO; + return p; +} + +/* Compiler hook to return a pointer to the info for the current exception, + Set the caught bit, and increment the number of handlers that are + looking at this exception. This makes handlers smaller. */ + +extern "C" cp_eh_info * +__start_cp_handler (void) +{ + cp_eh_info *p = CP_EH_INFO; + p->caught = 1; + p->handlers++; + return p; } /* Allocate a buffer for a cp_eh_info and an exception object of size SIZE, @@ -242,7 +258,7 @@ __cp_pop_exception (cp_eh_info *p) extern "C" void __uncatch_exception (void) { - cp_eh_info *p = __cp_eh_info (); + cp_eh_info *p = CP_EH_INFO; if (p == 0) terminate (); p->caught = false; @@ -263,7 +279,7 @@ __uncatch_exception (void) extern "C" void __check_eh_spec (int n, const void **spec) { - cp_eh_info *p = __cp_eh_info (); + cp_eh_info *p = CP_EH_INFO; for (int i = 0; i < n; ++i) { @@ -316,7 +332,7 @@ __throw_bad_typeid (void) bool std::uncaught_exception () { - cp_eh_info *p = __cp_eh_info (); + cp_eh_info *p = CP_EH_INFO; return p && ! p->caught; } |