[PATCH] D52405: [libc++] Use exclude_from_explicit_instantiation instead of always_inline
Louis Dionne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 29 10:32:18 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL345516: [libc++] Use exclude_from_explicit_instantiation instead of always_inline (authored by ldionne, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D52405?vs=171369&id=171535#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52405
Files:
libcxx/trunk/docs/ReleaseNotes.rst
libcxx/trunk/include/__config
Index: libcxx/trunk/include/__config
===================================================================
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -787,6 +787,15 @@
# define _LIBCPP_INTERNAL_LINKAGE _LIBCPP_ALWAYS_INLINE
#endif
+#if __has_attribute(exclude_from_explicit_instantiation)
+# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__ ((__exclude_from_explicit_instantiation__))
+#else
+ // Try to approximate the effect of exclude_from_explicit_instantiation
+ // (which is that entities are not assumed to be provided by explicit
+ // template instantitations in the dylib) by always inlining those entities.
+# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
+#endif
+
#ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU
# ifndef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
# define _LIBCPP_HIDE_FROM_ABI_PER_TU 0
@@ -799,7 +808,7 @@
# if _LIBCPP_HIDE_FROM_ABI_PER_TU
# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_INTERNAL_LINKAGE
# else
-# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_ALWAYS_INLINE
+# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# endif
#endif
Index: libcxx/trunk/docs/ReleaseNotes.rst
===================================================================
--- libcxx/trunk/docs/ReleaseNotes.rst
+++ libcxx/trunk/docs/ReleaseNotes.rst
@@ -41,3 +41,10 @@
API Changes
-----------
- Building libc++ for Mac OSX 10.6 is not supported anymore.
+- Starting with LLVM 8.0.0, users that wish to link together translation units
+ built with different versions of libc++'s headers into the same final linked
+ image MUST define the _LIBCPP_HIDE_FROM_ABI_PER_TU macro to 1 when building
+ those translation units. Not defining _LIBCPP_HIDE_FROM_ABI_PER_TU to 1 and
+ linking translation units built with different versions of libc++'s headers
+ together may lead to ODR violations and ABI issues. On the flipside, code
+ size improvements should be expected for everyone not defining the macro.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52405.171535.patch
Type: text/x-patch
Size: 2063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181029/6d46839b/attachment.bin>
More information about the llvm-commits
mailing list