Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -758,6 +758,45 @@ #endif #endif +// When _LIBCPP_LARGE_CODEBASE is defined, certain STL 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. +// +// This is controlled by using the following macros: +// +// _LIBCPP_TWEAK_INLINE_VISIBILITY: +// Replaces an _existing_ _LIBCPP_INLINE_VISIBILITY use on a target method. +// I.e. this indicates libc++ methods that were already possibly inlined, +// but that will never be when the tweak is active. +// +// Equivalent to _LIBCPP_INLINE_VISIBILITY if the tweak is disabled. +// +// _LIBCPP_TWEAK_NEVER_INLINE: +// This is added to ensure that a target method, which was _not_ already +// tagged with _LIBCPP_INLINE_VISIBILITY, will never be inlined. +// +// This is equivalent to adding _LIBCPP_TWEAK_INLINE_VISIBILITY, except +// that it helps spot the places where _LIBCPP_INLINE_VISIBILITY was not +// used in the original libc++ header. +// +// Empty if the tweak is disabled. +// +// _LIBCPP_TWEAK_ALWAYS_INLINE: +// This is added to ensure that a target method, which is _not_ already +// tagged with _LIBCPP_INLINE_VISIBILITY, will always be inlined. +// +// Empty if the tweak is disabled. +// +#ifdef _LIBCPP_LARGE_CODEBASE +#define _LIBCPP_TWEAK_INLINE_VISIBILITY __attribute__ ((noinline)) +#define _LIBCPP_TWEAK_ALWAYS_INLINE _LIBCPP_ALWAYS_INLINE +#define _LIBCPP_TWEAK_NEVER_INLINE __attribute__ ((noinline)) +#else +#define _LIBCPP_TWEAK_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY +#define _LIBCPP_TWEAK_ALWAYS_INLINE +#define _LIBCPP_TWEAK_NEVER_INLINE +#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 @@ -543,23 +543,28 @@ // basic_string template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const basic_string<_CharT, _Traits, _Allocator>& __y); template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y); template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y); template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y); template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y); @@ -754,21 +759,21 @@ public: static const size_type npos = -1; - _LIBCPP_INLINE_VISIBILITY basic_string() + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value); - _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a) + _LIBCPP_TWEAK_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_copy_constructible::value); #else _NOEXCEPT; #endif - basic_string(const basic_string& __str); - basic_string(const basic_string& __str, const allocator_type& __a); + _LIBCPP_TWEAK_NEVER_INLINE basic_string(const basic_string& __str); + _LIBCPP_TWEAK_NEVER_INLINE basic_string(const basic_string& __str, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(basic_string&& __str) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_move_constructible::value); @@ -776,23 +781,24 @@ _NOEXCEPT; #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY 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_TWEAK_INLINE_VISIBILITY basic_string(const _CharT* __s); + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(const _CharT* __s, const _Allocator& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(size_type __n, _CharT __c); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(size_type __n, _CharT __c, const _Allocator& __a); + _LIBCPP_TWEAK_NEVER_INLINE basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a = _Allocator()); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a = _Allocator()); template @@ -800,20 +806,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_TWEAK_INLINE_VISIBILITY explicit basic_string(__self_view __sv); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(__self_view __sv, const _Allocator& __a); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(_InputIterator __first, _InputIterator __last); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(initializer_list<_CharT> __il); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string(initializer_list<_CharT> __il, const _Allocator& __a); #endif // _LIBCPP_CXX03_LANG @@ -827,13 +833,13 @@ #ifndef _LIBCPP_CXX03_LANG template #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string& operator=(__self_view __sv) {return assign(__sv);} #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY 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);} @@ -1094,13 +1100,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_TWEAK_INLINE_VISIBILITY 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_TWEAK_INLINE_VISIBILITY 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); @@ -1143,67 +1149,75 @@ _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT {return __alloc();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type rfind(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_not_of(__self_view __sv, size_type __pos = npos) const _NOEXCEPT; + _LIBCPP_TWEAK_NEVER_INLINE size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY size_type find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY int compare(const basic_string& __str) const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY int compare(__self_view __sv) const _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY int compare(size_type __pos1, size_type __n1, __self_view __sv) const; @@ -1220,6 +1234,7 @@ compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const; int compare(const value_type* __s) const _NOEXCEPT; int compare(size_type __pos1, size_type __n1, const value_type* __s) const; + _LIBCPP_TWEAK_NEVER_INLINE int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const; #if _LIBCPP_STD_VER > 17 @@ -1367,11 +1382,11 @@ __align_it (__s+1)) - 1;} - inline + inline _LIBCPP_TWEAK_NEVER_INLINE void __init(const value_type* __s, size_type __sz, size_type __reserve); - inline + inline _LIBCPP_TWEAK_NEVER_INLINE void __init(const value_type* __s, size_type __sz); - inline + inline _LIBCPP_TWEAK_NEVER_INLINE void __init(size_type __n, value_type __c); template @@ -1381,7 +1396,7 @@ __is_exactly_input_iterator<_InputIterator>::value, void >::type - __init(_InputIterator __first, _InputIterator __last); + _LIBCPP_TWEAK_ALWAYS_INLINE __init(_InputIterator __first, _InputIterator __last); template inline @@ -1390,7 +1405,7 @@ __is_forward_iterator<_ForwardIterator>::value, void >::type - __init(_ForwardIterator __first, _ForwardIterator __last); + _LIBCPP_TWEAK_ALWAYS_INLINE __init(_ForwardIterator __first, _ForwardIterator __last); void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz, size_type __n_copy, size_type __n_del, size_type __n_add = 0); @@ -1522,7 +1537,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string() _NOEXCEPT_(is_nothrow_default_constructible::value) { @@ -1533,7 +1548,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_copy_constructible::value) @@ -1549,6 +1564,7 @@ } template +_LIBCPP_TWEAK_ALWAYS_INLINE void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve) @@ -1574,6 +1590,7 @@ } template +_LIBCPP_TWEAK_ALWAYS_INLINE void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz) { @@ -1598,7 +1615,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s) { _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr"); @@ -1609,7 +1626,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1621,7 +1638,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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"); @@ -1632,7 +1649,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1644,6 +1661,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str) : __r_(__second_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc())) { @@ -1657,6 +1675,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string( const basic_string& __str, const allocator_type& __a) : __r_(__second_tag(), __a) @@ -1673,7 +1692,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_move_constructible::value) @@ -1691,7 +1710,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a) : __r_(__second_tag(), __a) { @@ -1712,6 +1731,7 @@ #endif // _LIBCPP_CXX03_LANG template +_LIBCPP_TWEAK_ALWAYS_INLINE void basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c) { @@ -1736,7 +1756,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c) { __init(__n, __c); @@ -1746,7 +1766,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1757,6 +1777,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n, const _Allocator& __a) @@ -1772,7 +1793,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, const _Allocator& __a) : __r_(__second_tag(), __a) @@ -1788,6 +1809,7 @@ template template +_LIBCPP_TWEAK_NEVER_INLINE 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 *) @@ -1801,7 +1823,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv) { __init(__sv.data(), __sv.size()); @@ -1811,7 +1833,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const _Allocator& __a) : __r_(__second_tag(), __a) { @@ -1823,6 +1845,7 @@ template template +_LIBCPP_TWEAK_ALWAYS_INLINE typename enable_if < __is_exactly_input_iterator<_InputIterator>::value, @@ -1850,6 +1873,7 @@ template template +_LIBCPP_TWEAK_ALWAYS_INLINE typename enable_if < __is_forward_iterator<_ForwardIterator>::value, @@ -1881,7 +1905,7 @@ template template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last) { __init(__first, __last); @@ -1892,7 +1916,7 @@ template template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : __r_(__second_tag(), __a) @@ -1906,7 +1930,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string( initializer_list<_CharT> __il) { @@ -1917,8 +1941,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY - +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>::basic_string( initializer_list<_CharT> __il, const _Allocator& __a) : __r_(__second_tag(), __a) @@ -2046,6 +2069,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) { @@ -2067,6 +2091,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) { @@ -2110,7 +2135,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator>& basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)) @@ -3104,6 +3129,7 @@ }; template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s, size_type __pos, @@ -3115,7 +3141,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3135,7 +3161,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3157,6 +3183,7 @@ // rfind template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s, size_type __pos, @@ -3168,7 +3195,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str, size_type __pos) const _NOEXCEPT @@ -3178,7 +3205,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv, size_type __pos) const _NOEXCEPT @@ -3188,7 +3215,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s, size_type __pos) const _NOEXCEPT @@ -3210,6 +3237,7 @@ // find_first_of template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s, size_type __pos, @@ -3221,7 +3249,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3231,7 +3259,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv, size_type __pos) const _NOEXCEPT @@ -3241,7 +3269,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3263,6 +3291,7 @@ // find_last_of template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s, size_type __pos, @@ -3274,7 +3303,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3294,7 +3323,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3316,6 +3345,7 @@ // find_first_not_of template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s, size_type __pos, @@ -3327,7 +3357,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3347,7 +3377,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3370,6 +3400,7 @@ // find_last_not_of template +_LIBCPP_TWEAK_NEVER_INLINE typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s, size_type __pos, @@ -3381,7 +3412,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3401,7 +3432,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY 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 @@ -3424,7 +3455,7 @@ // compare template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY int basic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT { @@ -3442,7 +3473,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY int basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT { @@ -3494,6 +3525,7 @@ template template +_LIBCPP_TWEAK_NEVER_INLINE typename enable_if < __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, @@ -3510,6 +3542,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE int basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, @@ -3521,6 +3554,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE int basic_string<_CharT, _Traits, _Allocator>::compare(const value_type* __s) const _NOEXCEPT { @@ -3529,6 +3563,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE int basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1, size_type __n1, @@ -3559,7 +3594,7 @@ // operator== template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY bool operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT @@ -3571,7 +3606,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY bool operator==(const basic_string, _Allocator>& __lhs, const basic_string, _Allocator>& __rhs) _NOEXCEPT @@ -3590,7 +3625,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY bool operator==(const _CharT* __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT @@ -3603,7 +3638,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY bool operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs, const _CharT* __rhs) _NOEXCEPT @@ -3761,6 +3796,7 @@ // operator + template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) @@ -3774,6 +3810,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -3786,6 +3823,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -3797,6 +3835,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs) { @@ -3809,6 +3848,7 @@ } template +_LIBCPP_TWEAK_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs) { @@ -3822,7 +3862,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator> operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) { @@ -3830,7 +3870,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) { @@ -3838,7 +3878,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator> operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs) { @@ -3846,7 +3886,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __lhs , basic_string<_CharT,_Traits,_Allocator>&& __rhs) { Index: include/vector =================================================================== --- include/vector +++ include/vector @@ -358,7 +358,7 @@ size_type capacity() const _NOEXCEPT {return static_cast(__end_cap() - __begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY @@ -404,7 +404,7 @@ }; template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY void __vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT { @@ -685,13 +685,13 @@ } #endif - _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); + _LIBCPP_TWEAK_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); + _LIBCPP_TWEAK_INLINE_VISIBILITY void push_back(value_type&& __x); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_TWEAK_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); #else @@ -1583,7 +1583,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY void vector<_Tp, _Allocator>::push_back(const_reference __x) { @@ -1602,7 +1602,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_TWEAK_INLINE_VISIBILITY void vector<_Tp, _Allocator>::push_back(value_type&& __x) { @@ -1634,7 +1634,7 @@ template template -inline +inline _LIBCPP_TWEAK_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 typename vector<_Tp, _Allocator>::reference #else