[libcxx-commits] [libcxx] 1379899 - [libc++] Replace some _LIBCPP_HIDDEN with _LIBCPP_HIDE_FROM_ABI

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 12 13:47:08 PDT 2022


Author: David Tenty
Date: 2022-10-12T16:45:58-04:00
New Revision: 1379899518b02496a2b4a536fc9095b5456e7b7e

URL: https://github.com/llvm/llvm-project/commit/1379899518b02496a2b4a536fc9095b5456e7b7e
DIFF: https://github.com/llvm/llvm-project/commit/1379899518b02496a2b4a536fc9095b5456e7b7e.diff

LOG:  [libc++] Replace some _LIBCPP_HIDDEN with _LIBCPP_HIDE_FROM_ABI

These "implementation detail" function templates were already
hidden and have no specializations in the dylib, so they seem like they can safely
use _LIBCPP_HIDE_FROM_ABI instead and have the abi tags applied as well.

Seems some of these got over looked (e.g. D129823) in various places, and they
won't be flagged by the new checks added in D129968, as they were
already hidden.

Reviewed by: ldionne

Differential Revision: https://reviews.llvm.org/D135504

Added: 
    

Modified: 
    libcxx/include/__algorithm/sort.h
    libcxx/include/__iterator/ostreambuf_iterator.h
    libcxx/include/locale

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index a3a5c4f0640e..f97a1165ebbe 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -174,7 +174,7 @@ _LIBCPP_HIDDEN unsigned __sort5(_ForwardIterator __x1, _ForwardIterator __x2, _F
 }
 
 template <class _AlgPolicy, class _Compare, class _ForwardIterator>
-_LIBCPP_HIDDEN unsigned __sort5_wrap_policy(
+_LIBCPP_HIDE_FROM_ABI unsigned __sort5_wrap_policy(
     _ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _ForwardIterator __x5,
     _Compare __c) {
   using _WrappedComp = typename _WrapAlgPolicy<_AlgPolicy, _Compare>::type;

diff  --git a/libcxx/include/__iterator/ostreambuf_iterator.h b/libcxx/include/__iterator/ostreambuf_iterator.h
index 6da7598ed272..b75f7b6e8466 100644
--- a/libcxx/include/__iterator/ostreambuf_iterator.h
+++ b/libcxx/include/__iterator/ostreambuf_iterator.h
@@ -65,7 +65,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 
     template <class _Ch, class _Tr>
     friend
-    _LIBCPP_HIDDEN
+    _LIBCPP_HIDE_FROM_ABI
     ostreambuf_iterator<_Ch, _Tr>
     __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
                      const _Ch* __ob, const _Ch* __op, const _Ch* __oe,

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index 6dc805aa0c80..1a1aed010eb5 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -265,7 +265,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 //  If the input is "a", the first keyword matches and eofbit is set.
 //  If the input is "abc", no match is found and "ab" are consumed.
 template <class _InputIterator, class _ForwardIterator, class _Ctype>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 _ForwardIterator
 __scan_keyword(_InputIterator& __b, _InputIterator __e,
                _ForwardIterator __kb, _ForwardIterator __ke,
@@ -746,7 +746,7 @@ locale::id
 num_get<_CharT, _InputIterator>::id;
 
 template <class _Tp>
-_LIBCPP_HIDDEN _Tp
+_LIBCPP_HIDE_FROM_ABI _Tp
 __num_get_signed_integral(const char* __a, const char* __a_end,
                           ios_base::iostate& __err, int __base)
 {
@@ -781,7 +781,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
 }
 
 template <class _Tp>
-_LIBCPP_HIDDEN _Tp
+_LIBCPP_HIDE_FROM_ABI _Tp
 __num_get_unsigned_integral(const char* __a, const char* __a_end,
                             ios_base::iostate& __err, int __base)
 {
@@ -840,7 +840,7 @@ long double __do_strtod<long double>(const char* __a, char** __p2) {
 }
 
 template <class _Tp>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 _Tp
 __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
 {
@@ -1384,7 +1384,7 @@ locale::id
 num_put<_CharT, _OutputIterator>::id;
 
 template <class _CharT, class _OutputIterator>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 _OutputIterator
 __pad_and_output(_OutputIterator __s,
                  const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
@@ -1407,7 +1407,7 @@ __pad_and_output(_OutputIterator __s,
 }
 
 template <class _CharT, class _Traits>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 ostreambuf_iterator<_CharT, _Traits>
 __pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s,
                  const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
@@ -1646,7 +1646,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>;
 #endif
 
 template <class _CharT, class _InputIterator>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 int
 __get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
                      ios_base::iostate& __err, const ctype<_CharT>& __ct, int __n)
@@ -2814,7 +2814,7 @@ money_get<_CharT, _InputIterator>::id;
 _LIBCPP_FUNC_VIS void __do_nothing(void*);
 
 template <class _Tp>
-_LIBCPP_HIDDEN
+_LIBCPP_HIDE_FROM_ABI
 void
 __double_or_nothing(unique_ptr<_Tp, void(*)(void*)>& __b, _Tp*& __n, _Tp*& __e)
 {


        


More information about the libcxx-commits mailing list