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/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/Exception.h')
-rw-r--r-- | runtime/GCCLibraries/libexception/Exception.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/runtime/GCCLibraries/libexception/Exception.h b/runtime/GCCLibraries/libexception/Exception.h new file mode 100644 index 0000000000..a0357b54c5 --- /dev/null +++ b/runtime/GCCLibraries/libexception/Exception.h @@ -0,0 +1,49 @@ +//===- exception.h - Generic language-independent exceptions ----*- C++ -*-===// +// +// This file defines the the shared data structures used by all language +// specific exception handling runtime libraries. +// +//===----------------------------------------------------------------------===// + +#ifndef EXCEPTION_H +#define EXCEPTION_H + +typedef struct llvm_exception { + // ExceptionDestructor - This call-back function is used to destroy the + // current exception, without requiring the caller to know what the concrete + // exception type is. + // + void (*ExceptionDestructor)(struct llvm_exception *); + + // ExceptionType - This field identifies what runtime library this exception + // came from. Currently defined values are: + // 0 - Error + // 1 - longjmp exception (see longjmp-exception.c) + // 2 - C++ exception (see c++-exception.c) + // + unsigned ExceptionType; + + // Next - This points to the next exception in the current stack. + struct llvm_exception *Next; + + // HandlerCount - This is a count of the number of handlers which have + // currently caught this exception. If the handler is caught and this number + // falls to zero, the exception is destroyed. + // + unsigned HandlerCount; +} llvm_exception; + +enum { + ErrorException = 0, + LongjmpException = 1, + CXXException = 2, +}; + +// Language independent exception handling API... +// +extern "C" { + bool __llvm_eh_has_uncaught_exception(void); + void *__llvm_eh_current_uncaught_exception_type(unsigned HandlerType); +} + +#endif |