2003-08-25 22:35:36 +00:00
|
|
|
//===- 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
|
|
|
|
|
2003-08-27 04:50:12 +00:00
|
|
|
struct llvm_exception {
|
2003-08-25 22:35:36 +00:00
|
|
|
// ExceptionDestructor - This call-back function is used to destroy the
|
|
|
|
// current exception, without requiring the caller to know what the concrete
|
|
|
|
// exception type is.
|
|
|
|
//
|
2003-08-27 04:50:12 +00:00
|
|
|
void (*ExceptionDestructor)(llvm_exception *);
|
2003-08-25 22:35:36 +00:00
|
|
|
|
|
|
|
// 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.
|
2003-08-27 04:50:12 +00:00
|
|
|
llvm_exception *Next;
|
2003-08-25 22:35:36 +00:00
|
|
|
|
|
|
|
// 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;
|
2003-08-27 04:50:12 +00:00
|
|
|
};
|
2003-08-25 22:35:36 +00:00
|
|
|
|
|
|
|
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
|