diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h --- a/libcxx/include/__algorithm/comp_ref_type.h +++ b/libcxx/include/__algorithm/comp_ref_type.h @@ -23,11 +23,10 @@ struct __debug_less { _Compare &__comp_; - _LIBCPP_CONSTEXPR_SINCE_CXX14 - __debug_less(_Compare& __c) : __comp_(__c) {} + _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI __debug_less(_Compare& __c) : __comp_(__c) {} template - _LIBCPP_CONSTEXPR_SINCE_CXX14 + _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Up& __y) { bool __r = __comp_(__x, __y); @@ -37,7 +36,7 @@ } template - _LIBCPP_CONSTEXPR_SINCE_CXX14 + _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(_Tp& __x, _Up& __y) { bool __r = __comp_(__x, __y); diff --git a/libcxx/include/__algorithm/make_projected.h b/libcxx/include/__algorithm/make_projected.h --- a/libcxx/include/__algorithm/make_projected.h +++ b/libcxx/include/__algorithm/make_projected.h @@ -32,13 +32,14 @@ _Pred& __pred; // Can be a unary or a binary predicate. _Proj& __proj; - _LIBCPP_CONSTEXPR _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg) : __pred(__pred_arg), __proj(__proj_arg) {} + _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI _ProjectedPred(_Pred& __pred_arg, _Proj& __proj_arg) + : __pred(__pred_arg), __proj(__proj_arg) {} template typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>())) >::type - _LIBCPP_CONSTEXPR operator()(_Tp&& __v) const { + _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI operator()(_Tp&& __v) const { return std::__invoke(__pred, std::__invoke(__proj, std::forward<_Tp>(__v))); } @@ -47,7 +48,7 @@ decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T1>())), decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T2>())) >::type - _LIBCPP_CONSTEXPR operator()(_T1&& __lhs, _T2&& __rhs) const { + _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI operator()(_T1&& __lhs, _T2&& __rhs) const { return std::__invoke(__pred, std::__invoke(__proj, std::forward<_T1>(__lhs)), std::__invoke(__proj, std::forward<_T2>(__rhs))); diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h --- a/libcxx/include/__algorithm/shuffle.h +++ b/libcxx/include/__algorithm/shuffle.h @@ -31,7 +31,7 @@ class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer { public: - __libcpp_debug_randomizer() { + _LIBCPP_HIDE_FROM_ABI __libcpp_debug_randomizer() { __state_ = __seed(); __inc_ = __state_ + 0xda3e39cb94b95bdbULL; __inc_ = (__inc_ << 1) | 1; diff --git a/libcxx/include/__chrono/calendar.h b/libcxx/include/__chrono/calendar.h --- a/libcxx/include/__chrono/calendar.h +++ b/libcxx/include/__chrono/calendar.h @@ -31,7 +31,7 @@ using local_seconds = local_time; using local_days = local_time; -struct last_spec { _LIBCPP_HIDE_FROM_ABI explicit last_spec() = default; }; +struct last_spec { explicit last_spec() = default; }; inline constexpr last_spec last{}; diff --git a/libcxx/include/__chrono/day.h b/libcxx/include/__chrono/day.h --- a/libcxx/include/__chrono/day.h +++ b/libcxx/include/__chrono/day.h @@ -29,7 +29,7 @@ private: unsigned char __d_; public: - _LIBCPP_HIDE_FROM_ABI day() = default; + day() = default; _LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d_(static_cast(__val)) {} _LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr day operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; } diff --git a/libcxx/include/__chrono/duration.h b/libcxx/include/__chrono/duration.h --- a/libcxx/include/__chrono/duration.h +++ b/libcxx/include/__chrono/duration.h @@ -242,11 +242,10 @@ rep __rep_; public: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR #ifndef _LIBCPP_CXX03_LANG - duration() = default; + constexpr duration() = default; #else - duration() {} + _LIBCPP_HIDE_FROM_ABI duration() {} #endif template diff --git a/libcxx/include/__chrono/month.h b/libcxx/include/__chrono/month.h --- a/libcxx/include/__chrono/month.h +++ b/libcxx/include/__chrono/month.h @@ -29,7 +29,7 @@ private: unsigned char __m_; public: - _LIBCPP_HIDE_FROM_ABI month() = default; + month() = default; _LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m_(static_cast(__val)) {} _LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m_; return *this; } _LIBCPP_HIDE_FROM_ABI inline constexpr month operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; } diff --git a/libcxx/include/__chrono/monthday.h b/libcxx/include/__chrono/monthday.h --- a/libcxx/include/__chrono/monthday.h +++ b/libcxx/include/__chrono/monthday.h @@ -32,7 +32,7 @@ chrono::month __m_; chrono::day __d_; public: - _LIBCPP_HIDE_FROM_ABI month_day() = default; + month_day() = default; _LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept : __m_{__mval}, __d_{__dval} {} _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; } diff --git a/libcxx/include/__chrono/weekday.h b/libcxx/include/__chrono/weekday.h --- a/libcxx/include/__chrono/weekday.h +++ b/libcxx/include/__chrono/weekday.h @@ -35,7 +35,7 @@ unsigned char __wd_; _LIBCPP_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept; public: - _LIBCPP_HIDE_FROM_ABI weekday() = default; + weekday() = default; _LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd_(static_cast(__val == 7 ? 0 : __val)) {} _LIBCPP_HIDE_FROM_ABI inline constexpr weekday(const sys_days& __sysd) noexcept : __wd_(__weekday_from_days(__sysd.time_since_epoch().count())) {} @@ -126,7 +126,7 @@ chrono::weekday __wd_; unsigned char __idx_; public: - _LIBCPP_HIDE_FROM_ABI weekday_indexed() = default; + weekday_indexed() = default; _LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept : __wd_{__wdval}, __idx_(__idxval) {} _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; } diff --git a/libcxx/include/__chrono/year.h b/libcxx/include/__chrono/year.h --- a/libcxx/include/__chrono/year.h +++ b/libcxx/include/__chrono/year.h @@ -33,7 +33,7 @@ private: short __y_; public: - _LIBCPP_HIDE_FROM_ABI year() = default; + year() = default; _LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y_(static_cast(__val)) {} _LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y_; return *this; } diff --git a/libcxx/include/__chrono/year_month.h b/libcxx/include/__chrono/year_month.h --- a/libcxx/include/__chrono/year_month.h +++ b/libcxx/include/__chrono/year_month.h @@ -31,7 +31,7 @@ chrono::year __y_; chrono::month __m_; public: - _LIBCPP_HIDE_FROM_ABI year_month() = default; + year_month() = default; _LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept : __y_{__yval}, __m_{__mval} {} _LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; } diff --git a/libcxx/include/__chrono/year_month_day.h b/libcxx/include/__chrono/year_month_day.h --- a/libcxx/include/__chrono/year_month_day.h +++ b/libcxx/include/__chrono/year_month_day.h @@ -42,7 +42,7 @@ chrono::month __m_; chrono::day __d_; public: - _LIBCPP_HIDE_FROM_ABI year_month_day() = default; + year_month_day() = default; _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day( const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept : __y_{__yval}, __m_{__mval}, __d_{__dval} {} diff --git a/libcxx/include/__chrono/year_month_weekday.h b/libcxx/include/__chrono/year_month_weekday.h --- a/libcxx/include/__chrono/year_month_weekday.h +++ b/libcxx/include/__chrono/year_month_weekday.h @@ -39,7 +39,7 @@ chrono::month __m_; chrono::weekday_indexed __wdi_; public: - _LIBCPP_HIDE_FROM_ABI year_month_weekday() = default; + year_month_weekday() = default; _LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept : __y_{__yval}, __m_{__mval}, __wdi_{__wdival} {} diff --git a/libcxx/include/__concepts/swappable.h b/libcxx/include/__concepts/swappable.h --- a/libcxx/include/__concepts/swappable.h +++ b/libcxx/include/__concepts/swappable.h @@ -68,7 +68,7 @@ // *The name `swap` is used here unqualified. template requires __unqualified_swappable_with<_Tp, _Up> - constexpr void operator()(_Tp&& __t, _Up&& __u) const + _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)))) { swap(_VSTD::forward<_Tp>(__t), _VSTD::forward<_Up>(__u)); @@ -77,7 +77,7 @@ // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and... template requires __swappable_arrays<_Tp, _Up, _Size> - constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const + _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const noexcept(noexcept((*this)(*__t, *__u))) { // TODO(cjdb): replace with `ranges::swap_ranges`. @@ -88,7 +88,7 @@ // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models... template<__exchangeable _Tp> - constexpr void operator()(_Tp& __x, _Tp& __y) const + _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_Tp& __x, _Tp& __y) const noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>) { __y = _VSTD::exchange(__x, _VSTD::move(__y)); diff --git a/libcxx/include/__coroutine/coroutine_handle.h b/libcxx/include/__coroutine/coroutine_handle.h --- a/libcxx/include/__coroutine/coroutine_handle.h +++ b/libcxx/include/__coroutine/coroutine_handle.h @@ -33,7 +33,6 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle { public: // [coroutine.handle.con], construct/reset - _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle() noexcept = default; _LIBCPP_HIDE_FROM_ABI @@ -86,7 +85,7 @@ } private: - bool __is_suspended() const { + _LIBCPP_HIDE_FROM_ABI bool __is_suspended() const { // FIXME actually implement a check for if the coro is suspended. return __handle_ != nullptr; } @@ -108,7 +107,6 @@ struct _LIBCPP_TEMPLATE_VIS coroutine_handle { public: // [coroutine.handle.con], construct/reset - _LIBCPP_HIDE_FROM_ABI constexpr coroutine_handle() noexcept = default; _LIBCPP_HIDE_FROM_ABI @@ -182,7 +180,7 @@ } private: - bool __is_suspended() const { + _LIBCPP_HIDE_FROM_ABI bool __is_suspended() const { // FIXME actually implement a check for if the coro is suspended. return __handle_ != nullptr; } diff --git a/libcxx/include/__expected/bad_expected_access.h b/libcxx/include/__expected/bad_expected_access.h --- a/libcxx/include/__expected/bad_expected_access.h +++ b/libcxx/include/__expected/bad_expected_access.h @@ -33,14 +33,14 @@ _LIBCPP_HIDE_FROM_ABI bad_expected_access(bad_expected_access&&) = default; _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(const bad_expected_access&) = default; _LIBCPP_HIDE_FROM_ABI bad_expected_access& operator=(bad_expected_access&&) = default; - ~bad_expected_access() override = default; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_expected_access() override = default; public: // The way this has been designed (by using a class template below) means that we'll already // have a profusion of these vtables in TUs, and the dynamic linker will already have a bunch // of work to do. So it is not worth hiding the specialization in the dylib, given that // it adds deployment target restrictions. - const char* what() const noexcept override { return "bad access to std::expected"; } + _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override { return "bad access to std::expected"; } }; template diff --git a/libcxx/include/__expected/unexpect.h b/libcxx/include/__expected/unexpect.h --- a/libcxx/include/__expected/unexpect.h +++ b/libcxx/include/__expected/unexpect.h @@ -20,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD struct unexpect_t { - _LIBCPP_HIDE_FROM_ABI explicit unexpect_t() = default; + explicit unexpect_t() = default; }; inline constexpr unexpect_t unexpect{}; diff --git a/libcxx/include/__filesystem/directory_entry.h b/libcxx/include/__filesystem/directory_entry.h --- a/libcxx/include/__filesystem/directory_entry.h +++ b/libcxx/include/__filesystem/directory_entry.h @@ -46,9 +46,9 @@ public: // constructors and destructors - directory_entry() noexcept = default; - directory_entry(directory_entry const&) = default; - directory_entry(directory_entry&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI directory_entry() noexcept = default; + _LIBCPP_HIDE_FROM_ABI directory_entry(directory_entry const&) = default; + _LIBCPP_HIDE_FROM_ABI directory_entry(directory_entry&&) noexcept = default; _LIBCPP_INLINE_VISIBILITY explicit directory_entry(_Path const& __p) : __p_(__p) { @@ -61,10 +61,10 @@ __refresh(&__ec); } - ~directory_entry() {} + _LIBCPP_HIDE_FROM_ABI ~directory_entry() {} - directory_entry& operator=(directory_entry const&) = default; - directory_entry& operator=(directory_entry&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI directory_entry& operator=(directory_entry const&) = default; + _LIBCPP_HIDE_FROM_ABI directory_entry& operator=(directory_entry&&) noexcept = default; _LIBCPP_INLINE_VISIBILITY void assign(_Path const& __p) { @@ -510,8 +510,8 @@ private: friend class directory_iterator; friend class recursive_directory_iterator; - explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {} - __dir_element_proxy(__dir_element_proxy&& __o) + _LIBCPP_HIDE_FROM_ABI explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {} + _LIBCPP_HIDE_FROM_ABI __dir_element_proxy(__dir_element_proxy&& __o) : __elem_(_VSTD::move(__o.__elem_)) {} directory_entry __elem_; }; diff --git a/libcxx/include/__filesystem/file_status.h b/libcxx/include/__filesystem/file_status.h --- a/libcxx/include/__filesystem/file_status.h +++ b/libcxx/include/__filesystem/file_status.h @@ -35,14 +35,14 @@ : __ft_(__ft), __prms_(__prms) {} - file_status(const file_status&) noexcept = default; - file_status(file_status&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI file_status(const file_status&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI file_status(file_status&&) noexcept = default; _LIBCPP_INLINE_VISIBILITY ~file_status() {} - file_status& operator=(const file_status&) noexcept = default; - file_status& operator=(file_status&&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI file_status& operator=(const file_status&) noexcept = default; + _LIBCPP_HIDE_FROM_ABI file_status& operator=(file_status&&) noexcept = default; // observers _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h --- a/libcxx/include/__filesystem/filesystem_error.h +++ b/libcxx/include/__filesystem/filesystem_error.h @@ -58,7 +58,7 @@ _LIBCPP_INLINE_VISIBILITY const path& path2() const noexcept { return __storage_->__p2_; } - filesystem_error(const filesystem_error&) = default; + _LIBCPP_HIDE_FROM_ABI filesystem_error(const filesystem_error&) = default; ~filesystem_error() override; // key function _LIBCPP_HIDE_FROM_ABI_VIRTUAL diff --git a/libcxx/include/__filesystem/path_iterator.h b/libcxx/include/__filesystem/path_iterator.h --- a/libcxx/include/__filesystem/path_iterator.h +++ b/libcxx/include/__filesystem/path_iterator.h @@ -56,10 +56,10 @@ : __stashed_elem_(), __path_ptr_(nullptr), __entry_(), __state_(_Singular) {} - iterator(const iterator&) = default; - ~iterator() = default; + _LIBCPP_HIDE_FROM_ABI iterator(const iterator&) = default; + _LIBCPP_HIDE_FROM_ABI ~iterator() = default; - iterator& operator=(const iterator&) = default; + _LIBCPP_HIDE_FROM_ABI iterator& operator=(const iterator&) = default; _LIBCPP_INLINE_VISIBILITY reference operator*() const { return __stashed_elem_; } diff --git a/libcxx/include/__filesystem/recursive_directory_iterator.h b/libcxx/include/__filesystem/recursive_directory_iterator.h --- a/libcxx/include/__filesystem/recursive_directory_iterator.h +++ b/libcxx/include/__filesystem/recursive_directory_iterator.h @@ -59,10 +59,10 @@ recursive_directory_iterator(const path& __p, error_code& __ec) : recursive_directory_iterator(__p, directory_options::none, &__ec) {} - recursive_directory_iterator(const recursive_directory_iterator&) = default; - recursive_directory_iterator(recursive_directory_iterator&&) = default; + _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator(const recursive_directory_iterator&) = default; + _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator(recursive_directory_iterator&&) = default; - recursive_directory_iterator& + _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator& operator=(const recursive_directory_iterator&) = default; _LIBCPP_INLINE_VISIBILITY @@ -76,7 +76,7 @@ return *this; } - ~recursive_directory_iterator() = default; + _LIBCPP_HIDE_FROM_ABI ~recursive_directory_iterator() = default; _LIBCPP_INLINE_VISIBILITY const directory_entry& operator*() const { return __dereference(); } @@ -84,7 +84,7 @@ _LIBCPP_INLINE_VISIBILITY const directory_entry* operator->() const { return &__dereference(); } - recursive_directory_iterator& operator++() { return __increment(); } + _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator& operator++() { return __increment(); } _LIBCPP_INLINE_VISIBILITY __dir_element_proxy operator++(int) { diff --git a/libcxx/include/__format/format_args.h b/libcxx/include/__format/format_args.h --- a/libcxx/include/__format/format_args.h +++ b/libcxx/include/__format/format_args.h @@ -29,7 +29,7 @@ template class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FORMAT basic_format_args { public: - _LIBCPP_HIDE_FROM_ABI basic_format_args() noexcept = default; + basic_format_args() noexcept = default; template _LIBCPP_HIDE_FROM_ABI basic_format_args(const __format_arg_store<_Context, _Args...>& __store) noexcept diff --git a/libcxx/include/__format/formatter_pointer.h b/libcxx/include/__format/formatter_pointer.h --- a/libcxx/include/__format/formatter_pointer.h +++ b/libcxx/include/__format/formatter_pointer.h @@ -32,10 +32,12 @@ template <__fmt_char_type _CharT> struct _LIBCPP_TEMPLATE_VIS __formatter_pointer { public: - constexpr __formatter_pointer() { __parser_.__alignment_ = __format_spec::__alignment::__right; } + _LIBCPP_HIDE_FROM_ABI constexpr __formatter_pointer() { + __parser_.__alignment_ = __format_spec::__alignment::__right; + } - _LIBCPP_HIDE_FROM_ABI constexpr auto - parse(basic_format_parse_context<_CharT>& __parse_ctx) -> decltype(__parse_ctx.begin()) { + _LIBCPP_HIDE_FROM_ABI constexpr auto parse(basic_format_parse_context<_CharT>& __parse_ctx) + -> decltype(__parse_ctx.begin()) { auto __result = __parser_.__parse(__parse_ctx, __format_spec::__fields_pointer); __format_spec::__process_display_type_pointer(__parser_.__type_); return __result; diff --git a/libcxx/include/__functional/boyer_moore_searcher.h b/libcxx/include/__functional/boyer_moore_searcher.h --- a/libcxx/include/__functional/boyer_moore_searcher.h +++ b/libcxx/include/__functional/boyer_moore_searcher.h @@ -113,6 +113,7 @@ && is_same_v<_BinaryPredicate, equal_to<>>>; public: + _LIBCPP_HIDE_FROM_ABI boyer_moore_searcher(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _Hash __hash = _Hash(), @@ -134,7 +135,7 @@ } template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const { static_assert(__is_same_uncvref::value_type, typename iterator_traits<_RandomAccessIterator2>::value_type>::value, @@ -158,7 +159,7 @@ shared_ptr __suffix_; template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { _RandomAccessIterator2 __current = __f; const _RandomAccessIterator2 __last = __l - __pattern_length_; @@ -183,7 +184,8 @@ } template - void __compute_bm_prefix(_Iterator __first, _Iterator __last, _BinaryPredicate __pred, _Container& __prefix) { + _LIBCPP_HIDE_FROM_ABI void + __compute_bm_prefix(_Iterator __first, _Iterator __last, _BinaryPredicate __pred, _Container& __prefix) { const size_t __count = __last - __first; __prefix[0] = 0; @@ -199,7 +201,8 @@ } } - void __build_suffix_table(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _BinaryPredicate __pred) { + _LIBCPP_HIDE_FROM_ABI void + __build_suffix_table(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _BinaryPredicate __pred) { const size_t __count = __last - __first; if (__count == 0) @@ -241,6 +244,7 @@ && is_same_v<_Hash, hash> && is_same_v<_BinaryPredicate, equal_to<>>>; public: + _LIBCPP_HIDE_FROM_ABI boyer_moore_horspool_searcher(_RandomAccessIterator1 __first, _RandomAccessIterator1 __last, _Hash __hash = _Hash(), @@ -262,7 +266,7 @@ } template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> operator()(_RandomAccessIterator2 __first, _RandomAccessIterator2 __last) const { static_assert(__is_same_uncvref::value_type, typename std::iterator_traits<_RandomAccessIterator2>::value_type>::value, @@ -286,7 +290,7 @@ shared_ptr<__skip_table_type> __skip_table_; template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { _RandomAccessIterator2 __current = __f; const _RandomAccessIterator2 __last = __l - __pattern_length_; diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -56,7 +56,7 @@ #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION ~bad_function_call() _NOEXCEPT override; #else - ~bad_function_call() _NOEXCEPT override {} + _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~bad_function_call() _NOEXCEPT override {} #endif #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE @@ -201,7 +201,7 @@ _LIBCPP_INLINE_VISIBILITY void destroy() _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); } - static void __destroy_and_delete(__alloc_func* __f) { + _LIBCPP_HIDE_FROM_ABI static void __destroy_and_delete(__alloc_func* __f) { typedef allocator_traits<_Alloc> __alloc_traits; typedef __rebind_alloc<__alloc_traits, __alloc_func> _FunAlloc; _FunAlloc __a(__f->__get_allocator()); @@ -245,7 +245,7 @@ _LIBCPP_INLINE_VISIBILITY void destroy() _NOEXCEPT { __f_.~_Target(); } - static void __destroy_and_delete(__default_alloc_func* __f) { + _LIBCPP_HIDE_FROM_ABI static void __destroy_and_delete(__default_alloc_func* __f) { __f->destroy(); __builtin_new_allocator::__deallocate_type<__default_alloc_func>(__f, 1); } @@ -300,14 +300,14 @@ explicit __func(_Fp&& __f, _Alloc&& __a) : __f_(_VSTD::move(__f), _VSTD::move(__a)) {} - virtual __base<_Rp(_ArgTypes...)>* __clone() const; - virtual void __clone(__base<_Rp(_ArgTypes...)>*) const; - virtual void destroy() _NOEXCEPT; - virtual void destroy_deallocate() _NOEXCEPT; - virtual _Rp operator()(_ArgTypes&&... __arg); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual __base<_Rp(_ArgTypes...)>* __clone() const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __clone(__base<_Rp(_ArgTypes...)>*) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy_deallocate() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual _Rp operator()(_ArgTypes&&... __arg); #ifndef _LIBCPP_NO_RTTI - virtual const void* target(const type_info&) const _NOEXCEPT; - virtual const std::type_info& target_type() const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual const void* target(const type_info&) const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual const std::type_info& target_type() const _NOEXCEPT; #endif // _LIBCPP_NO_RTTI }; @@ -389,7 +389,7 @@ typedef __base<_Rp(_ArgTypes...)> __func; __func* __f_; - _LIBCPP_NO_CFI static __func* __as_base(void* __p) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI static __func* __as_base(void* __p) { return reinterpret_cast<__func*>(__p); } @@ -626,14 +626,15 @@ } private: - template static void* __large_clone(const void* __s) + template + _LIBCPP_HIDE_FROM_ABI static void* __large_clone(const void* __s) { const _Fun* __f = static_cast(__s); return __f->__clone(); } template - static void __large_destroy(void* __s) { + _LIBCPP_HIDE_FROM_ABI static void __large_destroy(void* __s) { _Fun::__destroy_and_delete(static_cast<_Fun*>(__s)); } @@ -699,14 +700,14 @@ _LIBCPP_INLINE_VISIBILITY explicit __policy_invoker(__Call __c) : __call_(__c) {} - static _Rp __call_empty(const __policy_storage*, + _LIBCPP_HIDE_FROM_ABI static _Rp __call_empty(const __policy_storage*, __fast_forward<_ArgTypes>...) { __throw_bad_function_call(); } template - static _Rp __call_impl(const __policy_storage* __buf, + _LIBCPP_HIDE_FROM_ABI static _Rp __call_impl(const __policy_storage* __buf, __fast_forward<_ArgTypes>... __args) { _Fun* __f = reinterpret_cast<_Fun*>(__use_small_storage<_Fun>::value @@ -1002,11 +1003,11 @@ _LIBCPP_INLINE_VISIBILITY function() _NOEXCEPT { } _LIBCPP_INLINE_VISIBILITY - function(nullptr_t) _NOEXCEPT {} - function(const function&); - function(function&&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {} + _LIBCPP_HIDE_FROM_ABI function(const function&); + _LIBCPP_HIDE_FROM_ABI function(function&&) _NOEXCEPT; template> - function(_Fp); + _LIBCPP_HIDE_FROM_ABI function(_Fp); #if _LIBCPP_STD_VER <= 14 template @@ -1023,16 +1024,16 @@ function(allocator_arg_t, const _Alloc& __a, _Fp __f); #endif - function& operator=(const function&); - function& operator=(function&&) _NOEXCEPT; - function& operator=(nullptr_t) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI function& operator=(const function&); + _LIBCPP_HIDE_FROM_ABI function& operator=(function&&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI function& operator=(nullptr_t) _NOEXCEPT; template::type>> - function& operator=(_Fp&&); + _LIBCPP_HIDE_FROM_ABI function& operator=(_Fp&&); - ~function(); + _LIBCPP_HIDE_FROM_ABI ~function(); // function modifiers: - void swap(function&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void swap(function&) _NOEXCEPT; #if _LIBCPP_STD_VER <= 14 template @@ -1054,13 +1055,15 @@ bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete; public: // function invocation: - _Rp operator()(_ArgTypes...) const; + _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const; #ifndef _LIBCPP_NO_RTTI // function target access: - const std::type_info& target_type() const _NOEXCEPT; - template _Tp* target() _NOEXCEPT; - template const _Tp* target() const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI const std::type_info& target_type() const _NOEXCEPT; + template + _LIBCPP_HIDE_FROM_ABI _Tp* target() _NOEXCEPT; + template + _LIBCPP_HIDE_FROM_ABI const _Tp* target() const _NOEXCEPT; #endif // _LIBCPP_NO_RTTI }; diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h --- a/libcxx/include/__functional/hash.h +++ b/libcxx/include/__functional/hash.h @@ -53,7 +53,7 @@ template struct __murmur2_or_cityhash<_Size, 32> { - inline _Size operator()(const void* __key, _Size __len) + _LIBCPP_HIDE_FROM_ABI inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK; }; @@ -96,28 +96,29 @@ template struct __murmur2_or_cityhash<_Size, 64> { - inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK; + _LIBCPP_HIDE_FROM_ABI inline _Size + operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK; - private: - // Some primes between 2^63 and 2^64. - static const _Size __k0 = 0xc3a5c85c97cb3127ULL; - static const _Size __k1 = 0xb492b66fbe98f273ULL; - static const _Size __k2 = 0x9ae16a3b2f90404fULL; - static const _Size __k3 = 0xc949d7c7509e6557ULL; + private: + // Some primes between 2^63 and 2^64. + static const _Size __k0 = 0xc3a5c85c97cb3127ULL; + static const _Size __k1 = 0xb492b66fbe98f273ULL; + static const _Size __k2 = 0x9ae16a3b2f90404fULL; + static const _Size __k3 = 0xc949d7c7509e6557ULL; - static _Size __rotate(_Size __val, int __shift) { - return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift))); + _LIBCPP_HIDE_FROM_ABI static _Size __rotate(_Size __val, int __shift) { + return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift))); } - static _Size __rotate_by_at_least_1(_Size __val, int __shift) { + _LIBCPP_HIDE_FROM_ABI static _Size __rotate_by_at_least_1(_Size __val, int __shift) { return (__val >> __shift) | (__val << (64 - __shift)); } - static _Size __shift_mix(_Size __val) { + _LIBCPP_HIDE_FROM_ABI static _Size __shift_mix(_Size __val) { return __val ^ (__val >> 47); } - static _Size __hash_len_16(_Size __u, _Size __v) + _LIBCPP_HIDE_FROM_ABI static _Size __hash_len_16(_Size __u, _Size __v) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { const _Size __mul = 0x9ddfea08eb382d69ULL; @@ -129,7 +130,7 @@ return __b; } - static _Size __hash_len_0_to_16(const char* __s, _Size __len) + _LIBCPP_HIDE_FROM_ABI static _Size __hash_len_0_to_16(const char* __s, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { if (__len > 8) { @@ -154,7 +155,7 @@ return __k2; } - static _Size __hash_len_17_to_32(const char *__s, _Size __len) + _LIBCPP_HIDE_FROM_ABI static _Size __hash_len_17_to_32(const char *__s, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { const _Size __a = std::__loadword<_Size>(__s) * __k1; @@ -167,7 +168,7 @@ // Return a 16-byte hash for 48 bytes. Quick and dirty. // Callers do best to use "random-looking" values for a and b. - static pair<_Size, _Size> __weak_hash_len_32_with_seeds( + _LIBCPP_HIDE_FROM_ABI static pair<_Size, _Size> __weak_hash_len_32_with_seeds( _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { @@ -181,7 +182,7 @@ } // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty. - static pair<_Size, _Size> __weak_hash_len_32_with_seeds( + _LIBCPP_HIDE_FROM_ABI static pair<_Size, _Size> __weak_hash_len_32_with_seeds( const char* __s, _Size __a, _Size __b) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { @@ -194,7 +195,7 @@ } // Return an 8-byte hash for 33 to 64 bytes. - static _Size __hash_len_33_to_64(const char *__s, size_t __len) + _LIBCPP_HIDE_FROM_ABI static _Size __hash_len_33_to_64(const char *__s, size_t __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK { _Size __z = std::__loadword<_Size>(__s + 24); diff --git a/libcxx/include/__functional/identity.h b/libcxx/include/__functional/identity.h --- a/libcxx/include/__functional/identity.h +++ b/libcxx/include/__functional/identity.h @@ -21,7 +21,7 @@ struct __identity { template - _LIBCPP_NODISCARD _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT { + _LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp&& operator()(_Tp&& __t) const _NOEXCEPT { return std::forward<_Tp>(__t); } @@ -32,7 +32,7 @@ struct identity { template - _LIBCPP_NODISCARD_EXT constexpr _Tp&& operator()(_Tp&& __t) const noexcept + _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator()(_Tp&& __t) const noexcept { return _VSTD::forward<_Tp>(__t); } diff --git a/libcxx/include/__functional/invoke.h b/libcxx/include/__functional/invoke.h --- a/libcxx/include/__functional/invoke.h +++ b/libcxx/include/__functional/invoke.h @@ -474,7 +474,7 @@ struct __invoke_void_return_wrapper { template - static _Ret __call(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI static _Ret __call(_Args&&... __args) { return std::__invoke(std::forward<_Args>(__args)...); } }; @@ -483,7 +483,7 @@ struct __invoke_void_return_wrapper<_Ret, true> { template - static void __call(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI static void __call(_Args&&... __args) { std::__invoke(std::forward<_Args>(__args)...); } }; diff --git a/libcxx/include/__functional/perfect_forward.h b/libcxx/include/__functional/perfect_forward.h --- a/libcxx/include/__functional/perfect_forward.h +++ b/libcxx/include/__functional/perfect_forward.h @@ -37,14 +37,14 @@ template , _Args&&...> >> - explicit constexpr __perfect_forward_impl(_Args&&... __bound_args) + _LIBCPP_HIDE_FROM_ABI explicit constexpr __perfect_forward_impl(_Args&&... __bound_args) : __bound_args_(_VSTD::forward<_Args>(__bound_args)...) {} - __perfect_forward_impl(__perfect_forward_impl const&) = default; - __perfect_forward_impl(__perfect_forward_impl&&) = default; + _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl(__perfect_forward_impl const&) = default; + _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl(__perfect_forward_impl&&) = default; - __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default; - __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default; + _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default; + _LIBCPP_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default; template >> _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) & diff --git a/libcxx/include/__functional/ranges_operations.h b/libcxx/include/__functional/ranges_operations.h --- a/libcxx/include/__functional/ranges_operations.h +++ b/libcxx/include/__functional/ranges_operations.h @@ -28,7 +28,7 @@ struct equal_to { template requires equality_comparable_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)))) { return _VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u); } @@ -39,7 +39,7 @@ struct not_equal_to { template requires equality_comparable_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u))))) { return !(_VSTD::forward<_Tp>(__t) == _VSTD::forward<_Up>(__u)); } @@ -50,7 +50,7 @@ struct less { template requires totally_ordered_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)))) { return _VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u); } @@ -61,7 +61,7 @@ struct less_equal { template requires totally_ordered_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(!(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t))))) { return !(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)); } @@ -72,7 +72,7 @@ struct greater { template requires totally_ordered_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(_VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t)))) { return _VSTD::forward<_Up>(__u) < _VSTD::forward<_Tp>(__t); } @@ -83,7 +83,7 @@ struct greater_equal { template requires totally_ordered_with<_Tp, _Up> - [[nodiscard]] constexpr bool operator()(_Tp &&__t, _Up &&__u) const + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp &&__t, _Up &&__u) const noexcept(noexcept(bool(!(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u))))) { return !(_VSTD::forward<_Tp>(__t) < _VSTD::forward<_Up>(__u)); } diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -803,8 +803,8 @@ public: bool __value_constructed; - __hash_node_destructor(__hash_node_destructor const&) = default; - __hash_node_destructor& operator=(const __hash_node_destructor&) = delete; + _LIBCPP_HIDE_FROM_ABI __hash_node_destructor(__hash_node_destructor const&) = default; + _LIBCPP_HIDE_FROM_ABI __hash_node_destructor& operator=(const __hash_node_destructor&) = delete; _LIBCPP_INLINE_VISIBILITY @@ -976,22 +976,22 @@ is_nothrow_default_constructible::value); _LIBCPP_INLINE_VISIBILITY __hash_table(const hasher& __hf, const key_equal& __eql); - __hash_table(const hasher& __hf, const key_equal& __eql, + _LIBCPP_HIDE_FROM_ABI __hash_table(const hasher& __hf, const key_equal& __eql, const allocator_type& __a); - explicit __hash_table(const allocator_type& __a); - __hash_table(const __hash_table& __u); - __hash_table(const __hash_table& __u, const allocator_type& __a); - __hash_table(__hash_table&& __u) + _LIBCPP_HIDE_FROM_ABI explicit __hash_table(const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u); + _LIBCPP_HIDE_FROM_ABI __hash_table(const __hash_table& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u) _NOEXCEPT_( is_nothrow_move_constructible<__bucket_list>::value && is_nothrow_move_constructible<__first_node>::value && is_nothrow_move_constructible<__node_allocator>::value && is_nothrow_move_constructible::value && is_nothrow_move_constructible::value); - __hash_table(__hash_table&& __u, const allocator_type& __a); - ~__hash_table(); + _LIBCPP_HIDE_FROM_ABI __hash_table(__hash_table&& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI ~__hash_table(); - __hash_table& operator=(const __hash_table& __u); + _LIBCPP_HIDE_FROM_ABI __hash_table& operator=(const __hash_table& __u); _LIBCPP_INLINE_VISIBILITY __hash_table& operator=(__hash_table&& __u) _NOEXCEPT_( @@ -1000,9 +1000,9 @@ is_nothrow_move_assignable::value && is_nothrow_move_assignable::value); template - void __assign_unique(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI void __assign_unique(_InputIterator __first, _InputIterator __last); template - void __assign_multi(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last); _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT @@ -1151,7 +1151,7 @@ _NodeHandle __node_handle_extract(const_iterator __it); #endif - void clear() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY void __rehash_unique(size_type __n) { __rehash(__n); } _LIBCPP_INLINE_VISIBILITY void __rehash_multi(size_type __n) { __rehash(__n); } _LIBCPP_INLINE_VISIBILITY void __reserve_unique(size_type __n) @@ -1188,42 +1188,42 @@ } template - iterator find(const _Key& __x); + _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __x); template - const_iterator find(const _Key& __x) const; + _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __x) const; typedef __hash_node_destructor<__node_allocator> _Dp; typedef unique_ptr<__node, _Dp> __node_holder; - iterator erase(const_iterator __p); - iterator erase(const_iterator __first, const_iterator __last); + _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p); + _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __first, const_iterator __last); template - size_type __erase_unique(const _Key& __k); + _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k); template - size_type __erase_multi(const _Key& __k); - __node_holder remove(const_iterator __p) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI size_type __erase_multi(const _Key& __k); + _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY size_type __count_unique(const _Key& __k) const; template - size_type __count_multi(const _Key& __k) const; + _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const; template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_unique(const _Key& __k); template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_unique(const _Key& __k) const; template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_multi(const _Key& __k); template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_multi(const _Key& __k) const; - void swap(__hash_table& __u) + _LIBCPP_HIDE_FROM_ABI void swap(__hash_table& __u) #if _LIBCPP_STD_VER <= 11 _NOEXCEPT_( __is_nothrow_swappable::value && __is_nothrow_swappable::value @@ -1239,7 +1239,7 @@ _LIBCPP_INLINE_VISIBILITY size_type max_bucket_count() const _NOEXCEPT {return max_size(); } - size_type bucket_size(size_type __n) const; + _LIBCPP_HIDE_FROM_ABI size_type bucket_size(size_type __n) const; _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT { size_type __bc = bucket_count(); @@ -1298,26 +1298,28 @@ #endif // _LIBCPP_ENABLE_DEBUG_MODE private: - template void __rehash(size_type __n); - template void __do_rehash(size_type __n); + template + _LIBCPP_HIDE_FROM_ABI void __rehash(size_type __n); + template + _LIBCPP_HIDE_FROM_ABI void __do_rehash(size_type __n); template - __node_holder __construct_node(_Args&& ...__args); + _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&& ...__args); template - __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest); + _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest); _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __hash_table& __u) {__copy_assign_alloc(__u, integral_constant());} - void __copy_assign_alloc(const __hash_table& __u, true_type); + _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const __hash_table& __u, true_type); _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __hash_table&, false_type) {} - void __move_assign(__hash_table& __u, false_type); - void __move_assign(__hash_table& __u, true_type) + _LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, false_type); + _LIBCPP_HIDE_FROM_ABI void __move_assign(__hash_table& __u, true_type) _NOEXCEPT_( is_nothrow_move_assignable<__node_allocator>::value && is_nothrow_move_assignable::value && @@ -1343,8 +1345,8 @@ _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} - void __deallocate_node(__next_pointer __np) _NOEXCEPT; - __next_pointer __detach() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void __deallocate_node(__next_pointer __np) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI __next_pointer __detach() _NOEXCEPT; template friend class _LIBCPP_TEMPLATE_VIS unordered_map; template friend class _LIBCPP_TEMPLATE_VIS unordered_multimap; diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h --- a/libcxx/include/__iterator/common_iterator.h +++ b/libcxx/include/__iterator/common_iterator.h @@ -46,14 +46,14 @@ requires (!same_as<_Iter, _Sent> && copyable<_Iter>) class common_iterator { struct __proxy { - constexpr const iter_value_t<_Iter>* operator->() const noexcept { + _LIBCPP_HIDE_FROM_ABI constexpr const iter_value_t<_Iter>* operator->() const noexcept { return _VSTD::addressof(__value_); } iter_value_t<_Iter> __value_; }; struct __postfix_proxy { - constexpr const iter_value_t<_Iter>& operator*() const noexcept { + _LIBCPP_HIDE_FROM_ABI constexpr const iter_value_t<_Iter>& operator*() const noexcept { return __value_; } iter_value_t<_Iter> __value_; @@ -62,14 +62,14 @@ public: variant<_Iter, _Sent> __hold_; - common_iterator() requires default_initializable<_Iter> = default; + _LIBCPP_HIDE_FROM_ABI common_iterator() requires default_initializable<_Iter> = default; - constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {} - constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {} + _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(_Iter __i) : __hold_(in_place_type<_Iter>, _VSTD::move(__i)) {} + _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(_Sent __s) : __hold_(in_place_type<_Sent>, _VSTD::move(__s)) {} template requires convertible_to && convertible_to - constexpr common_iterator(const common_iterator<_I2, _S2>& __other) + _LIBCPP_HIDE_FROM_ABI constexpr common_iterator(const common_iterator<_I2, _S2>& __other) : __hold_([&]() -> variant<_Iter, _Sent> { _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to construct from a valueless common_iterator"); if (__other.__hold_.index() == 0) @@ -80,7 +80,7 @@ template requires convertible_to && convertible_to && assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&> - common_iterator& operator=(const common_iterator<_I2, _S2>& __other) { + _LIBCPP_HIDE_FROM_ABI common_iterator& operator=(const common_iterator<_I2, _S2>& __other) { _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to assign from a valueless common_iterator"); auto __idx = __hold_.index(); @@ -101,13 +101,13 @@ return *this; } - constexpr decltype(auto) operator*() + _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() { _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator"); return *_VSTD::__unchecked_get<_Iter>(__hold_); } - constexpr decltype(auto) operator*() const + _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const requires __dereferenceable { _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator"); @@ -115,7 +115,7 @@ } template - decltype(auto) operator->() const + _LIBCPP_HIDE_FROM_ABI decltype(auto) operator->() const requires indirectly_readable && (requires(const _I2& __i) { __i.operator->(); } || is_reference_v> || @@ -132,12 +132,12 @@ } } - common_iterator& operator++() { + _LIBCPP_HIDE_FROM_ABI common_iterator& operator++() { _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator"); ++_VSTD::__unchecked_get<_Iter>(__hold_); return *this; } - decltype(auto) operator++(int) { + _LIBCPP_HIDE_FROM_ABI decltype(auto) operator++(int) { _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator"); if constexpr (forward_iterator<_Iter>) { auto __tmp = *this; diff --git a/libcxx/include/__iterator/move_sentinel.h b/libcxx/include/__iterator/move_sentinel.h --- a/libcxx/include/__iterator/move_sentinel.h +++ b/libcxx/include/__iterator/move_sentinel.h @@ -44,7 +44,7 @@ move_sentinel& operator=(const move_sentinel<_S2>& __s) { __last_ = __s.base(); return *this; } - constexpr _Sent base() const { return __last_; } + _LIBCPP_HIDE_FROM_ABI constexpr _Sent base() const { return __last_; } private: _Sent __last_ = _Sent(); diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -162,7 +162,7 @@ // locale operations: string name() const; bool operator==(const locale&) const; - bool operator!=(const locale& __y) const {return !(*this == __y);} + _LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const {return !(*this == __y);} template _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS bool operator()(const basic_string<_CharT, _Traits, _Allocator>&, diff --git a/libcxx/include/__memory/allocator.h b/libcxx/include/__memory/allocator.h --- a/libcxx/include/__memory/allocator.h +++ b/libcxx/include/__memory/allocator.h @@ -98,8 +98,7 @@ typedef true_type propagate_on_container_move_assignment; typedef true_type is_always_equal; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 - allocator() _NOEXCEPT = default; + _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default; template _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 @@ -187,8 +186,7 @@ typedef true_type propagate_on_container_move_assignment; typedef true_type is_always_equal; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 - allocator() _NOEXCEPT = default; + _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default; template _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 diff --git a/libcxx/include/__memory/builtin_new_allocator.h b/libcxx/include/__memory/builtin_new_allocator.h --- a/libcxx/include/__memory/builtin_new_allocator.h +++ b/libcxx/include/__memory/builtin_new_allocator.h @@ -28,10 +28,10 @@ struct __builtin_new_deleter { typedef void* pointer_type; - _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __builtin_new_deleter(size_t __size, size_t __align) : __size_(__size), __align_(__align) {} - void operator()(void* __p) const _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI void operator()(void* __p) const _NOEXCEPT { _VSTD::__libcpp_deallocate(__p, __size_, __align_); } @@ -42,25 +42,25 @@ typedef unique_ptr __holder_t; - static __holder_t __allocate_bytes(size_t __s, size_t __align) { + _LIBCPP_HIDE_FROM_ABI static __holder_t __allocate_bytes(size_t __s, size_t __align) { return __holder_t(_VSTD::__libcpp_allocate(__s, __align), __builtin_new_deleter(__s, __align)); } - static void __deallocate_bytes(void* __p, size_t __s, + _LIBCPP_HIDE_FROM_ABI static void __deallocate_bytes(void* __p, size_t __s, size_t __align) _NOEXCEPT { _VSTD::__libcpp_deallocate(__p, __s, __align); } template _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE - static __holder_t __allocate_type(size_t __n) { + _LIBCPP_HIDE_FROM_ABI static __holder_t __allocate_type(size_t __n) { return __allocate_bytes(__n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); } template _LIBCPP_NODEBUG _LIBCPP_ALWAYS_INLINE - static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI static void __deallocate_type(void* __p, size_t __n) _NOEXCEPT { __deallocate_bytes(__p, __n * sizeof(_Tp), _LIBCPP_ALIGNOF(_Tp)); } }; diff --git a/libcxx/include/__memory/ranges_uninitialized_algorithms.h b/libcxx/include/__memory/ranges_uninitialized_algorithms.h --- a/libcxx/include/__memory/ranges_uninitialized_algorithms.h +++ b/libcxx/include/__memory/ranges_uninitialized_algorithms.h @@ -45,7 +45,7 @@ template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel> requires default_initializable> - _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const { + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const { using _ValueType = remove_reference_t>; return _VSTD::__uninitialized_default_construct<_ValueType>( _VSTD::move(__first), _VSTD::move(__last)); @@ -53,7 +53,7 @@ template <__nothrow_forward_range _ForwardRange> requires default_initializable> - borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const { + _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const { return (*this)(ranges::begin(__range), ranges::end(__range)); } }; @@ -71,7 +71,7 @@ struct __fn { template <__nothrow_forward_iterator _ForwardIterator> requires default_initializable> - _ForwardIterator operator()(_ForwardIterator __first, + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const { using _ValueType = remove_reference_t>; return _VSTD::__uninitialized_default_construct_n<_ValueType>(_VSTD::move(__first), __n); @@ -92,7 +92,7 @@ template <__nothrow_forward_iterator _ForwardIterator, __nothrow_sentinel_for<_ForwardIterator> _Sentinel> requires default_initializable> - _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const { + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last) const { using _ValueType = remove_reference_t>; return _VSTD::__uninitialized_value_construct<_ValueType>( _VSTD::move(__first), _VSTD::move(__last)); @@ -100,7 +100,7 @@ template <__nothrow_forward_range _ForwardRange> requires default_initializable> - borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const { + _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range) const { return (*this)(ranges::begin(__range), ranges::end(__range)); } }; @@ -118,7 +118,7 @@ struct __fn { template <__nothrow_forward_iterator _ForwardIterator> requires default_initializable> - _ForwardIterator operator()(_ForwardIterator __first, + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n) const { using _ValueType = remove_reference_t>; return _VSTD::__uninitialized_value_construct_n<_ValueType>(_VSTD::move(__first), __n); @@ -140,14 +140,14 @@ __nothrow_sentinel_for<_ForwardIterator> _Sentinel, class _Tp> requires constructible_from, const _Tp&> - _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const { + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, _Sentinel __last, const _Tp& __x) const { using _ValueType = remove_reference_t>; return _VSTD::__uninitialized_fill<_ValueType>(_VSTD::move(__first), _VSTD::move(__last), __x); } template <__nothrow_forward_range _ForwardRange, class _Tp> requires constructible_from, const _Tp&> - borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range, const _Tp& __x) const { + _LIBCPP_HIDE_FROM_ABI borrowed_iterator_t<_ForwardRange> operator()(_ForwardRange&& __range, const _Tp& __x) const { return (*this)(ranges::begin(__range), ranges::end(__range), __x); } }; @@ -165,7 +165,7 @@ struct __fn { template <__nothrow_forward_iterator _ForwardIterator, class _Tp> requires constructible_from, const _Tp&> - _ForwardIterator operator()(_ForwardIterator __first, + _LIBCPP_HIDE_FROM_ABI _ForwardIterator operator()(_ForwardIterator __first, iter_difference_t<_ForwardIterator> __n, const _Tp& __x) const { using _ValueType = remove_reference_t>; @@ -192,7 +192,7 @@ __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel2> requires constructible_from, iter_reference_t<_InputIterator>> - uninitialized_copy_result<_InputIterator, _OutputIterator> + _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const { using _ValueType = remove_reference_t>; @@ -203,7 +203,7 @@ template requires constructible_from, range_reference_t<_InputRange>> - uninitialized_copy_result, borrowed_iterator_t<_OutputRange>> + _LIBCPP_HIDE_FROM_ABI uninitialized_copy_result, borrowed_iterator_t<_OutputRange>> operator()( _InputRange&& __in_range, _OutputRange&& __out_range) const { return (*this)(ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range)); @@ -228,7 +228,7 @@ __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel> requires constructible_from, iter_reference_t<_InputIterator>> - uninitialized_copy_n_result<_InputIterator, _OutputIterator> + _LIBCPP_HIDE_FROM_ABI uninitialized_copy_n_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n, _OutputIterator __ofirst, _Sentinel __olast) const { using _ValueType = remove_reference_t>; @@ -257,7 +257,7 @@ __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel2> requires constructible_from, iter_rvalue_reference_t<_InputIterator>> - uninitialized_move_result<_InputIterator, _OutputIterator> + _LIBCPP_HIDE_FROM_ABI uninitialized_move_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, _Sentinel1 __ilast, _OutputIterator __ofirst, _Sentinel2 __olast) const { using _ValueType = remove_reference_t>; auto __iter_move = [](auto&& __iter) -> decltype(auto) { return ranges::iter_move(__iter); }; @@ -268,7 +268,7 @@ template requires constructible_from, range_rvalue_reference_t<_InputRange>> - uninitialized_move_result, borrowed_iterator_t<_OutputRange>> + _LIBCPP_HIDE_FROM_ABI uninitialized_move_result, borrowed_iterator_t<_OutputRange>> operator()(_InputRange&& __in_range, _OutputRange&& __out_range) const { return (*this)(ranges::begin(__in_range), ranges::end(__in_range), ranges::begin(__out_range), ranges::end(__out_range)); @@ -293,7 +293,7 @@ __nothrow_forward_iterator _OutputIterator, __nothrow_sentinel_for<_OutputIterator> _Sentinel> requires constructible_from, iter_rvalue_reference_t<_InputIterator>> - uninitialized_move_n_result<_InputIterator, _OutputIterator> + _LIBCPP_HIDE_FROM_ABI uninitialized_move_n_result<_InputIterator, _OutputIterator> operator()(_InputIterator __ifirst, iter_difference_t<_InputIterator> __n, _OutputIterator __ofirst, _Sentinel __olast) const { using _ValueType = remove_reference_t>; diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -109,8 +109,8 @@ : public std::exception { public: - bad_weak_ptr() _NOEXCEPT = default; - bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_weak_ptr() _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_weak_ptr(const bad_weak_ptr&) _NOEXCEPT = default; ~bad_weak_ptr() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; @@ -220,12 +220,12 @@ : __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {} #ifndef _LIBCPP_NO_RTTI - const void* __get_deleter(const type_info&) const _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL const void* __get_deleter(const type_info&) const _NOEXCEPT override; #endif private: - void __on_zero_shared() _NOEXCEPT override; - void __on_zero_shared_weak() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override; }; #ifndef _LIBCPP_NO_RTTI @@ -285,7 +285,7 @@ _Tp* __get_elem() _NOEXCEPT { return __storage_.__get_elem(); } private: - void __on_zero_shared() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override { #if _LIBCPP_STD_VER > 17 using _TpAlloc = typename __allocator_traits_rebind<_Alloc, _Tp>::type; _TpAlloc __tmp(*__get_alloc()); @@ -295,7 +295,7 @@ #endif } - void __on_zero_shared_weak() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override { using _ControlBlockAlloc = typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type; using _ControlBlockPointer = typename allocator_traits<_ControlBlockAlloc>::pointer; _ControlBlockAlloc __tmp(*__get_alloc()); @@ -322,13 +322,13 @@ _LIBCPP_HIDE_FROM_ABI ~_Storage() { __get_alloc()->~_Alloc(); } - _Alloc* __get_alloc() _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI _Alloc* __get_alloc() _NOEXCEPT { _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); typename _CompressedPair::_Base1* __first = _CompressedPair::__get_first_base(__as_pair); _Alloc *__alloc = reinterpret_cast<_Alloc*>(__first); return __alloc; } - _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _Tp* __get_elem() _NOEXCEPT { _CompressedPair *__as_pair = reinterpret_cast<_CompressedPair*>(__blob_); typename _CompressedPair::_Base2* __second = _CompressedPair::__get_second_base(__as_pair); _Tp *__elem = reinterpret_cast<_Tp*>(__second); @@ -436,7 +436,7 @@ #endif >::value > > - explicit shared_ptr(_Yp* __p) : __ptr_(__p) { + _LIBCPP_HIDE_FROM_ABI explicit shared_ptr(_Yp* __p) : __ptr_(__p) { unique_ptr<_Yp> __hold(__p); typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT; typedef __shared_ptr_pointer<_Yp*, __shared_ptr_default_delete<_Tp, _Yp>, _AllocT> _CntrlBlk; @@ -995,12 +995,12 @@ ~__unbounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_ private: - void __on_zero_shared() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override { __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_); std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + __count_); } - void __on_zero_shared_weak() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override { using _AlignedStorage = __sp_aligned_storage; using _StorageAlloc = __allocator_traits_rebind_t<_Alloc, _AlignedStorage>; using _PointerTraits = pointer_traits::pointer>; @@ -1062,12 +1062,12 @@ ~__bounded_array_control_block() override { } // can't be `= default` because of the sometimes-non-trivial union member __data_ private: - void __on_zero_shared() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override { __allocator_traits_rebind_t<_Alloc, _Tp> __value_alloc(__alloc_); std::__allocator_destroy_multidimensional(__value_alloc, __data_, __data_ + _Count); } - void __on_zero_shared_weak() _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared_weak() _NOEXCEPT override { using _ControlBlockAlloc = __allocator_traits_rebind_t<_Alloc, __bounded_array_control_block>; using _PointerTraits = pointer_traits::pointer>; @@ -1423,7 +1423,7 @@ template _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r, typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0) _NOEXCEPT; - ~weak_ptr(); + _LIBCPP_HIDE_FROM_ABI ~weak_ptr(); _LIBCPP_INLINE_VISIBILITY weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT; @@ -1467,7 +1467,7 @@ _LIBCPP_INLINE_VISIBILITY bool expired() const _NOEXCEPT {return __cntrl_ == nullptr || __cntrl_->use_count() == 0;} - shared_ptr<_Tp> lock() const _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> lock() const _NOEXCEPT; template _LIBCPP_INLINE_VISIBILITY bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT diff --git a/libcxx/include/__memory/temp_value.h b/libcxx/include/__memory/temp_value.h --- a/libcxx/include/__memory/temp_value.h +++ b/libcxx/include/__memory/temp_value.h @@ -32,7 +32,7 @@ #endif _Alloc &__a; - _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp *__addr() { #ifdef _LIBCPP_CXX03_LANG return reinterpret_cast<_Tp*>(std::addressof(__v)); #else @@ -40,15 +40,15 @@ #endif } - _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp & get() { return *__addr(); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp & get() { return *__addr(); } template - _LIBCPP_NO_CFI + _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_CONSTEXPR_SINCE_CXX20 __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc) { _Traits::construct(__a, __addr(), std::forward<_Args>(__args)...); } - _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__temp_value() { _Traits::destroy(__a, __addr()); } }; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/libcxx/include/__memory_resource/monotonic_buffer_resource.h --- a/libcxx/include/__memory_resource/monotonic_buffer_resource.h +++ b/libcxx/include/__memory_resource/monotonic_buffer_resource.h @@ -35,7 +35,9 @@ char* __start_; char* __cur_; size_t __align_; - size_t __allocation_size() { return (reinterpret_cast(this) - __start_) + sizeof(*this); } + _LIBCPP_HIDE_FROM_ABI size_t __allocation_size() { + return (reinterpret_cast(this) - __start_) + sizeof(*this); + } void* __try_allocate_from_chunk(size_t, size_t); }; diff --git a/libcxx/include/__memory_resource/polymorphic_allocator.h b/libcxx/include/__memory_resource/polymorphic_allocator.h --- a/libcxx/include/__memory_resource/polymorphic_allocator.h +++ b/libcxx/include/__memory_resource/polymorphic_allocator.h @@ -50,7 +50,7 @@ _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(memory_resource* __r) noexcept : __res_(__r) {} - polymorphic_allocator(const polymorphic_allocator&) = default; + _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator&) = default; template _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(const polymorphic_allocator<_Tp>& __other) noexcept @@ -74,29 +74,29 @@ # if _LIBCPP_STD_VER >= 20 - [[nodiscard]] [[using __gnu__: __alloc_size__(2), __alloc_align__(3)]] void* + [[nodiscard]] [[using __gnu__: __alloc_size__(2), __alloc_align__(3)]] _LIBCPP_HIDE_FROM_ABI void* allocate_bytes(size_t __nbytes, size_t __alignment = alignof(max_align_t)) { return __res_->allocate(__nbytes, __alignment); } - void deallocate_bytes(void* __ptr, size_t __nbytes, size_t __alignment = alignof(max_align_t)) { + _LIBCPP_HIDE_FROM_ABI void deallocate_bytes(void* __ptr, size_t __nbytes, size_t __alignment = alignof(max_align_t)) { __res_->deallocate(__ptr, __nbytes, __alignment); } template - [[nodiscard]] _Type* allocate_object(size_t __n = 1) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Type* allocate_object(size_t __n = 1) { if (numeric_limits::max() / sizeof(_Type) < __n) std::__throw_bad_array_new_length(); return static_cast<_Type*>(allocate_bytes(__n * sizeof(_Type), alignof(_Type))); } template - void deallocate_object(_Type* __ptr, size_t __n = 1) { + _LIBCPP_HIDE_FROM_ABI void deallocate_object(_Type* __ptr, size_t __n = 1) { deallocate_bytes(__ptr, __n * sizeof(_Type), alignof(_Type)); } template - [[nodiscard]] _Type* new_object(_CtorArgs&&... __ctor_args) { + [[nodiscard]] _LIBCPP_HIDE_FROM_ABI _Type* new_object(_CtorArgs&&... __ctor_args) { _Type* __ptr = allocate_object<_Type>(); __exception_guard __guard([&] { deallocate_object(__ptr); }); construct(__ptr, std::forward<_CtorArgs>(__ctor_args)...); @@ -105,7 +105,7 @@ } template - void delete_object(_Type* __ptr) { + _LIBCPP_HIDE_FROM_ABI void delete_object(_Type* __ptr) { destroy(__ptr); deallocate_object(__ptr); } diff --git a/libcxx/include/__memory_resource/synchronized_pool_resource.h b/libcxx/include/__memory_resource/synchronized_pool_resource.h --- a/libcxx/include/__memory_resource/synchronized_pool_resource.h +++ b/libcxx/include/__memory_resource/synchronized_pool_resource.h @@ -46,7 +46,7 @@ synchronized_pool_resource(const synchronized_pool_resource&) = delete; - ~synchronized_pool_resource() override = default; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~synchronized_pool_resource() override = default; synchronized_pool_resource& operator=(const synchronized_pool_resource&) = delete; diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base --- a/libcxx/include/__mutex_base +++ b/libcxx/include/__mutex_base @@ -44,7 +44,7 @@ mutex& operator=(const mutex&) = delete; #if defined(_LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION) - ~mutex() = default; + _LIBCPP_HIDE_FROM_ABI ~mutex() = default; #else ~mutex() _NOEXCEPT; #endif @@ -164,15 +164,15 @@ return *this; } - void lock(); - bool try_lock(); + _LIBCPP_HIDE_FROM_ABI void lock(); + _LIBCPP_HIDE_FROM_ABI bool try_lock(); template - bool try_lock_for(const chrono::duration<_Rep, _Period>& __d); + _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration<_Rep, _Period>& __d); template - bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); + _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t); - void unlock(); + _LIBCPP_HIDE_FROM_ABI void unlock(); _LIBCPP_INLINE_VISIBILITY void swap(unique_lock& __u) _NOEXCEPT @@ -329,11 +329,11 @@ void __do_timed_wait(unique_lock& __lk, chrono::time_point) _NOEXCEPT; #if defined(_LIBCPP_HAS_COND_CLOCKWAIT) - void __do_timed_wait(unique_lock& __lk, + _LIBCPP_HIDE_FROM_ABI void __do_timed_wait(unique_lock& __lk, chrono::time_point) _NOEXCEPT; #endif template - void __do_timed_wait(unique_lock& __lk, + _LIBCPP_HIDE_FROM_ABI void __do_timed_wait(unique_lock& __lk, chrono::time_point<_Clock, chrono::nanoseconds>) _NOEXCEPT; }; #endif // !_LIBCPP_HAS_NO_THREADS diff --git a/libcxx/include/__random/binomial_distribution.h b/libcxx/include/__random/binomial_distribution.h --- a/libcxx/include/__random/binomial_distribution.h +++ b/libcxx/include/__random/binomial_distribution.h @@ -42,7 +42,7 @@ public: typedef binomial_distribution distribution_type; - explicit param_type(result_type __t = 1, double __p = 0.5); + _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __t = 1, double __p = 0.5); _LIBCPP_INLINE_VISIBILITY result_type t() const {return __t_;} @@ -85,7 +85,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/discard_block_engine.h b/libcxx/include/__random/discard_block_engine.h --- a/libcxx/include/__random/discard_block_engine.h +++ b/libcxx/include/__random/discard_block_engine.h @@ -90,7 +90,7 @@ seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;} // generating functions - result_type operator()(); + _LIBCPP_HIDE_FROM_ABI result_type operator()(); _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} diff --git a/libcxx/include/__random/discrete_distribution.h b/libcxx/include/__random/discrete_distribution.h --- a/libcxx/include/__random/discrete_distribution.h +++ b/libcxx/include/__random/discrete_distribution.h @@ -53,10 +53,10 @@ : __p_(__wl.begin(), __wl.end()) {__init();} #endif // _LIBCPP_CXX03_LANG template - param_type(size_t __nw, double __xmin, double __xmax, + _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw); - vector probabilities() const; + _LIBCPP_HIDE_FROM_ABI vector probabilities() const; friend _LIBCPP_INLINE_VISIBILITY bool operator==(const param_type& __x, const param_type& __y) @@ -66,7 +66,7 @@ {return !(__x == __y);} private: - void __init(); + _LIBCPP_HIDE_FROM_ABI void __init(); friend class discrete_distribution; @@ -115,7 +115,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/exponential_distribution.h b/libcxx/include/__random/exponential_distribution.h --- a/libcxx/include/__random/exponential_distribution.h +++ b/libcxx/include/__random/exponential_distribution.h @@ -79,7 +79,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/extreme_value_distribution.h b/libcxx/include/__random/extreme_value_distribution.h --- a/libcxx/include/__random/extreme_value_distribution.h +++ b/libcxx/include/__random/extreme_value_distribution.h @@ -84,7 +84,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/fisher_f_distribution.h b/libcxx/include/__random/fisher_f_distribution.h --- a/libcxx/include/__random/fisher_f_distribution.h +++ b/libcxx/include/__random/fisher_f_distribution.h @@ -82,7 +82,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/gamma_distribution.h b/libcxx/include/__random/gamma_distribution.h --- a/libcxx/include/__random/gamma_distribution.h +++ b/libcxx/include/__random/gamma_distribution.h @@ -85,7 +85,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/independent_bits_engine.h b/libcxx/include/__random/independent_bits_engine.h --- a/libcxx/include/__random/independent_bits_engine.h +++ b/libcxx/include/__random/independent_bits_engine.h @@ -161,7 +161,7 @@ private: _LIBCPP_INLINE_VISIBILITY result_type __eval(false_type); - result_type __eval(true_type); + _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type); template _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/linear_congruential_engine.h b/libcxx/include/__random/linear_congruential_engine.h --- a/libcxx/include/__random/linear_congruential_engine.h +++ b/libcxx/include/__random/linear_congruential_engine.h @@ -294,9 +294,9 @@ void seed(false_type, false_type, result_type __s) {__x_ = __s % __m;} template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); template diff --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h --- a/libcxx/include/__random/mersenne_twister_engine.h +++ b/libcxx/include/__random/mersenne_twister_engine.h @@ -141,7 +141,7 @@ explicit mersenne_twister_engine(_Sseq& __q, typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0) {seed(__q);} - void seed(result_type __sd = default_seed); + _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed); template _LIBCPP_INLINE_VISIBILITY typename enable_if @@ -153,7 +153,7 @@ {__seed(__q, integral_constant());} // generating functions - result_type operator()(); + _LIBCPP_HIDE_FROM_ABI result_type operator()(); _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} @@ -199,9 +199,9 @@ private: template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); template _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/negative_binomial_distribution.h b/libcxx/include/__random/negative_binomial_distribution.h --- a/libcxx/include/__random/negative_binomial_distribution.h +++ b/libcxx/include/__random/negative_binomial_distribution.h @@ -85,7 +85,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/normal_distribution.h b/libcxx/include/__random/normal_distribution.h --- a/libcxx/include/__random/normal_distribution.h +++ b/libcxx/include/__random/normal_distribution.h @@ -86,7 +86,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/piecewise_constant_distribution.h b/libcxx/include/__random/piecewise_constant_distribution.h --- a/libcxx/include/__random/piecewise_constant_distribution.h +++ b/libcxx/include/__random/piecewise_constant_distribution.h @@ -41,19 +41,19 @@ public: typedef piecewise_constant_distribution distribution_type; - param_type(); + _LIBCPP_HIDE_FROM_ABI param_type(); template - param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, + _LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w); #ifndef _LIBCPP_CXX03_LANG template - param_type(initializer_list __bl, _UnaryOperation __fw); + _LIBCPP_HIDE_FROM_ABI param_type(initializer_list __bl, _UnaryOperation __fw); #endif // _LIBCPP_CXX03_LANG template - param_type(size_t __nw, result_type __xmin, result_type __xmax, + _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); - param_type(param_type const&) = default; - param_type & operator=(const param_type& __rhs); + _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default; + _LIBCPP_HIDE_FROM_ABI param_type & operator=(const param_type& __rhs); _LIBCPP_INLINE_VISIBILITY vector intervals() const {return __b_;} @@ -68,7 +68,7 @@ {return !(__x == __y);} private: - void __init(); + _LIBCPP_HIDE_FROM_ABI void __init(); friend class piecewise_constant_distribution; @@ -125,7 +125,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/piecewise_linear_distribution.h b/libcxx/include/__random/piecewise_linear_distribution.h --- a/libcxx/include/__random/piecewise_linear_distribution.h +++ b/libcxx/include/__random/piecewise_linear_distribution.h @@ -41,19 +41,19 @@ public: typedef piecewise_linear_distribution distribution_type; - param_type(); + _LIBCPP_HIDE_FROM_ABI param_type(); template - param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, + _LIBCPP_HIDE_FROM_ABI param_type(_InputIteratorB __f_b, _InputIteratorB __l_b, _InputIteratorW __f_w); #ifndef _LIBCPP_CXX03_LANG template - param_type(initializer_list __bl, _UnaryOperation __fw); + _LIBCPP_HIDE_FROM_ABI param_type(initializer_list __bl, _UnaryOperation __fw); #endif // _LIBCPP_CXX03_LANG template - param_type(size_t __nw, result_type __xmin, result_type __xmax, + _LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); - param_type(param_type const&) = default; - param_type & operator=(const param_type& __rhs); + _LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default; + _LIBCPP_HIDE_FROM_ABI param_type & operator=(const param_type& __rhs); _LIBCPP_INLINE_VISIBILITY vector intervals() const {return __b_;} @@ -68,7 +68,7 @@ {return !(__x == __y);} private: - void __init(); + _LIBCPP_HIDE_FROM_ABI void __init(); friend class piecewise_linear_distribution; @@ -125,7 +125,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/poisson_distribution.h b/libcxx/include/__random/poisson_distribution.h --- a/libcxx/include/__random/poisson_distribution.h +++ b/libcxx/include/__random/poisson_distribution.h @@ -52,7 +52,7 @@ public: typedef poisson_distribution distribution_type; - explicit param_type(double __mean = 1.0); + _LIBCPP_HIDE_FROM_ABI explicit param_type(double __mean = 1.0); _LIBCPP_INLINE_VISIBILITY double mean() const {return __mean_;} @@ -93,7 +93,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/random_device.h b/libcxx/include/__random/random_device.h --- a/libcxx/include/__random/random_device.h +++ b/libcxx/include/__random/random_device.h @@ -58,7 +58,7 @@ // constructors #ifndef _LIBCPP_CXX03_LANG - random_device() : random_device("/dev/urandom") {} + _LIBCPP_HIDE_FROM_ABI random_device() : random_device("/dev/urandom") {} explicit random_device(const string& __token); #else explicit random_device(const string& __token = "/dev/urandom"); diff --git a/libcxx/include/__random/seed_seq.h b/libcxx/include/__random/seed_seq.h --- a/libcxx/include/__random/seed_seq.h +++ b/libcxx/include/__random/seed_seq.h @@ -52,7 +52,7 @@ // generating functions template - void generate(_RandomAccessIterator __first, _RandomAccessIterator __last); + _LIBCPP_HIDE_FROM_ABI void generate(_RandomAccessIterator __first, _RandomAccessIterator __last); // property functions _LIBCPP_INLINE_VISIBILITY @@ -70,7 +70,7 @@ private: template - void __init(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI void __init(_InputIterator __first, _InputIterator __last); vector __v_; }; diff --git a/libcxx/include/__random/student_t_distribution.h b/libcxx/include/__random/student_t_distribution.h --- a/libcxx/include/__random/student_t_distribution.h +++ b/libcxx/include/__random/student_t_distribution.h @@ -81,7 +81,8 @@ _LIBCPP_INLINE_VISIBILITY result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__random/subtract_with_carry_engine.h b/libcxx/include/__random/subtract_with_carry_engine.h --- a/libcxx/include/__random/subtract_with_carry_engine.h +++ b/libcxx/include/__random/subtract_with_carry_engine.h @@ -121,7 +121,7 @@ {__seed(__q, integral_constant());} // generating functions - result_type operator()(); + _LIBCPP_HIDE_FROM_ABI result_type operator()(); _LIBCPP_INLINE_VISIBILITY void discard(unsigned long long __z) {for (; __z; --__z) operator()();} @@ -155,12 +155,12 @@ private: - void seed(result_type __sd, integral_constant); - void seed(result_type __sd, integral_constant); + _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant); + _LIBCPP_HIDE_FROM_ABI void seed(result_type __sd, integral_constant); template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); template - void __seed(_Sseq& __q, integral_constant); + _LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant); }; template diff --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h --- a/libcxx/include/__random/uniform_int_distribution.h +++ b/libcxx/include/__random/uniform_int_distribution.h @@ -63,14 +63,14 @@ public: // constructors and seeding functions - __independent_bits_engine(_Engine& __e, size_t __w); + _LIBCPP_HIDE_FROM_ABI __independent_bits_engine(_Engine& __e, size_t __w); // generating functions - result_type operator()() {return __eval(integral_constant());} + _LIBCPP_HIDE_FROM_ABI result_type operator()() {return __eval(integral_constant());} private: - result_type __eval(false_type); - result_type __eval(true_type); + _LIBCPP_HIDE_FROM_ABI result_type __eval(false_type); + _LIBCPP_HIDE_FROM_ABI result_type __eval(true_type); }; template @@ -166,12 +166,12 @@ public: typedef uniform_int_distribution distribution_type; - explicit param_type(result_type __a = 0, + _LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = numeric_limits::max()) : __a_(__a), __b_(__b) {} - result_type a() const {return __a_;} - result_type b() const {return __b_;} + _LIBCPP_HIDE_FROM_ABI result_type a() const {return __a_;} + _LIBCPP_HIDE_FROM_ABI result_type b() const {return __b_;} _LIBCPP_HIDE_FROM_ABI friend bool operator==(const param_type& __x, const param_type& __y) @@ -187,8 +187,8 @@ public: // constructors and reset functions #ifndef _LIBCPP_CXX03_LANG - uniform_int_distribution() : uniform_int_distribution(0) {} - explicit uniform_int_distribution( + _LIBCPP_HIDE_FROM_ABI uniform_int_distribution() : uniform_int_distribution(0) {} + _LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution( result_type __a, result_type __b = numeric_limits::max()) : __p_(param_type(__a, __b)) {} #else @@ -197,23 +197,25 @@ result_type __b = numeric_limits::max()) : __p_(param_type(__a, __b)) {} #endif - explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {} - void reset() {} + _LIBCPP_HIDE_FROM_ABI explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {} + _LIBCPP_HIDE_FROM_ABI void reset() {} // generating functions - template result_type operator()(_URNG& __g) + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {return (*this)(__g, __p_);} - template result_type operator()(_URNG& __g, const param_type& __p); + template + _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p); // property functions - result_type a() const {return __p_.a();} - result_type b() const {return __p_.b();} + _LIBCPP_HIDE_FROM_ABI result_type a() const {return __p_.a();} + _LIBCPP_HIDE_FROM_ABI result_type b() const {return __p_.b();} - param_type param() const {return __p_;} - void param(const param_type& __p) {__p_ = __p;} + _LIBCPP_HIDE_FROM_ABI param_type param() const {return __p_;} + _LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) {__p_ = __p;} - result_type min() const {return a();} - result_type max() const {return b();} + _LIBCPP_HIDE_FROM_ABI result_type min() const {return a();} + _LIBCPP_HIDE_FROM_ABI result_type max() const {return b();} _LIBCPP_HIDE_FROM_ABI friend bool operator==(const uniform_int_distribution& __x, diff --git a/libcxx/include/__random/uniform_real_distribution.h b/libcxx/include/__random/uniform_real_distribution.h --- a/libcxx/include/__random/uniform_real_distribution.h +++ b/libcxx/include/__random/uniform_real_distribution.h @@ -65,7 +65,7 @@ #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY uniform_real_distribution() : uniform_real_distribution(0) {} - explicit uniform_real_distribution(result_type __a, result_type __b = 1) + _LIBCPP_HIDE_FROM_ABI explicit uniform_real_distribution(result_type __a, result_type __b = 1) : __p_(param_type(__a, __b)) {} #else _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h --- a/libcxx/include/__ranges/drop_view.h +++ b/libcxx/include/__ranges/drop_view.h @@ -66,7 +66,7 @@ _View __base_ = _View(); public: - drop_view() requires default_initializable<_View> = default; + _LIBCPP_HIDE_FROM_ABI drop_view() requires default_initializable<_View> = default; _LIBCPP_HIDE_FROM_ABI constexpr drop_view(_View __base, range_difference_t<_View> __count) diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h --- a/libcxx/include/__ranges/iota_view.h +++ b/libcxx/include/__ranges/iota_view.h @@ -45,7 +45,7 @@ namespace ranges { template struct __get_wider_signed { - static auto __call() { + consteval static auto __call() { if constexpr (sizeof(_Int) < sizeof(short)) return type_identity{}; else if constexpr (sizeof(_Int) < sizeof(int)) return type_identity{}; else if constexpr (sizeof(_Int) < sizeof(long)) return type_identity{}; @@ -381,7 +381,8 @@ public: _LIBCPP_HIDE_FROM_ABI __iota_view_sentinel() = default; - constexpr explicit __iota_view_sentinel(_BoundSentinel __bound_sentinel) : __bound_sentinel_(std::move(__bound_sentinel)) {} + _LIBCPP_HIDE_FROM_ABI constexpr explicit __iota_view_sentinel(_BoundSentinel __bound_sentinel) + : __bound_sentinel_(std::move(__bound_sentinel)) {} _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const __iterator& __x, const __iota_view_sentinel& __y) { diff --git a/libcxx/include/__ranges/non_propagating_cache.h b/libcxx/include/__ranges/non_propagating_cache.h --- a/libcxx/include/__ranges/non_propagating_cache.h +++ b/libcxx/include/__ranges/non_propagating_cache.h @@ -44,10 +44,11 @@ // This helper class is needed to perform copy and move elision when // constructing the contained type from an iterator. struct __wrapper { - template - constexpr explicit __wrapper(__forward_tag, _Args&& ...__args) : __t_(std::forward<_Args>(__args)...) { } - template - constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) { } + template + _LIBCPP_HIDE_FROM_ABI constexpr explicit __wrapper(__forward_tag, _Args&&... __args) + : __t_(std::forward<_Args>(__args)...) {} + template + _LIBCPP_HIDE_FROM_ABI constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) {} _Tp __t_; }; diff --git a/libcxx/include/__ranges/owning_view.h b/libcxx/include/__ranges/owning_view.h --- a/libcxx/include/__ranges/owning_view.h +++ b/libcxx/include/__ranges/owning_view.h @@ -38,11 +38,11 @@ _Rp __r_ = _Rp(); public: - owning_view() requires default_initializable<_Rp> = default; + _LIBCPP_HIDE_FROM_ABI owning_view() requires default_initializable<_Rp> = default; _LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {} - owning_view(owning_view&&) = default; - owning_view& operator=(owning_view&&) = default; + _LIBCPP_HIDE_FROM_ABI owning_view(owning_view&&) = default; + _LIBCPP_HIDE_FROM_ABI owning_view& operator=(owning_view&&) = default; _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; } _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; } diff --git a/libcxx/include/__ranges/range_adaptor.h b/libcxx/include/__ranges/range_adaptor.h --- a/libcxx/include/__ranges/range_adaptor.h +++ b/libcxx/include/__ranges/range_adaptor.h @@ -42,7 +42,7 @@ // i.e. something that can be called via the `x | f` notation. template struct __range_adaptor_closure_t : _Fn, __range_adaptor_closure<__range_adaptor_closure_t<_Fn>> { - constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(std::move(__f)) { } + _LIBCPP_HIDE_FROM_ABI constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(std::move(__f)) { } }; _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(__range_adaptor_closure_t); diff --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -82,7 +82,7 @@ private: static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics - struct _Empty { constexpr _Empty(auto) noexcept { } }; + struct _Empty { _LIBCPP_HIDE_FROM_ABI constexpr _Empty(auto) noexcept { } }; using _Size = conditional_t<_StoreSize, make_unsigned_t>, _Empty>; _LIBCPP_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter(); _LIBCPP_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent(); diff --git a/libcxx/include/__string/char_traits.h b/libcxx/include/__string/char_traits.h --- a/libcxx/include/__string/char_traits.h +++ b/libcxx/include/__string/char_traits.h @@ -85,14 +85,14 @@ using pos_type = streampos; using state_type = mbstate_t; - static inline void _LIBCPP_CONSTEXPR_SINCE_CXX17 + static inline void _LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_HIDE_FROM_ABI assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} - static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - static _LIBCPP_CONSTEXPR_SINCE_CXX17 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (; __n; --__n, ++__s1, ++__s2) { @@ -120,7 +120,7 @@ } return nullptr; } - static _LIBCPP_CONSTEXPR_SINCE_CXX20 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; char_type* __r = __s1; @@ -158,15 +158,15 @@ return __r; } - static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {return char_type(__c);} - static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {return int_type(__c);} - static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {return int_type(EOF);} }; @@ -203,36 +203,37 @@ using comparison_category = strong_ordering; #endif - static inline _LIBCPP_CONSTEXPR_SINCE_CXX17 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} - static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return (unsigned char)__c1 < (unsigned char)__c2;} - static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int + compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (__n == 0) return 0; return std::__constexpr_memcmp(__s1, __s2, __n); } - static inline size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT { + static inline _LIBCPP_HIDE_FROM_ABI size_t _LIBCPP_CONSTEXPR_SINCE_CXX17 length(const char_type* __s) _NOEXCEPT { return std::__constexpr_strlen(__s); } - static _LIBCPP_CONSTEXPR_SINCE_CXX17 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { if (__n == 0) return nullptr; return std::__constexpr_char_memchr(__s, static_cast(__a), __n); } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return std::__char_traits_move(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (!__libcpp_is_constant_evaluated()) _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); @@ -240,21 +241,21 @@ return __s1; } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { std::fill_n(__s, __n, __a); return __s; } - static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {return char_type(__c);} - static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {return int_type((unsigned char)__c);} - static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {return int_type(EOF);} }; @@ -273,36 +274,37 @@ using comparison_category = strong_ordering; #endif - static inline _LIBCPP_CONSTEXPR_SINCE_CXX17 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} - static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} - static _LIBCPP_CONSTEXPR_SINCE_CXX17 int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 int + compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (__n == 0) - return 0; + return 0; return std::__constexpr_wmemcmp(__s1, __s2, __n); } - static _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT { + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 size_t length(const char_type* __s) _NOEXCEPT { return std::__constexpr_wcslen(__s); } - static _LIBCPP_CONSTEXPR_SINCE_CXX17 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT { if (__n == 0) return nullptr; return std::__constexpr_wmemchr(__s, __a, __n); } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return std::__char_traits_move(__s1, __s2, __n); } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (!__libcpp_is_constant_evaluated()) _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); @@ -310,21 +312,21 @@ return __s1; } - static inline _LIBCPP_CONSTEXPR_SINCE_CXX20 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { std::fill_n(__s, __n, __a); return __s; } - static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {return char_type(__c);} - static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {return int_type(__c);} - static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {return int_type(WEOF);} }; #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS @@ -343,11 +345,11 @@ using comparison_category = strong_ordering; #endif - static inline constexpr void assign(char_type& __c1, const char_type& __c2) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr void assign(char_type& __c1, const char_type& __c2) noexcept {__c1 = __c2;} - static inline constexpr bool eq(char_type __c1, char_type __c2) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq(char_type __c1, char_type __c2) noexcept {return __c1 == __c2;} - static inline constexpr bool lt(char_type __c1, char_type __c2) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr bool lt(char_type __c1, char_type __c2) noexcept {return __c1 < __c2;} static _LIBCPP_HIDE_FROM_ABI constexpr int @@ -355,18 +357,18 @@ return std::__constexpr_memcmp(__s1, __s2, __n); } - static constexpr + static _LIBCPP_HIDE_FROM_ABI constexpr size_t length(const char_type* __s) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY static constexpr const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT; - static _LIBCPP_CONSTEXPR_SINCE_CXX20 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { return std::__char_traits_move(__s1, __s2, __n); } - static _LIBCPP_CONSTEXPR_SINCE_CXX20 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT { if (!__libcpp_is_constant_evaluated()) _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); @@ -374,21 +376,21 @@ return __s1; } - static _LIBCPP_CONSTEXPR_SINCE_CXX20 + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { std::fill_n(__s, __n, __a); return __s; } - static inline constexpr int_type not_eof(int_type __c) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type not_eof(int_type __c) noexcept {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline constexpr char_type to_char_type(int_type __c) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr char_type to_char_type(int_type __c) noexcept {return char_type(__c);} - static inline constexpr int_type to_int_type(char_type __c) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type to_int_type(char_type __c) noexcept {return int_type(__c);} - static inline constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr bool eq_int_type(int_type __c1, int_type __c2) noexcept {return __c1 == __c2;} - static inline constexpr int_type eof() noexcept + static inline _LIBCPP_HIDE_FROM_ABI constexpr int_type eof() noexcept {return int_type(EOF);} }; @@ -431,11 +433,11 @@ using comparison_category = strong_ordering; #endif - static inline _LIBCPP_CONSTEXPR_SINCE_CXX17 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} - static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_SINCE_CXX17 @@ -464,15 +466,15 @@ return __s; } - static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {return char_type(__c);} - static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {return int_type(__c);} - static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {return int_type(0xFFFF);} }; @@ -525,11 +527,11 @@ using comparison_category = strong_ordering; #endif - static inline _LIBCPP_CONSTEXPR_SINCE_CXX17 + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;} - static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT {return __c1 < __c2;} _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_SINCE_CXX17 @@ -556,15 +558,15 @@ return __s; } - static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} - static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT {return char_type(__c);} - static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT {return int_type(__c);} - static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT {return __c1 == __c2;} - static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT + static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT {return int_type(0xFFFFFFFF);} }; diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -797,7 +797,7 @@ bool __value_constructed; - __tree_node_destructor(const __tree_node_destructor &) = default; + _LIBCPP_HIDE_FROM_ABI __tree_node_destructor(const __tree_node_destructor &) = default; __tree_node_destructor& operator=(const __tree_node_destructor&) = delete; _LIBCPP_INLINE_VISIBILITY @@ -1100,36 +1100,36 @@ __node_pointer __root() const _NOEXCEPT {return static_cast<__node_pointer>(__end_node()->__left_);} - __node_base_pointer* __root_ptr() const _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI __node_base_pointer* __root_ptr() const _NOEXCEPT { return _VSTD::addressof(__end_node()->__left_); } typedef __tree_iterator iterator; typedef __tree_const_iterator const_iterator; - explicit __tree(const value_compare& __comp) + _LIBCPP_HIDE_FROM_ABI explicit __tree(const value_compare& __comp) _NOEXCEPT_( is_nothrow_default_constructible<__node_allocator>::value && is_nothrow_copy_constructible::value); - explicit __tree(const allocator_type& __a); - __tree(const value_compare& __comp, const allocator_type& __a); - __tree(const __tree& __t); - __tree& operator=(const __tree& __t); + _LIBCPP_HIDE_FROM_ABI explicit __tree(const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI __tree(const value_compare& __comp, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI __tree(const __tree& __t); + _LIBCPP_HIDE_FROM_ABI __tree& operator=(const __tree& __t); template - void __assign_unique(_ForwardIterator __first, _ForwardIterator __last); + _LIBCPP_HIDE_FROM_ABI void __assign_unique(_ForwardIterator __first, _ForwardIterator __last); template - void __assign_multi(_InputIterator __first, _InputIterator __last); - __tree(__tree&& __t) + _LIBCPP_HIDE_FROM_ABI void __assign_multi(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t) _NOEXCEPT_( is_nothrow_move_constructible<__node_allocator>::value && is_nothrow_move_constructible::value); - __tree(__tree&& __t, const allocator_type& __a); - __tree& operator=(__tree&& __t) + _LIBCPP_HIDE_FROM_ABI __tree(__tree&& __t, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI __tree& operator=(__tree&& __t) _NOEXCEPT_( __node_traits::propagate_on_container_move_assignment::value && is_nothrow_move_assignable::value && is_nothrow_move_assignable<__node_allocator>::value); - ~__tree(); + _LIBCPP_HIDE_FROM_ABI ~__tree(); _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return iterator(__begin_node());} @@ -1146,9 +1146,9 @@ __node_traits::max_size(__node_alloc()), numeric_limits::max());} - void clear() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; - void swap(__tree& __t) + _LIBCPP_HIDE_FROM_ABI void swap(__tree& __t) #if _LIBCPP_STD_VER <= 11 _NOEXCEPT_( __is_nothrow_swappable::value @@ -1160,23 +1160,23 @@ #endif template - pair + _LIBCPP_HIDE_FROM_ABI pair __emplace_unique_key_args(_Key const&, _Args&&... __args); template - pair + _LIBCPP_HIDE_FROM_ABI pair __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...); template - pair __emplace_unique_impl(_Args&&... __args); + _LIBCPP_HIDE_FROM_ABI pair __emplace_unique_impl(_Args&&... __args); template - iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args); + _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args); template - iterator __emplace_multi(_Args&&... __args); + _LIBCPP_HIDE_FROM_ABI iterator __emplace_multi(_Args&&... __args); template - iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); + _LIBCPP_HIDE_FROM_ABI iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); template _LIBCPP_INLINE_VISIBILITY @@ -1361,33 +1361,33 @@ _NodeHandle __node_handle_extract(const_iterator); #endif - iterator erase(const_iterator __p); - iterator erase(const_iterator __f, const_iterator __l); + _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __p); + _LIBCPP_HIDE_FROM_ABI iterator erase(const_iterator __f, const_iterator __l); template - size_type __erase_unique(const _Key& __k); + _LIBCPP_HIDE_FROM_ABI size_type __erase_unique(const _Key& __k); template - size_type __erase_multi(const _Key& __k); + _LIBCPP_HIDE_FROM_ABI size_type __erase_multi(const _Key& __k); - void __insert_node_at(__parent_pointer __parent, + _LIBCPP_HIDE_FROM_ABI void __insert_node_at(__parent_pointer __parent, __node_base_pointer& __child, __node_base_pointer __new_node) _NOEXCEPT; template - iterator find(const _Key& __v); + _LIBCPP_HIDE_FROM_ABI iterator find(const _Key& __v); template - const_iterator find(const _Key& __v) const; + _LIBCPP_HIDE_FROM_ABI const_iterator find(const _Key& __v) const; template - size_type __count_unique(const _Key& __k) const; + _LIBCPP_HIDE_FROM_ABI size_type __count_unique(const _Key& __k) const; template - size_type __count_multi(const _Key& __k) const; + _LIBCPP_HIDE_FROM_ABI size_type __count_multi(const _Key& __k) const; template _LIBCPP_INLINE_VISIBILITY iterator lower_bound(const _Key& __v) {return __lower_bound(__v, __root(), __end_node());} template - iterator __lower_bound(const _Key& __v, + _LIBCPP_HIDE_FROM_ABI iterator __lower_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result); template @@ -1395,7 +1395,7 @@ const_iterator lower_bound(const _Key& __v) const {return __lower_bound(__v, __root(), __end_node());} template - const_iterator __lower_bound(const _Key& __v, + _LIBCPP_HIDE_FROM_ABI const_iterator __lower_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result) const; template @@ -1403,7 +1403,7 @@ iterator upper_bound(const _Key& __v) {return __upper_bound(__v, __root(), __end_node());} template - iterator __upper_bound(const _Key& __v, + _LIBCPP_HIDE_FROM_ABI iterator __upper_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result); template @@ -1411,55 +1411,55 @@ const_iterator upper_bound(const _Key& __v) const {return __upper_bound(__v, __root(), __end_node());} template - const_iterator __upper_bound(const _Key& __v, + _LIBCPP_HIDE_FROM_ABI const_iterator __upper_bound(const _Key& __v, __node_pointer __root, __iter_pointer __result) const; template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_unique(const _Key& __k); template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_unique(const _Key& __k) const; template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_multi(const _Key& __k); template - pair + _LIBCPP_HIDE_FROM_ABI pair __equal_range_multi(const _Key& __k) const; typedef __tree_node_destructor<__node_allocator> _Dp; typedef unique_ptr<__node, _Dp> __node_holder; - __node_holder remove(const_iterator __p) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI __node_holder remove(const_iterator __p) _NOEXCEPT; private: __node_base_pointer& - __find_leaf_low(__parent_pointer& __parent, const key_type& __v); + _LIBCPP_HIDE_FROM_ABI __find_leaf_low(__parent_pointer& __parent, const key_type& __v); __node_base_pointer& - __find_leaf_high(__parent_pointer& __parent, const key_type& __v); + _LIBCPP_HIDE_FROM_ABI __find_leaf_high(__parent_pointer& __parent, const key_type& __v); __node_base_pointer& - __find_leaf(const_iterator __hint, + _LIBCPP_HIDE_FROM_ABI __find_leaf(const_iterator __hint, __parent_pointer& __parent, const key_type& __v); // FIXME: Make this function const qualified. Unfortunately doing so // breaks existing code which uses non-const callable comparators. template __node_base_pointer& - __find_equal(__parent_pointer& __parent, const _Key& __v); + _LIBCPP_HIDE_FROM_ABI __find_equal(__parent_pointer& __parent, const _Key& __v); template _LIBCPP_INLINE_VISIBILITY __node_base_pointer& __find_equal(__parent_pointer& __parent, const _Key& __v) const { return const_cast<__tree*>(this)->__find_equal(__parent, __v); } template - __node_base_pointer& + _LIBCPP_HIDE_FROM_ABI __node_base_pointer& __find_equal(const_iterator __hint, __parent_pointer& __parent, __node_base_pointer& __dummy, const _Key& __v); template - __node_holder __construct_node(_Args&& ...__args); + _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(_Args&& ...__args); - void destroy(__node_pointer __nd) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void destroy(__node_pointer __nd) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __tree& __t) @@ -1476,8 +1476,8 @@ _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __tree&, false_type) {} - void __move_assign(__tree& __t, false_type); - void __move_assign(__tree& __t, true_type) + _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, false_type); + _LIBCPP_HIDE_FROM_ABI void __move_assign(__tree& __t, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value && is_nothrow_move_assignable<__node_allocator>::value); diff --git a/libcxx/include/__tuple_dir/sfinae_helpers.h b/libcxx/include/__tuple_dir/sfinae_helpers.h --- a/libcxx/include/__tuple_dir/sfinae_helpers.h +++ b/libcxx/include/__tuple_dir/sfinae_helpers.h @@ -123,14 +123,14 @@ struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail { - static constexpr bool __enable_explicit_default() { return false; } - static constexpr bool __enable_implicit_default() { return false; } + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return false; } + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return false; } template - static constexpr bool __enable_explicit() { return false; } + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() { return false; } template - static constexpr bool __enable_implicit() { return false; } + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() { return false; } template - static constexpr bool __enable_assign() { return false; } + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_assign() { return false; } }; #endif // !defined(_LIBCPP_CXX03_LANG) diff --git a/libcxx/include/__utility/in_place.h b/libcxx/include/__utility/in_place.h --- a/libcxx/include/__utility/in_place.h +++ b/libcxx/include/__utility/in_place.h @@ -22,20 +22,20 @@ #if _LIBCPP_STD_VER > 14 struct _LIBCPP_TYPE_VIS in_place_t { - explicit in_place_t() = default; + explicit in_place_t() = default; }; inline constexpr in_place_t in_place{}; template struct _LIBCPP_TEMPLATE_VIS in_place_type_t { - explicit in_place_type_t() = default; + _LIBCPP_HIDE_FROM_ABI explicit in_place_type_t() = default; }; template inline constexpr in_place_type_t<_Tp> in_place_type{}; template struct _LIBCPP_TEMPLATE_VIS in_place_index_t { - explicit in_place_index_t() = default; + explicit in_place_index_t() = default; }; template inline constexpr in_place_index_t<_Idx> in_place_index{}; diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h --- a/libcxx/include/__utility/pair.h +++ b/libcxx/include/__utility/pair.h @@ -71,8 +71,8 @@ _T1 first; _T2 second; - pair(pair const&) = default; - pair(pair&&) = default; + _LIBCPP_HIDE_FROM_ABI pair(pair const&) = default; + _LIBCPP_HIDE_FROM_ABI pair(pair&&) = default; #ifdef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY @@ -94,37 +94,37 @@ #else struct _CheckArgs { template - static constexpr bool __enable_explicit_default() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit_default() { return is_default_constructible<_T1>::value && is_default_constructible<_T2>::value && !__enable_implicit_default<>(); } template - static constexpr bool __enable_implicit_default() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit_default() { return __is_implicitly_default_constructible<_T1>::value && __is_implicitly_default_constructible<_T2>::value; } template - static constexpr bool __is_pair_constructible() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_pair_constructible() { return is_constructible::value && is_constructible::value; } template - static constexpr bool __is_implicit() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __is_implicit() { return is_convertible<_U1, first_type>::value && is_convertible<_U2, second_type>::value; } template - static constexpr bool __enable_explicit() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() { return __is_pair_constructible<_U1, _U2>() && !__is_implicit<_U1, _U2>(); } template - static constexpr bool __enable_implicit() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() { return __is_pair_constructible<_U1, _U2>() && __is_implicit<_U1, _U2>(); } }; @@ -135,18 +135,18 @@ struct _CheckTupleLikeConstructor { template - static constexpr bool __enable_implicit() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_implicit() { return __tuple_convertible<_Tuple, pair>::value; } template - static constexpr bool __enable_explicit() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_explicit() { return __tuple_constructible<_Tuple, pair>::value && !__tuple_convertible<_Tuple, pair>::value; } template - static constexpr bool __enable_assign() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __enable_assign() { return __tuple_assignable<_Tuple, pair>::value; } }; diff --git a/libcxx/include/any b/libcxx/include/any --- a/libcxx/include/any +++ b/libcxx/include/any @@ -311,7 +311,7 @@ const void* __fallback_info); union _Storage { - constexpr _Storage() : __ptr(nullptr) {} + _LIBCPP_HIDE_FROM_ABI constexpr _Storage() : __ptr(nullptr) {} void * __ptr; __any_imp::_Buffer __buf; }; diff --git a/libcxx/include/array b/libcxx/include/array --- a/libcxx/include/array +++ b/libcxx/include/array @@ -224,14 +224,14 @@ return __elems_[__n]; } - _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reference at(size_type __n) { if (__n >= _Size) __throw_out_of_range("array::at"); return __elems_[__n]; } - _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const_reference at(size_type __n) const { if (__n >= _Size) __throw_out_of_range("array::at"); diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -911,7 +911,7 @@ #else __cxx_atomic_base_impl() _NOEXCEPT : __a_value() {} #endif // _LIBCPP_CXX03_LANG - _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __cxx_atomic_base_impl(_Tp __value) _NOEXCEPT : __a_value(__value) {} _LIBCPP_DISABLE_EXTENSION_WARNING _Atomic(_Tp) __a_value; }; diff --git a/libcxx/include/barrier b/libcxx/include/barrier --- a/libcxx/include/barrier +++ b/libcxx/include/barrier @@ -119,7 +119,7 @@ public: using arrival_token = __barrier_phase_t; - static constexpr ptrdiff_t max() noexcept { + static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return numeric_limits::max(); } @@ -288,7 +288,7 @@ public: using arrival_token = typename __barrier_base<_CompletionF>::arrival_token; - static constexpr ptrdiff_t max() noexcept { + static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return __barrier_base<_CompletionF>::max(); } diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable --- a/libcxx/include/condition_variable +++ b/libcxx/include/condition_variable @@ -191,7 +191,7 @@ struct __lock_external { template - void operator()(_Lock* __m) {__m->lock();} + _LIBCPP_HIDE_FROM_ABI void operator()(_Lock* __m) {__m->lock();} }; template diff --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine --- a/libcxx/include/experimental/coroutine +++ b/libcxx/include/experimental/coroutine @@ -160,14 +160,14 @@ } template - static coroutine_handle from_address(_Tp*) { + static _LIBCPP_HIDE_FROM_ABI coroutine_handle from_address(_Tp*) { static_assert(_CallIsValid, "coroutine_handle::from_address cannot be called with " "non-void pointers"); } private: - bool __is_suspended() const _NOEXCEPT { + _LIBCPP_HIDE_FROM_ABI bool __is_suspended() const _NOEXCEPT { // FIXME actually implement a check for if the coro is suspended. return __handle_; } @@ -243,14 +243,14 @@ } template - static coroutine_handle from_address(_Tp*) { + static _LIBCPP_HIDE_FROM_ABI coroutine_handle from_address(_Tp*) { static_assert(_CallIsValid, "coroutine_handle::from_address cannot be called with " "non-void pointers"); } template - static coroutine_handle from_address(_Promise*) { + static _LIBCPP_HIDE_FROM_ABI coroutine_handle from_address(_Promise*) { static_assert(_CallIsValid, "coroutine_handle::from_address cannot be used with " "pointers to the coroutine's promise type; use 'from_promise' instead"); @@ -283,12 +283,12 @@ __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false)); } - _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; } - _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; } + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; } - _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()() const _NOEXCEPT {} - _LIBCPP_CONSTEXPR_SINCE_CXX20 void resume() const _NOEXCEPT {} - _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy() const _NOEXCEPT {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void operator()() const _NOEXCEPT {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void resume() const _NOEXCEPT {} + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void destroy() const _NOEXCEPT {} private: _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -201,7 +201,7 @@ > skip_table_type; public: - boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, + _LIBCPP_HIDE_FROM_ABI boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()) : __first_(__f), __last_(__l), __pred_(__pred), __pattern_length_(_VSTD::distance(__first_, __last_)), @@ -216,7 +216,7 @@ } template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { static_assert(__is_same_uncvref::value_type, @@ -243,7 +243,7 @@ shared_ptr> __suffix_; template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { _RandomAccessIterator2 __cur = __f; @@ -277,7 +277,7 @@ template - void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix ) + _LIBCPP_HIDE_FROM_ABI void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix ) { const size_t __count = _VSTD::distance(__f, __l); @@ -294,7 +294,7 @@ } } - void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, + _LIBCPP_HIDE_FROM_ABI void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, _BinaryPredicate __pred) { const size_t __count = _VSTD::distance(__f, __l); @@ -350,7 +350,7 @@ > skip_table_type; public: - boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, + _LIBCPP_HIDE_FROM_ABI boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()) : __first_(__f), __last_(__l), __pred_(__pred), __pattern_length_(_VSTD::distance(__first_, __last_)), @@ -366,7 +366,7 @@ } template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const { static_assert(__is_same_uncvref::value_type, @@ -392,7 +392,7 @@ shared_ptr __skip_; template - pair<_RandomAccessIterator2, _RandomAccessIterator2> + _LIBCPP_HIDE_FROM_ABI pair<_RandomAccessIterator2, _RandomAccessIterator2> __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const { _RandomAccessIterator2 __cur = __f; const _RandomAccessIterator2 __last = __l - __pattern_length_; diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator --- a/libcxx/include/experimental/iterator +++ b/libcxx/include/experimental/iterator @@ -82,15 +82,15 @@ typedef void pointer; typedef void reference; - ostream_joiner(ostream_type& __os, _Delim&& __d) + _LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, _Delim&& __d) : __output_iter_(_VSTD::addressof(__os)), __delim_(_VSTD::move(__d)), __first_(true) {} - ostream_joiner(ostream_type& __os, const _Delim& __d) + _LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, const _Delim& __d) : __output_iter_(_VSTD::addressof(__os)), __delim_(__d), __first_(true) {} template - ostream_joiner& operator=(const _Tp& __v) + _LIBCPP_HIDE_FROM_ABI ostream_joiner& operator=(const _Tp& __v) { if (!__first_) *__output_iter_ << __delim_; @@ -99,9 +99,9 @@ return *this; } - ostream_joiner& operator*() _NOEXCEPT { return *this; } - ostream_joiner& operator++() _NOEXCEPT { return *this; } - ostream_joiner& operator++(int) _NOEXCEPT { return *this; } + _LIBCPP_HIDE_FROM_ABI ostream_joiner& operator*() _NOEXCEPT { return *this; } + _LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++() _NOEXCEPT { return *this; } + _LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++(int) _NOEXCEPT { return *this; } private: ostream_type* __output_iter_; diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource --- a/libcxx/include/experimental/memory_resource +++ b/libcxx/include/experimental/memory_resource @@ -107,7 +107,7 @@ // 8.5.2, memory.resource.public public: - virtual ~memory_resource() = default; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~memory_resource() = default; _LIBCPP_INLINE_VISIBILITY void* allocate(size_t __bytes, size_t __align = __max_align) @@ -175,7 +175,7 @@ : __res_(__r) {} - polymorphic_allocator(polymorphic_allocator const &) = default; + _LIBCPP_HIDE_FROM_ABI polymorphic_allocator(polymorphic_allocator const &) = default; template _LIBCPP_INLINE_VISIBILITY @@ -363,9 +363,9 @@ public: typedef _CharAlloc allocator_type; - __resource_adaptor_imp() = default; - __resource_adaptor_imp(__resource_adaptor_imp const &) = default; - __resource_adaptor_imp(__resource_adaptor_imp &&) = default; + _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp() = default; + _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp(__resource_adaptor_imp const &) = default; + _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp(__resource_adaptor_imp &&) = default; // 8.7.2, memory.resource.adaptor.ctor @@ -379,7 +379,7 @@ : __alloc_(_VSTD::move(__a)) {} - __resource_adaptor_imp & + _LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp & operator=(__resource_adaptor_imp const &) = default; _LIBCPP_INLINE_VISIBILITY @@ -388,7 +388,7 @@ // 8.7.3, memory.resource.adaptor.mem private: - void * do_allocate(size_t __bytes, size_t) override + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void * do_allocate(size_t __bytes, size_t) override { if (__bytes > __max_size()) __throw_bad_array_new_length(); @@ -396,7 +396,7 @@ return __alloc_.allocate(__s); } - void do_deallocate(void * __p, size_t __bytes, size_t) override + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void * __p, size_t __bytes, size_t) override { _LIBCPP_ASSERT(__bytes <= __max_size(), "do_deallocate called for size which exceeds the maximum allocation size"); @@ -404,7 +404,7 @@ __alloc_.deallocate((_ValueType*)__p, __s); } - bool do_is_equal(memory_resource const & __other) const _NOEXCEPT override { + _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool do_is_equal(memory_resource const & __other) const _NOEXCEPT override { __resource_adaptor_imp const * __p = dynamic_cast<__resource_adaptor_imp const *>(&__other); return __p ? __alloc_ == __p->__alloc_ : false; diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const --- a/libcxx/include/experimental/propagate_const +++ b/libcxx/include/experimental/propagate_const @@ -152,25 +152,25 @@ private: template - static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u) + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u) { return __u; } template - static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u) + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u) { return __get_pointer(__u.get()); } template - static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u) + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u) { return __u; } template - static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u) + static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u) { return __get_pointer(__u.get()); } @@ -192,22 +192,22 @@ template friend _LIBCPP_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; template friend _LIBCPP_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; - _LIBCPP_CONSTEXPR propagate_const() = default; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const() = default; propagate_const(const propagate_const&) = delete; - _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default; template ::value && is_constructible<_Tp, _Up&&>::value,bool> = true> - explicit _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) + explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu))) { } template ::value && is_constructible<_Tp, _Up&&>::value,bool> = false> - _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu))) { } @@ -215,7 +215,7 @@ template ::value && is_constructible<_Tp, _Up&&>::value && !__is_propagate_const>::value,bool> = true> - explicit _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) + explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) { } @@ -223,78 +223,78 @@ template ::value && is_constructible<_Tp, _Up&&>::value && !__is_propagate_const>::value,bool> = false> - _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) { } propagate_const& operator=(const propagate_const&) = delete; - _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default; + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default; template - _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu) { __t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu)); return *this; } template >::value>> - _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u) { __t_ = std::forward<_Up>(__u); return *this; } - _LIBCPP_CONSTEXPR const element_type* get() const + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* get() const { return __get_pointer(__t_); } - _LIBCPP_CONSTEXPR element_type* get() + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* get() { return __get_pointer(__t_); } - explicit _LIBCPP_CONSTEXPR operator bool() const + _LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR operator bool() const { return get() != nullptr; } - _LIBCPP_CONSTEXPR const element_type* operator->() const + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* operator->() const { return get(); } template ::value>> - _LIBCPP_CONSTEXPR operator const element_type *() const { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator const element_type *() const { return get(); } - _LIBCPP_CONSTEXPR const element_type& operator*() const + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type& operator*() const { return *get(); } - _LIBCPP_CONSTEXPR element_type* operator->() + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* operator->() { return get(); } template ::value>> - _LIBCPP_CONSTEXPR operator element_type *() { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator element_type *() { return get(); } - _LIBCPP_CONSTEXPR element_type& operator*() + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type& operator*() { return *get(); } - _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) - { + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) + _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { using _VSTD::swap; swap(__t_, __pt.__t_); } @@ -491,7 +491,7 @@ typedef size_t result_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> argument_type; - size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const + _LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const { return std::hash<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1)); } @@ -503,7 +503,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); @@ -516,7 +516,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::not_equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); @@ -529,7 +529,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::less<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); @@ -542,7 +542,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::greater<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); @@ -555,7 +555,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::less_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); @@ -568,7 +568,7 @@ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, + _LIBCPP_HIDE_FROM_ABI bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const { return std::greater_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd --- a/libcxx/include/experimental/simd +++ b/libcxx/include/experimental/simd @@ -691,8 +691,8 @@ friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } - void __set(size_t __index, _Tp __val) noexcept { + _LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } + _LIBCPP_HIDE_FROM_ABI void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } }; @@ -708,8 +708,8 @@ friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; } - void __set(size_t __index, _Tp __val) noexcept { + _LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; } + _LIBCPP_HIDE_FROM_ABI void __set(size_t __index, _Tp __val) noexcept { (&__storage_)[__index] = __val; } }; @@ -810,8 +810,8 @@ friend struct simd_mask; public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } - void __set(size_t __index, _Tp __val) noexcept { + _LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } + _LIBCPP_HIDE_FROM_ABI void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } }; @@ -831,79 +831,79 @@ __simd_storage<_Tp, _Abi>* __ptr_; size_t __index_; - __simd_reference(__simd_storage<_Tp, _Abi>* __ptr, size_t __index) + _LIBCPP_HIDE_FROM_ABI __simd_reference(__simd_storage<_Tp, _Abi>* __ptr, size_t __index) : __ptr_(__ptr), __index_(__index) {} - __simd_reference(const __simd_reference&) = default; + _LIBCPP_HIDE_FROM_ABI __simd_reference(const __simd_reference&) = default; public: __simd_reference() = delete; __simd_reference& operator=(const __simd_reference&) = delete; - operator _Vp() const { return __ptr_->__get(__index_); } + _LIBCPP_HIDE_FROM_ABI operator _Vp() const { return __ptr_->__get(__index_); } - __simd_reference operator=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator=(_Vp __value) && { __ptr_->__set(__index_, __value); return *this; } - __simd_reference operator++() && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator++() && { return std::move(*this) = __ptr_->__get(__index_) + 1; } - _Vp operator++(int) && { + _LIBCPP_HIDE_FROM_ABI _Vp operator++(int) && { auto __val = __ptr_->__get(__index_); __ptr_->__set(__index_, __val + 1); return __val; } - __simd_reference operator--() && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator--() && { return std::move(*this) = __ptr_->__get(__index_) - 1; } - _Vp operator--(int) && { + _LIBCPP_HIDE_FROM_ABI _Vp operator--(int) && { auto __val = __ptr_->__get(__index_); __ptr_->__set(__index_, __val - 1); return __val; } - __simd_reference operator+=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator+=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) + __value; } - __simd_reference operator-=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator-=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) - __value; } - __simd_reference operator*=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator*=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) * __value; } - __simd_reference operator/=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator/=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) / __value; } - __simd_reference operator%=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator%=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) % __value; } - __simd_reference operator>>=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator>>=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) >> __value; } - __simd_reference operator<<=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator<<=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) << __value; } - __simd_reference operator&=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator&=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) & __value; } - __simd_reference operator|=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator|=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) | __value; } - __simd_reference operator^=(_Vp __value) && { + _LIBCPP_HIDE_FROM_ABI __simd_reference operator^=(_Vp __value) && { return std::move(*this) = __ptr_->__get(__index_) ^ __value; } }; @@ -1350,11 +1350,11 @@ using mask_type = simd_mask<_Tp, _Abi>; using abi_type = _Abi; - simd() = default; - simd(const simd&) = default; - simd& operator=(const simd&) = default; + _LIBCPP_HIDE_FROM_ABI simd() = default; + _LIBCPP_HIDE_FROM_ABI simd(const simd&) = default; + _LIBCPP_HIDE_FROM_ABI simd& operator=(const simd&) = default; - static constexpr size_t size() noexcept { + static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return simd_size<_Tp, _Abi>::value; } @@ -1362,7 +1362,7 @@ __simd_storage<_Tp, _Abi> __s_; template - static constexpr bool __can_broadcast() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_broadcast() { return (std::is_arithmetic<_Up>::value && __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || (!std::is_arithmetic<_Up>::value && @@ -1374,7 +1374,7 @@ } template - static constexpr decltype( + static _LIBCPP_HIDE_FROM_ABI constexpr decltype( std::forward_as_tuple(std::declval<_Generator>()( std::integral_constant())...), bool()) @@ -1385,12 +1385,12 @@ } template - static bool __can_generate(...) { + static _LIBCPP_HIDE_FROM_ABI bool __can_generate(...) { return false; } template - void __generator_init(_Generator&& __g, std::index_sequence<__indicies...>) { + _LIBCPP_HIDE_FROM_ABI void __generator_init(_Generator&& __g, std::index_sequence<__indicies...>) { int __not_used[]{((*this)[__indicies] = __g(std::integral_constant()), 0)...}; @@ -1403,7 +1403,7 @@ class = typename std::enable_if< std::is_same<_Abi, simd_abi::fixed_size>::value && __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> - simd(const simd<_Up, simd_abi::fixed_size>& __v) { + _LIBCPP_HIDE_FROM_ABI simd(const simd<_Up, simd_abi::fixed_size>& __v) { for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = static_cast<_Tp>(__v[__i]); } @@ -1412,7 +1412,7 @@ // implicit broadcast constructor template ()>::type> - simd(_Up&& __rv) { + _LIBCPP_HIDE_FROM_ABI simd(_Up&& __rv) { auto __v = static_cast<_Tp>(__rv); for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = __v; @@ -1424,7 +1424,7 @@ int = typename std::enable_if< __can_generate<_Generator>(std::make_index_sequence()), int>::type()> - explicit simd(_Generator&& __g) { + explicit _LIBCPP_HIDE_FROM_ABI simd(_Generator&& __g) { __generator_init(std::forward<_Generator>(__g), std::make_index_sequence()); } @@ -1434,7 +1434,7 @@ class _Up, class _Flags, class = typename std::enable_if<__vectorizable<_Up>()>::type, class = typename std::enable_if::value>::type> - simd(const _Up* __buffer, _Flags) { + _LIBCPP_HIDE_FROM_ABI simd(const _Up* __buffer, _Flags) { // TODO: optimize for overaligned flags for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = static_cast<_Tp>(__buffer[__i]); @@ -1445,7 +1445,7 @@ template typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type - copy_from(const _Up* __buffer, _Flags) { + _LIBCPP_HIDE_FROM_ABI copy_from(const _Up* __buffer, _Flags) { *this = simd(__buffer, _Flags()); } @@ -1453,7 +1453,7 @@ template typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type - copy_to(_Up* __buffer, _Flags) const { + _LIBCPP_HIDE_FROM_ABI copy_to(_Up* __buffer, _Flags) const { // TODO: optimize for overaligned flags for (size_t __i = 0; __i < size(); __i++) { __buffer[__i] = static_cast<_Up>((*this)[__i]); @@ -1461,9 +1461,9 @@ } // scalar access [simd.subscr] - reference operator[](size_t __i) { return reference(&__s_, __i); } + _LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) { return reference(&__s_, __i); } - value_type operator[](size_t __i) const { return __s_.__get(__i); } + _LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const { return __s_.__get(__i); } // unary operators [simd.unary] simd& operator++(); @@ -1526,7 +1526,7 @@ using simd_type = simd<_Tp, _Abi>; using abi_type = _Abi; static constexpr size_t size() noexcept; - simd_mask() = default; + _LIBCPP_HIDE_FROM_ABI simd_mask() = default; // broadcast constructor explicit simd_mask(value_type) noexcept; diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -324,7 +324,7 @@ bool __first_constructed; bool __second_constructed; - __hash_map_node_destructor(__hash_map_node_destructor const&) = default; + _LIBCPP_HIDE_FROM_ABI __hash_map_node_destructor(__hash_map_node_destructor const&) = default; __hash_map_node_destructor& operator=(const __hash_map_node_destructor&) = delete; _LIBCPP_INLINE_VISIBILITY @@ -508,23 +508,23 @@ typedef __hash_map_const_iterator const_iterator; _LIBCPP_INLINE_VISIBILITY hash_map() { } - explicit hash_map(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI hash_map(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - hash_map(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI hash_map(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - hash_map(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI hash_map(_InputIterator __first, _InputIterator __last); template - hash_map(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - hash_map(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); - hash_map(const hash_map& __u); + _LIBCPP_HIDE_FROM_ABI hash_map(const hash_map& __u); _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const @@ -588,7 +588,7 @@ std::pair equal_range(const key_type& __k) const {return __table_.__equal_range_unique(__k);} - mapped_type& operator[](const key_type& __k); + _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k); _LIBCPP_INLINE_VISIBILITY size_type bucket_count() const {return __table_.bucket_count();} @@ -603,7 +603,7 @@ void resize(size_type __n) {__table_.__rehash_unique(__n);} private: - __node_holder __construct_node(const key_type& __k); + _LIBCPP_HIDE_FROM_ABI __node_holder __construct_node(const key_type& __k); }; template @@ -780,23 +780,23 @@ _LIBCPP_INLINE_VISIBILITY hash_multimap() { } - explicit hash_multimap(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI hash_multimap(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - hash_multimap(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - hash_multimap(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI hash_multimap(_InputIterator __first, _InputIterator __last); template - hash_multimap(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - hash_multimap(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); - hash_multimap(const hash_multimap& __u); + _LIBCPP_HIDE_FROM_ABI hash_multimap(const hash_multimap& __u); _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -244,21 +244,21 @@ _LIBCPP_INLINE_VISIBILITY hash_set() { } - explicit hash_set(size_type __n, const hasher& __hf = hasher(), + _LIBCPP_HIDE_FROM_ABI explicit hash_set(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - hash_set(size_type __n, const hasher& __hf, const key_equal& __eql, + _LIBCPP_HIDE_FROM_ABI hash_set(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - hash_set(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI hash_set(_InputIterator __first, _InputIterator __last); template - hash_set(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_set(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - hash_set(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_set(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); - hash_set(const hash_set& __u); + _LIBCPP_HIDE_FROM_ABI hash_set(const hash_set& __u); _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const @@ -465,21 +465,21 @@ _LIBCPP_INLINE_VISIBILITY hash_multiset() { } - explicit hash_multiset(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI hash_multiset(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - hash_multiset(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - hash_multiset(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI hash_multiset(_InputIterator __first, _InputIterator __last); template - hash_multiset(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - hash_multiset(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI hash_multiset(_InputIterator __first, _InputIterator __last, size_type __n , const hasher& __hf, const key_equal& __eql, const allocator_type& __a); - hash_multiset(const hash_multiset& __u); + _LIBCPP_HIDE_FROM_ABI hash_multiset(const hash_multiset& __u); _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -395,11 +395,11 @@ __iter_node_pointer __ptr_; - __begin_node_pointer __get_begin() const { + _LIBCPP_HIDE_FROM_ABI __begin_node_pointer __get_begin() const { return static_cast<__begin_node_pointer>( static_cast<__void_pointer>(__ptr_)); } - __node_pointer __get_unsafe_node_pointer() const { + _LIBCPP_HIDE_FROM_ABI __node_pointer __get_unsafe_node_pointer() const { return static_cast<__node_pointer>( static_cast<__void_pointer>(__ptr_)); } @@ -533,7 +533,7 @@ __forward_list_base& operator=(const __forward_list_base&); public: - ~__forward_list_base(); + _LIBCPP_HIDE_FROM_ABI ~__forward_list_base(); protected: _LIBCPP_INLINE_VISIBILITY @@ -558,7 +558,7 @@ __is_nothrow_swappable<__node_allocator>::value); #endif protected: - void clear() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; private: _LIBCPP_INLINE_VISIBILITY @@ -683,39 +683,39 @@ {} // = default; _LIBCPP_INLINE_VISIBILITY explicit forward_list(const allocator_type& __a); - explicit forward_list(size_type __n); + _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n); #if _LIBCPP_STD_VER > 11 - explicit forward_list(size_type __n, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI explicit forward_list(size_type __n, const allocator_type& __a); #endif - forward_list(size_type __n, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v); template ::value> > - forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : base(__a) + _LIBCPP_HIDE_FROM_ABI forward_list(size_type __n, const value_type& __v, const allocator_type& __a) : base(__a) { insert_after(cbefore_begin(), __n, __v); } template - forward_list(_InputIterator __f, _InputIterator __l, + _LIBCPP_HIDE_FROM_ABI forward_list(_InputIterator __f, _InputIterator __l, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>* = nullptr); template - forward_list(_InputIterator __f, _InputIterator __l, + _LIBCPP_HIDE_FROM_ABI forward_list(_InputIterator __f, _InputIterator __l, const allocator_type& __a, __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>* = nullptr); - forward_list(const forward_list& __x); - forward_list(const forward_list& __x, const __type_identity_t& __a); + _LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x); + _LIBCPP_HIDE_FROM_ABI forward_list(const forward_list& __x, const __type_identity_t& __a); - forward_list& operator=(const forward_list& __x); + _LIBCPP_HIDE_FROM_ABI forward_list& operator=(const forward_list& __x); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY forward_list(forward_list&& __x) _NOEXCEPT_(is_nothrow_move_constructible::value) : base(_VSTD::move(__x)) {} - forward_list(forward_list&& __x, const __type_identity_t& __a); + _LIBCPP_HIDE_FROM_ABI forward_list(forward_list&& __x, const __type_identity_t& __a); - forward_list(initializer_list __il); - forward_list(initializer_list __il, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI forward_list(initializer_list __il, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY forward_list& operator=(forward_list&& __x) @@ -734,8 +734,8 @@ template __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, void> - assign(_InputIterator __f, _InputIterator __l); - void assign(size_type __n, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI assign(_InputIterator __f, _InputIterator __l); + _LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v); _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -788,33 +788,35 @@ #ifndef _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 - template reference emplace_front(_Args&&... __args); + template + _LIBCPP_HIDE_FROM_ABI reference emplace_front(_Args&&... __args); #else - template void emplace_front(_Args&&... __args); + template + _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args); #endif - void push_front(value_type&& __v); + _LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v); #endif // _LIBCPP_CXX03_LANG - void push_front(const value_type& __v); + _LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v); - void pop_front(); + _LIBCPP_HIDE_FROM_ABI void pop_front(); #ifndef _LIBCPP_CXX03_LANG template - iterator emplace_after(const_iterator __p, _Args&&... __args); + _LIBCPP_HIDE_FROM_ABI iterator emplace_after(const_iterator __p, _Args&&... __args); - iterator insert_after(const_iterator __p, value_type&& __v); - iterator insert_after(const_iterator __p, initializer_list __il) + _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, value_type&& __v); + _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, initializer_list __il) {return insert_after(__p, __il.begin(), __il.end());} #endif // _LIBCPP_CXX03_LANG - iterator insert_after(const_iterator __p, const value_type& __v); - iterator insert_after(const_iterator __p, size_type __n, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI iterator insert_after(const_iterator __p, size_type __n, const value_type& __v); template _LIBCPP_INLINE_VISIBILITY __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value, iterator> insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l); - iterator erase_after(const_iterator __p); - iterator erase_after(const_iterator __f, const_iterator __l); + _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __p); + _LIBCPP_HIDE_FROM_ABI iterator erase_after(const_iterator __f, const_iterator __l); _LIBCPP_INLINE_VISIBILITY void swap(forward_list& __x) @@ -826,8 +828,8 @@ #endif {base::swap(__x);} - void resize(size_type __n); - void resize(size_type __n, const value_type& __v); + _LIBCPP_HIDE_FROM_ABI void resize(size_type __n); + _LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __v); _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT {base::clear();} @@ -838,15 +840,17 @@ _LIBCPP_INLINE_VISIBILITY void splice_after(const_iterator __p, forward_list&& __x, const_iterator __f, const_iterator __l); - void splice_after(const_iterator __p, forward_list& __x); - void splice_after(const_iterator __p, forward_list& __x, const_iterator __i); - void splice_after(const_iterator __p, forward_list& __x, + _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x); + _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x, const_iterator __i); + _LIBCPP_HIDE_FROM_ABI void splice_after(const_iterator __p, forward_list& __x, const_iterator __f, const_iterator __l); - __remove_return_type remove(const value_type& __v); - template __remove_return_type remove_if(_Predicate __pred); + _LIBCPP_HIDE_FROM_ABI __remove_return_type remove(const value_type& __v); + template + _LIBCPP_HIDE_FROM_ABI __remove_return_type remove_if(_Predicate __pred); _LIBCPP_INLINE_VISIBILITY __remove_return_type unique() { return unique(__equal_to()); } - template __remove_return_type unique(_BinaryPredicate __binary_pred); + template + _LIBCPP_HIDE_FROM_ABI __remove_return_type unique(_BinaryPredicate __binary_pred); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void merge(forward_list&& __x) {merge(__x, __less());} @@ -857,27 +861,28 @@ #endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void merge(forward_list& __x) {merge(__x, __less());} - template void merge(forward_list& __x, _Compare __comp); + template + _LIBCPP_HIDE_FROM_ABI void merge(forward_list& __x, _Compare __comp); _LIBCPP_INLINE_VISIBILITY void sort() {sort(__less());} template _LIBCPP_INLINE_VISIBILITY void sort(_Compare __comp); - void reverse() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void reverse() _NOEXCEPT; private: #ifndef _LIBCPP_CXX03_LANG - void __move_assign(forward_list& __x, true_type) + _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value); - void __move_assign(forward_list& __x, false_type); + _LIBCPP_HIDE_FROM_ABI void __move_assign(forward_list& __x, false_type); #endif // _LIBCPP_CXX03_LANG template - static + static _LIBCPP_HIDE_FROM_ABI __node_pointer __merge(__node_pointer __f1, __node_pointer __f2, _Compare& __comp); template - static + static _LIBCPP_HIDE_FROM_ABI __node_pointer __sort(__node_pointer __f, difference_type __sz, _Compare& __comp); }; diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -1590,11 +1590,11 @@ basic_filebuf* rdbuf() const; _LIBCPP_INLINE_VISIBILITY bool is_open() const; - void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); + _LIBCPP_HIDE_FROM_ABI void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #endif - void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); + _LIBCPP_HIDE_FROM_ABI void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -515,7 +515,7 @@ _LIBCPP_INLINE_VISIBILITY const error_code& code() const _NOEXCEPT {return __ec_;} - future_error(const future_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI future_error(const future_error&) _NOEXCEPT = default; ~future_error() _NOEXCEPT override; }; @@ -631,17 +631,17 @@ protected: _Up __value_; - void __on_zero_shared() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override; public: template - void set_value(_Arg&& __arg); + _LIBCPP_HIDE_FROM_ABI void set_value(_Arg&& __arg); template - void set_value_at_thread_exit(_Arg&& __arg); + _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Arg&& __arg); - _Rp move(); - __add_lvalue_reference_t<_Rp> copy(); + _LIBCPP_HIDE_FROM_ABI _Rp move(); + _LIBCPP_HIDE_FROM_ABI __add_lvalue_reference_t<_Rp> copy(); }; template @@ -711,13 +711,13 @@ protected: _Up __value_; - void __on_zero_shared() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override; public: - void set_value(_Rp& __arg); - void set_value_at_thread_exit(_Rp& __arg); + _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __arg); + _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp& __arg); - _Rp& copy(); + _LIBCPP_HIDE_FROM_ABI _Rp& copy(); }; template @@ -769,7 +769,7 @@ typedef __assoc_state<_Rp> base; _Alloc __alloc_; - virtual void __on_zero_shared() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT; public: _LIBCPP_INLINE_VISIBILITY explicit __assoc_state_alloc(const _Alloc& __a) @@ -797,7 +797,7 @@ typedef __assoc_state<_Rp&> base; _Alloc __alloc_; - virtual void __on_zero_shared() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT; public: _LIBCPP_INLINE_VISIBILITY explicit __assoc_state_alloc(const _Alloc& __a) @@ -823,7 +823,7 @@ typedef __assoc_sub_state base; _Alloc __alloc_; - void __on_zero_shared() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override; public: _LIBCPP_INLINE_VISIBILITY explicit __assoc_sub_state_alloc(const _Alloc& __a) @@ -854,7 +854,7 @@ _LIBCPP_INLINE_VISIBILITY explicit __deferred_assoc_state(_Fp&& __f); - virtual void __execute(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __execute(); }; template @@ -895,7 +895,7 @@ _LIBCPP_INLINE_VISIBILITY explicit __deferred_assoc_state(_Fp&& __f); - void __execute() override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __execute() override; }; template @@ -933,12 +933,12 @@ _Fp __func_; - virtual void __on_zero_shared() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __on_zero_shared() _NOEXCEPT; public: _LIBCPP_INLINE_VISIBILITY explicit __async_assoc_state(_Fp&& __f); - virtual void __execute(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __execute(); }; template @@ -982,12 +982,12 @@ _Fp __func_; - void __on_zero_shared() _NOEXCEPT override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __on_zero_shared() _NOEXCEPT override; public: _LIBCPP_INLINE_VISIBILITY explicit __async_assoc_state(_Fp&& __f); - void __execute() override; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __execute() override; }; template @@ -1044,7 +1044,7 @@ { __assoc_state<_Rp>* __state_; - explicit future(__assoc_state<_Rp>* __state); + explicit _LIBCPP_HIDE_FROM_ABI future(__assoc_state<_Rp>* __state); template friend class promise; template friend class shared_future; @@ -1069,12 +1069,12 @@ return *this; } - ~future(); + _LIBCPP_HIDE_FROM_ABI ~future(); _LIBCPP_INLINE_VISIBILITY shared_future<_Rp> share() _NOEXCEPT; // retrieving the value - _Rp get(); + _LIBCPP_HIDE_FROM_ABI _Rp get(); _LIBCPP_INLINE_VISIBILITY void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} @@ -1106,7 +1106,7 @@ struct __release_shared_count { - void operator()(__shared_count* __p) {__p->__release_shared();} + _LIBCPP_HIDE_FROM_ABI void operator()(__shared_count* __p) {__p->__release_shared();} }; template @@ -1131,7 +1131,7 @@ { __assoc_state<_Rp&>* __state_; - explicit future(__assoc_state<_Rp&>* __state); + explicit _LIBCPP_HIDE_FROM_ABI future(__assoc_state<_Rp&>* __state); template friend class promise; template friend class shared_future; @@ -1156,12 +1156,12 @@ return *this; } - ~future(); + _LIBCPP_HIDE_FROM_ABI ~future(); _LIBCPP_INLINE_VISIBILITY shared_future<_Rp&> share() _NOEXCEPT; // retrieving the value - _Rp& get(); + _LIBCPP_HIDE_FROM_ABI _Rp& get(); _LIBCPP_INLINE_VISIBILITY void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} @@ -1288,14 +1288,14 @@ template friend class packaged_task; public: - promise(); + _LIBCPP_HIDE_FROM_ABI promise(); template - promise(allocator_arg_t, const _Alloc& __a); + _LIBCPP_HIDE_FROM_ABI promise(allocator_arg_t, const _Alloc& __a); _LIBCPP_INLINE_VISIBILITY promise(promise&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} promise(const promise& __rhs) = delete; - ~promise(); + _LIBCPP_HIDE_FROM_ABI ~promise(); // assignment _LIBCPP_INLINE_VISIBILITY @@ -1310,17 +1310,17 @@ void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} // retrieving the result - future<_Rp> get_future(); + _LIBCPP_HIDE_FROM_ABI future<_Rp> get_future(); // setting the result - void set_value(const _Rp& __r); - void set_value(_Rp&& __r); - void set_exception(exception_ptr __p); + _LIBCPP_HIDE_FROM_ABI void set_value(const _Rp& __r); + _LIBCPP_HIDE_FROM_ABI void set_value(_Rp&& __r); + _LIBCPP_HIDE_FROM_ABI void set_exception(exception_ptr __p); // setting the result with deferred notification - void set_value_at_thread_exit(const _Rp& __r); - void set_value_at_thread_exit(_Rp&& __r); - void set_exception_at_thread_exit(exception_ptr __p); + _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(const _Rp& __r); + _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp&& __r); + _LIBCPP_HIDE_FROM_ABI void set_exception_at_thread_exit(exception_ptr __p); }; template @@ -1433,14 +1433,14 @@ template friend class packaged_task; public: - promise(); + _LIBCPP_HIDE_FROM_ABI promise(); template - promise(allocator_arg_t, const _Allocator& __a); + _LIBCPP_HIDE_FROM_ABI promise(allocator_arg_t, const _Allocator& __a); _LIBCPP_INLINE_VISIBILITY promise(promise&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} promise(const promise& __rhs) = delete; - ~promise(); + _LIBCPP_HIDE_FROM_ABI ~promise(); // assignment _LIBCPP_INLINE_VISIBILITY @@ -1455,15 +1455,15 @@ void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);} // retrieving the result - future<_Rp&> get_future(); + _LIBCPP_HIDE_FROM_ABI future<_Rp&> get_future(); // setting the result - void set_value(_Rp& __r); - void set_exception(exception_ptr __p); + _LIBCPP_HIDE_FROM_ABI void set_value(_Rp& __r); + _LIBCPP_HIDE_FROM_ABI void set_exception(exception_ptr __p); // setting the result with deferred notification - void set_value_at_thread_exit(_Rp&); - void set_exception_at_thread_exit(exception_ptr __p); + _LIBCPP_HIDE_FROM_ABI void set_value_at_thread_exit(_Rp&); + _LIBCPP_HIDE_FROM_ABI void set_exception_at_thread_exit(exception_ptr __p); }; template @@ -1654,10 +1654,10 @@ _LIBCPP_INLINE_VISIBILITY __packaged_task_func(_Fp&& __f, const _Alloc& __a) : __f_(_VSTD::move(__f), __a) {} - virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT; - virtual void destroy(); - virtual void destroy_deallocate(); - virtual _Rp operator()(_ArgTypes&& ... __args); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void destroy_deallocate(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual _Rp operator()(_ArgTypes&& ... __args); }; template @@ -1716,22 +1716,22 @@ _LIBCPP_INLINE_VISIBILITY __packaged_task_function() _NOEXCEPT : __f_(nullptr) {} template - __packaged_task_function(_Fp&& __f); + _LIBCPP_HIDE_FROM_ABI __packaged_task_function(_Fp&& __f); template - __packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f); + _LIBCPP_HIDE_FROM_ABI __packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f); - __packaged_task_function(__packaged_task_function&&) _NOEXCEPT; - __packaged_task_function& operator=(__packaged_task_function&&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI __packaged_task_function(__packaged_task_function&&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI __packaged_task_function& operator=(__packaged_task_function&&) _NOEXCEPT; __packaged_task_function(const __packaged_task_function&) = delete; __packaged_task_function& operator=(const __packaged_task_function&) = delete; - ~__packaged_task_function(); + _LIBCPP_HIDE_FROM_ABI ~__packaged_task_function(); - void swap(__packaged_task_function&) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI void swap(__packaged_task_function&) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY - _Rp operator()(_ArgTypes...) const; + _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const; }; template @@ -1936,10 +1936,10 @@ future get_future() {return __p_.get_future();} // execution - void operator()(_ArgTypes... __args); - void make_ready_at_thread_exit(_ArgTypes... __args); + _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args); + _LIBCPP_HIDE_FROM_ABI void make_ready_at_thread_exit(_ArgTypes... __args); - void reset(); + _LIBCPP_HIDE_FROM_ABI void reset(); }; template @@ -2051,10 +2051,10 @@ future get_future() {return __p_.get_future();} // execution - void operator()(_ArgTypes... __args); - void make_ready_at_thread_exit(_ArgTypes... __args); + _LIBCPP_HIDE_FROM_ABI void operator()(_ArgTypes... __args); + _LIBCPP_HIDE_FROM_ABI void make_ready_at_thread_exit(_ArgTypes... __args); - void reset(); + _LIBCPP_HIDE_FROM_ABI void reset(); }; #if _LIBCPP_STD_VER >= 17 @@ -2170,14 +2170,14 @@ _LIBCPP_INLINE_VISIBILITY __async_func(__async_func&& __f) : __f_(_VSTD::move(__f.__f_)) {} - _Rp operator()() + _LIBCPP_HIDE_FROM_ABI _Rp operator()() { typedef typename __make_tuple_indices<1+sizeof...(_Args), 1>::type _Index; return __execute(_Index()); } private: template - _Rp + _LIBCPP_HIDE_FROM_ABI _Rp __execute(__tuple_indices<_Indices...>) { return _VSTD::__invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...); @@ -2243,8 +2243,8 @@ _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} - ~shared_future(); - shared_future& operator=(const shared_future& __rhs) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI ~shared_future(); + _LIBCPP_HIDE_FROM_ABI shared_future& operator=(const shared_future& __rhs) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY shared_future& operator=(shared_future&& __rhs) _NOEXCEPT { @@ -2313,8 +2313,8 @@ _LIBCPP_INLINE_VISIBILITY shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_) {__rhs.__state_ = nullptr;} - ~shared_future(); - shared_future& operator=(const shared_future& __rhs); + _LIBCPP_HIDE_FROM_ABI ~shared_future(); + _LIBCPP_HIDE_FROM_ABI shared_future& operator=(const shared_future& __rhs); _LIBCPP_INLINE_VISIBILITY shared_future& operator=(shared_future&& __rhs) _NOEXCEPT { diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -442,7 +442,7 @@ public: explicit failure(const string& __msg, const error_code& __ec = io_errc::stream); explicit failure(const char* __msg, const error_code& __ec = io_errc::stream); - failure(const failure&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI failure(const failure&) _NOEXCEPT = default; ~failure() _NOEXCEPT override; }; diff --git a/libcxx/include/latch b/libcxx/include/latch --- a/libcxx/include/latch +++ b/libcxx/include/latch @@ -67,14 +67,14 @@ __atomic_base __a_; public: - static constexpr ptrdiff_t max() noexcept { + static _LIBCPP_HIDE_FROM_ABI constexpr ptrdiff_t max() noexcept { return numeric_limits::max(); } inline _LIBCPP_INLINE_VISIBILITY constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) { } - ~latch() = default; + _LIBCPP_HIDE_FROM_ABI ~latch() = default; latch(const latch&) = delete; latch& operator=(const latch&) = delete; diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -604,10 +604,10 @@ _LIBCPP_INLINE_VISIBILITY __list_imp(const __node_allocator& __a); #ifndef _LIBCPP_CXX03_LANG - __list_imp(__node_allocator&& __a) _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI __list_imp(__node_allocator&& __a) _NOEXCEPT; #endif - ~__list_imp(); - void clear() _NOEXCEPT; + _LIBCPP_HIDE_FROM_ABI ~__list_imp(); + _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return __sz() == 0;} @@ -632,7 +632,7 @@ return const_iterator(__end_as_link(), this); } - void swap(__list_imp& __c) + _LIBCPP_HIDE_FROM_ABI void swap(__list_imp& __c) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -3631,13 +3631,13 @@ _LIBCPP_INLINE_VISIBILITY wstring_convert(_Codecvt* __pcvt, state_type __state); - _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err, + _LIBCPP_EXPLICIT_AFTER_CXX11 _LIBCPP_HIDE_FROM_ABI wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY wstring_convert(wstring_convert&& __wc); #endif - ~wstring_convert(); + _LIBCPP_HIDE_FROM_ABI ~wstring_convert(); _LIBCPP_INLINE_VISIBILITY wide_string from_bytes(char __byte) @@ -3648,7 +3648,7 @@ _LIBCPP_INLINE_VISIBILITY wide_string from_bytes(const byte_string& __str) {return from_bytes(__str.data(), __str.data() + __str.size());} - wide_string from_bytes(const char* __first, const char* __last); + _LIBCPP_HIDE_FROM_ABI wide_string from_bytes(const char* __first, const char* __last); _LIBCPP_INLINE_VISIBILITY byte_string to_bytes(_Elem __wchar) @@ -3659,7 +3659,7 @@ _LIBCPP_INLINE_VISIBILITY byte_string to_bytes(const wide_string& __wstr) {return to_bytes(__wstr.data(), __wstr.data() + __wstr.size());} - byte_string to_bytes(const _Elem* __first, const _Elem* __last); + _LIBCPP_HIDE_FROM_ABI byte_string to_bytes(const _Elem* __first, const _Elem* __last); _LIBCPP_INLINE_VISIBILITY size_t converted() const _NOEXCEPT {return __cvtcount_;} @@ -3902,8 +3902,8 @@ public: #ifndef _LIBCPP_CXX03_LANG - wbuffer_convert() : wbuffer_convert(nullptr) {} - explicit wbuffer_convert(streambuf* __bytebuf, + _LIBCPP_HIDE_FROM_ABI wbuffer_convert() : wbuffer_convert(nullptr) {} + explicit _LIBCPP_HIDE_FROM_ABI wbuffer_convert(streambuf* __bytebuf, _Codecvt* __pcvt = new _Codecvt, state_type __state = state_type()); #else @@ -3913,7 +3913,7 @@ state_type __state = state_type()); #endif - ~wbuffer_convert(); + _LIBCPP_HIDE_FROM_ABI ~wbuffer_convert(); _LIBCPP_INLINE_VISIBILITY streambuf* rdbuf() const {return __bufptr_;} @@ -3929,21 +3929,21 @@ state_type state() const {return __st_;} protected: - virtual int_type underflow(); - virtual int_type pbackfail(int_type __c = traits_type::eof()); - virtual int_type overflow (int_type __c = traits_type::eof()); - virtual basic_streambuf* setbuf(char_type* __s, + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type underflow(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type pbackfail(int_type __c = traits_type::eof()); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int_type overflow (int_type __c = traits_type::eof()); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual basic_streambuf* setbuf(char_type* __s, streamsize __n); - virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __wch = ios_base::in | ios_base::out); - virtual pos_type seekpos(pos_type __sp, + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual pos_type seekpos(pos_type __sp, ios_base::openmode __wch = ios_base::in | ios_base::out); - virtual int sync(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual int sync(); private: - bool __read_mode(); - void __write_mode(); - wbuffer_convert* __close(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool __read_mode(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL void __write_mode(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL wbuffer_convert* __close(); }; _LIBCPP_SUPPRESS_DEPRECATED_PUSH diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -594,7 +594,7 @@ _LIBCPP_INLINE_VISIBILITY bool operator()(const _Key& __x, const _CP& __y) const {return static_cast(*this)(__x, __y.__get_value().first);} - void swap(__map_value_compare& __y) + _LIBCPP_HIDE_FROM_ABI void swap(__map_value_compare& __y) _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value) { using _VSTD::swap; @@ -1106,7 +1106,7 @@ { } - map(map&& __m, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI map(map&& __m, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY map& operator=(map&& __m) @@ -1200,13 +1200,13 @@ _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return __tree_.max_size();} - mapped_type& operator[](const key_type& __k); + _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k); #ifndef _LIBCPP_CXX03_LANG - mapped_type& operator[](key_type&& __k); + _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k); #endif - mapped_type& at(const key_type& __k); - const mapped_type& at(const key_type& __k) const; + _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k); + _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const; _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());} @@ -1886,7 +1886,7 @@ { } - multimap(multimap&& __m, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI multimap(multimap&& __m, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY multimap& operator=(multimap&& __m) diff --git a/libcxx/include/optional b/libcxx/include/optional --- a/libcxx/include/optional +++ b/libcxx/include/optional @@ -217,7 +217,7 @@ struct nullopt_t { - struct __secret_tag { _LIBCPP_INLINE_VISIBILITY explicit __secret_tag() = default; }; + struct __secret_tag { explicit __secret_tag() = default; }; _LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {} }; @@ -403,7 +403,7 @@ __raw_type* __value_; template - static constexpr bool __can_bind_reference() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { using _RawUp = __libcpp_remove_reference_t<_Up>; using _UpPtr = _RawUp*; using _RawTp = __libcpp_remove_reference_t<_Tp>; diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -1002,7 +1002,7 @@ regex_constants::error_type __code_; public: explicit regex_error(regex_constants::error_type __ecode); - regex_error(const regex_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI regex_error(const regex_error&) _NOEXCEPT = default; ~regex_error() _NOEXCEPT override; _LIBCPP_INLINE_VISIBILITY regex_constants::error_type code() const {return __code_;} @@ -1467,7 +1467,7 @@ _LIBCPP_INLINE_VISIBILITY __end_state() {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1533,7 +1533,7 @@ explicit __empty_state(__node<_CharT>* __s) : base(__s) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1559,7 +1559,7 @@ explicit __empty_non_own_state(__node<_CharT>* __s) : base(__s) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1585,7 +1585,7 @@ explicit __repeat_one_loop(__node<_CharT>* __s) : base(__s) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1611,7 +1611,7 @@ explicit __owns_two_states(__node<_CharT>* __s1, base* __s2) : base(__s1), __second_(__s2) {} - virtual ~__owns_two_states(); + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~__owns_two_states(); _LIBCPP_INLINE_VISIBILITY base* second() const {return __second_;} @@ -1654,8 +1654,8 @@ __mexp_begin_(__mexp_begin), __mexp_end_(__mexp_end), __greedy_(__greedy) {} - virtual void __exec(__state& __s) const; - virtual void __exec_split(bool __second, __state& __s) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state& __s) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec_split(bool __second, __state& __s) const; private: _LIBCPP_INLINE_VISIBILITY @@ -1747,8 +1747,8 @@ __owns_one_state<_CharT>* __s2) : base(__s1, __s2) {} - virtual void __exec(__state& __s) const; - virtual void __exec_split(bool __second, __state& __s) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state& __s) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec_split(bool __second, __state& __s) const; }; template @@ -1785,7 +1785,7 @@ explicit __begin_marked_subexpression(unsigned __mexp, __node<_CharT>* __s) : base(__s), __mexp_(__mexp) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1813,7 +1813,7 @@ explicit __end_marked_subexpression(unsigned __mexp, __node<_CharT>* __s) : base(__s), __mexp_(__mexp) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1842,7 +1842,7 @@ explicit __back_ref(unsigned __mexp, __node<_CharT>* __s) : base(__s), __mexp_(__mexp) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1893,7 +1893,7 @@ __node<_CharT>* __s) : base(__s), __traits_(__traits), __mexp_(__mexp) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -1948,7 +1948,7 @@ __node<_CharT>* __s) : base(__s), __traits_(__traits), __mexp_(__mexp) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2003,7 +2003,7 @@ __node<_CharT>* __s) : base(__s), __traits_(__traits), __invert_(__invert) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2079,7 +2079,7 @@ __l_anchor_multiline(bool __multiline, __node<_CharT>* __s) : base(__s), __multiline_(__multiline) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2123,7 +2123,7 @@ __r_anchor_multiline(bool __multiline, __node<_CharT>* __s) : base(__s), __multiline_(__multiline) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2163,7 +2163,7 @@ __match_any(__node<_CharT>* __s) : base(__s) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2225,7 +2225,7 @@ __match_char(_CharT __c, __node<_CharT>* __s) : base(__s), __c_(__c) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2265,7 +2265,7 @@ __match_char_icase(const _Traits& __traits, _CharT __c, __node<_CharT>* __s) : base(__s), __traits_(__traits), __c_(__traits.translate_nocase(__c)) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2306,7 +2306,7 @@ __match_char_collate(const _Traits& __traits, _CharT __c, __node<_CharT>* __s) : base(__s), __traits_(__traits), __c_(__traits.translate(__c)) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template @@ -2361,7 +2361,7 @@ __negate_(__negate), __icase_(__icase), __collate_(__collate), __might_have_digraph_(__traits_.getloc().name() != "C") {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; _LIBCPP_INLINE_VISIBILITY bool __negated() const {return __negate_;} @@ -3153,7 +3153,7 @@ __lookahead(const basic_regex<_CharT, _Traits>& __exp, bool __invert, __node<_CharT>* __s, unsigned __mexp) : base(__s), __exp_(__exp), __mexp_(__mexp), __invert_(__invert) {} - virtual void __exec(__state&) const; + _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual void __exec(__state&) const; }; template diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -633,7 +633,7 @@ } #ifndef _LIBCPP_CXX03_LANG - set(set&& __s, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI set(set&& __s, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY set(initializer_list __il, const value_compare& __comp = value_compare()) @@ -1158,7 +1158,7 @@ _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) : __tree_(_VSTD::move(__s.__tree_)) {} - multiset(multiset&& __s, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI multiset(multiset&& __s, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit multiset(const allocator_type& __a) diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex --- a/libcxx/include/shared_mutex +++ b/libcxx/include/shared_mutex @@ -397,13 +397,13 @@ return *this; } - void lock(); - bool try_lock(); + _LIBCPP_HIDE_FROM_ABI void lock(); + _LIBCPP_HIDE_FROM_ABI bool try_lock(); template - bool try_lock_for(const chrono::duration& __rel_time); + _LIBCPP_HIDE_FROM_ABI bool try_lock_for(const chrono::duration& __rel_time); template - bool try_lock_until(const chrono::time_point& __abs_time); - void unlock(); + _LIBCPP_HIDE_FROM_ABI bool try_lock_until(const chrono::time_point& __abs_time); + _LIBCPP_HIDE_FROM_ABI void unlock(); // Setters _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -65,7 +65,7 @@ __libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT; ~__libcpp_refstring(); - const char* c_str() const _NOEXCEPT {return __imp_;} + _LIBCPP_HIDE_FROM_ABI const char* c_str() const _NOEXCEPT {return __imp_;} }; #endif // !_LIBCPP_ABI_VCRUNTIME @@ -128,7 +128,7 @@ _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s) : logic_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - domain_error(const domain_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI domain_error(const domain_error&) _NOEXCEPT = default; ~domain_error() _NOEXCEPT override; #endif }; @@ -141,7 +141,7 @@ _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s) : logic_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - invalid_argument(const invalid_argument&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI invalid_argument(const invalid_argument&) _NOEXCEPT = default; ~invalid_argument() _NOEXCEPT override; #endif }; @@ -153,7 +153,7 @@ _LIBCPP_INLINE_VISIBILITY explicit length_error(const string& __s) : logic_error(__s) {} _LIBCPP_INLINE_VISIBILITY explicit length_error(const char* __s) : logic_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - length_error(const length_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI length_error(const length_error&) _NOEXCEPT = default; ~length_error() _NOEXCEPT override; #endif }; @@ -166,7 +166,7 @@ _LIBCPP_INLINE_VISIBILITY explicit out_of_range(const char* __s) : logic_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - out_of_range(const out_of_range&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI out_of_range(const out_of_range&) _NOEXCEPT = default; ~out_of_range() _NOEXCEPT override; #endif }; @@ -179,7 +179,7 @@ _LIBCPP_INLINE_VISIBILITY explicit range_error(const char* __s) : runtime_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - range_error(const range_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI range_error(const range_error&) _NOEXCEPT = default; ~range_error() _NOEXCEPT override; #endif }; @@ -192,7 +192,7 @@ _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s) : runtime_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - overflow_error(const overflow_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI overflow_error(const overflow_error&) _NOEXCEPT = default; ~overflow_error() _NOEXCEPT override; #endif }; @@ -205,7 +205,7 @@ _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s) : runtime_error(__s) {} #ifndef _LIBCPP_ABI_VCRUNTIME - underflow_error(const underflow_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI underflow_error(const underflow_error&) _NOEXCEPT = default; ~underflow_error() _NOEXCEPT override; #endif }; diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -4447,7 +4447,7 @@ template struct __string_hash : public __unary_function, _Allocator>, size_t> { - size_t + _LIBCPP_HIDE_FROM_ABI size_t operator()(const basic_string<_CharT, char_traits<_CharT>, _Allocator>& __val) const _NOEXCEPT { return std::__do_string_hash(__val.data(), __val.data() + __val.size()); } }; diff --git a/libcxx/include/strstream b/libcxx/include/strstream --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -146,7 +146,7 @@ { public: #ifndef _LIBCPP_CXX03_LANG - strstreambuf() : strstreambuf(0) {} + _LIBCPP_HIDE_FROM_ABI strstreambuf() : strstreambuf(0) {} explicit strstreambuf(streamsize __alsize); #else explicit strstreambuf(streamsize __alsize = 0); diff --git a/libcxx/include/system_error b/libcxx/include/system_error --- a/libcxx/include/system_error +++ b/libcxx/include/system_error @@ -530,7 +530,7 @@ system_error(int __ev, const error_category& __ecat, const string& __what_arg); system_error(int __ev, const error_category& __ecat, const char* __what_arg); system_error(int __ev, const error_category& __ecat); - system_error(const system_error&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI system_error(const system_error&) _NOEXCEPT = default; ~system_error() _NOEXCEPT override; _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -295,7 +295,7 @@ _Hp __value_; template - static constexpr bool __can_bind_reference() { + static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { #if __has_keyword(__reference_binds_to_temporary) return !__reference_binds_to_temporary(_Hp, _Tp); #else @@ -367,8 +367,8 @@ {static_assert(!is_reference<_Hp>::value, "Attempted to uses-allocator construct a reference element in a tuple");} - __tuple_leaf(const __tuple_leaf& __t) = default; - __tuple_leaf(__tuple_leaf&& __t) = default; + _LIBCPP_HIDE_FROM_ABI __tuple_leaf(const __tuple_leaf& __t) = default; + _LIBCPP_HIDE_FROM_ABI __tuple_leaf(__tuple_leaf&& __t) = default; _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value) @@ -1308,8 +1308,7 @@ class _LIBCPP_TEMPLATE_VIS tuple<> { public: - _LIBCPP_INLINE_VISIBILITY constexpr - tuple() _NOEXCEPT = default; + constexpr tuple() _NOEXCEPT = default; template _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {} diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -349,7 +349,7 @@ { public: bad_cast() _NOEXCEPT; - bad_cast(const bad_cast&) _NOEXCEPT = default; + _LIBCPP_HIDE_FROM_ABI bad_cast(const bad_cast&) _NOEXCEPT = default; ~bad_cast() _NOEXCEPT override; const char* what() const _NOEXCEPT override; }; diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1091,35 +1091,35 @@ { _VSTD::__debug_db_insert_c(this); } - explicit unordered_map(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_map(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI unordered_map(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - unordered_map(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last); template - unordered_map(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - unordered_map(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_map(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY explicit unordered_map(const allocator_type& __a); - unordered_map(const unordered_map& __u); - unordered_map(const unordered_map& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u); + _LIBCPP_HIDE_FROM_ABI unordered_map(const unordered_map& __u, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_map(unordered_map&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); - unordered_map(unordered_map&& __u, const allocator_type& __a); - unordered_map(initializer_list __il); - unordered_map(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_map(unordered_map&& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_map(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_map(initializer_list __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG @@ -1205,7 +1205,7 @@ pair insert(const value_type& __x) {return __table_.__insert_unique(__x);} - iterator insert(const_iterator __p, const value_type& __x) { + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __x) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, "unordered_map::insert(const_iterator, const value_type&) called with an iterator not " "referring to this unordered_map"); @@ -1226,7 +1226,7 @@ pair insert(value_type&& __x) {return __table_.__insert_unique(_VSTD::move(__x));} - iterator insert(const_iterator __p, value_type&& __x) { + _LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, value_type&& __x) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this, "unordered_map::insert(const_iterator, const value_type&) called with an iterator not" " referring to this unordered_map"); @@ -1486,13 +1486,13 @@ {return __table_.__equal_range_unique(__k);} #endif // _LIBCPP_STD_VER > 17 - mapped_type& operator[](const key_type& __k); + _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](const key_type& __k); #ifndef _LIBCPP_CXX03_LANG - mapped_type& operator[](key_type&& __k); + _LIBCPP_HIDE_FROM_ABI mapped_type& operator[](key_type&& __k); #endif - mapped_type& at(const key_type& __k); - const mapped_type& at(const key_type& __k) const; + _LIBCPP_HIDE_FROM_ABI mapped_type& at(const key_type& __k); + _LIBCPP_HIDE_FROM_ABI const mapped_type& at(const key_type& __k) const; _LIBCPP_INLINE_VISIBILITY size_type bucket_count() const _NOEXCEPT {return __table_.bucket_count();} @@ -1982,36 +1982,36 @@ { _VSTD::__debug_db_insert_c(this); } - explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_multimap(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI unordered_multimap(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - unordered_multimap(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last); template - unordered_multimap(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - unordered_multimap(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY explicit unordered_multimap(const allocator_type& __a); - unordered_multimap(const unordered_multimap& __u); - unordered_multimap(const unordered_multimap& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u); + _LIBCPP_HIDE_FROM_ABI unordered_multimap(const unordered_multimap& __u, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multimap(unordered_multimap&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); - unordered_multimap(unordered_multimap&& __u, const allocator_type& __a); - unordered_multimap(initializer_list __il); - unordered_multimap(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_multimap(unordered_multimap&& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_multimap(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_multimap(initializer_list __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG @@ -2128,12 +2128,12 @@ {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));} template - iterator emplace(_Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI iterator emplace(_Args&&... __args) { return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...); } template - iterator emplace_hint(const_iterator __p, _Args&&... __args) { + _LIBCPP_HIDE_FROM_ABI iterator emplace_hint(const_iterator __p, _Args&&... __args) { return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...); } #endif // _LIBCPP_CXX03_LANG diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -551,7 +551,7 @@ { _VSTD::__debug_db_insert_c(this); } - explicit unordered_set(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); #if _LIBCPP_STD_VER > 11 inline _LIBCPP_INLINE_VISIBILITY @@ -561,16 +561,16 @@ unordered_set(size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_set(__n, __hf, key_equal(), __a) {} #endif - unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, + _LIBCPP_HIDE_FROM_ABI unordered_set(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); template - unordered_set(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last); template - unordered_set(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - unordered_set(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #if _LIBCPP_STD_VER > 11 @@ -580,24 +580,24 @@ size_type __n, const allocator_type& __a) : unordered_set(__first, __last, __n, hasher(), key_equal(), __a) {} template - unordered_set(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_set(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_set(__first, __last, __n, __hf, key_equal(), __a) {} #endif _LIBCPP_INLINE_VISIBILITY explicit unordered_set(const allocator_type& __a); - unordered_set(const unordered_set& __u); - unordered_set(const unordered_set& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u); + _LIBCPP_HIDE_FROM_ABI unordered_set(const unordered_set& __u, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_set(unordered_set&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); - unordered_set(unordered_set&& __u, const allocator_type& __a); - unordered_set(initializer_list __il); - unordered_set(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_set(unordered_set&& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_set(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_set(initializer_list __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #if _LIBCPP_STD_VER > 11 @@ -1206,9 +1206,9 @@ { _VSTD::__debug_db_insert_c(this); } - explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(), + explicit _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_multiset(size_type __n, const hasher& __hf, + _LIBCPP_HIDE_FROM_ABI unordered_multiset(size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #if _LIBCPP_STD_VER > 11 inline _LIBCPP_INLINE_VISIBILITY @@ -1219,13 +1219,13 @@ : unordered_multiset(__n, __hf, key_equal(), __a) {} #endif template - unordered_multiset(_InputIterator __first, _InputIterator __last); + _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last); template - unordered_multiset(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); template - unordered_multiset(_InputIterator __first, _InputIterator __last, + _LIBCPP_HIDE_FROM_ABI unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n , const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #if _LIBCPP_STD_VER > 11 @@ -1242,18 +1242,18 @@ #endif _LIBCPP_INLINE_VISIBILITY explicit unordered_multiset(const allocator_type& __a); - unordered_multiset(const unordered_multiset& __u); - unordered_multiset(const unordered_multiset& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u); + _LIBCPP_HIDE_FROM_ABI unordered_multiset(const unordered_multiset& __u, const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multiset(unordered_multiset&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); - unordered_multiset(unordered_multiset&& __u, const allocator_type& __a); - unordered_multiset(initializer_list __il); - unordered_multiset(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_multiset(unordered_multiset&& __u, const allocator_type& __a); + _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); - unordered_multiset(initializer_list __il, size_type __n, + _LIBCPP_HIDE_FROM_ABI unordered_multiset(initializer_list __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); #if _LIBCPP_STD_VER > 11 @@ -1280,7 +1280,7 @@ _LIBCPP_INLINE_VISIBILITY unordered_multiset& operator=(unordered_multiset&& __u) _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); - unordered_multiset& operator=(initializer_list __il); + _LIBCPP_HIDE_FROM_ABI unordered_multiset& operator=(initializer_list __il); #endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -547,7 +547,7 @@ } template - static constexpr void __std_visit_visitor_return_type_check() { + static _LIBCPP_HIDE_FROM_ABI constexpr void __std_visit_visitor_return_type_check() { static_assert( __all...>::value, "`std::visit` requires the visitor to have a single return type."); @@ -673,7 +673,7 @@ private: template - static constexpr void __std_visit_exhaustive_visitor_check() { + static _LIBCPP_HIDE_FROM_ABI constexpr void __std_visit_exhaustive_visitor_check() { static_assert(is_invocable_v<_Visitor, _Values...>, "`std::visit` requires the visitor to be exhaustive."); } @@ -1034,10 +1034,10 @@ __a.__value = _VSTD::forward<_Arg>(__arg); } else { struct { - void operator()(true_type) const { + _LIBCPP_HIDE_FROM_ABI void operator()(true_type) const { __this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg)); } - void operator()(false_type) const { + _LIBCPP_HIDE_FROM_ABI void operator()(false_type) const { __this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg))); } __assignment* __this; @@ -1155,10 +1155,10 @@ public: using __base_type::__base_type; // get in_place_index_t constructor & friends - __impl(__impl const&) = default; - __impl(__impl&&) = default; - __impl& operator=(__impl const&) = default; - __impl& operator=(__impl&&) = default; + _LIBCPP_HIDE_FROM_ABI __impl(__impl const&) = default; + _LIBCPP_HIDE_FROM_ABI __impl(__impl&&) = default; + _LIBCPP_HIDE_FROM_ABI __impl& operator=(__impl const&) = default; + _LIBCPP_HIDE_FROM_ABI __impl& operator=(__impl&&) = default; template _LIBCPP_HIDE_FROM_ABI @@ -1323,8 +1323,8 @@ constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>) : __impl_(in_place_index<0>) {} - constexpr variant(const variant&) = default; - constexpr variant(variant&&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr variant(const variant&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr variant(variant&&) = default; template < class _Arg, @@ -1393,10 +1393,10 @@ is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>) : __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} - ~variant() = default; + _LIBCPP_HIDE_FROM_ABI ~variant() = default; - constexpr variant& operator=(const variant&) = default; - constexpr variant& operator=(variant&&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(const variant&) = default; + _LIBCPP_HIDE_FROM_ABI constexpr variant& operator=(variant&&) = default; template < class _Arg, diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -2107,7 +2107,7 @@ private: class __destroy_vector { public: - _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {} + _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI __destroy_vector(vector& __vec) : __vec_(__vec) {} _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() { if (__vec_.__begin_ != nullptr) @@ -2304,7 +2304,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT {__size_ = 0;} - _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&) + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(vector&) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else diff --git a/libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp b/libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp --- a/libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp +++ b/libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp @@ -11,12 +11,20 @@ #include "hide_from_abi.hpp" +namespace { +AST_MATCHER(clang::ClassTemplateDecl, hasFullSpecializations) { return !Node.specializations().empty(); } +AST_MATCHER(clang::CXXRecordDecl, isTrivial) { return Node.isTrivial(); } +} // namespace + namespace libcpp { hide_from_abi::hide_from_abi(llvm::StringRef name, clang::tidy::ClangTidyContext* context) : clang::tidy::ClangTidyCheck(name, context) {} void hide_from_abi::registerMatchers(clang::ast_matchers::MatchFinder* finder) { using namespace clang::ast_matchers; + + auto has_hide_from_abi_attr = anyOf(hasAttr(clang::attr::Visibility), hasAttr(clang::attr::AbiTag)); + finder->addMatcher( functionDecl( unless(anyOf( @@ -37,19 +45,60 @@ "__stable_partition", "__lock_first", "__stable_partition_impl"), - hasAttr(clang::attr::Visibility), - hasAttr(clang::attr::AbiTag), + has_hide_from_abi_attr, cxxMethodDecl(), // We have explicitly instantiated classes and some of their methods don't have these attributes isDeleted(), isConsteval())), isDefinition()) - .bind("missing_hide_from_abi"), + .bind("hide_from_abi_on_free_function"), this); + + auto on_trivial = allOf( + unless(isImplicit()), isDefaulted(), unless(ofClass(hasAncestor(classTemplateDecl()))), ofClass(isTrivial())); + + // TODO: find a better way to chek for explicit instantiations. Currently, every template that has a full specialization + // is ignored. For example, vector is ignored because we instantiate vector in discrete_distribution. + finder->addMatcher( + cxxMethodDecl( + unless(anyOf( + has_hide_from_abi_attr, + isDeleted(), + isImplicit(), + hasAncestor(cxxRecordDecl(isLambda())), + ofClass(anyOf(hasAncestor(classTemplateDecl(hasFullSpecializations())), + hasAnyName("basic_filebuf", + "basic_ifstream", + "basic_ofstream", // These are in the dylib in ABIv2 + // TODO: fix the matcher to catch `sentry` instantiation. + "sentry"))), + isConsteval(), + hasParent(classTemplateSpecializationDecl()), + on_trivial)), + isDefinition()) + .bind("hide_from_abi_on_member_function"), + this); + + finder->addMatcher(cxxMethodDecl(has_hide_from_abi_attr, on_trivial) + .bind("hide_from_abi_on_defaulted_smf_in_trivially_copyable_class"), + this); } void hide_from_abi::check(const clang::ast_matchers::MatchFinder::MatchResult& result) { - if (const auto* call = result.Nodes.getNodeAs("missing_hide_from_abi"); call != nullptr) { + if (const auto* call = result.Nodes.getNodeAs("hide_from_abi_on_free_function"); + call != nullptr) { diag(call->getBeginLoc(), "_LIBCPP_HIDE_FROM_ABI is missing"); } + + if (const auto* call = result.Nodes.getNodeAs("hide_from_abi_on_member_function"); + call != nullptr) { + diag(call->getLocation(), "_LIBCPP_HIDE_FROM_ABI is missing"); + } + + if (const auto* call = + result.Nodes.getNodeAs("hide_from_abi_on_defaulted_smf_in_trivially_copyable_class"); + call != nullptr) { + diag(call->getLocation(), + "_LIBCPP_HIDE_FROM_ABI should not be used for special member functions in trivial classes"); + } } } // namespace libcpp