xref: /openbsd-src/gnu/gcc/libstdc++-v3/libsupc++/cxxabi.h (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1*404b540aSrobert // new abi support -*- C++ -*-
2*404b540aSrobert 
3*404b540aSrobert // Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
4*404b540aSrobert //
5*404b540aSrobert // This file is part of GCC.
6*404b540aSrobert //
7*404b540aSrobert // GCC is free software; you can redistribute it and/or modify
8*404b540aSrobert // it under the terms of the GNU General Public License as published by
9*404b540aSrobert // the Free Software Foundation; either version 2, or (at your option)
10*404b540aSrobert // any later version.
11*404b540aSrobert //
12*404b540aSrobert // GCC is distributed in the hope that it will be useful,
13*404b540aSrobert // but WITHOUT ANY WARRANTY; without even the implied warranty of
14*404b540aSrobert // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*404b540aSrobert // GNU General Public License for more details.
16*404b540aSrobert //
17*404b540aSrobert // You should have received a copy of the GNU General Public License
18*404b540aSrobert // along with GCC; see the file COPYING.  If not, write to
19*404b540aSrobert // the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20*404b540aSrobert // Boston, MA 02110-1301, USA.
21*404b540aSrobert 
22*404b540aSrobert // As a special exception, you may use this file as part of a free software
23*404b540aSrobert // library without restriction.  Specifically, if other files instantiate
24*404b540aSrobert // templates or use macros or inline functions from this file, or you compile
25*404b540aSrobert // this file and link it with other files to produce an executable, this
26*404b540aSrobert // file does not by itself cause the resulting executable to be covered by
27*404b540aSrobert // the GNU General Public License.  This exception does not however
28*404b540aSrobert // invalidate any other reasons why the executable file might be covered by
29*404b540aSrobert // the GNU General Public License.
30*404b540aSrobert 
31*404b540aSrobert // Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
32*404b540aSrobert 
33*404b540aSrobert /* This file declares the new abi entry points into the runtime. It is not
34*404b540aSrobert    normally necessary for user programs to include this header, or use the
35*404b540aSrobert    entry points directly. However, this header is available should that be
36*404b540aSrobert    needed.
37*404b540aSrobert 
38*404b540aSrobert    Some of the entry points are intended for both C and C++, thus this header
39*404b540aSrobert    is includable from both C and C++. Though the C++ specific parts are not
40*404b540aSrobert    available in C, naturally enough.  */
41*404b540aSrobert 
42*404b540aSrobert /** @file cxxabi.h
43*404b540aSrobert  *  The header provides an interface to the C++ ABI.
44*404b540aSrobert  */
45*404b540aSrobert 
46*404b540aSrobert #ifndef _CXXABI_H
47*404b540aSrobert #define _CXXABI_H 1
48*404b540aSrobert 
49*404b540aSrobert #pragma GCC visibility push(default)
50*404b540aSrobert 
51*404b540aSrobert #include <stddef.h>
52*404b540aSrobert #include <bits/cxxabi_tweaks.h>
53*404b540aSrobert 
54*404b540aSrobert #ifdef __cplusplus
55*404b540aSrobert namespace __cxxabiv1
56*404b540aSrobert {
57*404b540aSrobert   extern "C"
58*404b540aSrobert   {
59*404b540aSrobert #endif
60*404b540aSrobert 
61*404b540aSrobert   typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
62*404b540aSrobert 
63*404b540aSrobert   // Allocate array.
64*404b540aSrobert   void*
65*404b540aSrobert   __cxa_vec_new(size_t __element_count, size_t __element_size,
66*404b540aSrobert 		size_t __padding_size, __cxa_cdtor_type constructor,
67*404b540aSrobert 		__cxa_cdtor_type destructor);
68*404b540aSrobert 
69*404b540aSrobert   void*
70*404b540aSrobert   __cxa_vec_new2(size_t __element_count, size_t __element_size,
71*404b540aSrobert 		 size_t __padding_size, __cxa_cdtor_type constructor,
72*404b540aSrobert 		 __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
73*404b540aSrobert 		 void (*__dealloc) (void*));
74*404b540aSrobert 
75*404b540aSrobert   void*
76*404b540aSrobert   __cxa_vec_new3(size_t __element_count, size_t __element_size,
77*404b540aSrobert 		 size_t __padding_size, __cxa_cdtor_type constructor,
78*404b540aSrobert 		 __cxa_cdtor_type destructor, void *(*__alloc) (size_t),
79*404b540aSrobert 		 void (*__dealloc) (void*, size_t));
80*404b540aSrobert 
81*404b540aSrobert   // Construct array.
82*404b540aSrobert   __cxa_vec_ctor_return_type
83*404b540aSrobert   __cxa_vec_ctor(void* __array_address, size_t __element_count,
84*404b540aSrobert 		 size_t __element_size, __cxa_cdtor_type constructor,
85*404b540aSrobert 		 __cxa_cdtor_type destructor);
86*404b540aSrobert 
87*404b540aSrobert   __cxa_vec_ctor_return_type
88*404b540aSrobert   __cxa_vec_cctor(void* dest_array, void* src_array, size_t element_count,
89*404b540aSrobert 		  size_t element_size,
90*404b540aSrobert 		  __cxa_cdtor_return_type (*constructor) (void*, void*),
91*404b540aSrobert 		  __cxa_cdtor_type destructor);
92*404b540aSrobert 
93*404b540aSrobert   // Destruct array.
94*404b540aSrobert   void
95*404b540aSrobert   __cxa_vec_dtor(void* __array_address, size_t __element_count,
96*404b540aSrobert 		 size_t __element_size, __cxa_cdtor_type destructor);
97*404b540aSrobert 
98*404b540aSrobert   void
99*404b540aSrobert   __cxa_vec_cleanup(void* __array_address, size_t __element_count,
100*404b540aSrobert 		    size_t __element_size, __cxa_cdtor_type destructor);
101*404b540aSrobert 
102*404b540aSrobert   // Destruct and release array.
103*404b540aSrobert   void
104*404b540aSrobert   __cxa_vec_delete(void* __array_address, size_t __element_size,
105*404b540aSrobert 		   size_t __padding_size, __cxa_cdtor_type destructor);
106*404b540aSrobert 
107*404b540aSrobert   void
108*404b540aSrobert   __cxa_vec_delete2(void* __array_address, size_t __element_size,
109*404b540aSrobert 		    size_t __padding_size, __cxa_cdtor_type destructor,
110*404b540aSrobert 		    void (*__dealloc) (void*));
111*404b540aSrobert 
112*404b540aSrobert   void
113*404b540aSrobert   __cxa_vec_delete3(void* __array_address, size_t __element_size,
114*404b540aSrobert 		    size_t __padding_size, __cxa_cdtor_type destructor,
115*404b540aSrobert 		    void (*__dealloc) (void*, size_t));
116*404b540aSrobert 
117*404b540aSrobert   int
118*404b540aSrobert   __cxa_guard_acquire(__guard*);
119*404b540aSrobert 
120*404b540aSrobert   void
121*404b540aSrobert   __cxa_guard_release(__guard*);
122*404b540aSrobert 
123*404b540aSrobert   void
124*404b540aSrobert   __cxa_guard_abort(__guard*);
125*404b540aSrobert 
126*404b540aSrobert   // Pure virtual functions.
127*404b540aSrobert   void
128*404b540aSrobert   __cxa_pure_virtual(void);
129*404b540aSrobert 
130*404b540aSrobert   // Exception handling.
131*404b540aSrobert   void
132*404b540aSrobert   __cxa_bad_cast();
133*404b540aSrobert 
134*404b540aSrobert   void
135*404b540aSrobert   __cxa_bad_typeid();
136*404b540aSrobert 
137*404b540aSrobert   // DSO destruction.
138*404b540aSrobert   int
139*404b540aSrobert   __cxa_atexit(void (*)(void*), void*, void*);
140*404b540aSrobert 
141*404b540aSrobert   int
142*404b540aSrobert   __cxa_finalize(void*);
143*404b540aSrobert 
144*404b540aSrobert   // Demangling routines.
145*404b540aSrobert   char*
146*404b540aSrobert   __cxa_demangle(const char* __mangled_name, char* __output_buffer,
147*404b540aSrobert 		 size_t* __length, int* __status);
148*404b540aSrobert #ifdef __cplusplus
149*404b540aSrobert   }
150*404b540aSrobert } // namespace __cxxabiv1
151*404b540aSrobert #endif
152*404b540aSrobert 
153*404b540aSrobert #ifdef __cplusplus
154*404b540aSrobert 
155*404b540aSrobert #include <typeinfo>
156*404b540aSrobert 
157*404b540aSrobert namespace __cxxabiv1
158*404b540aSrobert {
159*404b540aSrobert   // Type information for int, float etc.
160*404b540aSrobert   class __fundamental_type_info : public std::type_info
161*404b540aSrobert   {
162*404b540aSrobert   public:
163*404b540aSrobert     explicit
__fundamental_type_info(const char * __n)164*404b540aSrobert     __fundamental_type_info(const char* __n) : std::type_info(__n) { }
165*404b540aSrobert 
166*404b540aSrobert     virtual
167*404b540aSrobert     ~__fundamental_type_info();
168*404b540aSrobert   };
169*404b540aSrobert 
170*404b540aSrobert   // Type information for array objects.
171*404b540aSrobert   class __array_type_info : public std::type_info
172*404b540aSrobert   {
173*404b540aSrobert   public:
174*404b540aSrobert     explicit
__array_type_info(const char * __n)175*404b540aSrobert     __array_type_info(const char* __n) : std::type_info(__n) { }
176*404b540aSrobert 
177*404b540aSrobert     virtual
178*404b540aSrobert     ~__array_type_info();
179*404b540aSrobert   };
180*404b540aSrobert 
181*404b540aSrobert   // Type information for functions (both member and non-member).
182*404b540aSrobert   class __function_type_info : public std::type_info
183*404b540aSrobert   {
184*404b540aSrobert   public:
185*404b540aSrobert     explicit
__function_type_info(const char * __n)186*404b540aSrobert     __function_type_info(const char* __n) : std::type_info(__n) { }
187*404b540aSrobert 
188*404b540aSrobert     virtual
189*404b540aSrobert     ~__function_type_info();
190*404b540aSrobert 
191*404b540aSrobert   protected:
192*404b540aSrobert     // Implementation defined member function.
193*404b540aSrobert     virtual bool
194*404b540aSrobert     __is_function_p() const;
195*404b540aSrobert   };
196*404b540aSrobert 
197*404b540aSrobert   // Type information for enumerations.
198*404b540aSrobert   class __enum_type_info : public std::type_info
199*404b540aSrobert   {
200*404b540aSrobert   public:
201*404b540aSrobert     explicit
__enum_type_info(const char * __n)202*404b540aSrobert     __enum_type_info(const char* __n) : std::type_info(__n) { }
203*404b540aSrobert 
204*404b540aSrobert     virtual
205*404b540aSrobert     ~__enum_type_info();
206*404b540aSrobert   };
207*404b540aSrobert 
208*404b540aSrobert   // Common type information for simple pointers and pointers to member.
209*404b540aSrobert   class __pbase_type_info : public std::type_info
210*404b540aSrobert   {
211*404b540aSrobert   public:
212*404b540aSrobert     unsigned int 		__flags; // Qualification of the target object.
213*404b540aSrobert     const std::type_info* 	__pointee; // Type of pointed to object.
214*404b540aSrobert 
215*404b540aSrobert     explicit
__pbase_type_info(const char * __n,int __quals,const std::type_info * __type)216*404b540aSrobert     __pbase_type_info(const char* __n, int __quals,
217*404b540aSrobert 		      const std::type_info* __type)
218*404b540aSrobert     : std::type_info(__n), __flags(__quals), __pointee(__type)
219*404b540aSrobert     { }
220*404b540aSrobert 
221*404b540aSrobert     virtual
222*404b540aSrobert     ~__pbase_type_info();
223*404b540aSrobert 
224*404b540aSrobert     // Implementation defined type.
225*404b540aSrobert     enum __masks
226*404b540aSrobert       {
227*404b540aSrobert 	__const_mask = 0x1,
228*404b540aSrobert 	__volatile_mask = 0x2,
229*404b540aSrobert 	__restrict_mask = 0x4,
230*404b540aSrobert 	__incomplete_mask = 0x8,
231*404b540aSrobert 	__incomplete_class_mask = 0x10
232*404b540aSrobert       };
233*404b540aSrobert 
234*404b540aSrobert   protected:
235*404b540aSrobert     __pbase_type_info(const __pbase_type_info&);
236*404b540aSrobert 
237*404b540aSrobert     __pbase_type_info&
238*404b540aSrobert     operator=(const __pbase_type_info&);
239*404b540aSrobert 
240*404b540aSrobert     // Implementation defined member functions.
241*404b540aSrobert     virtual bool
242*404b540aSrobert     __do_catch(const std::type_info* __thr_type, void** __thr_obj,
243*404b540aSrobert 	       unsigned int __outer) const;
244*404b540aSrobert 
245*404b540aSrobert     inline virtual bool
246*404b540aSrobert     __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
247*404b540aSrobert 		    unsigned __outer) const;
248*404b540aSrobert   };
249*404b540aSrobert 
250*404b540aSrobert   // Type information for simple pointers.
251*404b540aSrobert   class __pointer_type_info : public __pbase_type_info
252*404b540aSrobert   {
253*404b540aSrobert   public:
254*404b540aSrobert     explicit
__pointer_type_info(const char * __n,int __quals,const std::type_info * __type)255*404b540aSrobert     __pointer_type_info(const char* __n, int __quals,
256*404b540aSrobert 			const std::type_info* __type)
257*404b540aSrobert     : __pbase_type_info (__n, __quals, __type) { }
258*404b540aSrobert 
259*404b540aSrobert 
260*404b540aSrobert     virtual
261*404b540aSrobert     ~__pointer_type_info();
262*404b540aSrobert 
263*404b540aSrobert   protected:
264*404b540aSrobert     // Implementation defined member functions.
265*404b540aSrobert     virtual bool
266*404b540aSrobert     __is_pointer_p() const;
267*404b540aSrobert 
268*404b540aSrobert     virtual bool
269*404b540aSrobert     __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
270*404b540aSrobert 		    unsigned __outer) const;
271*404b540aSrobert   };
272*404b540aSrobert 
273*404b540aSrobert   class __class_type_info;
274*404b540aSrobert 
275*404b540aSrobert   // Type information for a pointer to member variable.
276*404b540aSrobert   class __pointer_to_member_type_info : public __pbase_type_info
277*404b540aSrobert   {
278*404b540aSrobert   public:
279*404b540aSrobert     __class_type_info* __context;   // Class of the member.
280*404b540aSrobert 
281*404b540aSrobert     explicit
__pointer_to_member_type_info(const char * __n,int __quals,const std::type_info * __type,__class_type_info * __klass)282*404b540aSrobert     __pointer_to_member_type_info(const char* __n, int __quals,
283*404b540aSrobert 				  const std::type_info* __type,
284*404b540aSrobert 				  __class_type_info* __klass)
285*404b540aSrobert     : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
286*404b540aSrobert 
287*404b540aSrobert     virtual
288*404b540aSrobert     ~__pointer_to_member_type_info();
289*404b540aSrobert 
290*404b540aSrobert   protected:
291*404b540aSrobert     __pointer_to_member_type_info(const __pointer_to_member_type_info&);
292*404b540aSrobert 
293*404b540aSrobert     __pointer_to_member_type_info&
294*404b540aSrobert     operator=(const __pointer_to_member_type_info&);
295*404b540aSrobert 
296*404b540aSrobert     // Implementation defined member function.
297*404b540aSrobert     virtual bool
298*404b540aSrobert     __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
299*404b540aSrobert 		    unsigned __outer) const;
300*404b540aSrobert   };
301*404b540aSrobert 
302*404b540aSrobert   // Helper class for __vmi_class_type.
303*404b540aSrobert   class __base_class_type_info
304*404b540aSrobert   {
305*404b540aSrobert   public:
306*404b540aSrobert     const __class_type_info* 	__base_type;  // Base class type.
307*404b540aSrobert     long 			__offset_flags;  // Offset and info.
308*404b540aSrobert 
309*404b540aSrobert     enum __offset_flags_masks
310*404b540aSrobert       {
311*404b540aSrobert 	__virtual_mask = 0x1,
312*404b540aSrobert 	__public_mask = 0x2,
313*404b540aSrobert 	__hwm_bit = 2,
314*404b540aSrobert 	__offset_shift = 8          // Bits to shift offset.
315*404b540aSrobert       };
316*404b540aSrobert 
317*404b540aSrobert     // Implementation defined member functions.
318*404b540aSrobert     bool
__is_virtual_p()319*404b540aSrobert     __is_virtual_p() const
320*404b540aSrobert     { return __offset_flags & __virtual_mask; }
321*404b540aSrobert 
322*404b540aSrobert     bool
__is_public_p()323*404b540aSrobert     __is_public_p() const
324*404b540aSrobert     { return __offset_flags & __public_mask; }
325*404b540aSrobert 
326*404b540aSrobert     ptrdiff_t
__offset()327*404b540aSrobert     __offset() const
328*404b540aSrobert     {
329*404b540aSrobert       // This shift, being of a signed type, is implementation
330*404b540aSrobert       // defined. GCC implements such shifts as arithmetic, which is
331*404b540aSrobert       // what we want.
332*404b540aSrobert       return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
333*404b540aSrobert     }
334*404b540aSrobert   };
335*404b540aSrobert 
336*404b540aSrobert   // Type information for a class.
337*404b540aSrobert   class __class_type_info : public std::type_info
338*404b540aSrobert   {
339*404b540aSrobert   public:
340*404b540aSrobert     explicit
__class_type_info(const char * __n)341*404b540aSrobert     __class_type_info (const char *__n) : type_info(__n) { }
342*404b540aSrobert 
343*404b540aSrobert     virtual
344*404b540aSrobert     ~__class_type_info ();
345*404b540aSrobert 
346*404b540aSrobert     // Implementation defined types.
347*404b540aSrobert     // The type sub_kind tells us about how a base object is contained
348*404b540aSrobert     // within a derived object. We often do this lazily, hence the
349*404b540aSrobert     // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
350*404b540aSrobert     // not publicly contained.
351*404b540aSrobert     enum __sub_kind
352*404b540aSrobert       {
353*404b540aSrobert 	// We have no idea.
354*404b540aSrobert 	__unknown = 0,
355*404b540aSrobert 
356*404b540aSrobert 	// Not contained within us (in some circumstances this might
357*404b540aSrobert 	// mean not contained publicly)
358*404b540aSrobert 	__not_contained,
359*404b540aSrobert 
360*404b540aSrobert 	// Contained ambiguously.
361*404b540aSrobert 	__contained_ambig,
362*404b540aSrobert 
363*404b540aSrobert 	// Via a virtual path.
364*404b540aSrobert 	__contained_virtual_mask = __base_class_type_info::__virtual_mask,
365*404b540aSrobert 
366*404b540aSrobert 	// Via a public path.
367*404b540aSrobert 	__contained_public_mask = __base_class_type_info::__public_mask,
368*404b540aSrobert 
369*404b540aSrobert 	// Contained within us.
370*404b540aSrobert 	__contained_mask = 1 << __base_class_type_info::__hwm_bit,
371*404b540aSrobert 
372*404b540aSrobert 	__contained_private = __contained_mask,
373*404b540aSrobert 	__contained_public = __contained_mask | __contained_public_mask
374*404b540aSrobert       };
375*404b540aSrobert 
376*404b540aSrobert     struct __upcast_result;
377*404b540aSrobert     struct __dyncast_result;
378*404b540aSrobert 
379*404b540aSrobert   protected:
380*404b540aSrobert     // Implementation defined member functions.
381*404b540aSrobert     virtual bool
382*404b540aSrobert     __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
383*404b540aSrobert 
384*404b540aSrobert     virtual bool
385*404b540aSrobert     __do_catch(const type_info* __thr_type, void** __thr_obj,
386*404b540aSrobert 	       unsigned __outer) const;
387*404b540aSrobert 
388*404b540aSrobert   public:
389*404b540aSrobert     // Helper for upcast. See if DST is us, or one of our bases.
390*404b540aSrobert     // Return false if not found, true if found.
391*404b540aSrobert     virtual bool
392*404b540aSrobert     __do_upcast(const __class_type_info* __dst, const void* __obj,
393*404b540aSrobert 		__upcast_result& __restrict __result) const;
394*404b540aSrobert 
395*404b540aSrobert     // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
396*404b540aSrobert     // within OBJ_PTR. OBJ_PTR points to a base object of our type,
397*404b540aSrobert     // which is the destination type. SRC2DST indicates how SRC
398*404b540aSrobert     // objects might be contained within this type.  If SRC_PTR is one
399*404b540aSrobert     // of our SRC_TYPE bases, indicate the virtuality. Returns
400*404b540aSrobert     // not_contained for non containment or private containment.
401*404b540aSrobert     inline __sub_kind
402*404b540aSrobert     __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
403*404b540aSrobert 		      const __class_type_info* __src_type,
404*404b540aSrobert 		      const void* __src_ptr) const;
405*404b540aSrobert 
406*404b540aSrobert     // Helper for dynamic cast. ACCESS_PATH gives the access from the
407*404b540aSrobert     // most derived object to this base. DST_TYPE indicates the
408*404b540aSrobert     // desired type we want. OBJ_PTR points to a base of our type
409*404b540aSrobert     // within the complete object. SRC_TYPE indicates the static type
410*404b540aSrobert     // started from and SRC_PTR points to that base within the most
411*404b540aSrobert     // derived object. Fill in RESULT with what we find. Return true
412*404b540aSrobert     // if we have located an ambiguous match.
413*404b540aSrobert     virtual bool
414*404b540aSrobert     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
415*404b540aSrobert 		 const __class_type_info* __dst_type, const void* __obj_ptr,
416*404b540aSrobert 		 const __class_type_info* __src_type, const void* __src_ptr,
417*404b540aSrobert 		 __dyncast_result& __result) const;
418*404b540aSrobert 
419*404b540aSrobert     // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
420*404b540aSrobert     // bases are inherited by the type started from -- which is not
421*404b540aSrobert     // necessarily the current type. The current type will be a base
422*404b540aSrobert     // of the destination type.  OBJ_PTR points to the current base.
423*404b540aSrobert     virtual __sub_kind
424*404b540aSrobert     __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
425*404b540aSrobert 			 const __class_type_info* __src_type,
426*404b540aSrobert 			 const void* __src_ptr) const;
427*404b540aSrobert   };
428*404b540aSrobert 
429*404b540aSrobert   // Type information for a class with a single non-virtual base.
430*404b540aSrobert   class __si_class_type_info : public __class_type_info
431*404b540aSrobert   {
432*404b540aSrobert   public:
433*404b540aSrobert     const __class_type_info* __base_type;
434*404b540aSrobert 
435*404b540aSrobert     explicit
__si_class_type_info(const char * __n,const __class_type_info * __base)436*404b540aSrobert     __si_class_type_info(const char *__n, const __class_type_info *__base)
437*404b540aSrobert     : __class_type_info(__n), __base_type(__base) { }
438*404b540aSrobert 
439*404b540aSrobert     virtual
440*404b540aSrobert     ~__si_class_type_info();
441*404b540aSrobert 
442*404b540aSrobert   protected:
443*404b540aSrobert     __si_class_type_info(const __si_class_type_info&);
444*404b540aSrobert 
445*404b540aSrobert     __si_class_type_info&
446*404b540aSrobert     operator=(const __si_class_type_info&);
447*404b540aSrobert 
448*404b540aSrobert     // Implementation defined member functions.
449*404b540aSrobert     virtual bool
450*404b540aSrobert     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
451*404b540aSrobert 		 const __class_type_info* __dst_type, const void* __obj_ptr,
452*404b540aSrobert 		 const __class_type_info* __src_type, const void* __src_ptr,
453*404b540aSrobert 		 __dyncast_result& __result) const;
454*404b540aSrobert 
455*404b540aSrobert     virtual __sub_kind
456*404b540aSrobert     __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
457*404b540aSrobert 			 const __class_type_info* __src_type,
458*404b540aSrobert 			 const void* __sub_ptr) const;
459*404b540aSrobert 
460*404b540aSrobert     virtual bool
461*404b540aSrobert     __do_upcast(const __class_type_info*__dst, const void*__obj,
462*404b540aSrobert 		__upcast_result& __restrict __result) const;
463*404b540aSrobert   };
464*404b540aSrobert 
465*404b540aSrobert   // Type information for a class with multiple and/or virtual bases.
466*404b540aSrobert   class __vmi_class_type_info : public __class_type_info
467*404b540aSrobert   {
468*404b540aSrobert   public:
469*404b540aSrobert     unsigned int 		__flags;  // Details about the class hierarchy.
470*404b540aSrobert     unsigned int 		__base_count;  // Number of direct bases.
471*404b540aSrobert 
472*404b540aSrobert     // The array of bases uses the trailing array struct hack so this
473*404b540aSrobert     // class is not constructable with a normal constructor. It is
474*404b540aSrobert     // internally generated by the compiler.
475*404b540aSrobert     __base_class_type_info 	__base_info[1];  // Array of bases.
476*404b540aSrobert 
477*404b540aSrobert     explicit
__vmi_class_type_info(const char * __n,int ___flags)478*404b540aSrobert     __vmi_class_type_info(const char* __n, int ___flags)
479*404b540aSrobert     : __class_type_info(__n), __flags(___flags), __base_count(0) { }
480*404b540aSrobert 
481*404b540aSrobert     virtual
482*404b540aSrobert     ~__vmi_class_type_info();
483*404b540aSrobert 
484*404b540aSrobert     // Implementation defined types.
485*404b540aSrobert     enum __flags_masks
486*404b540aSrobert       {
487*404b540aSrobert 	__non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
488*404b540aSrobert 	__diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
489*404b540aSrobert 	__flags_unknown_mask = 0x10
490*404b540aSrobert       };
491*404b540aSrobert 
492*404b540aSrobert   protected:
493*404b540aSrobert     // Implementation defined member functions.
494*404b540aSrobert     virtual bool
495*404b540aSrobert     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
496*404b540aSrobert 		 const __class_type_info* __dst_type, const void* __obj_ptr,
497*404b540aSrobert 		 const __class_type_info* __src_type, const void* __src_ptr,
498*404b540aSrobert 		 __dyncast_result& __result) const;
499*404b540aSrobert 
500*404b540aSrobert     virtual __sub_kind
501*404b540aSrobert     __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
502*404b540aSrobert 			 const __class_type_info* __src_type,
503*404b540aSrobert 			 const void* __src_ptr) const;
504*404b540aSrobert 
505*404b540aSrobert     virtual bool
506*404b540aSrobert     __do_upcast(const __class_type_info* __dst, const void* __obj,
507*404b540aSrobert 		__upcast_result& __restrict __result) const;
508*404b540aSrobert   };
509*404b540aSrobert 
510*404b540aSrobert   // Dynamic cast runtime.
511*404b540aSrobert   // src2dst has the following possible values
512*404b540aSrobert   //  >-1: src_type is a unique public non-virtual base of dst_type
513*404b540aSrobert   //       dst_ptr + src2dst == src_ptr
514*404b540aSrobert   //   -1: unspecified relationship
515*404b540aSrobert   //   -2: src_type is not a public base of dst_type
516*404b540aSrobert   //   -3: src_type is a multiple public non-virtual base of dst_type
517*404b540aSrobert   extern "C" void*
518*404b540aSrobert   __dynamic_cast(const void* __src_ptr, // Starting object.
519*404b540aSrobert 		 const __class_type_info* __src_type, // Static type of object.
520*404b540aSrobert 		 const __class_type_info* __dst_type, // Desired target type.
521*404b540aSrobert 		 ptrdiff_t __src2dst); // How src and dst are related.
522*404b540aSrobert 
523*404b540aSrobert 
524*404b540aSrobert   // Returns the type_info for the currently handled exception [15.3/8], or
525*404b540aSrobert   // null if there is none.
526*404b540aSrobert   extern "C" std::type_info*
527*404b540aSrobert   __cxa_current_exception_type();
528*404b540aSrobert } // namespace __cxxabiv1
529*404b540aSrobert 
530*404b540aSrobert // User programs should use the alias `abi'.
531*404b540aSrobert namespace abi = __cxxabiv1;
532*404b540aSrobert 
533*404b540aSrobert #endif // __cplusplus
534*404b540aSrobert 
535*404b540aSrobert #pragma GCC visibility pop
536*404b540aSrobert 
537*404b540aSrobert #endif // __CXXABI_H
538