2011-01-15 01:27:10 +01:00
|
|
|
// ABI Support -*- C++ -*-
|
|
|
|
|
2021-01-04 10:26:59 +01:00
|
|
|
// Copyright (C) 2000-2021 Free Software Foundation, Inc.
|
2001-02-16 01:44:44 +01:00
|
|
|
//
|
Makefile.am, [...]: Replace "GNU CC" with "GCC".
2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
* libsupc++/Makefile.am, libsupc++/cxxabi.h, libsupc++/del_op.cc,
libsupc++/del_opnt.cc, libsupc++/del_opv.cc, libsupc++/del_opvnt.cc,
libsupc++/eh_alloc.cc, libsupc++/eh_aux_runtime.cc,
libsupc++/eh_catch.cc, libsupc++/eh_exception.cc,
libsupc++/eh_globals.cc, libsupc++/eh_personality.cc,
libsupc++/eh_term_handler.cc, libsupc++/eh_terminate.cc,
libsupc++/eh_throw.cc, libsupc++/eh_type.cc,
libsupc++/eh_unex_handler.cc, libsupc++/exception,
libsupc++/new, libsupc++/new_handler.cc, libsupc++/new_op.cc,
libsupc++/new_opnt.cc, libsupc++/new_opv.cc, libsupc++/new_opvnt.cc,
libsupc++/pure.cc, libsupc++/tinfo.cc, libsupc++/tinfo2.cc,
libsupc++/typeinfo, libsupc++/unwind-cxx.h, libsupc++/vec.cc:
Replace "GNU CC" with "GCC".
From-SVN: r67155
2003-05-24 18:22:03 +02:00
|
|
|
// This file is part of GCC.
|
2000-10-11 01:43:26 +02:00
|
|
|
//
|
Makefile.am, [...]: Replace "GNU CC" with "GCC".
2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
* libsupc++/Makefile.am, libsupc++/cxxabi.h, libsupc++/del_op.cc,
libsupc++/del_opnt.cc, libsupc++/del_opv.cc, libsupc++/del_opvnt.cc,
libsupc++/eh_alloc.cc, libsupc++/eh_aux_runtime.cc,
libsupc++/eh_catch.cc, libsupc++/eh_exception.cc,
libsupc++/eh_globals.cc, libsupc++/eh_personality.cc,
libsupc++/eh_term_handler.cc, libsupc++/eh_terminate.cc,
libsupc++/eh_throw.cc, libsupc++/eh_type.cc,
libsupc++/eh_unex_handler.cc, libsupc++/exception,
libsupc++/new, libsupc++/new_handler.cc, libsupc++/new_op.cc,
libsupc++/new_opnt.cc, libsupc++/new_opv.cc, libsupc++/new_opvnt.cc,
libsupc++/pure.cc, libsupc++/tinfo.cc, libsupc++/tinfo2.cc,
libsupc++/typeinfo, libsupc++/unwind-cxx.h, libsupc++/vec.cc:
Replace "GNU CC" with "GCC".
From-SVN: r67155
2003-05-24 18:22:03 +02:00
|
|
|
// GCC is free software; you can redistribute it and/or modify
|
2000-10-11 01:43:26 +02:00
|
|
|
// it under the terms of the GNU General Public License as published by
|
2009-04-09 17:00:19 +02:00
|
|
|
// the Free Software Foundation; either version 3, or (at your option)
|
2000-10-11 01:43:26 +02:00
|
|
|
// any later version.
|
2011-01-15 01:27:10 +01:00
|
|
|
//
|
Makefile.am, [...]: Replace "GNU CC" with "GCC".
2003-05-24 Nathanael Nerode <neroden@gcc.gnu.org>
* libsupc++/Makefile.am, libsupc++/cxxabi.h, libsupc++/del_op.cc,
libsupc++/del_opnt.cc, libsupc++/del_opv.cc, libsupc++/del_opvnt.cc,
libsupc++/eh_alloc.cc, libsupc++/eh_aux_runtime.cc,
libsupc++/eh_catch.cc, libsupc++/eh_exception.cc,
libsupc++/eh_globals.cc, libsupc++/eh_personality.cc,
libsupc++/eh_term_handler.cc, libsupc++/eh_terminate.cc,
libsupc++/eh_throw.cc, libsupc++/eh_type.cc,
libsupc++/eh_unex_handler.cc, libsupc++/exception,
libsupc++/new, libsupc++/new_handler.cc, libsupc++/new_op.cc,
libsupc++/new_opnt.cc, libsupc++/new_opv.cc, libsupc++/new_opvnt.cc,
libsupc++/pure.cc, libsupc++/tinfo.cc, libsupc++/tinfo2.cc,
libsupc++/typeinfo, libsupc++/unwind-cxx.h, libsupc++/vec.cc:
Replace "GNU CC" with "GCC".
From-SVN: r67155
2003-05-24 18:22:03 +02:00
|
|
|
// GCC is distributed in the hope that it will be useful,
|
2000-10-11 01:43:26 +02:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2011-01-15 01:27:10 +01:00
|
|
|
//
|
2009-04-09 17:00:19 +02:00
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
2000-10-11 01:43:26 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
2000-10-11 01:43:26 +02:00
|
|
|
|
2001-02-16 01:44:44 +01:00
|
|
|
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2000-10-11 01:43:26 +02:00
|
|
|
/* This file declares the new abi entry points into the runtime. It is not
|
|
|
|
normally necessary for user programs to include this header, or use the
|
|
|
|
entry points directly. However, this header is available should that be
|
|
|
|
needed.
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2000-10-11 01:43:26 +02:00
|
|
|
Some of the entry points are intended for both C and C++, thus this header
|
|
|
|
is includable from both C and C++. Though the C++ specific parts are not
|
|
|
|
available in C, naturally enough. */
|
|
|
|
|
2004-11-24 05:11:23 +01:00
|
|
|
/** @file cxxabi.h
|
|
|
|
* The header provides an interface to the C++ ABI.
|
|
|
|
*/
|
|
|
|
|
2003-07-05 06:05:45 +02:00
|
|
|
#ifndef _CXXABI_H
|
|
|
|
#define _CXXABI_H 1
|
2000-10-11 01:43:26 +02:00
|
|
|
|
2010-02-18 18:58:53 +01:00
|
|
|
#pragma GCC system_header
|
|
|
|
|
2004-08-03 08:45:54 +02:00
|
|
|
#pragma GCC visibility push(default)
|
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
#include <stddef.h>
|
2011-01-15 01:27:10 +01:00
|
|
|
#include <bits/c++config.h>
|
2007-05-08 08:50:32 +02:00
|
|
|
#include <bits/cxxabi_tweaks.h>
|
2011-01-15 01:27:10 +01:00
|
|
|
#include <bits/cxxabi_forced.h>
|
2016-08-22 19:29:31 +02:00
|
|
|
#include <bits/cxxabi_init_exception.h>
|
2011-12-16 19:43:06 +01:00
|
|
|
|
2000-10-11 01:43:26 +02:00
|
|
|
#ifdef __cplusplus
|
2007-05-08 08:50:32 +02:00
|
|
|
namespace __cxxabiv1
|
2011-01-15 01:27:10 +01:00
|
|
|
{
|
|
|
|
extern "C"
|
2007-05-08 08:50:32 +02:00
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
|
|
|
|
|
|
|
|
// Allocate array.
|
2011-01-15 01:27:10 +01:00
|
|
|
void*
|
|
|
|
__cxa_vec_new(size_t __element_count, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __constructor,
|
|
|
|
__cxa_cdtor_type __destructor);
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
void*
|
|
|
|
__cxa_vec_new2(size_t __element_count, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __constructor,
|
2011-01-15 01:27:10 +01:00
|
|
|
__cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
|
2007-05-08 08:50:32 +02:00
|
|
|
void (*__dealloc) (void*));
|
|
|
|
|
|
|
|
void*
|
|
|
|
__cxa_vec_new3(size_t __element_count, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __constructor,
|
2011-01-15 01:27:10 +01:00
|
|
|
__cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
|
2007-05-08 08:50:32 +02:00
|
|
|
void (*__dealloc) (void*, size_t));
|
|
|
|
|
|
|
|
// Construct array.
|
|
|
|
__cxa_vec_ctor_return_type
|
|
|
|
__cxa_vec_ctor(void* __array_address, size_t __element_count,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __element_size, __cxa_cdtor_type __constructor,
|
|
|
|
__cxa_cdtor_type __destructor);
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
__cxa_vec_ctor_return_type
|
2010-09-09 12:46:04 +02:00
|
|
|
__cxa_vec_cctor(void* __dest_array, void* __src_array,
|
2011-01-15 01:27:10 +01:00
|
|
|
size_t __element_count, size_t __element_size,
|
|
|
|
__cxa_cdtor_return_type (*__constructor) (void*, void*),
|
2010-09-09 12:46:04 +02:00
|
|
|
__cxa_cdtor_type __destructor);
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Destruct array.
|
2011-01-15 01:27:10 +01:00
|
|
|
void
|
2007-05-08 08:50:32 +02:00
|
|
|
__cxa_vec_dtor(void* __array_address, size_t __element_count,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __element_size, __cxa_cdtor_type __destructor);
|
2011-01-15 01:27:10 +01:00
|
|
|
|
|
|
|
void
|
2010-09-09 12:46:04 +02:00
|
|
|
__cxa_vec_cleanup(void* __array_address, size_t __element_count, size_t __s,
|
|
|
|
__cxa_cdtor_type __destructor) _GLIBCXX_NOTHROW;
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Destruct and release array.
|
2011-01-15 01:27:10 +01:00
|
|
|
void
|
2007-05-08 08:50:32 +02:00
|
|
|
__cxa_vec_delete(void* __array_address, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __destructor);
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
void
|
2007-05-08 08:50:32 +02:00
|
|
|
__cxa_vec_delete2(void* __array_address, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __destructor,
|
2007-05-08 08:50:32 +02:00
|
|
|
void (*__dealloc) (void*));
|
2011-01-15 01:27:10 +01:00
|
|
|
|
|
|
|
void
|
2007-05-08 08:50:32 +02:00
|
|
|
__cxa_vec_delete3(void* __array_address, size_t __element_size,
|
2010-09-09 12:46:04 +02:00
|
|
|
size_t __padding_size, __cxa_cdtor_type __destructor,
|
2007-05-08 08:50:32 +02:00
|
|
|
void (*__dealloc) (void*, size_t));
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
int
|
2007-05-08 08:50:32 +02:00
|
|
|
__cxa_guard_acquire(__guard*);
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
void
|
* eh_type.cc (__cxa_current_exception_type) Mark throw().
* unwind-cxx.h (__cxa_get_globals, __cxa_get_globals_fast): Mark const.
(__cxa_get_exception_ptr): Mark pure.
(__cxa_bad_cast, __cxa_bad_typeid): Mark noreturn
(__terminate): Makr throw ().
* exception (terminate): Mark throw().
(uncaught_exception): Mark pure.
* eh_ptr.cc (_M_safe_bool_dummy): Mark throw().
* guard.cc (__cxa_guard_abort, __cxa_guard_release): Mark throw().
* eh_terminate.cc (__terminate, terminate): Mark throw().
* vec.cc (__cxa_vec_cleanup): Mark throw().
* cxxabi.h (__cxa_vec_cleanup, __cxa_guard_release, __cxa_guard_abort): Mark throw ().
(__cxa_pure_virtual): Mark noreturn.
(__cxa_current_exception_type): Mark throw and pure.
* exception_ptr.h (operator ==, !=, _M_get, !, ==,
__cxa_exception_type): Mark pure.
(_M_safe_bool_dummy): Mark pure and const.
From-SVN: r146331
2009-04-19 00:18:21 +02:00
|
|
|
__cxa_guard_release(__guard*) _GLIBCXX_NOTHROW;
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
void
|
* eh_type.cc (__cxa_current_exception_type) Mark throw().
* unwind-cxx.h (__cxa_get_globals, __cxa_get_globals_fast): Mark const.
(__cxa_get_exception_ptr): Mark pure.
(__cxa_bad_cast, __cxa_bad_typeid): Mark noreturn
(__terminate): Makr throw ().
* exception (terminate): Mark throw().
(uncaught_exception): Mark pure.
* eh_ptr.cc (_M_safe_bool_dummy): Mark throw().
* guard.cc (__cxa_guard_abort, __cxa_guard_release): Mark throw().
* eh_terminate.cc (__terminate, terminate): Mark throw().
* vec.cc (__cxa_vec_cleanup): Mark throw().
* cxxabi.h (__cxa_vec_cleanup, __cxa_guard_release, __cxa_guard_abort): Mark throw ().
(__cxa_pure_virtual): Mark noreturn.
(__cxa_current_exception_type): Mark throw and pure.
* exception_ptr.h (operator ==, !=, _M_get, !, ==,
__cxa_exception_type): Mark pure.
(_M_safe_bool_dummy): Mark pure and const.
From-SVN: r146331
2009-04-19 00:18:21 +02:00
|
|
|
__cxa_guard_abort(__guard*) _GLIBCXX_NOTHROW;
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-10-10 21:03:39 +02:00
|
|
|
// DSO destruction.
|
|
|
|
int
|
2020-10-08 04:26:13 +02:00
|
|
|
#ifdef _GLIBCXX_CDTOR_CALLABI
|
|
|
|
__cxa_atexit(void (_GLIBCXX_CDTOR_CALLABI *)(void*), void*, void*) _GLIBCXX_NOTHROW;
|
|
|
|
#else
|
2011-10-10 21:03:39 +02:00
|
|
|
__cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
|
2020-10-08 04:26:13 +02:00
|
|
|
#endif
|
2011-10-10 21:03:39 +02:00
|
|
|
|
2020-05-05 00:07:19 +02:00
|
|
|
void
|
2011-10-10 21:03:39 +02:00
|
|
|
__cxa_finalize(void*);
|
|
|
|
|
2012-10-08 16:45:24 +02:00
|
|
|
// TLS destruction.
|
|
|
|
int
|
2020-10-08 04:26:13 +02:00
|
|
|
#ifdef _GLIBCXX_CDTOR_CALLABI
|
|
|
|
__cxa_thread_atexit(void (_GLIBCXX_CDTOR_CALLABI *)(void*), void*, void *) _GLIBCXX_NOTHROW;
|
|
|
|
#else
|
2012-10-08 16:45:24 +02:00
|
|
|
__cxa_thread_atexit(void (*)(void*), void*, void *) _GLIBCXX_NOTHROW;
|
2020-10-08 04:26:13 +02:00
|
|
|
#endif
|
2012-10-08 16:45:24 +02:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Pure virtual functions.
|
|
|
|
void
|
* eh_type.cc (__cxa_current_exception_type) Mark throw().
* unwind-cxx.h (__cxa_get_globals, __cxa_get_globals_fast): Mark const.
(__cxa_get_exception_ptr): Mark pure.
(__cxa_bad_cast, __cxa_bad_typeid): Mark noreturn
(__terminate): Makr throw ().
* exception (terminate): Mark throw().
(uncaught_exception): Mark pure.
* eh_ptr.cc (_M_safe_bool_dummy): Mark throw().
* guard.cc (__cxa_guard_abort, __cxa_guard_release): Mark throw().
* eh_terminate.cc (__terminate, terminate): Mark throw().
* vec.cc (__cxa_vec_cleanup): Mark throw().
* cxxabi.h (__cxa_vec_cleanup, __cxa_guard_release, __cxa_guard_abort): Mark throw ().
(__cxa_pure_virtual): Mark noreturn.
(__cxa_current_exception_type): Mark throw and pure.
* exception_ptr.h (operator ==, !=, _M_get, !, ==,
__cxa_exception_type): Mark pure.
(_M_safe_bool_dummy): Mark pure and const.
From-SVN: r146331
2009-04-19 00:18:21 +02:00
|
|
|
__cxa_pure_virtual(void) __attribute__ ((__noreturn__));
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
void
|
2011-10-10 21:03:39 +02:00
|
|
|
__cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2013-11-15 17:33:59 +01:00
|
|
|
// Exception handling auxiliary.
|
2011-10-10 21:03:39 +02:00
|
|
|
void
|
|
|
|
__cxa_bad_cast() __attribute__((__noreturn__));
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-10-10 21:03:39 +02:00
|
|
|
void
|
|
|
|
__cxa_bad_typeid() __attribute__((__noreturn__));
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2013-05-09 05:58:00 +02:00
|
|
|
void
|
|
|
|
__cxa_throw_bad_array_new_length() __attribute__((__noreturn__));
|
|
|
|
|
2009-02-21 01:45:21 +01:00
|
|
|
/**
|
2011-01-15 01:27:10 +01:00
|
|
|
* @brief Demangling routine.
|
2009-02-21 01:45:21 +01:00
|
|
|
* ABI-mandated entry point in the C++ runtime library for demangling.
|
|
|
|
*
|
|
|
|
* @param __mangled_name A NUL-terminated character string
|
|
|
|
* containing the name to be demangled.
|
|
|
|
*
|
|
|
|
* @param __output_buffer A region of memory, allocated with
|
|
|
|
* malloc, of @a *__length bytes, into which the demangled name is
|
|
|
|
* stored. If @a __output_buffer is not long enough, it is
|
|
|
|
* expanded using realloc. @a __output_buffer may instead be NULL;
|
|
|
|
* in that case, the demangled name is placed in a region of memory
|
|
|
|
* allocated with malloc.
|
|
|
|
*
|
2018-09-05 17:18:16 +02:00
|
|
|
* @param __length If @a __length is non-null, the length of the
|
2009-02-21 01:45:21 +01:00
|
|
|
* buffer containing the demangled name is placed in @a *__length.
|
|
|
|
*
|
2018-09-05 17:18:16 +02:00
|
|
|
* @param __status If @a __status is non-null, @a *__status is set to
|
|
|
|
* one of the following values:
|
2009-02-21 01:45:21 +01:00
|
|
|
* 0: The demangling operation succeeded.
|
2009-11-15 21:59:55 +01:00
|
|
|
* -1: A memory allocation failure occurred.
|
2009-02-21 01:45:21 +01:00
|
|
|
* -2: @a mangled_name is not a valid name under the C++ ABI mangling rules.
|
|
|
|
* -3: One of the arguments is invalid.
|
|
|
|
*
|
|
|
|
* @return A pointer to the start of the NUL-terminated demangled
|
|
|
|
* name, or NULL if the demangling fails. The caller is
|
|
|
|
* responsible for deallocating this memory using @c free.
|
|
|
|
*
|
|
|
|
* The demangling is performed using the C++ ABI mangling rules,
|
|
|
|
* with GNU extensions. For example, this function is used in
|
|
|
|
* __gnu_cxx::__verbose_terminate_handler.
|
2011-01-15 01:27:10 +01:00
|
|
|
*
|
2017-09-13 12:05:59 +02:00
|
|
|
* See https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html
|
2009-02-21 01:45:21 +01:00
|
|
|
* for other examples of use.
|
|
|
|
*
|
|
|
|
* @note The same demangling functionality is available via
|
|
|
|
* libiberty (@c <libiberty/demangle.h> and @c libiberty.a) in GCC
|
|
|
|
* 3.1 and later, but that requires explicit installation (@c
|
|
|
|
* --enable-install-libiberty) and uses a different API, although
|
|
|
|
* the ABI is unchanged.
|
|
|
|
*/
|
2007-05-08 08:50:32 +02:00
|
|
|
char*
|
|
|
|
__cxa_demangle(const char* __mangled_name, char* __output_buffer,
|
|
|
|
size_t* __length, int* __status);
|
2011-10-10 21:03:39 +02:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
} // namespace __cxxabiv1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
|
|
#include <typeinfo>
|
|
|
|
|
|
|
|
namespace __cxxabiv1
|
|
|
|
{
|
|
|
|
// Type information for int, float etc.
|
|
|
|
class __fundamental_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__fundamental_type_info(const char* __n) : std::type_info(__n) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__fundamental_type_info();
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for array objects.
|
|
|
|
class __array_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__array_type_info(const char* __n) : std::type_info(__n) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__array_type_info();
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for functions (both member and non-member).
|
|
|
|
class __function_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__function_type_info(const char* __n) : std::type_info(__n) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__function_type_info();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Implementation defined member function.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__is_function_p() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for enumerations.
|
|
|
|
class __enum_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__enum_type_info(const char* __n) : std::type_info(__n) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__enum_type_info();
|
|
|
|
};
|
|
|
|
|
|
|
|
// Common type information for simple pointers and pointers to member.
|
|
|
|
class __pbase_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
unsigned int __flags; // Qualification of the target object.
|
|
|
|
const std::type_info* __pointee; // Type of pointed to object.
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
|
|
|
__pbase_type_info(const char* __n, int __quals,
|
2007-05-08 08:50:32 +02:00
|
|
|
const std::type_info* __type)
|
|
|
|
: std::type_info(__n), __flags(__quals), __pointee(__type)
|
|
|
|
{ }
|
2011-01-15 01:27:10 +01:00
|
|
|
|
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__pbase_type_info();
|
|
|
|
|
|
|
|
// Implementation defined type.
|
2011-01-15 01:27:10 +01:00
|
|
|
enum __masks
|
2007-05-08 08:50:32 +02:00
|
|
|
{
|
|
|
|
__const_mask = 0x1,
|
|
|
|
__volatile_mask = 0x2,
|
|
|
|
__restrict_mask = 0x4,
|
|
|
|
__incomplete_mask = 0x8,
|
Implement N4514, C++ Extensions for Transactional Memory.
gcc/
* builtins.def (BUILT_IN_ABORT): Add transaction_pure attribute.
gcc/c-family/
* c-common.c (c_common_reswords): Add C++ TM TS keywords.
(c_common_attribute_table): Add transaction_safe_dynamic.
transaction_safe now affects type identity.
(handle_tm_attribute): Handle transaction_safe_dynamic.
* c-common.h (enum rid): Add RID_ATOMIC_NOEXCEPT,
RID_ATOMIC_CANCEL, RID_SYNCHRONIZED.
(OBJC_IS_CXX_KEYWORD): Add RID_SYNCHRONIZED.
(D_TRANSMEM): New.
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_transactional_memory.
* c-pretty-print.c (pp_c_attributes_display): Don't print
transaction_safe in C++.
gcc/c/
* c-parser.c (c_lex_one_token): Handle @synchronized.
* c-decl.c (match_builtin_function_types): A declaration of a built-in
can change whether the function is transaction_safe.
gcc/cp/
* cp-tree.h (struct cp_declarator): Add tx_qualifier field.
(BCS_NORMAL, BCS_TRANSACTION): New enumerators.
* lex.c (init_reswords): Limit TM kewords to -fgnu-tm.
* parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized.
(make_call_declarator): Take tx_qualifier.
(cp_parser_tx_qualifier_opt): New.
(cp_parser_lambda_declarator_opt): Use it.
(cp_parser_direct_declarator): Likewise.
(cp_parser_statement): Handle atomic_noexcept, atomic_cancel.
(cp_parser_compound_statement): Change in_try parameter to bcs_flags.
(cp_parser_std_attribute): Map optimize_for_synchronized to
transaction_callable.
(cp_parser_transaction): Take the token. Handle atomic_noexcept.
* lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety.
* call.c (enum conversion_kind): Add ck_tsafe.
(standard_conversion): Handle transaction-safety conversion.
(convert_like_real, resolve_address_of_overloaded_function): Likewise.
(check_methods): Diagnose transaction_safe_dynamic on non-virtual
function.
(look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic.
* cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant)
(can_convert_tx_safety): New.
* typeck.c (composite_pointer_type): Handle transaction-safety.
* name-lookup.h (enum scope_kind): Add sk_transaction.
* name-lookup.c (begin_scope): Handle it.
* semantics.c (begin_compound_stmt): Pass it.
* decl.c (check_previous_goto_1): Check it.
(struct named_label_entry): Add in_transaction_scope.
(poplevel_named_label_1): Set it.
(check_goto): Check it.
(duplicate_decls): A specialization can be transaction_safe
independently of its template.
(grokdeclarator): Handle tx-qualifier.
* rtti.c (ptr_initializer): Handle transaction-safe.
* search.c (check_final_overrider): Check transaction_safe_dynamic.
Don't check transaction_safe.
* mangle.c (write_function_type): Mangle transaction_safe here.
(write_CV_qualifiers_for_type): Not here.
(write_type): Preserve transaction_safe when stripping attributes.
* error.c (dump_type_suffix): Print transaction_safe.
libiberty/
* cp-demangle.c (d_cv_qualifiers): Dx means transaction_safe.
(cplus_demangle_type): Let d_cv_qualifiers handle it.
(d_dump, d_make_comp, has_return_type, d_encoding)
(d_count_templates_scopes, d_print_comp_inner)
(d_print_mod_list, d_print_mod, d_print_function_type)
(is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE.
From-SVN: r228462
2015-10-04 21:17:19 +02:00
|
|
|
__incomplete_class_mask = 0x10,
|
Implement P0012R1, Make exception specifications part of the type system.
gcc/cp/
* cp-tree.h (enum tsubst_flags): Add tf_fndecl_type.
(flag_noexcept_type, ce_type): New.
* call.c (build_conv): Add ck_fnptr.
(enum conversion_kind): Change ck_tsafe to ck_fnptr.
(convert_like_real): Likewise.
(standard_conversion): Likewise. Allow function pointer
conversions for pointers to member functions.
(reference_compatible_p): Allow function pointer conversions.
(direct_reference_binding): Likewise.
(reference_binding): Reference-compatible is no longer a subset of
reference-related.
(is_subseq): Also strip ck_lvalue after next_conversion.
* class.c (instantiate_type): Check fnptr_conv_p.
(resolve_address_of_overloaded_function): Likewise.
* cvt.c (can_convert_tx_safety): Now static.
(noexcept_conv_p, fnptr_conv_p, strip_fnptr_conv): New.
* decl.c (flag_noexcept_type): Define.
(cxx_init_decl_processing): Set it.
(bad_specifiers): Check it.
(grokdeclarator) [cdk_function]: Add exception-spec to type here.
* lambda.c (maybe_add_lambda_conv_op): Add exception-spec to
returned pointer.
* mangle.c (struct globals): Add need_cxx1z_warning.
(mangle_decl): Check it.
(write_exception_spec): New.
(write_function_type): Call it.
(canonicalize_for_substitution): Handle exception spec.
(write_type): Likewise.
(write_encoding): Set processing_template_decl across mangling of
partially-instantiated type.
* pt.c (determine_specialization): Pass tf_fndecl_type.
(tsubst_decl, fn_type_unification): Likewise.
(tsubst): Strip tf_fndecl_type, pass it to
tsubst_exception_specification.
(convert_nontype_argument_function): Handle function pointer
conversion.
(convert_nontype_argument): Likewise.
(unify, for_each_template_parm_r): Walk into noexcept-specifier.
* rtti.c (ptr_initializer): Encode noexcept.
* tree.c (canonical_eh_spec): New.
(build_exception_variant): Use it.
* typeck.c (composite_pointer_type): Handle fnptr conversion.
(comp_except_specs): Compare canonical EH specs.
(structural_comptypes): Call it.
gcc/c-family/
* c.opt (Wc++1z-compat): New.
* c-cppbuiltin.c (c_cpp_builtins): Add __cpp_noexcept_function_type.
libstdc++-v3/
* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM)
(_GLIBCXX_NOEXCEPT_QUAL): New.
* include/std/type_traits (is_function): Use them.
* libsubc++/new (launder): Likewise.
* libsupc++/cxxabi.h (__pbase_type_info::__masks): Add
__noexcept_mask.
* libsupc++/pbase_type_info.cc (__do_catch): Handle function
pointer conversion.
libiberty/
* cp-demangle.c (is_fnqual_component_type): New.
(d_encoding, d_print_comp_inner, d_print_mod_list): Use it.
(FNQUAL_COMPONENT_CASE): New.
(d_make_comp, has_return_type, d_print_comp_inner)
(d_print_function_type): Use it.
(next_is_type_qual): New.
(d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC.
From-SVN: r241944
2016-11-08 00:09:29 +01:00
|
|
|
__transaction_safe_mask = 0x20,
|
|
|
|
__noexcept_mask = 0x40
|
2007-05-08 08:50:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
__pbase_type_info(const __pbase_type_info&);
|
|
|
|
|
|
|
|
__pbase_type_info&
|
|
|
|
operator=(const __pbase_type_info&);
|
|
|
|
|
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
|
|
|
__do_catch(const std::type_info* __thr_type, void** __thr_obj,
|
2007-05-08 08:50:32 +02:00
|
|
|
unsigned int __outer) const;
|
|
|
|
|
2014-07-10 00:21:49 +02:00
|
|
|
inline virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
|
2014-07-10 00:21:49 +02:00
|
|
|
unsigned __outer) const;
|
2007-05-08 08:50:32 +02:00
|
|
|
};
|
|
|
|
|
2014-07-10 00:21:49 +02:00
|
|
|
inline bool __pbase_type_info::
|
|
|
|
__pointer_catch (const __pbase_type_info *thrown_type,
|
|
|
|
void **thr_obj,
|
|
|
|
unsigned outer) const
|
|
|
|
{
|
|
|
|
return __pointee->__do_catch (thrown_type->__pointee, thr_obj, outer + 2);
|
|
|
|
}
|
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Type information for simple pointers.
|
|
|
|
class __pointer_type_info : public __pbase_type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
|
|
|
__pointer_type_info(const char* __n, int __quals,
|
2007-05-08 08:50:32 +02:00
|
|
|
const std::type_info* __type)
|
|
|
|
: __pbase_type_info (__n, __quals, __type) { }
|
|
|
|
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__pointer_type_info();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__is_pointer_p() const;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
|
|
|
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
|
2007-05-08 08:50:32 +02:00
|
|
|
unsigned __outer) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class __class_type_info;
|
|
|
|
|
|
|
|
// Type information for a pointer to member variable.
|
|
|
|
class __pointer_to_member_type_info : public __pbase_type_info
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
__class_type_info* __context; // Class of the member.
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__pointer_to_member_type_info(const char* __n, int __quals,
|
2011-01-15 01:27:10 +01:00
|
|
|
const std::type_info* __type,
|
2007-05-08 08:50:32 +02:00
|
|
|
__class_type_info* __klass)
|
|
|
|
: __pbase_type_info(__n, __quals, __type), __context(__klass) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__pointer_to_member_type_info();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
__pointer_to_member_type_info(const __pointer_to_member_type_info&);
|
|
|
|
|
|
|
|
__pointer_to_member_type_info&
|
|
|
|
operator=(const __pointer_to_member_type_info&);
|
|
|
|
|
|
|
|
// Implementation defined member function.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
|
|
|
|
unsigned __outer) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Helper class for __vmi_class_type.
|
|
|
|
class __base_class_type_info
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
const __class_type_info* __base_type; // Base class type.
|
2012-12-21 11:12:48 +01:00
|
|
|
#ifdef _GLIBCXX_LLP64
|
|
|
|
long long __offset_flags; // Offset and info.
|
|
|
|
#else
|
2007-05-08 08:50:32 +02:00
|
|
|
long __offset_flags; // Offset and info.
|
2012-12-21 11:12:48 +01:00
|
|
|
#endif
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
enum __offset_flags_masks
|
2007-05-08 08:50:32 +02:00
|
|
|
{
|
|
|
|
__virtual_mask = 0x1,
|
|
|
|
__public_mask = 0x2,
|
|
|
|
__hwm_bit = 2,
|
|
|
|
__offset_shift = 8 // Bits to shift offset.
|
|
|
|
};
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__is_virtual_p() const
|
|
|
|
{ return __offset_flags & __virtual_mask; }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__is_public_p() const
|
|
|
|
{ return __offset_flags & __public_mask; }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
ptrdiff_t
|
2007-05-08 08:50:32 +02:00
|
|
|
__offset() const
|
2011-01-15 01:27:10 +01:00
|
|
|
{
|
2007-05-08 08:50:32 +02:00
|
|
|
// This shift, being of a signed type, is implementation
|
|
|
|
// defined. GCC implements such shifts as arithmetic, which is
|
|
|
|
// what we want.
|
|
|
|
return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for a class.
|
|
|
|
class __class_type_info : public std::type_info
|
|
|
|
{
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__class_type_info (const char *__n) : type_info(__n) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__class_type_info ();
|
|
|
|
|
|
|
|
// Implementation defined types.
|
|
|
|
// The type sub_kind tells us about how a base object is contained
|
|
|
|
// within a derived object. We often do this lazily, hence the
|
|
|
|
// UNKNOWN value. At other times we may use NOT_CONTAINED to mean
|
|
|
|
// not publicly contained.
|
|
|
|
enum __sub_kind
|
|
|
|
{
|
|
|
|
// We have no idea.
|
2011-01-15 01:27:10 +01:00
|
|
|
__unknown = 0,
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
// Not contained within us (in some circumstances this might
|
|
|
|
// mean not contained publicly)
|
2011-01-15 01:27:10 +01:00
|
|
|
__not_contained,
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
// Contained ambiguously.
|
2011-01-15 01:27:10 +01:00
|
|
|
__contained_ambig,
|
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Via a virtual path.
|
2011-01-15 01:27:10 +01:00
|
|
|
__contained_virtual_mask = __base_class_type_info::__virtual_mask,
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
// Via a public path.
|
2011-01-15 01:27:10 +01:00
|
|
|
__contained_public_mask = __base_class_type_info::__public_mask,
|
2007-05-08 08:50:32 +02:00
|
|
|
|
|
|
|
// Contained within us.
|
|
|
|
__contained_mask = 1 << __base_class_type_info::__hwm_bit,
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
__contained_private = __contained_mask,
|
|
|
|
__contained_public = __contained_mask | __contained_public_mask
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __upcast_result;
|
|
|
|
struct __dyncast_result;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
|
|
|
__do_catch(const type_info* __thr_type, void** __thr_obj,
|
2007-05-08 08:50:32 +02:00
|
|
|
unsigned __outer) const;
|
|
|
|
|
|
|
|
public:
|
2011-01-15 01:27:10 +01:00
|
|
|
// Helper for upcast. See if DST is us, or one of our bases.
|
|
|
|
// Return false if not found, true if found.
|
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_upcast(const __class_type_info* __dst, const void* __obj,
|
|
|
|
__upcast_result& __restrict __result) const;
|
|
|
|
|
|
|
|
// Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
|
|
|
|
// within OBJ_PTR. OBJ_PTR points to a base object of our type,
|
|
|
|
// which is the destination type. SRC2DST indicates how SRC
|
|
|
|
// objects might be contained within this type. If SRC_PTR is one
|
|
|
|
// of our SRC_TYPE bases, indicate the virtuality. Returns
|
|
|
|
// not_contained for non containment or private containment.
|
2011-01-15 01:27:10 +01:00
|
|
|
inline __sub_kind
|
2007-05-08 08:50:32 +02:00
|
|
|
__find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
|
2011-01-15 01:27:10 +01:00
|
|
|
const __class_type_info* __src_type,
|
2007-05-08 08:50:32 +02:00
|
|
|
const void* __src_ptr) const;
|
|
|
|
|
|
|
|
// Helper for dynamic cast. ACCESS_PATH gives the access from the
|
|
|
|
// most derived object to this base. DST_TYPE indicates the
|
|
|
|
// desired type we want. OBJ_PTR points to a base of our type
|
|
|
|
// within the complete object. SRC_TYPE indicates the static type
|
|
|
|
// started from and SRC_PTR points to that base within the most
|
|
|
|
// derived object. Fill in RESULT with what we find. Return true
|
|
|
|
// if we have located an ambiguous match.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
|
2011-01-15 01:27:10 +01:00
|
|
|
const __class_type_info* __dst_type, const void* __obj_ptr,
|
|
|
|
const __class_type_info* __src_type, const void* __src_ptr,
|
2007-05-08 08:50:32 +02:00
|
|
|
__dyncast_result& __result) const;
|
2011-01-15 01:27:10 +01:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
|
|
|
|
// bases are inherited by the type started from -- which is not
|
|
|
|
// necessarily the current type. The current type will be a base
|
|
|
|
// of the destination type. OBJ_PTR points to the current base.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual __sub_kind
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
|
|
|
|
const __class_type_info* __src_type,
|
|
|
|
const void* __src_ptr) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for a class with a single non-virtual base.
|
|
|
|
class __si_class_type_info : public __class_type_info
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
const __class_type_info* __base_type;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__si_class_type_info(const char *__n, const __class_type_info *__base)
|
|
|
|
: __class_type_info(__n), __base_type(__base) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__si_class_type_info();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
__si_class_type_info(const __si_class_type_info&);
|
|
|
|
|
|
|
|
__si_class_type_info&
|
|
|
|
operator=(const __si_class_type_info&);
|
|
|
|
|
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
|
|
|
|
const __class_type_info* __dst_type, const void* __obj_ptr,
|
|
|
|
const __class_type_info* __src_type, const void* __src_ptr,
|
|
|
|
__dyncast_result& __result) const;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual __sub_kind
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
|
|
|
|
const __class_type_info* __src_type,
|
|
|
|
const void* __sub_ptr) const;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_upcast(const __class_type_info*__dst, const void*__obj,
|
|
|
|
__upcast_result& __restrict __result) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Type information for a class with multiple and/or virtual bases.
|
2011-01-15 01:27:10 +01:00
|
|
|
class __vmi_class_type_info : public __class_type_info
|
2007-05-08 08:50:32 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
unsigned int __flags; // Details about the class hierarchy.
|
|
|
|
unsigned int __base_count; // Number of direct bases.
|
|
|
|
|
|
|
|
// The array of bases uses the trailing array struct hack so this
|
|
|
|
// class is not constructable with a normal constructor. It is
|
|
|
|
// internally generated by the compiler.
|
|
|
|
__base_class_type_info __base_info[1]; // Array of bases.
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
explicit
|
2007-05-08 08:50:32 +02:00
|
|
|
__vmi_class_type_info(const char* __n, int ___flags)
|
|
|
|
: __class_type_info(__n), __flags(___flags), __base_count(0) { }
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual
|
2007-05-08 08:50:32 +02:00
|
|
|
~__vmi_class_type_info();
|
|
|
|
|
|
|
|
// Implementation defined types.
|
2011-01-15 01:27:10 +01:00
|
|
|
enum __flags_masks
|
2007-05-08 08:50:32 +02:00
|
|
|
{
|
|
|
|
__non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
|
|
|
|
__diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
|
|
|
|
__flags_unknown_mask = 0x10
|
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Implementation defined member functions.
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
|
|
|
|
const __class_type_info* __dst_type, const void* __obj_ptr,
|
|
|
|
const __class_type_info* __src_type, const void* __src_ptr,
|
|
|
|
__dyncast_result& __result) const;
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
virtual __sub_kind
|
|
|
|
__do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
|
2007-05-08 08:50:32 +02:00
|
|
|
const __class_type_info* __src_type,
|
|
|
|
const void* __src_ptr) const;
|
2011-01-15 01:27:10 +01:00
|
|
|
|
|
|
|
virtual bool
|
2007-05-08 08:50:32 +02:00
|
|
|
__do_upcast(const __class_type_info* __dst, const void* __obj,
|
|
|
|
__upcast_result& __restrict __result) const;
|
|
|
|
};
|
|
|
|
|
2011-10-10 21:03:39 +02:00
|
|
|
// Exception handling forward declarations.
|
|
|
|
struct __cxa_exception;
|
|
|
|
struct __cxa_refcounted_exception;
|
|
|
|
struct __cxa_dependent_exception;
|
|
|
|
struct __cxa_eh_globals;
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
2007-05-08 08:50:32 +02:00
|
|
|
// Dynamic cast runtime.
|
2011-10-10 21:03:39 +02:00
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// src2dst has the following possible values
|
|
|
|
// >-1: src_type is a unique public non-virtual base of dst_type
|
|
|
|
// dst_ptr + src2dst == src_ptr
|
|
|
|
// -1: unspecified relationship
|
|
|
|
// -2: src_type is not a public base of dst_type
|
|
|
|
// -3: src_type is a multiple public non-virtual base of dst_type
|
2011-10-10 21:03:39 +02:00
|
|
|
void*
|
2007-05-08 08:50:32 +02:00
|
|
|
__dynamic_cast(const void* __src_ptr, // Starting object.
|
|
|
|
const __class_type_info* __src_type, // Static type of object.
|
|
|
|
const __class_type_info* __dst_type, // Desired target type.
|
|
|
|
ptrdiff_t __src2dst); // How src and dst are related.
|
|
|
|
|
|
|
|
|
2011-10-10 21:03:39 +02:00
|
|
|
// Exception handling runtime.
|
|
|
|
|
|
|
|
// The __cxa_eh_globals for the current thread can be obtained by using
|
|
|
|
// either of the following functions. The "fast" version assumes at least
|
|
|
|
// one prior call of __cxa_get_globals has been made from the current
|
|
|
|
// thread, so no initialization is necessary.
|
|
|
|
__cxa_eh_globals*
|
|
|
|
__cxa_get_globals() _GLIBCXX_NOTHROW __attribute__ ((__const__));
|
|
|
|
|
|
|
|
__cxa_eh_globals*
|
|
|
|
__cxa_get_globals_fast() _GLIBCXX_NOTHROW __attribute__ ((__const__));
|
|
|
|
|
|
|
|
// Free the space allocated for the primary exception.
|
|
|
|
void
|
|
|
|
__cxa_free_exception(void*) _GLIBCXX_NOTHROW;
|
|
|
|
|
|
|
|
// Throw the exception.
|
|
|
|
void
|
2011-12-16 19:43:06 +01:00
|
|
|
__cxa_throw(void*, std::type_info*, void (_GLIBCXX_CDTOR_CALLABI *) (void *))
|
2011-10-10 21:03:39 +02:00
|
|
|
__attribute__((__noreturn__));
|
|
|
|
|
|
|
|
// Used to implement exception handlers.
|
|
|
|
void*
|
|
|
|
__cxa_get_exception_ptr(void*) _GLIBCXX_NOTHROW __attribute__ ((__pure__));
|
|
|
|
|
|
|
|
void*
|
|
|
|
__cxa_begin_catch(void*) _GLIBCXX_NOTHROW;
|
|
|
|
|
|
|
|
void
|
|
|
|
__cxa_end_catch();
|
|
|
|
|
|
|
|
void
|
|
|
|
__cxa_rethrow() __attribute__((__noreturn__));
|
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// Returns the type_info for the currently handled exception [15.3/8], or
|
|
|
|
// null if there is none.
|
2011-10-10 21:03:39 +02:00
|
|
|
std::type_info*
|
* eh_type.cc (__cxa_current_exception_type) Mark throw().
* unwind-cxx.h (__cxa_get_globals, __cxa_get_globals_fast): Mark const.
(__cxa_get_exception_ptr): Mark pure.
(__cxa_bad_cast, __cxa_bad_typeid): Mark noreturn
(__terminate): Makr throw ().
* exception (terminate): Mark throw().
(uncaught_exception): Mark pure.
* eh_ptr.cc (_M_safe_bool_dummy): Mark throw().
* guard.cc (__cxa_guard_abort, __cxa_guard_release): Mark throw().
* eh_terminate.cc (__terminate, terminate): Mark throw().
* vec.cc (__cxa_vec_cleanup): Mark throw().
* cxxabi.h (__cxa_vec_cleanup, __cxa_guard_release, __cxa_guard_abort): Mark throw ().
(__cxa_pure_virtual): Mark noreturn.
(__cxa_current_exception_type): Mark throw and pure.
* exception_ptr.h (operator ==, !=, _M_get, !, ==,
__cxa_exception_type): Mark pure.
(_M_safe_bool_dummy): Mark pure and const.
From-SVN: r146331
2009-04-19 00:18:21 +02:00
|
|
|
__cxa_current_exception_type() _GLIBCXX_NOTHROW __attribute__ ((__pure__));
|
2007-05-08 08:50:32 +02:00
|
|
|
|
2011-10-10 21:03:39 +02:00
|
|
|
// GNU Extensions.
|
|
|
|
|
|
|
|
// Allocate memory for a dependent exception.
|
|
|
|
__cxa_dependent_exception*
|
|
|
|
__cxa_allocate_dependent_exception() _GLIBCXX_NOTHROW;
|
|
|
|
|
|
|
|
// Free the space allocated for the dependent exception.
|
|
|
|
void
|
|
|
|
__cxa_free_dependent_exception(__cxa_dependent_exception*) _GLIBCXX_NOTHROW;
|
|
|
|
|
|
|
|
} // extern "C"
|
|
|
|
|
2007-05-08 08:50:32 +02:00
|
|
|
// A magic placeholder class that can be caught by reference
|
|
|
|
// to recognize foreign exceptions.
|
|
|
|
class __foreign_exception
|
|
|
|
{
|
2011-10-10 21:03:39 +02:00
|
|
|
virtual ~__foreign_exception() throw();
|
2007-05-08 08:50:32 +02:00
|
|
|
virtual void __pure_dummy() = 0; // prevent catch by value
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace __cxxabiv1
|
2004-05-22 23:07:28 +02:00
|
|
|
|
2009-02-21 01:45:21 +01:00
|
|
|
/** @namespace abi
|
|
|
|
* @brief The cross-vendor C++ Application Binary Interface. A
|
|
|
|
* namespace alias to __cxxabiv1, but user programs should use the
|
2009-11-06 23:15:17 +01:00
|
|
|
* alias 'abi'.
|
2009-02-21 01:45:21 +01:00
|
|
|
*
|
|
|
|
* A brief overview of an ABI is given in the libstdc++ FAQ, question
|
|
|
|
* 5.8 (you may have a copy of the FAQ locally, or you can view the online
|
2011-04-24 12:51:00 +02:00
|
|
|
* version at http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#5_8 ).
|
2009-02-21 01:45:21 +01:00
|
|
|
*
|
|
|
|
* GCC subscribes to a cross-vendor ABI for C++, sometimes
|
|
|
|
* called the IA64 ABI because it happens to be the native ABI for that
|
|
|
|
* platform. It is summarized at http://www.codesourcery.com/cxx-abi/
|
|
|
|
* along with the current specification.
|
|
|
|
*
|
|
|
|
* For users of GCC greater than or equal to 3.x, entry points are
|
2009-11-06 23:15:17 +01:00
|
|
|
* available in <cxxabi.h>, which notes, <em>'It is not normally
|
2009-02-21 01:45:21 +01:00
|
|
|
* necessary for user programs to include this header, or use the
|
|
|
|
* entry points directly. However, this header is available should
|
2009-11-06 23:15:17 +01:00
|
|
|
* that be needed.'</em>
|
2009-02-21 01:45:21 +01:00
|
|
|
*/
|
2000-10-11 01:43:26 +02:00
|
|
|
namespace abi = __cxxabiv1;
|
|
|
|
|
2009-11-09 23:09:30 +01:00
|
|
|
namespace __gnu_cxx
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief Exception thrown by __cxa_guard_acquire.
|
|
|
|
* @ingroup exceptions
|
|
|
|
*
|
2019-07-29 16:27:19 +02:00
|
|
|
* C++ 2011 6.7 [stmt.dcl]/4: If control re-enters the declaration
|
|
|
|
* recursively while the variable is being initialized, the behavior
|
|
|
|
* is undefined.
|
2009-11-09 23:09:30 +01:00
|
|
|
*
|
|
|
|
* Since we already have a library function to handle locking, we might
|
|
|
|
* as well check for this situation and throw an exception.
|
|
|
|
* We use the second byte of the guard variable to remember that we're
|
|
|
|
* in the middle of an initialization.
|
|
|
|
*/
|
|
|
|
class recursive_init_error: public std::exception
|
|
|
|
{
|
|
|
|
public:
|
2019-07-29 16:27:19 +02:00
|
|
|
recursive_init_error() _GLIBCXX_NOTHROW;
|
|
|
|
virtual ~recursive_init_error() _GLIBCXX_NOTHROW;
|
2009-11-09 23:09:30 +01:00
|
|
|
};
|
|
|
|
}
|
2004-05-22 23:07:28 +02:00
|
|
|
#endif // __cplusplus
|
2000-10-11 01:43:26 +02:00
|
|
|
|
2004-08-03 08:45:54 +02:00
|
|
|
#pragma GCC visibility pop
|
|
|
|
|
2011-01-15 01:27:10 +01:00
|
|
|
#endif // __CXXABI_H
|