diff options
| author | Shoaib Meenai <smeenai@fb.com> | 2016-09-19 18:29:07 +0000 |
|---|---|---|
| committer | Shoaib Meenai <smeenai@fb.com> | 2016-09-19 18:29:07 +0000 |
| commit | 190994e435884229ca058362e9974a5de4c41947 (patch) | |
| tree | 9b04d11dc8bc301699d23abe99ebd450a513712c /libcxx/include | |
| parent | 1197a1612d89c019ef67e43e15f45c7615b13b4d (diff) | |
| download | bcm5719-llvm-190994e435884229ca058362e9974a5de4c41947.tar.gz bcm5719-llvm-190994e435884229ca058362e9974a5de4c41947.zip | |
[libc++] Fix extern template visibility for Windows
On Windows, marking an `extern template class` declaration as exported
actually forces an instantiation, which is not the desired behavior.
Instead, the actual explicit instantiations need to be exported.
Differential Revision: https://reviews.llvm.org/D24679
llvm-svn: 281925
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/__config | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 15e02d68325..86f945dc96b 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -551,15 +551,20 @@ namespace std { // only really useful for a DLL. _LIBCPP_DLL should be a compiler builtin define ideally... #if defined(_LIBCPP_DLL) && defined(cxx_EXPORTS) # define _LIBCPP_DLL_VIS __declspec(dllexport) +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS #elif defined(_LIBCPP_DLL) # define _LIBCPP_DLL_VIS __declspec(dllimport) +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS #else # define _LIBCPP_DLL_VIS +# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS #endif #define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS #define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS #define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS -#define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS #define _LIBCPP_HIDDEN #define _LIBCPP_TYPE_VIS_ONLY #define _LIBCPP_FUNC_VIS_ONLY @@ -619,6 +624,10 @@ namespace std { # endif #endif +#ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +#endif + #ifndef _LIBCPP_INLINE_VISIBILITY #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) #endif |

