[libcxx-commits] [PATCH] D122536: [libc++] Optimize `exception_ptr`, especially for the empty case

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 6 16:08:20 PDT 2022


philnik added a comment.

In D122536#3633708 <https://reviews.llvm.org/D122536#3633708>, @fwolff wrote:

> In D122536#3633419 <https://reviews.llvm.org/D122536#3633419>, @philnik wrote:
>
>> The problem is that you have introduced new symbols to the dylib. I think the easiest way to avoid this is to use `__cxa_{increment, decrement}_exception_refcount` in the header directly.
>
> How is this supposed to work? Including `cxxabi.h` in the header breaks everything, and nowhere else in `libcxx/include/` do any `__cxa_*` functions get called. Also, there must be a way to distinguish `exception_pointer_cxxabi.ipp` from `exception_pointer_unimplemented.ipp` in the header if we're not going to introduce any additional symbols; how should I go about doing this?

I think you should only enable the optimization for known-good C++ABIs (so only libc++abi currently) and to forward-declare the `__cxa_` functions. That means the default still is calling the functions in `exception_pointer_unimplemented.ipp`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122536/new/

https://reviews.llvm.org/D122536



More information about the libcxx-commits mailing list