[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
This revision was automatically updated to reflect the committed changes. Closed by commit rL296732: [libc++] Make _LIBCPP_TYPE_VIS export members (authored by smeenai). Changed prior to commit: https://reviews.llvm.org/D25208?vs=90275&id=90276#toc Repository: rL LLVM https://reviews.llvm.org/D25208 Files: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst libcxx/trunk/include/__config libcxx/trunk/include/__locale libcxx/trunk/include/__mutex_base libcxx/trunk/include/condition_variable libcxx/trunk/include/future libcxx/trunk/include/mutex libcxx/trunk/include/shared_mutex libcxx/trunk/include/thread Index: libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst === --- libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst +++ libcxx/trunk/docs/DesignDocs/VisibilityMacros.rst @@ -47,18 +47,17 @@ A synonym for `_LIBCPP_INLINE_VISIBILITY` **_LIBCPP_TYPE_VIS** + Mark a type's typeinfo, vtable and members as having default visibility. + This attribute cannot be used on class templates. + +**_LIBCPP_TEMPLATE_VIS** Mark a type's typeinfo and vtable as having default visibility. - `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the - type's member functions. This attribute cannot be used on class templates. + This macro has no effect on the visibility of the type's member functions. **GCC Behavior**: GCC does not support Clang's `type_visibility(...)` attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TEMPLATE_VIS** - The same as `_LIBCPP_TYPE_VIS` except that it may be applied to class - templates. - **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. Index: libcxx/trunk/include/__locale === --- libcxx/trunk/include/__locale +++ libcxx/trunk/include/__locale @@ -92,13 +92,16 @@ const locale& operator=(const locale&) _NOEXCEPT; -template locale combine(const locale&) const; +template + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS + locale combine(const locale&) const; // locale operations: string name() const; bool operator==(const locale&) const; bool operator!=(const locale& __y) const {return !(*this == __y);} template + _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const; Index: libcxx/trunk/include/future === --- libcxx/trunk/include/future +++ libcxx/trunk/include/future @@ -582,6 +582,7 @@ _LIBCPP_INLINE_VISIBILITY wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS future_status wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const; @@ -1674,6 +1675,7 @@ public: promise(); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS promise(allocator_arg_t, const _Allocator& __a); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: libcxx/trunk/include/condition_variable === --- libcxx/trunk/include/condition_variable +++ libcxx/trunk/include/condition_variable @@ -133,12 +133,14 @@ void notify_all() _NOEXCEPT; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(_Lock& __lock); template _LIBCPP_INLINE_VISIBILITY void wait(_Lock& __lock, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __t); Index: libcxx/trunk/include/__mutex_base === --- libcxx/trunk/include/__mutex_base +++ libcxx/trunk/include/__mutex_base @@ -316,20 +316,24 @@ void wait(unique_lock& __lk) _NOEXCEPT; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(unique_lock& __lk, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_s
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai updated this revision to Diff 90275. smeenai added a comment. Rebase https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config include/__locale include/__mutex_base include/condition_variable include/future include/mutex include/shared_mutex include/thread Index: include/thread === --- include/thread +++ include/thread @@ -298,9 +298,12 @@ !is_same::type, thread>::value >::type > +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_HAS_NO_VARIADICS -template explicit thread(_Fp __f); +template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS +explicit thread(_Fp __f); #endif ~thread(); Index: include/shared_mutex === --- include/shared_mutex +++ include/shared_mutex @@ -220,6 +220,7 @@ return try_lock_until(chrono::steady_clock::now() + __rel_time); } template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time); void unlock(); @@ -235,6 +236,7 @@ return try_lock_shared_until(chrono::steady_clock::now() + __rel_time); } template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time); void unlock_shared(); Index: include/mutex === --- include/mutex +++ include/mutex @@ -248,6 +248,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; @@ -291,6 +292,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; Index: include/future === --- include/future +++ include/future @@ -582,6 +582,7 @@ _LIBCPP_INLINE_VISIBILITY wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS future_status wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const; @@ -1674,6 +1675,7 @@ public: promise(); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS promise(allocator_arg_t, const _Allocator& __a); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/condition_variable === --- include/condition_variable +++ include/condition_variable @@ -133,12 +133,14 @@ void notify_all() _NOEXCEPT; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(_Lock& __lock); template _LIBCPP_INLINE_VISIBILITY void wait(_Lock& __lock, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __t); Index: include/__mutex_base === --- include/__mutex_base +++ include/__mutex_base @@ -316,20 +316,24 @@ void wait(unique_lock& __lk) _NOEXCEPT; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(unique_lock& __lk, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_for(unique_lock& __lk, const chrono::duration<_Rep, _Period>& __d); Index: include/__locale === --- include/__locale +++ include/__locale @@ -92,13 +92,16 @@ const locale& operator=(const loc
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai updated this revision to Diff 90109. smeenai added a comment. Rebase atop https://reviews.llvm.org/D29157 and switch to _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config include/__locale include/__mutex_base include/condition_variable include/future include/mutex include/thread Index: include/thread === --- include/thread +++ include/thread @@ -300,7 +300,9 @@ > explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_HAS_NO_VARIADICS -template explicit thread(_Fp __f); +template +inline _LIBCPP_INLINE_VISIBILITY +explicit thread(_Fp __f); #endif ~thread(); Index: include/mutex === --- include/mutex +++ include/mutex @@ -248,6 +248,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; @@ -291,6 +292,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; Index: include/future === --- include/future +++ include/future @@ -582,6 +582,7 @@ _LIBCPP_INLINE_VISIBILITY wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS future_status wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const; @@ -1674,6 +1675,7 @@ public: promise(); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS promise(allocator_arg_t, const _Allocator& __a); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/condition_variable === --- include/condition_variable +++ include/condition_variable @@ -133,12 +133,14 @@ void notify_all() _NOEXCEPT; template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS void wait(_Lock& __lock); template _LIBCPP_INLINE_VISIBILITY void wait(_Lock& __lock, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __t); Index: include/__mutex_base === --- include/__mutex_base +++ include/__mutex_base @@ -316,20 +316,24 @@ void wait(unique_lock& __lk) _NOEXCEPT; template +inline _LIBCPP_INLINE_VISIBILITY void wait(unique_lock& __lk, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred); template +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS cv_status wait_for(unique_lock& __lk, const chrono::duration<_Rep, _Period>& __d); Index: include/__locale === --- include/__locale +++ include/__locale @@ -92,13 +92,16 @@ const locale& operator=(const locale&) _NOEXCEPT; -template locale combine(const locale&) const; +template + inline _LIBCPP_INLINE_VISIBILITY + locale combine(const locale&) const; // locale operations: string name() const; bool operator==(const locale&) const; bool operator!=(const locale& __y) const {return !(*this == __y);} template + inline _LIBCPP_INLINE_VISIBILITY bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const; Index: include/__config === --- include/__config +++ include/__config @@ -627,18 +627,22 @@ #ifndef _LIBCPP_TYPE_VIS # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#if __has_attribute(__type_visibility__) -# define _LIBCP
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai updated this revision to Diff 87911. smeenai added a comment. Rebase and ping https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config include/__locale include/__mutex_base include/condition_variable include/future include/mutex include/thread Index: include/thread === --- include/thread +++ include/thread @@ -300,7 +300,9 @@ > explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_HAS_NO_VARIADICS -template explicit thread(_Fp __f); +template +inline _LIBCPP_INLINE_VISIBILITY +explicit thread(_Fp __f); #endif ~thread(); Index: include/mutex === --- include/mutex +++ include/mutex @@ -248,6 +248,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_HIDDEN bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; @@ -291,6 +292,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_HIDDEN bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; Index: include/future === --- include/future +++ include/future @@ -582,7 +582,7 @@ _LIBCPP_INLINE_VISIBILITY wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const; template -future_status +_LIBCPP_HIDDEN future_status wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const; virtual void __execute(); @@ -1674,6 +1674,7 @@ public: promise(); template +_LIBCPP_HIDDEN promise(allocator_arg_t, const _Allocator& __a); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/condition_variable === --- include/condition_variable +++ include/condition_variable @@ -133,13 +133,14 @@ void notify_all() _NOEXCEPT; template +_LIBCPP_HIDDEN void wait(_Lock& __lock); template _LIBCPP_INLINE_VISIBILITY void wait(_Lock& __lock, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __t); Index: include/__mutex_base === --- include/__mutex_base +++ include/__mutex_base @@ -316,21 +316,22 @@ void wait(unique_lock& __lk) _NOEXCEPT; template +inline _LIBCPP_INLINE_VISIBILITY void wait(unique_lock& __lk, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t); template -bool +_LIBCPP_HIDDEN bool wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_for(unique_lock& __lk, const chrono::duration<_Rep, _Period>& __d); Index: include/__locale === --- include/__locale +++ include/__locale @@ -92,13 +92,16 @@ const locale& operator=(const locale&) _NOEXCEPT; -template locale combine(const locale&) const; +template + inline _LIBCPP_INLINE_VISIBILITY + locale combine(const locale&) const; // locale operations: string name() const; bool operator==(const locale&) const; bool operator!=(const locale& __y) const {return !(*this == __y);} template + inline _LIBCPP_INLINE_VISIBILITY bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const; Index: include/__config === --- include/__config +++ include/__config @@ -625,18 +625,22 @@ #ifndef _LIBCPP_TYPE_VIS # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#if __has_attribute(__type_visibility__) -# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -#else -# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -#endif +#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) # else #define _LIBCPP_TYPE_VIS # endif #endif #ifndef _LIBCPP_TEMPLATE_VIS -# define _L
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. Ping. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai updated this revision to Diff 85816. smeenai edited the summary of this revision. smeenai removed a reviewer: compnerd. smeenai added a comment. Folding https://reviews.llvm.org/D27430 and addressing comments from that diff. https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config include/__locale include/__mutex_base include/condition_variable include/future include/mutex include/thread Index: include/thread === --- include/thread +++ include/thread @@ -300,7 +300,9 @@ > explicit thread(_Fp&& __f, _Args&&... __args); #else // _LIBCPP_HAS_NO_VARIADICS -template explicit thread(_Fp __f); +template +inline _LIBCPP_INLINE_VISIBILITY +explicit thread(_Fp __f); #endif ~thread(); Index: include/mutex === --- include/mutex +++ include/mutex @@ -248,6 +248,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_HIDDEN bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; @@ -291,6 +292,7 @@ bool try_lock_for(const chrono::duration<_Rep, _Period>& __d) {return try_lock_until(chrono::steady_clock::now() + __d);} template +_LIBCPP_HIDDEN bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); void unlock() _NOEXCEPT; }; Index: include/future === --- include/future +++ include/future @@ -582,7 +582,7 @@ _LIBCPP_INLINE_VISIBILITY wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const; template -future_status +_LIBCPP_HIDDEN future_status wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const; virtual void __execute(); @@ -1674,6 +1674,7 @@ public: promise(); template +_LIBCPP_HIDDEN promise(allocator_arg_t, const _Allocator& __a); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/condition_variable === --- include/condition_variable +++ include/condition_variable @@ -133,13 +133,14 @@ void notify_all() _NOEXCEPT; template +_LIBCPP_HIDDEN void wait(_Lock& __lock); template _LIBCPP_INLINE_VISIBILITY void wait(_Lock& __lock, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_until(_Lock& __lock, const chrono::time_point<_Clock, _Duration>& __t); Index: include/__mutex_base === --- include/__mutex_base +++ include/__mutex_base @@ -316,21 +316,22 @@ void wait(unique_lock& __lk) _NOEXCEPT; template +inline _LIBCPP_INLINE_VISIBILITY void wait(unique_lock& __lk, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t); template -bool +_LIBCPP_HIDDEN bool wait_until(unique_lock& __lk, const chrono::time_point<_Clock, _Duration>& __t, _Predicate __pred); template -cv_status +_LIBCPP_HIDDEN cv_status wait_for(unique_lock& __lk, const chrono::duration<_Rep, _Period>& __d); Index: include/__locale === --- include/__locale +++ include/__locale @@ -92,13 +92,16 @@ const locale& operator=(const locale&) _NOEXCEPT; -template locale combine(const locale&) const; +template + inline _LIBCPP_INLINE_VISIBILITY + locale combine(const locale&) const; // locale operations: string name() const; bool operator==(const locale&) const; bool operator!=(const locale& __y) const {return !(*this == __y);} template + inline _LIBCPP_INLINE_VISIBILITY bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, const basic_string<_CharT, _Traits, _Allocator>&) const; Index: include/__config === --- include/__config +++ include/__config @@ -632,18 +632,22 @@ #ifndef _LIBCPP_TYPE_VIS # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#if __has_attribute(__type_visibility__) -# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -#else -# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -#endif +#define _LIBCPP_TYPE_VI
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. In https://reviews.llvm.org/D25208#647743, @EricWF wrote: > Actually I probably shouldn't have approved this due to > http://llvm.org/PR30642. I forgot about that when I last reviewed this. Yup. I wrote https://github.com/smeenai/bad-visibility-finder to find all problematic instances, and https://reviews.llvm.org/D27430 fixes all the issues caused by this diff (I haven't gotten around to addressing the comments on that yet). https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
EricWF requested changes to this revision. EricWF added a comment. This revision now requires changes to proceed. Actually I probably shouldn't have approved this due to http://llvm.org/PR30642. I forgot about that when I last reviewed this. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
EricWF added a comment. Yeah, that sounds good. I want to do more investigation into this as well. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. Not gonna submit this till https://reviews.llvm.org/D27430 has been submitted (will address comments on that one after holidays). https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai requested a review of this revision. smeenai added a comment. Actually, I think this can stand on its own. I'll do the extern template fixes in another diff. Also, ping :) https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai planned changes to this revision. smeenai added a comment. Hidden visibility also requires extern template declarations to expand to default visibility (as opposed to just default type visibility) to be feasible. Will fix annotations there and then roll that macro change into this diff. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. https://reviews.llvm.org/D27430 should unblock this. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai updated this revision to Diff 80334. smeenai added a comment. Rebasing https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config Index: include/__config === --- include/__config +++ include/__config @@ -563,18 +563,22 @@ #ifndef _LIBCPP_TYPE_VIS # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#if __has_attribute(__type_visibility__) -# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -#else -# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -#endif +#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) # else #define _LIBCPP_TYPE_VIS # endif #endif #ifndef _LIBCPP_TYPE_VIS_ONLY -# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +#if __has_attribute(__type_visibility__) +# define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__type_visibility__("default"))) +#else +# define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__visibility__("default"))) +#endif +# else +#define _LIBCPP_TYPE_VIS_ONLY +# endif #endif #ifndef _LIBCPP_FUNC_VIS_ONLY Index: docs/DesignDocs/VisibilityMacros.rst === --- docs/DesignDocs/VisibilityMacros.rst +++ docs/DesignDocs/VisibilityMacros.rst @@ -41,17 +41,17 @@ A synonym for `_LIBCPP_INLINE_VISIBILITY` **_LIBCPP_TYPE_VIS** + Mark a type's typeinfo, vtable and members as having default visibility. + This attribute cannot be used on class templates. + +**_LIBCPP_TYPE_VIS_ONLY** Mark a type's typeinfo and vtable as having default visibility. - `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the - type's member functions. This attribute cannot be used on class templates. + This macro has no effect on the visibility of the type's member functions. **GCC Behavior**: GCC does not support Clang's `type_visibility(...)` attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TYPE_VIS_ONLY** - The same as `_LIBCPP_TYPE_VIS` except that it may be applied to templates. - **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. Index: include/__config === --- include/__config +++ include/__config @@ -563,18 +563,22 @@ #ifndef _LIBCPP_TYPE_VIS # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) -#if __has_attribute(__type_visibility__) -# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -#else -# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -#endif +#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) # else #define _LIBCPP_TYPE_VIS # endif #endif #ifndef _LIBCPP_TYPE_VIS_ONLY -# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS +# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +#if __has_attribute(__type_visibility__) +# define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__type_visibility__("default"))) +#else +# define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__visibility__("default"))) +#endif +# else +#define _LIBCPP_TYPE_VIS_ONLY +# endif #endif #ifndef _LIBCPP_FUNC_VIS_ONLY Index: docs/DesignDocs/VisibilityMacros.rst === --- docs/DesignDocs/VisibilityMacros.rst +++ docs/DesignDocs/VisibilityMacros.rst @@ -41,17 +41,17 @@ A synonym for `_LIBCPP_INLINE_VISIBILITY` **_LIBCPP_TYPE_VIS** + Mark a type's typeinfo, vtable and members as having default visibility. + This attribute cannot be used on class templates. + +**_LIBCPP_TYPE_VIS_ONLY** Mark a type's typeinfo and vtable as having default visibility. - `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the - type's member functions. This attribute cannot be used on class templates. + This macro has no effect on the visibility of the type's member functions. **GCC Behavior**: GCC does not support Clang's `type_visibility(...)` attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TYPE_VIS_ONLY** - The same as `_LIBCPP_TYPE_VIS` except that it may be applied to templates. - **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. I should clarify that the ABI omissions are for Linux. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. Ping. I used @EricWF's ABI list verification work to confirm that this diff doesn't change the ABI of libc++ on both Darwin and Linux, so it should be completely safe. Building with hidden visibility on top of this patch gives the following ABI removals: https://reviews.llvm.org/P7937. I'll be going through this list over the next few days to figure out if the omissions are actually correct or if they're indicative of missing source export annotations. https://reviews.llvm.org/D26823 resulted from this effort. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. Ping :) https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. Ping. The way I see it, this doesn't change anything for people not building with hidden visibility (which should be most people, including the buildbots), but it does make `_LIBCPP_TYPE_VIS` more useful (and consistent with the existing Windows behavior) for people building (or attempting to build) with hidden visibility. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai added a comment. In https://reviews.llvm.org/D25208#564930, @EricWF wrote: > Why do you want to build `libc++.so` with hidden visibility? What's wrong > with the existing way we build `libc++.so`? There's nothing wrong with the existing way, per se. I personally prefer hidden visibility semantics because I come from a Windows background and hidden visibility matches up well with DLL semantics, but the first section of https://gcc.gnu.org/wiki/Visibility covers the advantages of hidden visibility pretty well. https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
EricWF added a comment. Why do you want to build `libc++.so` with hidden visibility? What's wrong with the existing way we build `libc++.so`? https://reviews.llvm.org/D25208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D25208: [libc++] Make _LIBCPP_TYPE_VIS export members
smeenai created this revision. smeenai added reviewers: compnerd, EricWF, mclow.lists. smeenai added a subscriber: cfe-commits. Most classes annotated with _LIBCPP_TYPE_VIS need to have at least some of their members exported, otherwise we have a lot of link errors when linking against a libc++ built with hidden visibility. This also makes _LIBCPP_TYPE_VIS be consistent across platforms, since on Windows it already exports members. https://reviews.llvm.org/D25208 Files: docs/DesignDocs/VisibilityMacros.rst include/__config Index: include/__config === --- include/__config +++ include/__config @@ -560,15 +560,15 @@ #endif #ifndef _LIBCPP_TYPE_VIS -# if __has_attribute(__type_visibility__) -#define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -# else -#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -# endif +#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) #endif #ifndef _LIBCPP_TYPE_VIS_ONLY -# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS +# if __has_attribute(__type_visibility__) +#define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__type_visibility__("default"))) +# else +#define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__visibility__("default"))) +# endif #endif #ifndef _LIBCPP_FUNC_VIS_ONLY Index: docs/DesignDocs/VisibilityMacros.rst === --- docs/DesignDocs/VisibilityMacros.rst +++ docs/DesignDocs/VisibilityMacros.rst @@ -29,17 +29,17 @@ A synonym for `_LIBCPP_INLINE_VISIBILITY` **_LIBCPP_TYPE_VIS** + Mark a type's typeinfo, vtable and members as having default visibility. + This attribute cannot be used on class templates. + +**_LIBCPP_TYPE_VIS_ONLY** Mark a type's typeinfo and vtable as having default visibility. - `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the - type's member functions. This attribute cannot be used on class templates. + This macro has no effect on the visibility of the type's member functions. **GCC Behavior**: GCC does not support Clang's `type_visibility(...)` attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TYPE_VIS_ONLY** - The same as `_LIBCPP_TYPE_VIS` except that it may be applied to templates. - **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. Index: include/__config === --- include/__config +++ include/__config @@ -560,15 +560,15 @@ #endif #ifndef _LIBCPP_TYPE_VIS -# if __has_attribute(__type_visibility__) -#define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) -# else -#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) -# endif +#define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) #endif #ifndef _LIBCPP_TYPE_VIS_ONLY -# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS +# if __has_attribute(__type_visibility__) +#define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__type_visibility__("default"))) +# else +#define _LIBCPP_TYPE_VIS_ONLY __attribute__ ((__visibility__("default"))) +# endif #endif #ifndef _LIBCPP_FUNC_VIS_ONLY Index: docs/DesignDocs/VisibilityMacros.rst === --- docs/DesignDocs/VisibilityMacros.rst +++ docs/DesignDocs/VisibilityMacros.rst @@ -29,17 +29,17 @@ A synonym for `_LIBCPP_INLINE_VISIBILITY` **_LIBCPP_TYPE_VIS** + Mark a type's typeinfo, vtable and members as having default visibility. + This attribute cannot be used on class templates. + +**_LIBCPP_TYPE_VIS_ONLY** Mark a type's typeinfo and vtable as having default visibility. - `_LIBCPP_TYPE_VIS`. This macro has no effect on the visibility of the - type's member functions. This attribute cannot be used on class templates. + This macro has no effect on the visibility of the type's member functions. **GCC Behavior**: GCC does not support Clang's `type_visibility(...)` attribute. With GCC the `visibility(...)` attribute is used and member functions are affected. -**_LIBCPP_TYPE_VIS_ONLY** - The same as `_LIBCPP_TYPE_VIS` except that it may be applied to templates. - **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits