OLD | NEW |
(Empty) | |
| 1 //===--------------------------- cxxabi.h ---------------------------------===// |
| 2 // |
| 3 // The LLVM Compiler Infrastructure |
| 4 // |
| 5 // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 // Source Licenses. See LICENSE.TXT for details. |
| 7 // |
| 8 //===----------------------------------------------------------------------===// |
| 9 |
| 10 #ifndef __CXXABI_H |
| 11 #define __CXXABI_H |
| 12 |
| 13 /* |
| 14 * This header provides the interface to the C++ ABI as defined at: |
| 15 * http://www.codesourcery.com/cxx-abi/ |
| 16 */ |
| 17 |
| 18 #include <stddef.h> |
| 19 #include <stdint.h> |
| 20 |
| 21 #define _LIBCPPABI_VERSION 1001 |
| 22 #define LIBCXXABI_NORETURN __attribute__((noreturn)) |
| 23 |
| 24 #ifdef __cplusplus |
| 25 |
| 26 namespace std { |
| 27 class type_info; // forward declaration |
| 28 } |
| 29 |
| 30 |
| 31 // runtime routines use C calling conventions, but are in __cxxabiv1 namespace |
| 32 namespace __cxxabiv1 { |
| 33 extern "C" { |
| 34 |
| 35 // 2.4.2 Allocating the Exception Object |
| 36 extern void * __cxa_allocate_exception(size_t thrown_size) throw(); |
| 37 extern void __cxa_free_exception(void * thrown_exception) throw(); |
| 38 |
| 39 // 2.4.3 Throwing the Exception Object |
| 40 extern LIBCXXABI_NORETURN void __cxa_throw(void * thrown_exception, |
| 41 std::type_info * tinfo, void (*dest)(void *)); |
| 42 |
| 43 // 2.5.3 Exception Handlers |
| 44 extern void * __cxa_get_exception_ptr(void * exceptionObject) throw(); |
| 45 extern void * __cxa_begin_catch(void * exceptionObject) throw(); |
| 46 extern void __cxa_end_catch(); |
| 47 extern std::type_info * __cxa_current_exception_type(); |
| 48 |
| 49 // 2.5.4 Rethrowing Exceptions |
| 50 extern LIBCXXABI_NORETURN void __cxa_rethrow(); |
| 51 |
| 52 |
| 53 |
| 54 // 2.6 Auxiliary Runtime APIs |
| 55 extern LIBCXXABI_NORETURN void __cxa_bad_cast(void); |
| 56 extern LIBCXXABI_NORETURN void __cxa_bad_typeid(void); |
| 57 |
| 58 |
| 59 |
| 60 // 3.2.6 Pure Virtual Function API |
| 61 extern LIBCXXABI_NORETURN void __cxa_pure_virtual(void); |
| 62 |
| 63 // 3.2.7 Deleted Virtual Function API |
| 64 extern LIBCXXABI_NORETURN void __cxa_deleted_virtual(void); |
| 65 |
| 66 // 3.3.2 One-time Construction API |
| 67 #if __arm__ |
| 68 extern int __cxa_guard_acquire(uint32_t*); |
| 69 extern void __cxa_guard_release(uint32_t*); |
| 70 extern void __cxa_guard_abort(uint32_t*); |
| 71 #else |
| 72 extern int __cxa_guard_acquire(uint64_t*); |
| 73 extern void __cxa_guard_release(uint64_t*); |
| 74 extern void __cxa_guard_abort(uint64_t*); |
| 75 #endif |
| 76 |
| 77 // 3.3.3 Array Construction and Destruction API |
| 78 extern void* __cxa_vec_new(size_t element_count, |
| 79 size_t element_size, |
| 80 size_t padding_size, |
| 81 void (*constructor)(void*), |
| 82 void (*destructor)(void*) ); |
| 83 |
| 84 extern void* __cxa_vec_new2(size_t element_count, |
| 85 size_t element_size, |
| 86 size_t padding_size, |
| 87 void (*constructor)(void*), |
| 88 void (*destructor)(void*), |
| 89 void* (*alloc)(size_t), |
| 90 void (*dealloc)(void*) ); |
| 91 |
| 92 extern void* __cxa_vec_new3(size_t element_count, |
| 93 size_t element_size, |
| 94 size_t padding_size, |
| 95 void (*constructor)(void*), |
| 96 void (*destructor)(void*), |
| 97 void* (*alloc)(size_t), |
| 98 void (*dealloc)(void*, size_t) ); |
| 99 |
| 100 extern void __cxa_vec_ctor(void* array_address, |
| 101 size_t element_count, |
| 102 size_t element_size, |
| 103 void (*constructor)(void*), |
| 104 void (*destructor)(void*) ); |
| 105 |
| 106 |
| 107 extern void __cxa_vec_dtor(void* array_address, |
| 108 size_t element_count, |
| 109 size_t element_size, |
| 110 void (*destructor)(void*) ); |
| 111 |
| 112 |
| 113 extern void __cxa_vec_cleanup(void* array_address, |
| 114 size_t element_count, |
| 115 size_t element_size, |
| 116 void (*destructor)(void*) ); |
| 117 |
| 118 |
| 119 extern void __cxa_vec_delete(void* array_address, |
| 120 size_t element_size, |
| 121 size_t padding_size, |
| 122 void (*destructor)(void*) ); |
| 123 |
| 124 |
| 125 extern void __cxa_vec_delete2(void* array_address, |
| 126 size_t element_size, |
| 127 size_t padding_size, |
| 128 void (*destructor)(void*), |
| 129 void (*dealloc)(void*) ); |
| 130 |
| 131 |
| 132 extern void __cxa_vec_delete3(void* __array_address, |
| 133 size_t element_size, |
| 134 size_t padding_size, |
| 135 void (*destructor)(void*), |
| 136 void (*dealloc) (void*, size_t)); |
| 137 |
| 138 |
| 139 extern void __cxa_vec_cctor(void* dest_array, |
| 140 void* src_array, |
| 141 size_t element_count, |
| 142 size_t element_size, |
| 143 void (*constructor) (void*, void*), |
| 144 void (*destructor)(void*) ); |
| 145 |
| 146 |
| 147 // 3.3.5.3 Runtime API |
| 148 extern int __cxa_atexit(void (*f)(void*), void* p, void* d); |
| 149 extern int __cxa_finalize(void*); |
| 150 |
| 151 |
| 152 // 3.4 Demangler API |
| 153 extern char* __cxa_demangle(const char* mangled_name, |
| 154 char* output_buffer, |
| 155 size_t* length, |
| 156 int* status); |
| 157 |
| 158 // Apple additions to support C++ 0x exception_ptr class |
| 159 // These are primitives to wrap a smart pointer around an exception object |
| 160 extern void * __cxa_current_primary_exception() throw(); |
| 161 extern void __cxa_rethrow_primary_exception(void* primary_exception); |
| 162 extern void __cxa_increment_exception_refcount(void* primary_exception) throw(); |
| 163 extern void __cxa_decrement_exception_refcount(void* primary_exception) throw(); |
| 164 |
| 165 // Apple addition to support std::uncaught_exception() |
| 166 extern bool __cxa_uncaught_exception() throw(); |
| 167 |
| 168 } // extern "C" |
| 169 } // namespace __cxxabiv1 |
| 170 |
| 171 #endif // __cplusplus |
| 172 |
| 173 namespace abi = __cxxabiv1; |
| 174 |
| 175 #endif // __CXXABI_H |
OLD | NEW |