Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] [libc++abi] Initialize exception directly in make_exception_ptr if __cxa_init_primary_exception is available in ABI-library #65534

Merged
merged 82 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
154891f
[libcxx] [libcxxabi] don't throw+catch in std::make_exception_ptr, if…
itrofimow Aug 23, 2023
5e74f1e
+ clang-format
itrofimow Aug 23, 2023
918a514
cleanup
itrofimow Aug 23, 2023
dd5e10e
+ clang-format, fix libcxx.imp
itrofimow Aug 23, 2023
2bf9b30
wip on making the build green
itrofimow Aug 29, 2023
167a1b7
wip on making the build green
itrofimow Aug 29, 2023
143412f
bits of formatting
itrofimow Aug 30, 2023
4d5e1de
ABI fixes
itrofimow Sep 6, 2023
f7c8474
rebase fix
itrofimow Sep 25, 2023
547470a
rebase fix
itrofimow Sep 27, 2023
469eba8
+ clang-format
itrofimow Sep 27, 2023
5fdfe55
+ generate-cxx-abilist
itrofimow Sep 27, 2023
87983b8
fix compilcation under gcc
itrofimow Oct 2, 2023
0fb50a2
some more ifdefs
itrofimow Oct 6, 2023
7e9d774
+ clang-format
itrofimow Oct 8, 2023
ee06cd9
+ clang-format
itrofimow Oct 9, 2023
ba2ccee
+ clang-format, 17.0.2
itrofimow Oct 9, 2023
dbec12c
code review fixes
itrofimow Oct 12, 2023
2b2eb9c
fix transitive_includes tests
itrofimow Oct 12, 2023
481e40a
runtime lookup of __cxa_init_primary_exception
itrofimow Oct 14, 2023
b9fb80d
regenerate cxx-abilist
itrofimow Oct 14, 2023
6ff32ad
add exception_ptr.bench
itrofimow Oct 14, 2023
ce34b01
add threaded benchmark
itrofimow Oct 14, 2023
921275a
better measurements in benchmark
itrofimow Oct 14, 2023
83fc377
add cxx-abilist for other architectures, some ifdefs for windows
itrofimow Oct 14, 2023
d89a05d
support libcxxrt as well
itrofimow Oct 14, 2023
2eb4473
add remaining cxx-abilists
itrofimow Oct 15, 2023
41ed5ff
fix the build for older versions of libcxxrt, add some comments
itrofimow Oct 15, 2023
72698d1
cleaner benchmark
itrofimow Oct 15, 2023
3904feb
revert the typeinfo header split, make exception dependent on typeinf…
itrofimow Oct 19, 2023
52a826e
use weak linkage instead of dlsym
itrofimow Oct 19, 2023
275e5a1
+ clang-format
itrofimow Oct 19, 2023
ad0297f
fix transitive_includes
itrofimow Oct 20, 2023
7b71e9a
some formatting again
itrofimow Oct 20, 2023
0be3274
add libsupc++ support
itrofimow Oct 20, 2023
2825b1e
make tidy happy: + _LIBCPP_HIDE_FROM_ABI
itrofimow Oct 20, 2023
9505e1e
include new explicitly
itrofimow Oct 21, 2023
f8656cb
regenerate cxx-abilist
itrofimow Oct 21, 2023
62688ba
drop new -> exception include dependency
itrofimow Oct 21, 2023
96d059f
oops
itrofimow Oct 21, 2023
82e367e
oops[2]
itrofimow Oct 21, 2023
2d7d84e
fixing gcc errors hopefully
itrofimow Oct 21, 2023
da25833
fix windows build, add fix powerpc abilists
itrofimow Oct 21, 2023
114db76
fix mingw build once again
itrofimow Oct 21, 2023
41f419b
fix abilist for freebsd, reset mingw shenanigans
itrofimow Oct 23, 2023
292d95b
disable for apple and windows, move define to config
itrofimow Oct 24, 2023
fbeaf12
+ clang-format
itrofimow Oct 24, 2023
f7d7596
fix abilists for apple
itrofimow Oct 24, 2023
d828925
bits of cleanup
itrofimow Oct 25, 2023
04a6368
gcc build fix
itrofimow Oct 25, 2023
cf916fe
cr fixes
itrofimow Oct 27, 2023
5a9b4e6
support mingw
itrofimow Oct 30, 2023
89a5f3d
+ clang-format
itrofimow Oct 30, 2023
99003b4
cleanup runtime lookup mess, switch to an availability macros instead
itrofimow Nov 22, 2023
0c7a4fc
cleanup exception_pointer_glibcxx
itrofimow Nov 22, 2023
870e924
rebase fix
itrofimow Nov 27, 2023
0602721
remove nullptr branch, as __init_native_exception can't return nullpt…
itrofimow Dec 5, 2023
2685882
cr fixes, simplify: call __cxa_* directly from headers
itrofimow Dec 14, 2023
eb9778b
fix abi-list for unknown-linux-gnu
itrofimow Dec 14, 2023
e2a8852
fix the build for C++03
itrofimow Dec 14, 2023
ce8881f
fix the build for C++03, attempt 2
itrofimow Dec 14, 2023
e108f13
fix transitive includes for cxx03
itrofimow Dec 14, 2023
7588693
fix transitive includes for cxx11,14,17,20
itrofimow Dec 14, 2023
14aed04
adjust abi-lists for other platforms
itrofimow Dec 15, 2023
18d3e63
adjust abi-list for freebsd
itrofimow Dec 15, 2023
fc10a48
adjust the abi-list for noexceptions
itrofimow Dec 15, 2023
f005def
merge with upstream
itrofimow Dec 19, 2023
71b4af1
an attempt to fix MinGW build
itrofimow Dec 20, 2023
baa37c5
an attempt to fix MinGW build once again
itrofimow Dec 20, 2023
326a391
merge with upstream
itrofimow Jan 1, 2024
88b19df
cleanup redundant whitespaces
itrofimow Jan 1, 2024
c7690dd
merge fix
itrofimow Jan 1, 2024
afb7fde
don't declare cxa_* functions for Microsoft ABI
itrofimow Jan 1, 2024
2729379
formatting fix
itrofimow Jan 1, 2024
4da4ca8
Merge remote-tracking branch 'upstream/main' into dont_throw_in_make_…
itrofimow Jan 8, 2024
1561207
Merge remote-tracking branch 'upstream/main' into dont_throw_in_make_…
itrofimow Jan 10, 2024
6748626
Merge remote-tracking branch 'upstream/main' into dont_throw_in_make_…
itrofimow Jan 14, 2024
686f32e
update abilists for Android
itrofimow Jan 14, 2024
ef44458
Merge remote-tracking branch 'upstream/main' into dont_throw_in_make_…
itrofimow Jan 17, 2024
0baabd5
undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION under _LIBCPP_HAS_N…
itrofimow Jan 17, 2024
cdff9df
remove unused include
itrofimow Jan 17, 2024
9395df1
fix the docs for building libcxx with other ABI-libraries
itrofimow Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libcxx/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ set(BENCHMARK_TESTS
allocation.bench.cpp
deque.bench.cpp
deque_iterator.bench.cpp
exception_ptr.bench.cpp
filesystem.bench.cpp
format_to_n.bench.cpp
format_to.bench.cpp
Expand Down
19 changes: 19 additions & 0 deletions libcxx/benchmarks/exception_ptr.bench.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <benchmark/benchmark.h>
#include <exception>

void bm_make_exception_ptr(benchmark::State& state) {
for (auto _ : state) {
benchmark::DoNotOptimize(std::make_exception_ptr(42));
}
}
BENCHMARK(bm_make_exception_ptr)->ThreadRange(1, 8);

BENCHMARK_MAIN();
3 changes: 3 additions & 0 deletions libcxx/docs/BuildingLibcxx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ We can now run CMake:
$ cmake -G Ninja -S runtimes -B build \
-DLLVM_ENABLE_RUNTIMES="libcxx" \
-DLIBCXX_CXX_ABI=libstdc++ \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
$ ninja -C build install-cxx

Expand All @@ -546,6 +547,8 @@ We can now run CMake like:
$ cmake -G Ninja -S runtimes -B build \
-DLLVM_ENABLE_RUNTIMES="libcxx" \
-DLIBCXX_CXX_ABI=libcxxrt \
-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=ON \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src
$ ninja -C build install-cxx

Expand Down
25 changes: 22 additions & 3 deletions libcxx/include/__availability
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
# define _LIBCPP_AVAILABILITY_HAS_BAD_ANY_CAST 1
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST

// These macros controls the availability of __cxa_init_primary_exception
// in the built library, which std::make_exception_ptr might use
// (see libcxx/include/__exception/exception_ptr.h).
# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 1
# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION

// These macros control the availability of all parts of <filesystem> that
// depend on something in the dylib.
# define _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY 1
Expand Down Expand Up @@ -136,9 +142,9 @@
# define _LIBCPP_AVAILABILITY_HAS_TZDB 1
# define _LIBCPP_AVAILABILITY_TZDB

// This controls the availability of C++23 <print>, which
// has a dependency on the built library (it needs access to
// the underlying buffer types of std::cout, std::cerr, and std::clog.
// This controls the availability of C++23 <print>, which
// has a dependency on the built library (it needs access to
// the underlying buffer types of std::cout, std::cerr, and std::clog.
# define _LIBCPP_AVAILABILITY_HAS_PRINT 1
# define _LIBCPP_AVAILABILITY_PRINT

Expand Down Expand Up @@ -167,6 +173,10 @@
# define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
# define _LIBCPP_AVAILABILITY_BAD_ANY_CAST _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS

// TODO: Update once this is released
# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0
# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION __attribute__((unavailable))

// <filesystem>
// clang-format off
# if (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101500) || \
Expand Down Expand Up @@ -303,4 +313,13 @@
# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
#endif

// Define availability attributes that depend on both
// _LIBCPP_HAS_NO_EXCEPTIONS and _LIBCPP_HAS_NO_RTTI.
#if defined(_LIBCPP_HAS_NO_EXCEPTIONS) || defined(_LIBCPP_HAS_NO_RTTI)
# undef _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
# undef _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
# define _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION 0
# define _LIBCPP_AVAILABILITY_INIT_PRIMARY_EXCEPTION
#endif

#endif // _LIBCPP___AVAILABILITY
50 changes: 50 additions & 0 deletions libcxx/include/__exception/exception_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,56 @@
#ifndef _LIBCPP___EXCEPTION_EXCEPTION_PTR_H
#define _LIBCPP___EXCEPTION_EXCEPTION_PTR_H

#include <__availability>
#include <__config>
#include <__exception/operations.h>
#include <__memory/addressof.h>
#include <__memory/construct_at.h>
#include <__type_traits/decay.h>
#include <cstddef>
#include <cstdlib>
#include <new>
#include <typeinfo>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif

#ifndef _LIBCPP_ABI_MICROSOFT

namespace __cxxabiv1 {

extern "C" {
_LIBCPP_OVERRIDABLE_FUNC_VIS void* __cxa_allocate_exception(size_t) throw();
_LIBCPP_OVERRIDABLE_FUNC_VIS void __cxa_free_exception(void*) throw();

struct __cxa_exception;
_LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
void*,
std::type_info*,
void(
# if defined(_WIN32)
__thiscall
ldionne marked this conversation as resolved.
Show resolved Hide resolved
# endif
*)(void*)) throw();
}

} // namespace __cxxabiv1

#endif

namespace std { // purposefully not using versioning namespace

#ifndef _LIBCPP_ABI_MICROSOFT

class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
void* __ptr_;

static exception_ptr __from_native_exception_pointer(void*) _NOEXCEPT;

template <class _Ep>
friend _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep) _NOEXCEPT;

public:
_LIBCPP_HIDE_FROM_ABI exception_ptr() _NOEXCEPT : __ptr_() {}
_LIBCPP_HIDE_FROM_ABI exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
Expand All @@ -51,11 +84,28 @@ class _LIBCPP_EXPORTED_FROM_ABI exception_ptr {
template <class _Ep>
_LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
# ifndef _LIBCPP_HAS_NO_EXCEPTIONS
# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION && __cplusplus >= 201103L
using _Ep2 = __decay_t<_Ep>;

void* __ex = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ep));
(void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) {
std::__destroy_at(static_cast<_Ep2*>(__p));
});

try {
::new (__ex) _Ep2(__e);
return exception_ptr::__from_native_exception_pointer(__ex);
} catch (...) {
__cxxabiv1::__cxa_free_exception(__ex);
return current_exception();
ldionne marked this conversation as resolved.
Show resolved Hide resolved
}
# else
try {
throw __e;
} catch (...) {
return current_exception();
}
# endif
# else
((void)__e);
std::abort();
Expand Down
1 change: 0 additions & 1 deletion libcxx/include/new
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ _LIBCPP_END_NAMESPACE_STD

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstdlib>
# include <exception>
ldionne marked this conversation as resolved.
Show resolved Hide resolved
# include <type_traits>
#endif

Expand Down
1 change: 0 additions & 1 deletion libcxx/include/typeinfo
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ _LIBCPP_END_NAMESPACE_STD

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstdlib>
# include <exception>
# include <type_traits>
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
{'is_defined': False, 'name': '___cxa_guard_acquire', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_guard_release', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_increment_exception_refcount', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_init_primary_exception', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_pure_virtual', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_rethrow', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_rethrow_primary_exception', 'type': 'U'}
Expand Down Expand Up @@ -811,6 +812,7 @@
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down Expand Up @@ -2509,6 +2511,7 @@
{'is_defined': True, 'name': '___cxa_guard_abort', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_guard_acquire', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_guard_release', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_init_primary_exception', 'type': 'I'}
ldionne marked this conversation as resolved.
Show resolved Hide resolved
{'is_defined': True, 'name': '___cxa_pure_virtual', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_rethrow', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_throw', 'type': 'I'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down Expand Up @@ -2311,6 +2312,7 @@
{'is_defined': True, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_guard_release', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_init_primary_exception', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_new_handler', 'size': 4, 'type': 'OBJECT'}
{'is_defined': True, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_rethrow', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
Expand Down Expand Up @@ -1111,6 +1112,7 @@
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_guard_acquire', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_guard_release', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_init_primary_exception', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_pure_virtual', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_rethrow', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
Expand Down Expand Up @@ -1111,6 +1112,7 @@
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_guard_acquire', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_guard_release', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_init_primary_exception', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_pure_virtual', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_rethrow', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'IMP', 'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
{'is_defined': False, 'name': '___cxa_guard_acquire', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_guard_release', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_increment_exception_refcount', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_init_primary_exception', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_pure_virtual', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_rethrow', 'type': 'U'}
{'is_defined': False, 'name': '___cxa_rethrow_primary_exception', 'type': 'U'}
Expand Down Expand Up @@ -811,6 +812,7 @@
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev', 'type': 'I'}
{'is_defined': True, 'name': '__ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down Expand Up @@ -2543,6 +2545,7 @@
{'is_defined': True, 'name': '___cxa_guard_abort', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_guard_acquire', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_guard_release', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_init_primary_exception', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_pure_virtual', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_rethrow', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_throw', 'type': 'I'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13bad_exceptionD2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down Expand Up @@ -2305,6 +2306,7 @@
{'is_defined': True, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_guard_release', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_init_primary_exception', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_new_handler', 'size': 8, 'type': 'OBJECT'}
{'is_defined': True, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
{'is_defined': True, 'name': '__cxa_rethrow', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
{'is_defined': False, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_guard_release', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_init_primary_exception', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_rethrow', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'type': 'FUNC'}
Expand Down Expand Up @@ -523,6 +524,7 @@
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
{'is_defined': False, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_guard_release', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_init_primary_exception', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_rethrow', 'type': 'FUNC'}
{'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'type': 'FUNC'}
Expand Down Expand Up @@ -521,6 +522,7 @@
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptr31__from_native_exception_pointerEPv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
Expand Down Expand Up @@ -1999,4 +2000,4 @@
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
8 changes: 8 additions & 0 deletions libcxx/src/support/runtime/exception_pointer_cxxabi.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other) noexcept {
return *this;
}

exception_ptr exception_ptr::__from_native_exception_pointer(void* __e) noexcept {
exception_ptr ptr;
ptr.__ptr_ = __e;
__cxa_increment_exception_refcount(ptr.__ptr_);

return ptr;
}

nested_exception::nested_exception() noexcept : __ptr_(current_exception()) {}

nested_exception::~nested_exception() noexcept {}
Expand Down
Loading
Loading