aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/exception.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@cygnus.com>1998-06-08 12:43:28 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>1998-06-08 12:43:28 +0000
commita1622f838f1188fca74ba0186300882f33006ae7 (patch)
tree8c6db0a08fe59e66faaa88318e5d8e194578463d /gcc/cp/exception.cc
parentaeb302bbec86aff44fadaad0c9c9bf5e59cbe3f5 (diff)
downloadgcc-a1622f838f1188fca74ba0186300882f33006ae7.zip
gcc-a1622f838f1188fca74ba0186300882f33006ae7.tar.gz
gcc-a1622f838f1188fca74ba0186300882f33006ae7.tar.bz2
[multiple changes]
Thu Jun 8 14:16:15 EDT 1998 Andrew MacLeod <amacleod@cygnus.com> * eh-common.h: Remove NEW_EH_MODEL compile time flag, and replace with flag_new_exceptions runtime flag. (struct old_exception_table): New struct which represents what the exception table looks like without the new model. (NEW_EH_RUNTIME): New value used as a tag in the exception table to flag that this is a new style table. * except.h: Remove compile time flag NEW_EH_MODEL. (expand_builtin_eh_stub_old): New prototype. * tree.h (enum built_in_function): Add BUILT_IN_EH_STUB_OLD. * expr.c (expand_builtin): New builtin func BUILT_IN_EH_STUB_OLD. * c-decl.c (init_decl_processing): Add new builtin function __builtin_eh_stub_old. * final.c (final_scan_insn): Replace compile time flag NEW_EH_MODEL. * flags.h (flag_new_exceptions): New runtime flag. * toplev.c (flag_new_exceptions): Initialize default to 0, -fnew-exceptions sets to 1. * except.c (output_exception_table_entry): Output New style exception identifier into table, and replace compile time flag NEW_EH_MODEL with runtime flag flag_new_exceptions. (output_exception_table): Replace compile time flag NEW_EH_MODEL. (expand_builtin_eh_stub_old): Duplicates original functionality of expand_builtin_eh_stub. (expand_builtin_eh_stub): Replace compile time flag NEW_EH_MODEL. * libgcc2.c (find_exception_handler): Remove NEW_EH_MODEL #ifdefs. (old_find_exception_handler): New func, same as find_exception_handler except it works on the old style exception table. (__throw): Replace NEW_EH_MODEL. Detect new model based on presence of identifier in the exception table, and call appropriate routines. 1998-06-08 Andrew MacLeod <amacleod@cygnus.com> * except.c (init_exception_processing): Remove NEW_EH_MODEL compile time flag. Call __cp_eh_info instead of __cp_exception_info. * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag. (__cp_exception_info): Return offset into cp_eh_info structure to match what use to be the start of this structure. (__cp_eh_info): New function to return a pointer to cp_eh_info struct. (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL compile time flag. (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call __cp_eh_info instead of __cp_exception_info. From-SVN: r20336
Diffstat (limited to 'gcc/cp/exception.cc')
-rw-r--r--gcc/cp/exception.cc27
1 files changed, 16 insertions, 11 deletions
diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc
index 461dba4..b081fa7 100644
--- a/gcc/cp/exception.cc
+++ b/gcc/cp/exception.cc
@@ -86,9 +86,7 @@ std::unexpected ()
struct cp_eh_info
{
-#ifdef NEW_EH_MODEL
__eh_info eh_info;
-#endif
void *value;
void *type;
void (*cleanup)(void *, int);
@@ -105,11 +103,23 @@ extern "C" cp_eh_info **__get_eh_info (); // actually void **
extern bool __is_pointer (void *);
+
+/* OLD Compiler hook to return a pointer to the info for the current exception.
+ Used by get_eh_info (). This fudges the actualy returned value to
+ point to the beginning of what USE to be the cp_eh_info structure.
+ THis is so that old code that dereferences this pointer will find
+ things where it expects it to be.*/
+extern "C" void *
+__cp_exception_info (void)
+{
+ return &((*__get_eh_info ())->value);
+}
+
/* Compiler hook to return a pointer to the info for the current exception.
Used by get_eh_info (). */
extern "C" cp_eh_info *
-__cp_exception_info (void)
+__cp_eh_info (void)
{
return *__get_eh_info ();
}
@@ -138,8 +148,6 @@ __eh_free (void *p)
}
-#ifdef NEW_EH_MODEL
-
typedef void * (* rtimetype) (void);
extern "C" void *
@@ -157,7 +165,6 @@ __cplus_type_matcher (cp_eh_info *info, exception_table *matching_info,
ret = __throw_type_match_rtti (match_type, info->type, info->value);
return ret;
}
-#endif
/* Compiler hook to push a new exception onto the stack.
@@ -174,12 +181,10 @@ __cp_push_exception (void *value, void *type, void (*cleanup)(void *, int))
p->handlers = 0;
p->caught = false;
-#ifdef NEW_EH_MODEL
p->eh_info.match_function = __cplus_type_matcher;
p->eh_info.language = EH_LANG_C_plus_plus;
p->eh_info.version = 1;
p->eh_info.coerced_value = NULL;
-#endif
cp_eh_info **q = __get_eh_info ();
@@ -227,7 +232,7 @@ __cp_pop_exception (cp_eh_info *p)
extern "C" void
__uncatch_exception (void)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
if (p == 0)
terminate ();
p->caught = false;
@@ -248,7 +253,7 @@ __uncatch_exception (void)
extern "C" void
__check_eh_spec (int n, const void **spec)
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
for (int i = 0; i < n; ++i)
{
@@ -301,7 +306,7 @@ __throw_bad_typeid (void)
bool
std::uncaught_exception ()
{
- cp_eh_info *p = __cp_exception_info ();
+ cp_eh_info *p = __cp_eh_info ();
return p && ! p->caught;
}