summaryrefslogtreecommitdiffstats
path: root/libcxx/include/functional
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-03-28 19:33:31 +0000
committerShoaib Meenai <smeenai@fb.com>2017-03-28 19:33:31 +0000
commitc7cd73e8b89ae0a37ed056a9dbad9e6af42a255c (patch)
tree817ba7fa1d51727e96b8faee9912c0f13960ffa8 /libcxx/include/functional
parentb5a46c1f45a7ecbcfc99b682000bbc8c0b7712a5 (diff)
downloadbcm5719-llvm-c7cd73e8b89ae0a37ed056a9dbad9e6af42a255c.tar.gz
bcm5719-llvm-c7cd73e8b89ae0a37ed056a9dbad9e6af42a255c.zip
[libc++] Add a key function for bad_function_call
Summary: bad_function_call is currently an empty class, so any object files using that class will end up with their own copy of its typeinfo, typeinfo name and vtable, leading to unnecessary duplication that has to be resolved by the dynamic linker. Instead, give bad_function_call a key function and put a definition for that key function in libc++ itself, to centralize the typeinfo and vtable. This is consistent with the behavior for other exception classes. The key functions are defined in libc++ rather than libc++abi since the class is defined in the libc++ versioning namespace, so ABI compatibility with libstdc++ is not a concern. Guard this change behind an ABI macro, since it isn't backwards compatible (i.e., clients built against the new libc++ headers wouldn't be able to run against an older libc++ library). Reviewers: mclow.lists, EricWF Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D27387 llvm-svn: 298937
Diffstat (limited to 'libcxx/include/functional')
-rw-r--r--libcxx/include/functional6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/include/functional b/libcxx/include/functional
index 977ada67f33..fecac4e41f8 100644
--- a/libcxx/include/functional
+++ b/libcxx/include/functional
@@ -1389,6 +1389,12 @@ mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
class _LIBCPP_EXCEPTION_ABI bad_function_call
: public exception
{
+#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+public:
+ virtual ~bad_function_call() _NOEXCEPT;
+
+ virtual const char* what() const _NOEXCEPT;
+#endif
};
_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
OpenPOWER on IntegriCloud