[libcxx-commits] [PATCH] D73807: [libc++] Optimize std::string's external instantiations in an ABI compatible way

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 31 14:35:03 PST 2020


EricWF created this revision.
EricWF added reviewers: mvels, ldionne, mclow.lists.
Herald added subscribers: dexonsmith, christof.

This patch introduces the mechanism through which libc++ can add, remove, or modify externally instantiated methods of std::string.
Under an unstable ABI, adding and removing external definitions is trivial. Under the stable ABI we are much more limited.

If we want to allow inlining of a external method in ABI v1 we can remove the extern template declaration while
retaining the extern template definition  New code will no longer generate out-of-line calls to that method, but
old code will continue to work since the definition is still present.

At the same time, we can define but not declare new out-of-line methods in the stable ABI. Staging these definitions
for use in the future, after all supported dylibs contain them.

This allows code to perform and inline std::string roughly the same across both ABI's. Meaning std::string
should retain the same performance characteristics regardless of ABI.

ABI breaking changes are guarded by `_LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATIONS`, but n


Repository:
  rCXX libc++

https://reviews.llvm.org/D73807

Files:
  libcxx/include/__config
  libcxx/include/__string
  libcxx/include/string
  libcxx/src/string.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73807.241805.patch
Type: text/x-patch
Size: 6061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200131/901d9e4e/attachment-0001.bin>


More information about the libcxx-commits mailing list