diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-25 22:35:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-25 22:35:36 +0000 |
commit | 5337521c2b04f5dce02b3ce9a8d231c4273ab3fd (patch) | |
tree | 4c3386537caff6a2ae64eeba7dd081b5435d1592 /runtime/GCCLibraries/libexception/C++-Exception.h | |
parent | bfa964699f2ee6390a713bd1f77953d61e38e93d (diff) |
Initial checking of C++ exception handling library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/GCCLibraries/libexception/C++-Exception.h')
-rw-r--r-- | runtime/GCCLibraries/libexception/C++-Exception.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/runtime/GCCLibraries/libexception/C++-Exception.h b/runtime/GCCLibraries/libexception/C++-Exception.h new file mode 100644 index 0000000000..cc37294572 --- /dev/null +++ b/runtime/GCCLibraries/libexception/C++-Exception.h @@ -0,0 +1,62 @@ +//===- c++-exception.h - C++ Specific exception Handling --------*- C++ -*-===// +// +// This file defines the data structures and API used by the C++ exception +// handling runtime library. +// +//===----------------------------------------------------------------------===// + +#ifndef CXX_EXCEPTION_H +#define CXX_EXCEPTION_H + +#include "exception.h" +#include <typeinfo> + +typedef struct llvm_cxx_exception { + /* TypeInfo - A pointer to the C++ std::type_info object for this exception + * class. This is required because the class may not be polymorphic. + */ + const std::type_info *TypeInfo; + + /* ExceptionObjectDestructor - A pointer to the function which destroys the + * object represented by this exception. This is required because the class + * may not be polymorphic. This may be null if there is no cleanup required. + */ + void (*ExceptionObjectDestructor)(void *); + + /* UnexpectedHandler - This contains a pointer to the "unexpected" handler + * which may be registered by the user program with set_unexpected. Calls to + * unexpected which are a result of an exception throw are supposed to use the + * value of the handler at the time of the throw, not the currently set value. + */ + void *UnexpectedHandler; + + /* TerminateHandler - This contains a pointer to the "terminate" handler which + * may be registered by the user program with set_terminate. Calls to + * unexpected which are a result of an exception throw are supposed to use the + * value of the handler at the time of the throw, not the currently set value. + */ + void *TerminateHandler; + + /* BaseException - The language independent portion of the exception state. + * This is at the end of the record so that we can add additional members to + * this structure without breaking binary compatibility. + */ + llvm_exception BaseException; +} llvm_cxx_exception; + + + +extern "C" { + void *__llvm_cxxeh_allocate_exception(unsigned NumBytes); + void __llvm_cxxeh_free_exception(void *ObjectPtr); + void __llvm_cxxeh_throw(void *ObjectPtr, const std::type_info *TypeInfoPtr, + void (*DtorPtr)(void*)); + + void * __llvm_cxxeh_current_uncaught_exception_isa(const std::type_info *Ty); + void *__llvm_cxxeh_begin_catch(void); + void __llvm_cxxeh_end_catch(void); + + void __llvm_cxxeh_rethrow(void); +} + +#endif |