blob: 85f3e1837f93bd91aa95e713c65814a18d23fccf [file] [log] [blame]
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/include/__config b/sources/cxx-stl/llvm-libc++/libcxx/include/__config
index b227522f..f153f6f3 100644
--- a/sources/cxx-stl/llvm-libc++/libcxx/include/__config
+++ b/sources/cxx-stl/llvm-libc++/libcxx/include/__config
@@ -203,6 +203,17 @@
#define _LIBCPP_ALWAYS_INLINE_EXCEPT_GCC49 _LIBCPP_ALWAYS_INLINE
#endif
+#ifdef CHROMIUM_CXX_TWEAK_INLINES
+#define CHROMIUM_LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), noinline))
+#define CHROMIUM_LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
+#define CHROMIUM_LIBCPP_NEVER_INLINE __attribute__ ((__visibility__("hidden"), noinline))
+#else
+#define CHROMIUM_LIBCPP_INLINE_VISIBILITY _LIBCPP_INLINE_VISIBILITY
+#define CHROMIUM_LIBCPP_ALWAYS_INLINE
+#define CHROMIUM_LIBCPP_NEVER_INLINE
+#endif
+#define CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 CHROMIUM_LIBCPP_INLINE_VISIBILITY
+
#if defined(__clang__)
#if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/include/string b/sources/cxx-stl/llvm-libc++/libcxx/include/string
index ba83e22a..222567f5 100644
--- a/sources/cxx-stl/llvm-libc++/libcxx/include/string
+++ b/sources/cxx-stl/llvm-libc++/libcxx/include/string
@@ -1174,23 +1174,28 @@ size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
// basic_string
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x,
const basic_string<_CharT, _Traits, _Allocator>& __y);
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
@@ -1368,54 +1373,59 @@ private:
public:
static const size_type npos = -1;
- _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 basic_string()
+ // Adding CHROMIUM defines to constructors and operator+ saved 300kb (Sept 2017).
+ // Made __init __always_inline__, and functions that call it (constructors and operator+) noinline.
+ // For more context: https://crbug.com/738155
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 basic_string()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
- _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 explicit basic_string(const allocator_type& __a);
- basic_string(const basic_string& __str);
- basic_string(const basic_string& __str, const allocator_type& __a);
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 explicit basic_string(const allocator_type& __a);
+ CHROMIUM_LIBCPP_NEVER_INLINE basic_string(const basic_string& __str);
+ CHROMIUM_LIBCPP_NEVER_INLINE basic_string(const basic_string& __str, const allocator_type& __a);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string(basic_string&& __str)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(basic_string&& __str, const allocator_type& __a);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 basic_string(const value_type* __s);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49 basic_string(const value_type* __s);
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(const value_type* __s, const allocator_type& __a);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(const value_type* __s, size_type __n);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(const value_type* __s, size_type __n, const allocator_type& __a);
- _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string(size_type __n, value_type __c);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(size_type __n, value_type __c, const allocator_type& __a);
- basic_string(const basic_string& __str, size_type __pos, size_type __n = npos,
+ CHROMIUM_LIBCPP_NEVER_INLINE basic_string(const basic_string& __str, size_type __pos, size_type __n = npos,
const allocator_type& __a = allocator_type());
template<class _InputIterator>
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(_InputIterator __first, _InputIterator __last);
template<class _InputIterator>
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(initializer_list<value_type> __il);
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string(initializer_list<value_type> __il, const allocator_type& __a);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
~basic_string();
- basic_string& operator=(const basic_string& __str);
+ // Adding noinline to operator= saved 100kb (Sept 2017).
+ CHROMIUM_LIBCPP_NEVER_INLINE basic_string& operator=(const basic_string& __str);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string& operator=(basic_string&& __str)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value);
#endif
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
+ CHROMIUM_LIBCPP_NEVER_INLINE
basic_string& operator=(value_type __c);
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
@@ -1612,11 +1622,9 @@ public:
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
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, const value_type* __s, size_type __n);
- _LIBCPP_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);
@@ -1650,59 +1658,69 @@ public:
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT {return __alloc();}
- _LIBCPP_INLINE_VISIBILITY
+ // Adding CHROMIUM defines to find methods saved 20kb (Sept 2017).
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
+ // Adding noinline to this overload saved only 1kb (Sept 2017).
size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
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
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ CHROMIUM_LIBCPP_NEVER_INLINE
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
+ // Adding CHROMIUM defines to compare and operator== saved 100kb (Sept 2017).
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
int compare(const basic_string& __str) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
int compare(size_type __pos1, size_type __n1, const basic_string& __str, 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;
+ CHROMIUM_LIBCPP_NEVER_INLINE
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
@@ -1824,9 +1842,9 @@ private:
__align_it<sizeof(value_type) < __alignment ?
__alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}
- void __init(const value_type* __s, size_type __sz, size_type __reserve);
- void __init(const value_type* __s, size_type __sz);
- void __init(size_type __n, value_type __c);
+ CHROMIUM_LIBCPP_ALWAYS_INLINE void __init(const value_type* __s, size_type __sz, size_type __reserve);
+ CHROMIUM_LIBCPP_ALWAYS_INLINE void __init(const value_type* __s, size_type __sz);
+ CHROMIUM_LIBCPP_ALWAYS_INLINE void __init(size_type __n, value_type __c);
template <class _InputIterator>
typename enable_if
@@ -1835,7 +1853,7 @@ private:
!__is_forward_iterator<_InputIterator>::value,
void
>::type
- __init(_InputIterator __first, _InputIterator __last);
+ CHROMIUM_LIBCPP_ALWAYS_INLINE __init(_InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
typename enable_if
@@ -1843,7 +1861,7 @@ private:
__is_forward_iterator<_ForwardIterator>::value,
void
>::type
- __init(_ForwardIterator __first, _ForwardIterator __last);
+ CHROMIUM_LIBCPP_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);
@@ -1972,7 +1990,7 @@ basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string<_CharT, _Traits, _Allocator>::basic_string()
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
{
@@ -1983,7 +2001,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string()
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
: __r_(__a)
{
@@ -1994,7 +2012,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
}
template <class _CharT, class _Traits, class _Allocator>
-void
+CHROMIUM_LIBCPP_ALWAYS_INLINE void
basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve)
{
if (__reserve > max_size())
@@ -2018,7 +2036,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
}
template <class _CharT, class _Traits, class _Allocator>
-void
+CHROMIUM_LIBCPP_ALWAYS_INLINE void
basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz)
{
if (__sz > max_size())
@@ -2042,7 +2060,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s)
{
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
@@ -2053,7 +2071,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s)
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, const allocator_type& __a)
: __r_(__a)
{
@@ -2065,7 +2083,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, c
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n)
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
@@ -2076,7 +2094,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, s
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n, const allocator_type& __a)
: __r_(__a)
{
@@ -2088,7 +2106,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, s
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
+CHROMIUM_LIBCPP_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
: __r_(__alloc_traits::select_on_container_copy_construction(__str.__alloc()))
{
if (!__str.__is_long())
@@ -2101,7 +2119,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, const allocator_type& __a)
+CHROMIUM_LIBCPP_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, const allocator_type& __a)
: __r_(__a)
{
if (!__str.__is_long())
@@ -2116,7 +2134,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
: __r_(_VSTD::move(__str.__r_))
@@ -2130,7 +2148,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a)
: __r_(__a)
{
@@ -2149,6 +2167,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_ALWAYS_INLINE
void
basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
{
@@ -2173,7 +2192,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49
basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c)
{
__init(__n, __c);
@@ -2183,7 +2202,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_typ
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c, const allocator_type& __a)
: __r_(__a)
{
@@ -2194,7 +2213,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_typ
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n,
+CHROMIUM_LIBCPP_NEVER_INLINE basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n,
const allocator_type& __a)
: __r_(__a)
{
@@ -2209,6 +2228,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
template <class _CharT, class _Traits, class _Allocator>
template <class _InputIterator>
+CHROMIUM_LIBCPP_ALWAYS_INLINE
typename enable_if
<
__is_input_iterator <_InputIterator>::value &&
@@ -2237,6 +2257,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _Input
template <class _CharT, class _Traits, class _Allocator>
template <class _ForwardIterator>
+CHROMIUM_LIBCPP_ALWAYS_INLINE
typename enable_if
<
__is_forward_iterator<_ForwardIterator>::value,
@@ -2268,7 +2289,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _For
template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last)
{
__init(__first, __last);
@@ -2279,7 +2300,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,
const allocator_type& __a)
: __r_(__a)
@@ -2293,7 +2314,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il)
{
__init(__il.begin(), __il.end());
@@ -2303,7 +2324,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_t
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il, const allocator_type& __a)
: __r_(__a)
{
@@ -2430,6 +2451,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)
}
template <class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)
{
@@ -2451,6 +2473,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)
}
template <class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
{
@@ -2489,7 +2512,7 @@ basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, tr
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
@@ -3421,6 +3444,7 @@ struct _LIBCPP_HIDDEN __traits_eq
};
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos,
@@ -3432,7 +3456,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3442,7 +3466,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3464,6 +3488,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(value_type __c,
// rfind
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos,
@@ -3475,7 +3500,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3485,7 +3510,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3507,6 +3532,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(value_type __c,
// find_first_of
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_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,
@@ -3518,7 +3544,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3528,7 +3554,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __s
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3550,6 +3576,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(value_type __c,
// find_last_of
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_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,
@@ -3561,7 +3588,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3571,7 +3598,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __st
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3593,6 +3620,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(value_type __c,
// find_first_not_of
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_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,
@@ -3604,7 +3632,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* _
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3614,7 +3642,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string&
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3637,6 +3665,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,
// find_last_not_of
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_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,
@@ -3648,7 +3677,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3658,7 +3687,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string&
}
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_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
@@ -3681,7 +3710,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
// compare
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
int
basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
{
@@ -3742,6 +3771,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
}
template <class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
@@ -3785,7 +3815,7 @@ basic_string<_CharT, _Traits, _Allocator>::__invariants() const
// operator==
template<class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
bool
operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
@@ -3797,7 +3827,7 @@ operator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
}
template<class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
bool
operator==(const basic_string<char, char_traits<char>, _Allocator>& __lhs,
const basic_string<char, char_traits<char>, _Allocator>& __rhs) _NOEXCEPT
@@ -3981,6 +4011,7 @@ operator>=(const _CharT* __lhs,
// operator +
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
const basic_string<_CharT, _Traits, _Allocator>& __rhs)
@@ -3994,6 +4025,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,
}
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& __rhs)
{
@@ -4006,6 +4038,7 @@ operator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& _
}
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs)
{
@@ -4017,6 +4050,7 @@ operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs)
}
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs)
{
@@ -4029,6 +4063,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT*
}
template<class _CharT, class _Traits, class _Allocator>
+CHROMIUM_LIBCPP_NEVER_INLINE
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)
{
diff --git a/sources/cxx-stl/llvm-libc++/libcxx/include/vector b/sources/cxx-stl/llvm-libc++/libcxx/include/vector
index 2cc23e5c..78e53671 100644
--- a/sources/cxx-stl/llvm-libc++/libcxx/include/vector
+++ b/sources/cxx-stl/llvm-libc++/libcxx/include/vector
@@ -374,7 +374,9 @@ protected:
size_type capacity() const _NOEXCEPT
{return static_cast<size_type>(__end_cap() - __begin_);}
- _LIBCPP_INLINE_VISIBILITY
+ // Saved 33kb (Sept 2017).
+ // For more context: https://crbug.com/738155
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
@@ -440,7 +442,7 @@ private:
};
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
void
__vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT
{
@@ -698,12 +700,15 @@ public:
const value_type* data() const _NOEXCEPT
{return _VSTD::__to_raw_pointer(this->__begin_);}
- _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
+ // push_back and emplace_back saved 270kb (Sept 2017).
+ // For more context: https://crbug.com/738155
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
- void emplace_back(_Args&&... __args);
+ CHROMIUM_LIBCPP_INLINE_VISIBILITY
+ void emplace_back(_Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void pop_back();
@@ -1576,7 +1581,7 @@ vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)
}
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::push_back(const_reference __x)
{
@@ -1594,7 +1599,7 @@ vector<_Tp, _Allocator>::push_back(const_reference __x)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::push_back(value_type&& __x)
{
@@ -1627,7 +1632,7 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
template <class _Tp, class _Allocator>
template <class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline CHROMIUM_LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
--
2.14.1.821.g8fa685d3b7-goog