[libcxx-commits] [PATCH] D65667: [libcxx] Avoid destructor call for error_category singletons

Chris Bowler via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 19 18:26:05 PDT 2022


cebowleratibm updated this revision to Diff 423779.
cebowleratibm added a comment.

Revised after D123519 <https://reviews.llvm.org/D123519>.

I think _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS belongs in __config now, though I just followed suit with what was done in D123519 <https://reviews.llvm.org/D123519>.  I need to make preprocess out the constexpr/constinit singleton pattern in each of the derived error_category compilation units.

I chose to keep the _LIBCPP_NO_DESTROY and the union pattern even with _LIBCPP_ERROR_CATEGORY_DEFINE_LEGACY_INLINE_FUNCTIONS as it's still useful to bypass calling the destructor and bypass registering the destructor when _LIBCPP_NO_DESTROY is supported.  Unfortunately there's no way to bypass the initialization runtime guard with the old ABI, but an improvement nonetheless and the ideal solution moving forward.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65667

Files:
  libcxx/src/future.cpp
  libcxx/src/ios.cpp
  libcxx/src/system_error.cpp
  libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
  libcxx/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
  libcxx/test/std/input.output/iostreams.base/std.ios.manip/error.reporting/iostream_category.pass.cpp
  libcxx/test/std/thread/futures/futures.errors/future_category.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65667.423779.patch
Type: text/x-patch
Size: 11091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220420/6ee0fa1a/attachment-0001.bin>


More information about the libcxx-commits mailing list