[libcxx-commits] [libcxx] [libc++] Rename _LIBCPP_INLINE_VISIBILITY to _LIBCPP_HIDE_FROM_ABI (PR #74095)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 1 07:52:30 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

In preparation for running clang-format on the whole code base, we are also removing mentions of the legacy _LIBCPP_INLINE_VISIBILITY macro in favor of the newer _LIBCPP_HIDE_FROM_ABI.

We're still leaving the definition of _LIBCPP_INLINE_VISIBILITY to avoid creating needless breakage in case some older patches are checked-in with mentions of the old macro. After we branch for LLVM 18, we can do another pass to clean up remaining uses of the macro that might have gotten introduced by mistake (if any) and remove the macro itself at the same time. This is just a minor convenience to smooth out the transition as much as possible.

See https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all for the clang-format proposal.

---

Patch is 1.27 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/74095.diff


234 Files Affected:

- (modified) libcxx/.clang-format (-1) 
- (modified) libcxx/docs/Contributing.rst (-2) 
- (modified) libcxx/docs/DesignDocs/VisibilityMacros.rst (-4) 
- (modified) libcxx/include/__algorithm/any_of.h (+1-1) 
- (modified) libcxx/include/__algorithm/binary_search.h (+2-2) 
- (modified) libcxx/include/__algorithm/comp_ref_type.h (+2-2) 
- (modified) libcxx/include/__algorithm/copy.h (+1-1) 
- (modified) libcxx/include/__algorithm/copy_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/copy_n.h (+2-2) 
- (modified) libcxx/include/__algorithm/count_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/fill.h (+3-3) 
- (modified) libcxx/include/__algorithm/fill_n.h (+2-2) 
- (modified) libcxx/include/__algorithm/find.h (+1-1) 
- (modified) libcxx/include/__algorithm/find_first_of.h (+2-2) 
- (modified) libcxx/include/__algorithm/find_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/find_if_not.h (+1-1) 
- (modified) libcxx/include/__algorithm/for_each_n.h (+1-1) 
- (modified) libcxx/include/__algorithm/generate.h (+1-1) 
- (modified) libcxx/include/__algorithm/generate_n.h (+1-1) 
- (modified) libcxx/include/__algorithm/half_positive.h (+2-2) 
- (modified) libcxx/include/__algorithm/inplace_merge.h (+4-4) 
- (modified) libcxx/include/__algorithm/is_heap.h (+2-2) 
- (modified) libcxx/include/__algorithm/is_sorted.h (+2-2) 
- (modified) libcxx/include/__algorithm/iter_swap.h (+1-1) 
- (modified) libcxx/include/__algorithm/lexicographical_compare.h (+2-2) 
- (modified) libcxx/include/__algorithm/max.h (+4-4) 
- (modified) libcxx/include/__algorithm/merge.h (+2-2) 
- (modified) libcxx/include/__algorithm/min.h (+4-4) 
- (modified) libcxx/include/__algorithm/minmax.h (+3-3) 
- (modified) libcxx/include/__algorithm/mismatch.h (+4-4) 
- (modified) libcxx/include/__algorithm/move_backward.h (+1-1) 
- (modified) libcxx/include/__algorithm/next_permutation.h (+2-2) 
- (modified) libcxx/include/__algorithm/none_of.h (+1-1) 
- (modified) libcxx/include/__algorithm/partial_sort.h (+2-2) 
- (modified) libcxx/include/__algorithm/partial_sort_copy.h (+2-2) 
- (modified) libcxx/include/__algorithm/partition.h (+1-1) 
- (modified) libcxx/include/__algorithm/prev_permutation.h (+2-2) 
- (modified) libcxx/include/__algorithm/remove_copy.h (+1-1) 
- (modified) libcxx/include/__algorithm/remove_copy_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/replace.h (+1-1) 
- (modified) libcxx/include/__algorithm/replace_copy.h (+1-1) 
- (modified) libcxx/include/__algorithm/replace_copy_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/replace_if.h (+1-1) 
- (modified) libcxx/include/__algorithm/reverse.h (+3-3) 
- (modified) libcxx/include/__algorithm/reverse_copy.h (+1-1) 
- (modified) libcxx/include/__algorithm/rotate.h (+5-5) 
- (modified) libcxx/include/__algorithm/rotate_copy.h (+1-1) 
- (modified) libcxx/include/__algorithm/sample.h (+4-4) 
- (modified) libcxx/include/__algorithm/search.h (+3-3) 
- (modified) libcxx/include/__algorithm/shift_left.h (+1-1) 
- (modified) libcxx/include/__algorithm/shift_right.h (+1-1) 
- (modified) libcxx/include/__algorithm/stable_partition.h (+1-1) 
- (modified) libcxx/include/__algorithm/swap_ranges.h (+1-1) 
- (modified) libcxx/include/__algorithm/transform.h (+2-2) 
- (modified) libcxx/include/__bit/blsr.h (+3-3) 
- (modified) libcxx/include/__bit/countl.h (+1-1) 
- (modified) libcxx/include/__bit/popcount.h (+3-3) 
- (modified) libcxx/include/__chrono/duration.h (+47-47) 
- (modified) libcxx/include/__chrono/time_point.h (+23-23) 
- (modified) libcxx/include/__config (+5-4) 
- (modified) libcxx/include/__exception/nested_exception.h (+2-2) 
- (modified) libcxx/include/__filesystem/copy_options.h (+7-7) 
- (modified) libcxx/include/__filesystem/directory_entry.h (+60-60) 
- (modified) libcxx/include/__filesystem/directory_options.h (+7-7) 
- (modified) libcxx/include/__filesystem/file_status.h (+7-7) 
- (modified) libcxx/include/__filesystem/operations.h (+3-3) 
- (modified) libcxx/include/__filesystem/path.h (+1-1) 
- (modified) libcxx/include/__filesystem/path_iterator.h (+10-10) 
- (modified) libcxx/include/__filesystem/perm_options.h (+7-7) 
- (modified) libcxx/include/__filesystem/perms.h (+7-7) 
- (modified) libcxx/include/__filesystem/recursive_directory_iterator.h (+18-18) 
- (modified) libcxx/include/__filesystem/u8path.h (+3-3) 
- (modified) libcxx/include/__functional/binary_negate.h (+3-3) 
- (modified) libcxx/include/__functional/bind.h (+14-14) 
- (modified) libcxx/include/__functional/binder1st.h (+4-4) 
- (modified) libcxx/include/__functional/binder2nd.h (+4-4) 
- (modified) libcxx/include/__functional/default_searcher.h (+2-2) 
- (modified) libcxx/include/__functional/function.h (+72-72) 
- (modified) libcxx/include/__functional/mem_fn.h (+3-3) 
- (modified) libcxx/include/__functional/mem_fun_ref.h (+24-24) 
- (modified) libcxx/include/__functional/operations.h (+38-38) 
- (modified) libcxx/include/__functional/pointer_to_binary_function.h (+3-3) 
- (modified) libcxx/include/__functional/pointer_to_unary_function.h (+3-3) 
- (modified) libcxx/include/__functional/reference_wrapper.h (+8-8) 
- (modified) libcxx/include/__functional/unary_negate.h (+3-3) 
- (modified) libcxx/include/__fwd/get.h (+12-12) 
- (modified) libcxx/include/__hash_table (+138-138) 
- (modified) libcxx/include/__iterator/access.h (+8-8) 
- (modified) libcxx/include/__iterator/data.h (+4-4) 
- (modified) libcxx/include/__iterator/distance.h (+3-3) 
- (modified) libcxx/include/__iterator/empty.h (+3-3) 
- (modified) libcxx/include/__iterator/front_insert_iterator.h (+7-7) 
- (modified) libcxx/include/__iterator/insert_iterator.h (+7-7) 
- (modified) libcxx/include/__iterator/istream_iterator.h (+9-9) 
- (modified) libcxx/include/__iterator/istreambuf_iterator.h (+14-14) 
- (modified) libcxx/include/__iterator/next.h (+1-1) 
- (modified) libcxx/include/__iterator/ostream_iterator.h (+6-6) 
- (modified) libcxx/include/__iterator/ostreambuf_iterator.h (+7-7) 
- (modified) libcxx/include/__iterator/prev.h (+1-1) 
- (modified) libcxx/include/__iterator/reverse_access.h (+10-10) 
- (modified) libcxx/include/__iterator/reverse_iterator.h (+31-31) 
- (modified) libcxx/include/__iterator/size.h (+4-4) 
- (modified) libcxx/include/__locale (+127-127) 
- (modified) libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h (+11-11) 
- (modified) libcxx/include/__locale_dir/locale_base_api/locale_guard.h (+2-2) 
- (modified) libcxx/include/__memory/addressof.h (+5-5) 
- (modified) libcxx/include/__memory/allocator.h (+20-20) 
- (modified) libcxx/include/__memory/allocator_arg_t.h (+3-3) 
- (modified) libcxx/include/__memory/allocator_destructor.h (+2-2) 
- (modified) libcxx/include/__memory/allocator_traits.h (+12-12) 
- (modified) libcxx/include/__memory/auto_ptr.h (+15-15) 
- (modified) libcxx/include/__memory/destruct_n.h (+10-10) 
- (modified) libcxx/include/__memory/pointer_traits.h (+8-8) 
- (modified) libcxx/include/__memory/raw_storage_iterator.h (+7-7) 
- (modified) libcxx/include/__memory/shared_ptr.h (+82-82) 
- (modified) libcxx/include/__memory/temporary_buffer.h (+2-2) 
- (modified) libcxx/include/__memory/unique_ptr.h (+76-76) 
- (modified) libcxx/include/__node_handle (+15-15) 
- (modified) libcxx/include/__numeric/accumulate.h (+2-2) 
- (modified) libcxx/include/__numeric/adjacent_difference.h (+2-2) 
- (modified) libcxx/include/__numeric/exclusive_scan.h (+2-2) 
- (modified) libcxx/include/__numeric/gcd_lcm.h (+4-4) 
- (modified) libcxx/include/__numeric/inclusive_scan.h (+3-3) 
- (modified) libcxx/include/__numeric/inner_product.h (+2-2) 
- (modified) libcxx/include/__numeric/iota.h (+1-1) 
- (modified) libcxx/include/__numeric/midpoint.h (+3-3) 
- (modified) libcxx/include/__numeric/partial_sum.h (+2-2) 
- (modified) libcxx/include/__numeric/reduce.h (+3-3) 
- (modified) libcxx/include/__numeric/transform_exclusive_scan.h (+1-1) 
- (modified) libcxx/include/__numeric/transform_inclusive_scan.h (+2-2) 
- (modified) libcxx/include/__numeric/transform_reduce.h (+3-3) 
- (modified) libcxx/include/__random/bernoulli_distribution.h (+18-18) 
- (modified) libcxx/include/__random/binomial_distribution.h (+19-19) 
- (modified) libcxx/include/__random/cauchy_distribution.h (+20-20) 
- (modified) libcxx/include/__random/chi_squared_distribution.h (+18-18) 
- (modified) libcxx/include/__random/clamp_to_integral.h (+2-2) 
- (modified) libcxx/include/__random/discard_block_engine.h (+14-14) 
- (modified) libcxx/include/__random/discrete_distribution.h (+19-19) 
- (modified) libcxx/include/__random/exponential_distribution.h (+17-17) 
- (modified) libcxx/include/__random/extreme_value_distribution.h (+19-19) 
- (modified) libcxx/include/__random/fisher_f_distribution.h (+19-19) 
- (modified) libcxx/include/__random/gamma_distribution.h (+19-19) 
- (modified) libcxx/include/__random/geometric_distribution.h (+18-18) 
- (modified) libcxx/include/__random/independent_bits_engine.h (+18-18) 
- (modified) libcxx/include/__random/linear_congruential_engine.h (+27-27) 
- (modified) libcxx/include/__random/lognormal_distribution.h (+22-22) 
- (modified) libcxx/include/__random/mersenne_twister_engine.h (+14-14) 
- (modified) libcxx/include/__random/negative_binomial_distribution.h (+19-19) 
- (modified) libcxx/include/__random/normal_distribution.h (+19-19) 
- (modified) libcxx/include/__random/piecewise_constant_distribution.h (+19-19) 
- (modified) libcxx/include/__random/piecewise_linear_distribution.h (+19-19) 
- (modified) libcxx/include/__random/poisson_distribution.h (+16-16) 
- (modified) libcxx/include/__random/random_device.h (+2-2) 
- (modified) libcxx/include/__random/seed_seq.h (+6-6) 
- (modified) libcxx/include/__random/shuffle_order_engine.h (+22-22) 
- (modified) libcxx/include/__random/student_t_distribution.h (+17-17) 
- (modified) libcxx/include/__random/subtract_with_carry_engine.h (+11-11) 
- (modified) libcxx/include/__random/uniform_real_distribution.h (+19-19) 
- (modified) libcxx/include/__random/weibull_distribution.h (+20-20) 
- (modified) libcxx/include/__string/char_traits.h (+28-28) 
- (modified) libcxx/include/__thread/this_thread.h (+2-2) 
- (modified) libcxx/include/__thread/thread.h (+15-15) 
- (modified) libcxx/include/__thread/timed_backoff_policy.h (+1-1) 
- (modified) libcxx/include/__threading_support (+1-1) 
- (modified) libcxx/include/__tree (+122-122) 
- (modified) libcxx/include/__type_traits/integral_constant.h (+2-2) 
- (modified) libcxx/include/__type_traits/invoke.h (+7-7) 
- (modified) libcxx/include/__type_traits/is_constant_evaluated.h (+1-1) 
- (modified) libcxx/include/__type_traits/is_swappable.h (+2-2) 
- (modified) libcxx/include/__utility/cmp.h (+7-7) 
- (modified) libcxx/include/__utility/convert_to_integral.h (+10-10) 
- (modified) libcxx/include/__utility/exchange.h (+1-1) 
- (modified) libcxx/include/__utility/integer_sequence.h (+1-1) 
- (modified) libcxx/include/__utility/rel_ops.h (+4-4) 
- (modified) libcxx/include/__utility/swap.h (+2-2) 
- (modified) libcxx/include/__utility/to_underlying.h (+2-2) 
- (modified) libcxx/include/any (+50-50) 
- (modified) libcxx/include/array (+62-62) 
- (modified) libcxx/include/barrier (+19-19) 
- (modified) libcxx/include/bitset (+75-75) 
- (modified) libcxx/include/cmath (+10-10) 
- (modified) libcxx/include/codecvt (+18-18) 
- (modified) libcxx/include/complex (+109-109) 
- (modified) libcxx/include/condition_variable (+7-7) 
- (modified) libcxx/include/experimental/__memory (+4-4) 
- (modified) libcxx/include/experimental/propagate_const (+25-25) 
- (modified) libcxx/include/ext/__hash (+11-11) 
- (modified) libcxx/include/ext/hash_map (+105-105) 
- (modified) libcxx/include/ext/hash_set (+60-60) 
- (modified) libcxx/include/forward_list (+87-87) 
- (modified) libcxx/include/fstream (+48-48) 
- (modified) libcxx/include/future (+131-131) 
- (modified) libcxx/include/initializer_list (+7-7) 
- (modified) libcxx/include/iomanip (+31-31) 
- (modified) libcxx/include/ios (+84-84) 
- (modified) libcxx/include/iosfwd (+2-2) 
- (modified) libcxx/include/istream (+21-21) 
- (modified) libcxx/include/latch (+5-5) 
- (modified) libcxx/include/limits (+90-90) 
- (modified) libcxx/include/list (+102-102) 
- (modified) libcxx/include/locale (+88-88) 
- (modified) libcxx/include/map (+236-236) 
- (modified) libcxx/include/mutex (+13-13) 
- (modified) libcxx/include/new (+12-12) 
- (modified) libcxx/include/optional (+113-113) 
- (modified) libcxx/include/ostream (+9-9) 
- (modified) libcxx/include/queue (+64-64) 
- (modified) libcxx/include/regex (+195-195) 
- (modified) libcxx/include/scoped_allocator (+46-46) 
- (modified) libcxx/include/semaphore (+11-11) 
- (modified) libcxx/include/set (+168-168) 
- (modified) libcxx/include/span (+57-57) 
- (modified) libcxx/include/sstream (+25-25) 
- (modified) libcxx/include/stack (+30-30) 
- (modified) libcxx/include/stdexcept (+24-24) 
- (modified) libcxx/include/stdlib.h (+7-7) 
- (modified) libcxx/include/streambuf (+7-7) 
- (modified) libcxx/include/string_view (+89-89) 
- (modified) libcxx/include/strstream (+31-31) 
- (modified) libcxx/include/tuple (+99-99) 
- (modified) libcxx/include/typeindex (+10-10) 
- (modified) libcxx/include/typeinfo (+24-24) 
- (modified) libcxx/include/unordered_map (+230-230) 
- (modified) libcxx/include/unordered_set (+150-150) 
- (modified) libcxx/include/valarray (+287-287) 
- (modified) libcxx/include/variant (+5-5) 
- (modified) libcxx/include/wchar.h (+15-15) 
- (modified) libcxx/src/condition_variable_destructor.cpp (+1-1) 
- (modified) libcxx/src/hash.cpp (+2-2) 
- (modified) libcxx/src/include/atomic_support.h (+12-12) 
- (modified) libcxx/src/include/sso_allocator.h (+8-8) 
- (modified) libcxx/src/mutex_destructor.cpp (+1-1) 
- (modified) libcxx/src/support/win32/thread_win32.cpp (+2-2) 
- (modified) libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/noncopyable_return_type.pass.cpp (+1-1) 


``````````diff
diff --git a/libcxx/.clang-format b/libcxx/.clang-format
index 16948dbee314c09..56bdf2b5f911659 100644
--- a/libcxx/.clang-format
+++ b/libcxx/.clang-format
@@ -37,7 +37,6 @@ AttributeMacros: [
                   '_LIBCPP_HIDDEN',
                   '_LIBCPP_HIDE_FROM_ABI_AFTER_V1',
                   '_LIBCPP_HIDE_FROM_ABI',
-                  '_LIBCPP_INLINE_VISIBILITY',
                   '_LIBCPP_INTERNAL_LINKAGE',
                   '_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS',
                   '_LIBCPP_NO_SANITIZE',
diff --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
index ae883841851698a..4cd0568989f8507 100644
--- a/libcxx/docs/Contributing.rst
+++ b/libcxx/docs/Contributing.rst
@@ -68,8 +68,6 @@ In general, try to follow the style of existing code. There are a few
 exceptions:
 
 - ``_VSTD::foo`` is no longer used in new code. Use ``std::foo`` instead.
-- ``_LIBCPP_INLINE_VISIBILITY`` is no longer used in new code. Use
-  ``_LIBCPP_HIDE_FROM_ABI`` instead.
 - Prefer ``using foo = int`` over ``typedef int foo``. The compilers supported
   by libc++ accept alias declarations in all standard modes.
 
diff --git a/libcxx/docs/DesignDocs/VisibilityMacros.rst b/libcxx/docs/DesignDocs/VisibilityMacros.rst
index b0566ab60446330..83a9a62942bc97f 100644
--- a/libcxx/docs/DesignDocs/VisibilityMacros.rst
+++ b/libcxx/docs/DesignDocs/VisibilityMacros.rst
@@ -49,10 +49,6 @@ Visibility Macros
   Mark a function as not being part of the ABI of any final linked image that
   uses it.
 
-**_LIBCPP_INLINE_VISIBILITY**
-  Historical predecessor of ``_LIBCPP_HIDE_FROM_ABI`` -- please use
-  ``_LIBCPP_HIDE_FROM_ABI`` instead.
-
 **_LIBCPP_HIDE_FROM_ABI_AFTER_V1**
   Mark a function as being hidden from the ABI (per `_LIBCPP_HIDE_FROM_ABI`)
   when libc++ is built with an ABI version after ABI v1. This macro is used to
diff --git a/libcxx/include/__algorithm/any_of.h b/libcxx/include/__algorithm/any_of.h
index fe0882816b9b78c..8ba7aae2b225e17 100644
--- a/libcxx/include/__algorithm/any_of.h
+++ b/libcxx/include/__algorithm/any_of.h
@@ -19,7 +19,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
 any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (__pred(*__first))
diff --git a/libcxx/include/__algorithm/binary_search.h b/libcxx/include/__algorithm/binary_search.h
index 0c8f5545e066ef4..5a1d49f5f43e27d 100644
--- a/libcxx/include/__algorithm/binary_search.h
+++ b/libcxx/include/__algorithm/binary_search.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Tp, class _Compare>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
 {
@@ -33,7 +33,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
 
 template <class _ForwardIterator, class _Tp>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h
index 2aeb55f550b53c2..2797e9da6658504 100644
--- a/libcxx/include/__algorithm/comp_ref_type.h
+++ b/libcxx/include/__algorithm/comp_ref_type.h
@@ -47,7 +47,7 @@ struct __debug_less
 
     template <class _LHS, class _RHS>
     _LIBCPP_CONSTEXPR_SINCE_CXX14
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCPP_HIDE_FROM_ABI
     decltype((void)std::declval<_Compare&>()(
         std::declval<_LHS &>(), std::declval<_RHS &>()))
     __do_compare_assert(int, _LHS & __l, _RHS & __r) {
@@ -59,7 +59,7 @@ struct __debug_less
 
     template <class _LHS, class _RHS>
     _LIBCPP_CONSTEXPR_SINCE_CXX14
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCPP_HIDE_FROM_ABI
     void __do_compare_assert(long, _LHS &, _RHS &) {}
 };
 
diff --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h
index b35c6fa04a38149..4c3815405af0cf6 100644
--- a/libcxx/include/__algorithm/copy.h
+++ b/libcxx/include/__algorithm/copy.h
@@ -113,7 +113,7 @@ __copy(_InIter __first, _Sent __last, _OutIter __result) {
 }
 
 template <class _InputIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
 copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
   return std::__copy<_ClassicAlgPolicy>(__first, __last, __result).second;
 }
diff --git a/libcxx/include/__algorithm/copy_if.h b/libcxx/include/__algorithm/copy_if.h
index a5938b8719daa8b..d68d1dbbadf8aca 100644
--- a/libcxx/include/__algorithm/copy_if.h
+++ b/libcxx/include/__algorithm/copy_if.h
@@ -18,7 +18,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template<class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 copy_if(_InputIterator __first, _InputIterator __last,
         _OutputIterator __result, _Predicate __pred)
diff --git a/libcxx/include/__algorithm/copy_n.h b/libcxx/include/__algorithm/copy_n.h
index c138d59e97956c2..19f3f729c3d0819 100644
--- a/libcxx/include/__algorithm/copy_n.h
+++ b/libcxx/include/__algorithm/copy_n.h
@@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template<class _InputIterator, class _Size, class _OutputIterator,
          __enable_if_t<__has_input_iterator_category<_InputIterator>::value &&
                        !__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
@@ -46,7 +46,7 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 
 template<class _InputIterator, class _Size, class _OutputIterator,
          __enable_if_t<__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
 {
diff --git a/libcxx/include/__algorithm/count_if.h b/libcxx/include/__algorithm/count_if.h
index b96521fe0a856c0..04f52b894f8bd41 100644
--- a/libcxx/include/__algorithm/count_if.h
+++ b/libcxx/include/__algorithm/count_if.h
@@ -20,7 +20,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
     typename iterator_traits<_InputIterator>::difference_type
     count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   typename iterator_traits<_InputIterator>::difference_type __r(0);
diff --git a/libcxx/include/__algorithm/fill.h b/libcxx/include/__algorithm/fill.h
index 0753c427ae4ed32..e59c4963851d306 100644
--- a/libcxx/include/__algorithm/fill.h
+++ b/libcxx/include/__algorithm/fill.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 void
 __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, forward_iterator_tag)
 {
@@ -31,7 +31,7 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, fo
 }
 
 template <class _RandomAccessIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 void
 __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value, random_access_iterator_tag)
 {
@@ -39,7 +39,7 @@ __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& _
 }
 
 template <class _ForwardIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 void
 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
 {
diff --git a/libcxx/include/__algorithm/fill_n.h b/libcxx/include/__algorithm/fill_n.h
index e7863ac7ec7e802..c2dfbf11975899a 100644
--- a/libcxx/include/__algorithm/fill_n.h
+++ b/libcxx/include/__algorithm/fill_n.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // fill_n isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
 
 template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 {
@@ -32,7 +32,7 @@ __fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 }
 
 template <class _OutputIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 fill_n(_OutputIterator __first, _Size __n, const _Tp& __value)
 {
diff --git a/libcxx/include/__algorithm/find.h b/libcxx/include/__algorithm/find.h
index d7c268bc6b338b0..0118489d94699d5 100644
--- a/libcxx/include/__algorithm/find.h
+++ b/libcxx/include/__algorithm/find.h
@@ -119,7 +119,7 @@ __find_impl(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst>
 }
 
 template <class _InputIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
 find(_InputIterator __first, _InputIterator __last, const _Tp& __value) {
   __identity __proj;
   return std::__rewrap_iter(
diff --git a/libcxx/include/__algorithm/find_first_of.h b/libcxx/include/__algorithm/find_first_of.h
index 12f0109a616c3e6..c386687d46ffee3 100644
--- a/libcxx/include/__algorithm/find_first_of.h
+++ b/libcxx/include/__algorithm/find_first_of.h
@@ -35,14 +35,14 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator1 __find_first_of_ce(_ForwardItera
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1
 find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
               _ForwardIterator2 __last2, _BinaryPredicate __pred) {
   return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
 }
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of(
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator1 find_first_of(
     _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2) {
   return std::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to());
 }
diff --git a/libcxx/include/__algorithm/find_if.h b/libcxx/include/__algorithm/find_if.h
index f4ef3ac31cfefb5..09a39f646351c37 100644
--- a/libcxx/include/__algorithm/find_if.h
+++ b/libcxx/include/__algorithm/find_if.h
@@ -19,7 +19,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
 find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (__pred(*__first))
diff --git a/libcxx/include/__algorithm/find_if_not.h b/libcxx/include/__algorithm/find_if_not.h
index 96c159cf5ed3008..bf29ebb7cdd93c7 100644
--- a/libcxx/include/__algorithm/find_if_not.h
+++ b/libcxx/include/__algorithm/find_if_not.h
@@ -19,7 +19,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Predicate>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator
 find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
   for (; __first != __last; ++__first)
     if (!__pred(*__first))
diff --git a/libcxx/include/__algorithm/for_each_n.h b/libcxx/include/__algorithm/for_each_n.h
index 5bd7318224d171d..7006bafe7304610 100644
--- a/libcxx/include/__algorithm/for_each_n.h
+++ b/libcxx/include/__algorithm/for_each_n.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 #if _LIBCPP_STD_VER >= 17
 
 template <class _InputIterator, class _Size, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator for_each_n(_InputIterator __first,
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _InputIterator for_each_n(_InputIterator __first,
                                                                                          _Size __orig_n,
                                                                                          _Function __f) {
   typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
diff --git a/libcxx/include/__algorithm/generate.h b/libcxx/include/__algorithm/generate.h
index 48e21b51e6c4c99..e2051dc16dc03e6 100644
--- a/libcxx/include/__algorithm/generate.h
+++ b/libcxx/include/__algorithm/generate.h
@@ -18,7 +18,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 void
 generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
 {
diff --git a/libcxx/include/__algorithm/generate_n.h b/libcxx/include/__algorithm/generate_n.h
index ff5c82d3e422121..1c8194c3c071b77 100644
--- a/libcxx/include/__algorithm/generate_n.h
+++ b/libcxx/include/__algorithm/generate_n.h
@@ -19,7 +19,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _OutputIterator, class _Size, class _Generator>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 _OutputIterator
 generate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)
 {
diff --git a/libcxx/include/__algorithm/half_positive.h b/libcxx/include/__algorithm/half_positive.h
index e90666d1342f3d3..2315e154fb2ef50 100644
--- a/libcxx/include/__algorithm/half_positive.h
+++ b/libcxx/include/__algorithm/half_positive.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 // Perform division by two quickly for positive integers (llvm.org/PR39129)
 
 template <typename _Integral, __enable_if_t<is_integral<_Integral>::value, int> = 0>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
 _Integral
 __half_positive(_Integral __value)
 {
@@ -31,7 +31,7 @@ __half_positive(_Integral __value)
 }
 
 template <typename _Tp, __enable_if_t<!is_integral<_Tp>::value, int> = 0>
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
 _Tp
 __half_positive(_Tp __value)
 {
diff --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h
index 44a9425559ef12d..a3dad4668cbd9b4 100644
--- a/libcxx/include/__algorithm/inplace_merge.h
+++ b/libcxx/include/__algorithm/inplace_merge.h
@@ -44,17 +44,17 @@ class __invert // invert the sense of a comparison
 private:
     _Predicate __p_;
 public:
-    _LIBCPP_INLINE_VISIBILITY __invert() {}
+    _LIBCPP_HIDE_FROM_ABI __invert() {}
 
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_HIDE_FROM_ABI
     explicit __invert(_Predicate __p) : __p_(__p) {}
 
     template <class _T1>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_HIDE_FROM_ABI
     bool operator()(const _T1& __x) {return !__p_(__x);}
 
     template <class _T1, class _T2>
-    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_HIDE_FROM_ABI
     bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);}
 };
 
diff --git a/libcxx/include/__algorithm/is_heap.h b/libcxx/include/__algorithm/is_heap.h
index 93d84d33806e18b..77cbe019ec0bad5 100644
--- a/libcxx/include/__algorithm/is_heap.h
+++ b/libcxx/include/__algorithm/is_heap.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _RandomAccessIterator, class _Compare>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
 {
@@ -32,7 +32,7 @@ is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __
 
 template<class _RandomAccessIterator>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
 {
diff --git a/libcxx/include/__algorithm/is_sorted.h b/libcxx/include/__algorithm/is_sorted.h
index a321c2c12dc4ebc..69374962c105a24 100644
--- a/libcxx/include/__algorithm/is_sorted.h
+++ b/libcxx/include/__algorithm/is_sorted.h
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator, class _Compare>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 {
@@ -32,7 +32,7 @@ is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
 
 template<class _ForwardIterator>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 is_sorted(_ForwardIterator __first, _ForwardIterator __last)
 {
diff --git a/libcxx/include/__algorithm/iter_swap.h b/libcxx/include/__algorithm/iter_swap.h
index 44422b5de0f0740..f647e74324674e6 100644
--- a/libcxx/include/__algorithm/iter_swap.h
+++ b/libcxx/include/__algorithm/iter_swap.h
@@ -20,7 +20,7 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void iter_swap(_ForwardIterator1 __a,
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void iter_swap(_ForwardIterator1 __a,
                                                                               _ForwardIterator2 __b)
     //                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
     _NOEXCEPT_(_NOEXCEPT_(swap(*std::declval<_ForwardIterator1>(), *std::declval<_ForwardIterator2>()))) {
diff --git a/libcxx/include/__algorithm/lexicographical_compare.h b/libcxx/include/__algorithm/lexicographical_compare.h
index 62b72edc80f7731..9a5b657b7f91b13 100644
--- a/libcxx/include/__algorithm/lexicographical_compare.h
+++ b/libcxx/include/__algorithm/lexicographical_compare.h
@@ -37,7 +37,7 @@ __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
 
 template <class _InputIterator1, class _InputIterator2, class _Compare>
 _LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
 bool
 lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                         _InputIterator2 __first2, _InputIterator2 __last2, _Compa...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/74095


More information about the libcxx-commits mailing list