[PATCH] D15434: [libcxx] Export 2 basic_string methods to minimize the effect from internal_linkage switch

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 10 14:54:52 PST 2015


eugenis created this revision.
eugenis added a reviewer: EricWF.
eugenis added a subscriber: cfe-commits.
eugenis set the repository for this revision to rL LLVM.

The switch to internal_linkage attribute removes 3 symbols from the libc++ export table, all in basic_string:
insert(..., InputIterator
insert(..., ForwardIterator
replace(..., InputIterator

These are template methods of a template class. They are instantiated only in functions/methods that are marked with LIBCPP_INLINE_VISIBILITY; normally they are exported as linkonce_odr; after the internal_linkage switch they are not instantiated at all because their callers are never evaluated.

This change explicitly exports these methods to avoid this problem. It does not change the export list of libc++.so in any way.


Repository:
  rL LLVM

http://reviews.llvm.org/D15434

Files:
  src/string.cpp

Index: src/string.cpp
===================================================================
--- src/string.cpp
+++ src/string.cpp
@@ -29,6 +29,13 @@
     string
     operator+<char, char_traits<char>, allocator<char> >(char const*, string const&);
 
+template string::iterator string::insert(string::const_iterator, char const *,
+                                         char const *);
+template basic_string<wchar_t> &
+basic_string<wchar_t>::replace(basic_string<wchar_t>::const_iterator,
+                               basic_string<wchar_t>::const_iterator,
+                               wchar_t const *, wchar_t const *);
+
 namespace
 {
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15434.42466.patch
Type: text/x-patch
Size: 646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151210/ac264066/attachment.bin>


More information about the cfe-commits mailing list