|
1 /* Copyright (c) Edison Design Group, 2002-2004. */ |
|
2 /* |
|
3 cxxabi.h -- Include file for IA-64 ABI entry points. |
|
4 */ |
|
5 |
|
6 #ifndef __CXXABI_H |
|
7 #define __CXXABI_H |
|
8 |
|
9 #ifndef __STDDEF_H |
|
10 #include <stddef.h> |
|
11 #endif /* ifndef __STDDEF_H */ |
|
12 |
|
13 namespace std |
|
14 { |
|
15 #ifdef __EDG__ |
|
16 #pragma define_type_info |
|
17 #endif |
|
18 |
|
19 class type_info |
|
20 { |
|
21 public: |
|
22 IMPORT_C virtual ~type_info(); |
|
23 IMPORT_C bool operator==(const type_info&) const; |
|
24 IMPORT_C bool operator!=(const type_info&) const; |
|
25 IMPORT_C bool before(const type_info&) const; |
|
26 IMPORT_C const char* name() const; |
|
27 private: |
|
28 type_info(const type_info&); |
|
29 type_info& operator=(const type_info&); |
|
30 private: |
|
31 const char *__type_name; |
|
32 }; |
|
33 |
|
34 class exception |
|
35 { |
|
36 public: |
|
37 IMPORT_C exception() throw (); |
|
38 IMPORT_C exception(const exception&) throw (); |
|
39 IMPORT_C exception& operator=(const exception&) throw (); |
|
40 IMPORT_C virtual ~exception() throw (); |
|
41 IMPORT_C virtual const char* what() const throw (); |
|
42 }; |
|
43 |
|
44 class bad_exception : public exception |
|
45 { |
|
46 public: |
|
47 bad_exception() throw (); |
|
48 bad_exception(const bad_exception&) throw (); |
|
49 bad_exception& operator=(const bad_exception&) throw (); |
|
50 |
|
51 virtual ~bad_exception() throw (); |
|
52 |
|
53 virtual const char* what() const throw (); |
|
54 }; |
|
55 |
|
56 class bad_cast : public exception |
|
57 { |
|
58 public: |
|
59 IMPORT_C bad_cast() throw (); |
|
60 IMPORT_C bad_cast(const bad_cast&) throw (); |
|
61 IMPORT_C bad_cast& operator=(const bad_cast&) throw (); |
|
62 IMPORT_C virtual ~bad_cast() throw (); |
|
63 IMPORT_C virtual const char* what() const throw (); |
|
64 }; |
|
65 |
|
66 class bad_typeid : public exception |
|
67 { |
|
68 public: |
|
69 IMPORT_C bad_typeid() throw (); |
|
70 IMPORT_C bad_typeid(const bad_typeid&) throw (); |
|
71 IMPORT_C bad_typeid& operator=(const bad_typeid&) throw (); |
|
72 IMPORT_C virtual ~bad_typeid() throw (); |
|
73 IMPORT_C virtual const char* what() const throw (); |
|
74 }; |
|
75 } |
|
76 |
|
77 |
|
78 |
|
79 #ifdef __EDG_RUNTIME_USES_NAMESPACES |
|
80 namespace __cxxabiv1 { |
|
81 using namespace std; |
|
82 #endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */ |
|
83 |
|
84 /* type_info implementation classes */ |
|
85 |
|
86 #pragma define_type_info |
|
87 class __fundamental_type_info : public type_info { |
|
88 public: |
|
89 virtual ~__fundamental_type_info(); |
|
90 }; |
|
91 |
|
92 #pragma define_type_info |
|
93 class __array_type_info : public type_info { |
|
94 public: |
|
95 virtual ~__array_type_info(); |
|
96 }; |
|
97 |
|
98 #pragma define_type_info |
|
99 class __function_type_info : public type_info { |
|
100 public: |
|
101 virtual ~__function_type_info(); |
|
102 }; |
|
103 |
|
104 #pragma define_type_info |
|
105 class __enum_type_info : public type_info { |
|
106 public: |
|
107 virtual ~__enum_type_info(); |
|
108 }; |
|
109 |
|
110 #pragma define_type_info |
|
111 class __class_type_info : public type_info { |
|
112 public: |
|
113 virtual ~__class_type_info(); |
|
114 }; |
|
115 |
|
116 #pragma define_type_info |
|
117 class __si_class_type_info : public __class_type_info { |
|
118 public: |
|
119 virtual ~__si_class_type_info(); |
|
120 const __class_type_info *__base_type; |
|
121 }; |
|
122 |
|
123 struct __base_class_type_info { |
|
124 const __class_type_info *__base_type; |
|
125 long __offset_flags; |
|
126 |
|
127 enum __offset_flags_masks { |
|
128 __virtual_mask = 0x1, |
|
129 __public_mask = 0x2, |
|
130 __offset_shift = 8 |
|
131 }; |
|
132 }; |
|
133 |
|
134 #pragma define_type_info |
|
135 class __vmi_class_type_info : public __class_type_info { |
|
136 public: |
|
137 virtual ~__vmi_class_type_info(); |
|
138 unsigned int __flags; |
|
139 unsigned int __base_count; |
|
140 __base_class_type_info __base_info[1]; |
|
141 |
|
142 enum __flags_masks { |
|
143 __non_diamond_repeat_mask = 0x1, |
|
144 __diamond_shaped_mask = 0x2 |
|
145 }; |
|
146 }; |
|
147 |
|
148 #pragma define_type_info |
|
149 class __pbase_type_info : public type_info { |
|
150 public: |
|
151 virtual ~__pbase_type_info(); |
|
152 unsigned int __flags; |
|
153 const type_info *__pointee; |
|
154 |
|
155 enum __masks { |
|
156 __const_mask = 0x1, |
|
157 __volatile_mask = 0x2, |
|
158 __restrict_mask = 0x4, |
|
159 __incomplete_mask = 0x8, |
|
160 __incomplete_class_mask = 0x10 |
|
161 }; |
|
162 }; |
|
163 |
|
164 #pragma define_type_info |
|
165 class __pointer_type_info : public __pbase_type_info { |
|
166 virtual ~__pointer_type_info(); |
|
167 }; |
|
168 |
|
169 #pragma define_type_info |
|
170 class __pointer_to_member_type_info : public __pbase_type_info { |
|
171 virtual ~__pointer_to_member_type_info(); |
|
172 const __class_type_info *__context; |
|
173 }; |
|
174 |
|
175 extern "C" { |
|
176 /* Pure virtual function calls. */ |
|
177 void __cxa_pure_virtual(); |
|
178 |
|
179 /* Constructors return void in the IA-64 ABI. But in the ARM EABI |
|
180 variant, they return void*. */ |
|
181 #ifdef __EDG_IA64_ABI_VARIANT_CTORS_AND_DTORS_RETURN_THIS |
|
182 typedef void* __ctor_dtor_return_type; |
|
183 #else /* ifndef __EDG_IA64_ABI_VARIANT_CTORS_AND_DTORS_RETURN_THIS */ |
|
184 typedef void __ctor_dtor_return_type; |
|
185 #endif /* ifdef __EDG_IA64_ABI_VARIANT_CTORS_AND_DTORS_RETURN_THIS */ |
|
186 |
|
187 /* Guard variables are 64 bits in the IA-64 ABI but only 32 bits in |
|
188 the ARM EABI. */ |
|
189 #ifdef __EDG_IA64_ABI_USE_INT_STATIC_INIT_GUARD |
|
190 typedef int __guard_variable_type; |
|
191 #else /* ifndef __EDG_IA64_ABI_USE_INT_STATIC_INIT_GUARD */ |
|
192 typedef unsigned long long __guard_variable_type; |
|
193 #endif /* ifdef __EDG_IA64_ABI_USE_INT_STATIC_INIT_GUARD */ |
|
194 |
|
195 /* Guard variables for the initialization of variables with static storage |
|
196 duration. */ |
|
197 int __cxa_guard_acquire(__guard_variable_type *); |
|
198 void __cxa_guard_release(__guard_variable_type *); |
|
199 void __cxa_guard_abort(__guard_variable_type *); |
|
200 |
|
201 /* Construction and destruction of arrays. */ |
|
202 void *__cxa_vec_new(size_t, size_t, size_t, |
|
203 __ctor_dtor_return_type (*)(void *), |
|
204 __ctor_dtor_return_type (*)(void *)); |
|
205 void *__cxa_vec_new2(size_t, size_t, size_t, |
|
206 __ctor_dtor_return_type (*)(void *), |
|
207 __ctor_dtor_return_type (*)(void *), |
|
208 void *(*)(size_t), |
|
209 void (*)(void *)); |
|
210 void *__cxa_vec_new3(size_t, size_t, size_t, |
|
211 __ctor_dtor_return_type (*)(void *), |
|
212 __ctor_dtor_return_type (*)(void *), |
|
213 void *(*)(size_t), |
|
214 void (*)(void *, size_t)); |
|
215 #ifndef CXXABI_VEC_CTOR_RETURNS_VOID |
|
216 /* The C++ ABI says this returns 'void' but we actually return |
|
217 'void *' to remain compatible with RVCT 2.0 objects. But the |
|
218 compiler no longer assumes it. */ |
|
219 void * |
|
220 #else /* def CXXABI_VEC_CTOR_RETURNS_VOID */ |
|
221 void |
|
222 #endif /* def CXXABI_VEC_CTOR_RETURNS_VOID */ |
|
223 __cxa_vec_ctor(void *, size_t, size_t, |
|
224 __ctor_dtor_return_type (*)(void *), |
|
225 __ctor_dtor_return_type (*)(void *)); |
|
226 void __cxa_vec_dtor(void *, size_t, size_t, |
|
227 __ctor_dtor_return_type (*)(void *)); |
|
228 void __cxa_vec_cleanup(void *, size_t, size_t, |
|
229 __ctor_dtor_return_type (*)(void *)); |
|
230 void __cxa_vec_delete(void *, size_t, size_t, |
|
231 __ctor_dtor_return_type (*)(void *)); |
|
232 void __cxa_vec_delete2(void *, size_t, size_t, |
|
233 __ctor_dtor_return_type (*)(void *), |
|
234 void (*)(void *)); |
|
235 void __cxa_vec_delete3(void *, size_t, size_t, |
|
236 __ctor_dtor_return_type (*)(void *), |
|
237 void (*)(void *, size_t)); |
|
238 #ifndef CXXABI_VEC_CTOR_RETURNS_VOID |
|
239 /* The C++ ABI says this returns 'void' but we actually return |
|
240 'void *' to remain compatible with RVCT 2.0 objects. But the |
|
241 compiler no longer assumes it. */ |
|
242 void * |
|
243 #else /* def CXXABI_VEC_CTOR_RETURNS_VOID */ |
|
244 void |
|
245 #endif /* def CXXABI_VEC_CTOR_RETURNS_VOID */ |
|
246 __cxa_vec_cctor(void *, void *, size_t, size_t, |
|
247 __ctor_dtor_return_type (*)(void *, void *), |
|
248 __ctor_dtor_return_type (*)(void *)); |
|
249 |
|
250 /* Finalization. */ |
|
251 int __cxa_atexit(void (*)(void *), void *, void *); |
|
252 void __cxa_finalize(void *); |
|
253 |
|
254 /* Exception-handling support. */ |
|
255 void __cxa_bad_cast(); |
|
256 void __cxa_bad_typeid(); |
|
257 |
|
258 /* Demangling interface. */ |
|
259 char *__cxa_demangle(const char* __mangled_name, |
|
260 char *__buf, |
|
261 size_t *__n, |
|
262 int *__status); |
|
263 |
|
264 } /* extern "C" */ |
|
265 #ifdef __EDG_RUNTIME_USES_NAMESPACES |
|
266 } /* namespace __cxxabiv1 */ |
|
267 |
|
268 /* Create the "abi" namespace alias. */ |
|
269 namespace abi = __cxxabiv1; |
|
270 #endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */ |
|
271 |
|
272 #endif /* ifndef __CXXABI_H */ |