[PATCH] D27387: [libc++] Add a key function for bad_function_call

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 3 14:19:30 PST 2016


smeenai created this revision.
smeenai added reviewers: EricWF, mclow.lists.
smeenai added a subscriber: cfe-commits.
Herald added a subscriber: mgorny.

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.


https://reviews.llvm.org/D27387

Files:
  include/functional
  lib/CMakeLists.txt
  lib/abi/x86_64-apple-darwin16.0.0.abilist
  lib/abi/x86_64-unknown-linux-gnu.abilist
  src/functional.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27387.80191.patch
Type: text/x-patch
Size: 9552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161203/1dd6ffc0/attachment.bin>


More information about the cfe-commits mailing list