[libcxx-commits] [PATCH] D142842: [libc++] Remove _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 29 07:16:14 PST 2023


philnik created this revision.
philnik added reviewers: ldionne, Mordante.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142842

Files:
  libcxx/include/__config
  libcxx/include/__functional/function.h
  libcxx/src/functional.cpp


Index: libcxx/src/functional.cpp
===================================================================
--- libcxx/src/functional.cpp
+++ libcxx/src/functional.cpp
@@ -10,12 +10,6 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-bad_function_call::~bad_function_call() noexcept
-{
-}
-#endif
-
 #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
 const char*
 bad_function_call::what() const noexcept
Index: libcxx/include/__functional/function.h
===================================================================
--- libcxx/include/__functional/function.h
+++ libcxx/include/__functional/function.h
@@ -50,14 +50,7 @@
     : public exception
 {
 public:
-// Note that when a key function is not used, every translation unit that uses
-// bad_function_call will end up containing a weak definition of the vtable and
-// typeinfo.
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-    ~bad_function_call() _NOEXCEPT override;
-#else
-    ~bad_function_call() _NOEXCEPT override {}
-#endif
+    ~bad_function_call() _NOEXCEPT override = default;
 
 #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
     const char* what() const _NOEXCEPT override;
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -162,11 +162,6 @@
 // reduces the number of weak definitions generated in programs that use
 // iostreams by providing a single strong definition in the shared library.
 #    define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
-
-// Define a key function for `bad_function_call` in the library, to centralize
-// its vtable and typeinfo to libc++ rather than having all other libraries
-// using that class define their own copies.
-#    define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
 #  endif
 
 #  define _LIBCPP_TOSTRING2(x) #x


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142842.493094.patch
Type: text/x-patch
Size: 1908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230129/7c9d5fdf/attachment.bin>


More information about the libcxx-commits mailing list