Index: docs/DesignDocs/VisibilityMacros.rst =================================================================== --- docs/DesignDocs/VisibilityMacros.rst +++ docs/DesignDocs/VisibilityMacros.rst @@ -155,6 +155,25 @@ versioning namespace. This allows throwing and catching some exception types between libc++ and libstdc++. +Special Visibility Macros for Large Codebases +============================================= + +When `_LIBCPP_LARGE_CODEBASE` is defined, certain types will be tweaked to +ensure that their constructor, or certain methods, are never inlined. This can +reduce binary size in large codebases with little impact on performance. + +**_LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE** + When the tweak is active, mark a function to never be inlined. Otherwise, + mark a function as hidden and force inlining whenever possible. + +**_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE** + When the tweak is active, mark a function to never be inlined. Otherwise, + this macro has no effect. + +**_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE** + When the tweak is active, mark a function as hidden and force inlining + whenever possible. Otherwise, this macro has no effect. + Links ===== Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -779,6 +779,16 @@ # endif #endif +#ifdef _LIBCPP_LARGE_CODEBASE +# define _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE __attribute__ ((noinline)) +# define _LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE _LIBCPP_ALWAYS_INLINE +# define _LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE __attribute__ ((noinline)) +#else +# define _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE _LIBCPP_INLINE_VISIBILITY +# define _LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE +# define _LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE +#endif + #ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY # if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) # define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__)) Index: include/string =================================================================== --- include/string +++ include/string @@ -763,10 +763,10 @@ public: static const size_type npos = -1; - _LIBCPP_INLINE_VISIBILITY basic_string() + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value); - _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a) + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE explicit basic_string(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_copy_constructible::value); #else @@ -777,7 +777,7 @@ basic_string(const basic_string& __str, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(basic_string&& __str) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_move_constructible::value); @@ -785,23 +785,23 @@ _NOEXCEPT; #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(basic_string&& __str, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(const _CharT* __s); + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(const _CharT* __s, const _Allocator& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(const _CharT* __s, size_type __n); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(size_type __n, _CharT __c); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(size_type __n, _CharT __c, const _Allocator& __a); basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator()); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator()); template @@ -809,20 +809,20 @@ basic_string(const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a = allocator_type(), typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type* = 0); - _LIBCPP_INLINE_VISIBILITY explicit + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE explicit basic_string(__self_view __sv); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(__self_view __sv, const _Allocator& __a); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(_InputIterator __first, _InputIterator __last); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(initializer_list<_CharT> __il); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string(initializer_list<_CharT> __il, const _Allocator& __a); #endif // _LIBCPP_CXX03_LANG @@ -836,13 +836,13 @@ #ifndef _LIBCPP_CXX03_LANG template #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string& operator=(__self_view __sv) {return assign(__sv);} #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string& operator=(basic_string&& __str) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());} #endif _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} @@ -1103,13 +1103,13 @@ basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2); basic_string& replace(size_type __pos, size_type __n1, const value_type* __s); basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str); _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, __self_view __sv) { return replace(__i1 - begin(), __i2 - __i1, __sv); } _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s); _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c); @@ -1152,67 +1152,67 @@ _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT {return __alloc();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE size_type find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE int compare(const basic_string& __str) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE int compare(__self_view __sv) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY int compare(size_type __pos1, size_type __n1, __self_view __sv) const; @@ -1547,7 +1547,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value) { @@ -1558,7 +1558,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_copy_constructible::value) @@ -1574,6 +1574,7 @@ } template +_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) @@ -1599,6 +1600,7 @@ } template +_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) { @@ -1623,7 +1625,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s) { _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr"); @@ -1634,7 +1636,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1646,7 +1648,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n) { _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr"); @@ -1657,7 +1659,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1669,6 +1671,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str) : __r_(__second_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc())) { @@ -1682,6 +1685,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string( const basic_string& __str, const allocator_type& __a) : __r_(__second_tag(), __a) @@ -1698,7 +1702,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_move_constructible::value) @@ -1716,7 +1720,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a) : __r_(__second_tag(), __a) { @@ -1737,6 +1741,7 @@ #endif // _LIBCPP_CXX03_LANG template +_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE void basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c) { @@ -1761,7 +1766,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c) { __init(__n, __c); @@ -1771,7 +1776,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1782,6 +1787,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a) @@ -1797,7 +1803,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a) : __r_(__second_tag(), __a) @@ -1813,6 +1819,7 @@ template template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string( const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a, typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *) @@ -1826,7 +1833,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv) { __init(__sv.data(), __sv.size()); @@ -1836,7 +1843,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1848,6 +1855,7 @@ template template +_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE typename enable_if < __is_exactly_input_iterator<_InputIterator>::value, @@ -1875,6 +1883,7 @@ template template +_LIBCPP_ALWAYS_INLINE_FOR_LARGE_CODEBASE typename enable_if < __is_forward_iterator<_ForwardIterator>::value, @@ -1906,7 +1915,7 @@ template template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last) { __init(__first, __last); @@ -1917,7 +1926,7 @@ template template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : __r_(__second_tag(), __a) @@ -1931,7 +1940,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string( initializer_list<_CharT> __il) { @@ -1942,8 +1951,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY - +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>::basic_string( initializer_list<_CharT> __il, const _Allocator& __a) : __r_(__second_tag(), __a) @@ -2071,6 +2079,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) { @@ -2092,6 +2101,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) { @@ -2134,7 +2144,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)) @@ -3128,6 +3138,7 @@ }; template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s, size_type __pos, @@ -3139,7 +3150,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3159,7 +3170,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3181,6 +3192,7 @@ // rfind template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s, size_type __pos, @@ -3192,7 +3204,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3202,7 +3214,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv, size_type __pos) const _NOEXCEPT @@ -3212,7 +3224,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3234,6 +3246,7 @@ // find_first_of template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s, size_type __pos, @@ -3245,7 +3258,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3255,7 +3268,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv, size_type __pos) const _NOEXCEPT @@ -3265,7 +3278,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3287,6 +3300,7 @@ // find_last_of template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s, size_type __pos, @@ -3298,7 +3312,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3318,7 +3332,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3340,6 +3354,7 @@ // find_first_not_of template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s, size_type __pos, @@ -3351,7 +3366,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3371,7 +3386,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3394,6 +3409,7 @@ // find_last_not_of template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s, size_type __pos, @@ -3405,7 +3421,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3425,7 +3441,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3448,7 +3464,7 @@ // compare template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE int basic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT { @@ -3466,7 +3482,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE int basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT { @@ -3518,6 +3534,7 @@ template template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE typename enable_if < __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, @@ -3534,6 +3551,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE int basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, @@ -3545,6 +3563,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE int basic_string<_CharT, _Traits, _Allocator>::compare(const value_type* __s) const _NOEXCEPT { @@ -3553,6 +3572,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE int basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, @@ -3599,7 +3619,7 @@ // operator== template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE bool operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT @@ -3611,7 +3631,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE bool operator==(const basic_string, _Allocator>& __lhs, const basic_string, _Allocator>& __rhs) _NOEXCEPT @@ -3630,7 +3650,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE bool operator==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT @@ -3643,7 +3663,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE bool operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs, const _CharT* __rhs) _NOEXCEPT @@ -3801,6 +3821,7 @@ // operator + template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) @@ -3814,6 +3835,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -3826,6 +3848,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -3837,6 +3860,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) { @@ -3849,6 +3873,7 @@ } template +_LIBCPP_NEVER_INLINE_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs) { @@ -3862,7 +3887,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) { @@ -3870,7 +3895,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) { @@ -3878,7 +3903,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) { @@ -3886,7 +3911,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __lhs , basic_string<_CharT,_Traits,_Allocator>&& __rhs) { Index: include/vector =================================================================== --- include/vector +++ include/vector @@ -366,7 +366,7 @@ size_type capacity() const _NOEXCEPT {return static_cast(__end_cap() - __begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void __destruct_at_end(pointer __new_last) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -412,7 +412,7 @@ }; template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void __vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT { @@ -702,13 +702,13 @@ } #endif - _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void push_back(value_type&& __x); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE #if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); #else @@ -1616,7 +1616,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void vector<_Tp, _Allocator>::push_back(const_reference __x) { @@ -1635,7 +1635,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE void vector<_Tp, _Allocator>::push_back(value_type&& __x) { @@ -1667,7 +1667,7 @@ template template -inline +inline _LIBCPP_INLINE_VISIBILITY_FOR_LARGE_CODEBASE #if _LIBCPP_STD_VER > 14 typename vector<_Tp, _Allocator>::reference #else