-
Notifications
You must be signed in to change notification settings - Fork 117
/
objcxx_eh.h
66 lines (60 loc) · 2.1 KB
/
objcxx_eh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifdef __cplusplus
extern "C" {
#endif
/**
* Allocates a C++ exception. This function is part of the Itanium C++ ABI and
* is provided externally.
*/
/*
* Note: Recent versions of libsupc++ already provide a prototype for
* __cxa__allocate_exception(). Since the libsupc++ version is defined with
* _GLIBCXX_NOTHROW, clang gives a type mismatch error.
*/
#ifndef __cplusplus
#undef CXA_ALLOCATE_EXCEPTION_SPECIFIER
#define CXA_ALLOCATE_EXCEPTION_SPECIFIER
#endif
void *__cxa_allocate_exception(size_t thrown_size) CXA_ALLOCATE_EXCEPTION_SPECIFIER;
/**
* Initialises an exception object returned by __cxa_allocate_exception() for
* storing an Objective-C object. The return value is the location of the
* _Unwind_Exception structure within this structure, and should be passed to
* the C++ personality function.
*/
struct _Unwind_Exception *objc_init_cxx_exception(id thrown_exception);
/**
* The GNU C++ exception personality function, provided by libsupc++ (GNU) or
* libcxxrt (PathScale).
*/
__attribute__((weak)) DECLARE_PERSONALITY_FUNCTION(__gxx_personality_v0);
/**
* Frees an exception object allocated by __cxa_allocate_exception(). Part of
* the Itanium C++ ABI.
*/
void __cxa_free_exception(void *thrown_exception);
/**
* Tests whether a C++ exception contains an Objective-C object, and returns if
* if it does. The second argument is a pointer to a boolean value indicating
* whether this is a valid object.
*/
void *objc_object_for_cxx_exception(void *thrown_exception, int *isValid);
/**
* Prints the type info associated with an exception. Used only when
* debugging, not compiled in the normal build.
*/
void print_type_info(void *thrown_exception);
/**
* The exception class that we've detected that C++ runtime library uses.
*/
extern uint64_t cxx_exception_class;
/**
* The exception class that libsupc++ and libcxxrt use.
*/
const uint64_t gnu_cxx_exception_class = EXCEPTION_CLASS('G','N','U','C','C','+','+','\0');
/**
* The exception class that libc++abi uses.
*/
const uint64_t llvm_cxx_exception_class = EXCEPTION_CLASS('C','L','N','G','C','+','+','\0');
#ifdef __cplusplus
}
#endif