[libcxx-commits] [libcxx] [libc++] Introduce ABI sensitive areas to avoid requiring _LIBCPP_HIDE_FROM_ABI everywhere (PR #131156)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 12 03:33:41 PDT 2025


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/131156

>From 18faeef2a80f206e83d4ff983e4ec3bcdafc0a10 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Mon, 3 Mar 2025 22:11:03 +0100
Subject: [PATCH] [libc++] Introduce macros for hiding ranges of functions from
 the ABI

---
 libcxx/include/__algorithm/shuffle.h          |   2 +
 libcxx/include/__algorithm/sort.h             |  63 +++++-----
 libcxx/include/__atomic/atomic_sync.h         |   2 +
 .../__charconv/from_chars_floating_point.h    |   2 +
 .../__charconv/to_chars_floating_point.h      |   9 +-
 libcxx/include/__chrono/file_clock.h          |   2 +
 libcxx/include/__chrono/steady_clock.h        |   2 +
 libcxx/include/__chrono/system_clock.h        |   2 +
 .../__condition_variable/condition_variable.h |   2 +
 libcxx/include/__config                       |  20 +++-
 .../include/__expected/bad_expected_access.h  |   2 +
 libcxx/include/__filesystem/directory_entry.h |   2 +
 .../include/__filesystem/directory_iterator.h |   2 +
 .../include/__filesystem/filesystem_error.h   |   2 +
 libcxx/include/__filesystem/operations.h      |   2 +
 libcxx/include/__filesystem/path.h            |   2 +
 libcxx/include/__filesystem/path_iterator.h   |   2 +
 .../recursive_directory_iterator.h            |   2 +
 libcxx/include/__functional/function.h        |   2 +
 libcxx/include/__hash_table                   |   2 +
 libcxx/include/__locale                       |   2 +
 libcxx/include/__memory/align.h               |   2 +
 libcxx/include/__memory/shared_count.h        |   2 +
 libcxx/include/__memory/shared_ptr.h          |   4 +
 .../__memory_resource/memory_resource.h       |   2 +
 .../monotonic_buffer_resource.h               |   2 +
 .../synchronized_pool_resource.h              |   2 +
 .../unsynchronized_pool_resource.h            |   2 +
 libcxx/include/__mutex/mutex.h                |   2 +
 libcxx/include/__mutex/once_flag.h            |   2 +
 libcxx/include/__ostream/basic_ostream.h      |   2 +
 libcxx/include/__ostream/print.h              |   2 +
 .../include/__random/binomial_distribution.h  |   2 +
 libcxx/include/__random/random_device.h       |   2 +
 libcxx/include/__split_buffer                 | 108 ++++++++----------
 .../include/__system_error/error_category.h   |   4 +
 libcxx/include/__system_error/error_code.h    |   2 +
 .../include/__system_error/error_condition.h  |   2 +
 libcxx/include/__system_error/system_error.h  |   2 +
 .../__system_error/throw_system_error.h       |   2 +
 libcxx/include/__thread/this_thread.h         |   2 +
 libcxx/include/__thread/thread.h              |   2 +
 libcxx/include/__verbose_abort                |   2 +
 libcxx/include/barrier                        |   2 +
 libcxx/include/codecvt                        |   2 +
 libcxx/include/condition_variable             |   2 +
 libcxx/include/fstream                        |   2 +
 libcxx/include/future                         |   2 +
 libcxx/include/ios                            |   2 +
 libcxx/include/istream                        |   2 +
 libcxx/include/locale                         |   2 +
 libcxx/include/mutex                          |   2 +
 libcxx/include/print                          |   2 +
 libcxx/include/regex                          |   2 +
 libcxx/include/shared_mutex                   |   4 +
 libcxx/include/sstream                        |   2 +
 libcxx/include/stdexcept                      |   2 +
 libcxx/include/streambuf                      |   2 +
 libcxx/include/string                         |   2 +
 libcxx/include/strstream                      |   2 +
 libcxx/include/valarray                       |   2 +
 libcxx/src/algorithm.cpp                      |   2 +
 libcxx/src/atomic.cpp                         |   2 +
 libcxx/src/barrier.cpp                        |   2 +
 libcxx/src/call_once.cpp                      |   2 +
 libcxx/src/charconv.cpp                       |   3 +
 libcxx/src/chrono.cpp                         |   2 +
 libcxx/src/condition_variable.cpp             |   2 +
 libcxx/src/condition_variable_destructor.cpp  |   2 +
 libcxx/src/error_category.cpp                 |   2 +
 libcxx/src/expected.cpp                       |   4 +
 libcxx/src/filesystem/directory_entry.cpp     |   2 +
 libcxx/src/filesystem/directory_iterator.cpp  |   2 +
 libcxx/src/filesystem/filesystem_clock.cpp    |   2 +
 libcxx/src/filesystem/filesystem_error.cpp    |   2 +
 libcxx/src/filesystem/operations.cpp          |   2 +
 libcxx/src/filesystem/path.cpp                |   2 +
 libcxx/src/functional.cpp                     |   2 +
 libcxx/src/future.cpp                         |   2 +
 libcxx/src/hash.cpp                           |   2 +
 libcxx/src/ios.cpp                            |   2 +
 libcxx/src/iostream.cpp                       |   2 +
 libcxx/src/locale.cpp                         |   2 +
 libcxx/src/memory.cpp                         |   2 +
 libcxx/src/memory_resource.cpp                |   2 +
 libcxx/src/mutex.cpp                          |   2 +
 libcxx/src/mutex_destructor.cpp               |   2 +
 libcxx/src/ostream.cpp                        |   2 +
 libcxx/src/print.cpp                          |   2 +
 libcxx/src/random.cpp                         |   2 +
 libcxx/src/random_shuffle.cpp                 |   2 +
 libcxx/src/regex.cpp                          |   2 +
 libcxx/src/shared_mutex.cpp                   |   2 +
 libcxx/src/std_stream.h                       |   2 +
 libcxx/src/stdexcept.cpp                      |   2 +
 libcxx/src/string.cpp                         |   2 +
 libcxx/src/strstream.cpp                      |   2 +
 libcxx/src/system_error.cpp                   |   2 +
 libcxx/src/thread.cpp                         |   2 +
 libcxx/src/valarray.cpp                       |   2 +
 libcxx/src/vector.cpp                         |   2 +
 libcxx/src/verbose_abort.cpp                  |   2 +
 102 files changed, 305 insertions(+), 100 deletions(-)

diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h
index 7177fbb469ba7..37999364797c6 100644
--- a/libcxx/include/__algorithm/shuffle.h
+++ b/libcxx/include/__algorithm/shuffle.h
@@ -65,6 +65,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __libcpp_debug_randomizer {
 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) || defined(_LIBCPP_BUILDING_LIBRARY)
 class _LIBCPP_EXPORTED_FROM_ABI __rs_default;
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
 
 class _LIBCPP_EXPORTED_FROM_ABI __rs_default {
@@ -90,6 +91,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __rs_default {
 };
 
 _LIBCPP_EXPORTED_FROM_ABI __rs_default __rs_get();
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _RandomAccessIterator>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX14 void
diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h
index 4332b62544b40..4369ff1ba8d78 100644
--- a/libcxx/include/__algorithm/sort.h
+++ b/libcxx/include/__algorithm/sort.h
@@ -62,7 +62,7 @@ enum { __block_size = sizeof(uint64_t) * 8 };
 
 // Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.
 template <class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
 __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c) {
   // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -76,7 +76,7 @@ __cond_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _Compare __c)
 // Ensures that *__x, *__y and *__z are ordered according to the comparator __c,
 // under the assumption that *__y and *__z are already ordered.
 template <class _Compare, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
 __partially_sorted_swap(_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
   // Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).
   using value_type = typename iterator_traits<_RandomAccessIterator>::value_type;
@@ -95,7 +95,7 @@ template <class,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
 __sort3(_RandomAccessIterator __x1, _RandomAccessIterator __x2, _RandomAccessIterator __x3, _Compare __c) {
   bool __swapped1 = std::__cond_swap<_Compare>(__x2, __x3, __c);
   bool __swapped2 = std::__partially_sorted_swap<_Compare>(__x1, __x2, __x3, __c);
@@ -106,7 +106,7 @@ template <class _AlgPolicy,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
+inline _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
 __sort3(_RandomAccessIterator __x, _RandomAccessIterator __y, _RandomAccessIterator __z, _Compare __c) {
   using _Ops = _IterOps<_AlgPolicy>;
 
@@ -138,7 +138,7 @@ template <class,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __sort4(_RandomAccessIterator __x1,
         _RandomAccessIterator __x2,
         _RandomAccessIterator __x3,
@@ -155,7 +155,7 @@ template <class _AlgPolicy,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __sort4(_RandomAccessIterator __x1,
         _RandomAccessIterator __x2,
         _RandomAccessIterator __x3,
@@ -180,7 +180,7 @@ template <class _AlgPolicy,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __sort5(_RandomAccessIterator __x1,
         _RandomAccessIterator __x2,
         _RandomAccessIterator __x3,
@@ -199,7 +199,7 @@ template <class _AlgPolicy,
           class _Compare,
           class _RandomAccessIterator,
           __enable_if_t<!__use_branchless_sort<_Compare, _RandomAccessIterator>, int> = 0>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __sort5(_RandomAccessIterator __x1,
         _RandomAccessIterator __x2,
         _RandomAccessIterator __x3,
@@ -225,7 +225,7 @@ __sort5(_RandomAccessIterator __x1,
 
 // Assumes size > 0
 template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
+_LIBCPP_CONSTEXPR_SINCE_CXX14 void
 __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
   _BidirectionalIterator __lm1 = __last;
   for (--__lm1; __first != __lm1; ++__first) {
@@ -238,7 +238,7 @@ __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
 // Sort the iterator range [__first, __last) using the comparator __comp using
 // the insertion sort algorithm.
 template <class _AlgPolicy, class _Compare, class _BidirectionalIterator>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void
+_LIBCPP_CONSTEXPR_SINCE_CXX26 void
 __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
 
@@ -268,8 +268,7 @@ __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last,
 // Assumes that there is an element in the position (__first - 1) and that each
 // element in the input range is greater or equal to the element at __first - 1.
 template <class _AlgPolicy, class _Compare, class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI void
-__insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
+void __insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIterator __last, _Compare __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
   typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -296,8 +295,7 @@ __insertion_sort_unguarded(_RandomAccessIterator const __first, _RandomAccessIte
 }
 
 template <class _AlgPolicy, class _Comp, class _RandomAccessIterator>
-_LIBCPP_HIDE_FROM_ABI bool
-__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
+bool __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
 
   typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -350,7 +348,7 @@ __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
+inline void __swap_bitmap_pos(
     _RandomAccessIterator __first, _RandomAccessIterator __last, uint64_t& __left_bitset, uint64_t& __right_bitset) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -368,7 +366,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos(
 template <class _Compare,
           class _RandomAccessIterator,
           class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __populate_left_bitset(_RandomAccessIterator __first, _Compare __comp, _ValueType& __pivot, uint64_t& __left_bitset) {
   // Possible vectorization. With a proper "-march" flag, the following loop
   // will be compiled into a set of SIMD instructions.
@@ -384,7 +382,7 @@ __populate_left_bitset(_RandomAccessIterator __first, _Compare __comp, _ValueTyp
 template <class _Compare,
           class _RandomAccessIterator,
           class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
-inline _LIBCPP_HIDE_FROM_ABI void
+inline void
 __populate_right_bitset(_RandomAccessIterator __lm1, _Compare __comp, _ValueType& __pivot, uint64_t& __right_bitset) {
   // Possible vectorization. With a proper "-march" flag, the following loop
   // will be compiled into a set of SIMD instructions.
@@ -401,7 +399,7 @@ template <class _AlgPolicy,
           class _Compare,
           class _RandomAccessIterator,
           class _ValueType = typename iterator_traits<_RandomAccessIterator>::value_type>
-inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks(
+inline void __bitset_partition_partial_blocks(
     _RandomAccessIterator& __first,
     _RandomAccessIterator& __lm1,
     _Compare __comp,
@@ -448,7 +446,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __bitset_partition_partial_blocks(
 }
 
 template <class _AlgPolicy, class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within(
+inline void __swap_bitmap_pos_within(
     _RandomAccessIterator& __first, _RandomAccessIterator& __lm1, uint64_t& __left_bitset, uint64_t& __right_bitset) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -489,7 +487,7 @@ inline _LIBCPP_HIDE_FROM_ABI void __swap_bitmap_pos_within(
 // __bitset_partition uses bitsets for storing outcomes of the comparisons
 // between the pivot and other elements.
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool>
+std::pair<_RandomAccessIterator, bool>
 __bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
@@ -581,7 +579,7 @@ __bitset_partition(_RandomAccessIterator __first, _RandomAccessIterator __last,
 // the provided range is already sorted, false otherwise.  We assume that the
 // length of the range is at least three elements.
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI std::pair<_RandomAccessIterator, bool>
+std::pair<_RandomAccessIterator, bool>
 __partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -649,7 +647,7 @@ __partition_with_equals_on_right(_RandomAccessIterator __first, _RandomAccessIte
 // Similar to the above function.  Elements equivalent to the pivot are put to
 // the left of the pivot.  Returns the iterator to the pivot element.
 template <class _AlgPolicy, class _RandomAccessIterator, class _Compare>
-_LIBCPP_HIDE_FROM_ABI _RandomAccessIterator
+_RandomAccessIterator
 __partition_with_equals_on_left(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) {
   using _Ops = _IterOps<_AlgPolicy>;
   typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
@@ -827,7 +825,7 @@ void __introsort(_RandomAccessIterator __first,
 }
 
 template <typename _Number>
-inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
+inline _Number __log2i(_Number __n) {
   if (__n == 0)
     return 0;
   if (sizeof(__n) <= sizeof(unsigned))
@@ -845,6 +843,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Number __log2i(_Number __n) {
   return __log2;
 }
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 template <class _Comp, class _RandomAccessIterator>
 void __sort(_RandomAccessIterator, _RandomAccessIterator, _Comp);
 
@@ -873,9 +872,10 @@ extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<float>&, float*>(fl
 extern template _LIBCPP_EXPORTED_FROM_ABI void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
 extern template _LIBCPP_EXPORTED_FROM_ABI void
 __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+_LIBCPP_CONSTEXPR_SINCE_CXX20 void
 __sort_dispatch(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
   typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
   difference_type __depth_limit = 2 * std::__log2i(__last - __first);
@@ -912,20 +912,20 @@ using __sort_is_specialized_in_library _LIBCPP_NODEBUG = __is_any_of<
     long double>;
 
 template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, __less<>&) {
+void __sort_dispatch(_Type* __first, _Type* __last, __less<>&) {
   __less<_Type> __comp;
   std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
 }
 
 template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<_Type>&) {
+void __sort_dispatch(_Type* __first, _Type* __last, less<_Type>&) {
   __less<_Type> __comp;
   std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
 }
 
 #if _LIBCPP_STD_VER >= 14
 template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<>&) {
+void __sort_dispatch(_Type* __first, _Type* __last, less<>&) {
   __less<_Type> __comp;
   std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
 }
@@ -933,14 +933,14 @@ _LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, less<>
 
 #if _LIBCPP_STD_VER >= 20
 template <class _AlgPolicy, class _Type, __enable_if_t<__sort_is_specialized_in_library<_Type>::value, int> = 0>
-_LIBCPP_HIDE_FROM_ABI void __sort_dispatch(_Type* __first, _Type* __last, ranges::less&) {
+void __sort_dispatch(_Type* __first, _Type* __last, ranges::less&) {
   __less<_Type> __comp;
   std::__sort<__less<_Type>&, _Type*>(__first, __last, __comp);
 }
 #endif
 
 template <class _AlgPolicy, class _RandomAccessIterator, class _Comp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
 __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp& __comp) {
   std::__debug_randomize_range<_AlgPolicy>(__first, __last);
 
@@ -954,14 +954,13 @@ __sort_impl(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp&
 }
 
 template <class _RandomAccessIterator, class _Comp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void
 sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) {
   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
 }
 
 template <class _RandomAccessIterator>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
-sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
+inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
   std::sort(__first, __last, __less<>());
 }
 
diff --git a/libcxx/include/__atomic/atomic_sync.h b/libcxx/include/__atomic/atomic_sync.h
index 0dae448d649be..344dd261eb94d 100644
--- a/libcxx/include/__atomic/atomic_sync.h
+++ b/libcxx/include/__atomic/atomic_sync.h
@@ -58,6 +58,7 @@ struct __atomic_waitable< _Tp,
 #if _LIBCPP_STD_VER >= 20
 #  if _LIBCPP_HAS_THREADS
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_one(void const volatile*) _NOEXCEPT;
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void __cxx_atomic_notify_all(void const volatile*) _NOEXCEPT;
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
@@ -73,6 +74,7 @@ _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __cxx_contention_t
 __libcpp_atomic_monitor(__cxx_atomic_contention_t const volatile*) _NOEXCEPT;
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void
 __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile*, __cxx_contention_t) _NOEXCEPT;
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _AtomicWaitable, class _Poll>
 struct __atomic_wait_backoff_impl {
diff --git a/libcxx/include/__charconv/from_chars_floating_point.h b/libcxx/include/__charconv/from_chars_floating_point.h
index 811e518a81db7..d93c98162930d 100644
--- a/libcxx/include/__charconv/from_chars_floating_point.h
+++ b/libcxx/include/__charconv/from_chars_floating_point.h
@@ -35,6 +35,7 @@ struct __from_chars_result {
   errc __ec;
 };
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 template <class _Fp>
 _LIBCPP_EXPORTED_FROM_ABI __from_chars_result<_Fp> __from_chars_floating_point(
     _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
@@ -44,6 +45,7 @@ extern template __from_chars_result<float> __from_chars_floating_point(
 
 extern template __from_chars_result<double> __from_chars_floating_point(
     _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _Fp>
 _LIBCPP_HIDE_FROM_ABI from_chars_result
diff --git a/libcxx/include/__charconv/to_chars_floating_point.h b/libcxx/include/__charconv/to_chars_floating_point.h
index 118f316b21a10..d84373e1818b7 100644
--- a/libcxx/include/__charconv/to_chars_floating_point.h
+++ b/libcxx/include/__charconv/to_chars_floating_point.h
@@ -18,10 +18,11 @@
 #  pragma GCC system_header
 #endif
 
-_LIBCPP_BEGIN_NAMESPACE_STD
-
 #if _LIBCPP_STD_VER >= 17
 
+_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
+
 _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
 to_chars(char* __first, char* __last, float __value);
 
@@ -48,8 +49,10 @@ to_chars(char* __first, char* __last, double __value, chars_format __fmt, int __
 
 _LIBCPP_AVAILABILITY_TO_CHARS_FLOATING_POINT _LIBCPP_EXPORTED_FROM_ABI to_chars_result
 to_chars(char* __first, char* __last, long double __value, chars_format __fmt, int __precision);
-#endif // _LIBCPP_STD_VER >= 17
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
+#endif // _LIBCPP_STD_VER >= 17
+
 #endif // _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H
diff --git a/libcxx/include/__chrono/file_clock.h b/libcxx/include/__chrono/file_clock.h
index b4b7e9dc14e70..6f4beb38ce65d 100644
--- a/libcxx/include/__chrono/file_clock.h
+++ b/libcxx/include/__chrono/file_clock.h
@@ -46,6 +46,7 @@ _LIBCPP_END_NAMESPACE_STD
 
 #ifndef _LIBCPP_CXX03_LANG
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 struct _FilesystemClock {
 #  if _LIBCPP_HAS_INT128
   typedef __int128_t rep;
@@ -74,6 +75,7 @@ struct _FilesystemClock {
   }
 #  endif // _LIBCPP_STD_VER >= 20
 };
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 #endif // !_LIBCPP_CXX03_LANG
 
diff --git a/libcxx/include/__chrono/steady_clock.h b/libcxx/include/__chrono/steady_clock.h
index 1b247b2c28609..2a0c0797272af 100644
--- a/libcxx/include/__chrono/steady_clock.h
+++ b/libcxx/include/__chrono/steady_clock.h
@@ -19,6 +19,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace chrono {
 
@@ -37,6 +38,7 @@ class _LIBCPP_EXPORTED_FROM_ABI steady_clock {
 
 } // namespace chrono
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___CHRONO_STEADY_CLOCK_H
diff --git a/libcxx/include/__chrono/system_clock.h b/libcxx/include/__chrono/system_clock.h
index 5a9eb65bdae7a..fe5a5e5d18f47 100644
--- a/libcxx/include/__chrono/system_clock.h
+++ b/libcxx/include/__chrono/system_clock.h
@@ -20,6 +20,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace chrono {
 
@@ -47,6 +48,7 @@ using sys_days    = sys_time<days>;
 
 } // namespace chrono
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___CHRONO_SYSTEM_CLOCK_H
diff --git a/libcxx/include/__condition_variable/condition_variable.h b/libcxx/include/__condition_variable/condition_variable.h
index 1e8edd5dcb009..3a9757c481f10 100644
--- a/libcxx/include/__condition_variable/condition_variable.h
+++ b/libcxx/include/__condition_variable/condition_variable.h
@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if _LIBCPP_HAS_THREADS
 
@@ -225,6 +226,7 @@ inline void condition_variable::__do_timed_wait(unique_lock<mutex>& __lk,
 
 #endif // _LIBCPP_HAS_THREADS
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/__config b/libcxx/include/__config
index e14632f65b877..4b4c7a3a398a5 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -149,8 +149,8 @@ _LIBCPP_HARDENING_MODE_DEBUG
 
 // } HARDENING
 
-#  define _LIBCPP_TOSTRING2(x) #x
-#  define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
+#  define _LIBCPP_TOSTRING2(...) #__VA_ARGS__
+#  define _LIBCPP_TOSTRING(...) _LIBCPP_TOSTRING2(__VA_ARGS__)
 
 // NOLINTNEXTLINE(libcpp-cpp-version-check)
 #  if __cplusplus < 201103L
@@ -559,6 +559,18 @@ typedef __char32_t char32_t;
 #  endif
 
 // clang-format off
+#  define _LIBCPP_BEGIN_HIDE_FROM_ABI                                                                                  \
+    _LIBCPP_DIAGNOSTIC_PUSH                                                                                            \
+    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wpragma-clang-attribute")                                                       \
+    _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wignored-attributes")                                                           \
+    _Pragma(_LIBCPP_TOSTRING(clang attribute _LibcxxHideFromABI.push(__attribute__((                                   \
+                __exclude_from_explicit_instantiation__, __abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE)))),       \
+            apply_to = function)))                                                                                     \
+    _LIBCPP_DIAGNOSTIC_POP
+#  define _LIBCPP_END_HIDE_FROM_ABI _Pragma("clang attribute _LibcxxHideFromABI.pop")
+
+#  define _LIBCPP_BEGIN_ABI_SENSITIVE _LIBCPP_END_HIDE_FROM_ABI
+#  define _LIBCPP_END_ABI_SENSITIVE _LIBCPP_BEGIN_HIDE_FROM_ABI
 
 // The unversioned namespace is used when we want to be ABI compatible with other standard libraries in some way. There
 // are two main categories where that's the case:
@@ -569,9 +581,9 @@ typedef __char32_t char32_t;
 // If it's not clear whether using the unversioned namespace is the correct thing to do, it's not. The versioned
 // namespace (_LIBCPP_BEGIN_NAMESPACE_STD) should almost always be used.
 #  define _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD                                                                      \
-    _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS namespace _LIBCPP_NAMESPACE_VISIBILITY std {
+    _LIBCPP_PUSH_EXTENSION_DIAGNOSTICS _LIBCPP_BEGIN_HIDE_FROM_ABI namespace _LIBCPP_NAMESPACE_VISIBILITY std {
 
-#  define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_POP_EXTENSION_DIAGNOSTICS
+#  define _LIBCPP_END_UNVERSIONED_NAMESPACE_STD } _LIBCPP_END_HIDE_FROM_ABI _LIBCPP_POP_EXTENSION_DIAGNOSTICS
 
 #  define _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD inline namespace _LIBCPP_ABI_NAMESPACE {
 #  define _LIBCPP_END_NAMESPACE_STD } _LIBCPP_END_UNVERSIONED_NAMESPACE_STD
diff --git a/libcxx/include/__expected/bad_expected_access.h b/libcxx/include/__expected/bad_expected_access.h
index 1b734389e8311..a05af31ecb126 100644
--- a/libcxx/include/__expected/bad_expected_access.h
+++ b/libcxx/include/__expected/bad_expected_access.h
@@ -31,6 +31,7 @@ _LIBCPP_DIAGNOSTIC_PUSH
 #  if !_LIBCPP_AVAILABILITY_HAS_BAD_EXPECTED_ACCESS_KEY_FUNCTION
 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
 #  endif
+_LIBCPP_BEGIN_ABI_SENSITIVE
 template <>
 class _LIBCPP_EXPORTED_FROM_ABI bad_expected_access<void> : public exception {
 protected:
@@ -48,6 +49,7 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_expected_access<void> : public exception {
   _LIBCPP_HIDE_FROM_ABI_VIRTUAL const char* what() const noexcept override { return "bad access to std::expected"; }
 #  endif
 };
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_DIAGNOSTIC_POP
 
 template <class _Err>
diff --git a/libcxx/include/__filesystem/directory_entry.h b/libcxx/include/__filesystem/directory_entry.h
index 5f236cf2648df..c5ac17aca755c 100644
--- a/libcxx/include/__filesystem/directory_entry.h
+++ b/libcxx/include/__filesystem/directory_entry.h
@@ -39,6 +39,7 @@ _LIBCPP_PUSH_MACROS
 #if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
@@ -461,6 +462,7 @@ class __dir_element_proxy {
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 #endif // _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
diff --git a/libcxx/include/__filesystem/directory_iterator.h b/libcxx/include/__filesystem/directory_iterator.h
index f5085b39ebf93..75d3480ee86ce 100644
--- a/libcxx/include/__filesystem/directory_iterator.h
+++ b/libcxx/include/__filesystem/directory_iterator.h
@@ -33,6 +33,7 @@ _LIBCPP_PUSH_MACROS
 #if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
@@ -129,6 +130,7 @@ inline _LIBCPP_HIDE_FROM_ABI directory_iterator end(directory_iterator) noexcept
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 #  if _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h
index 73592bba31da0..658d39ad3ddab 100644
--- a/libcxx/include/__filesystem/filesystem_error.h
+++ b/libcxx/include/__filesystem/filesystem_error.h
@@ -26,6 +26,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY _LIBCPP_EXPORTED_FROM_ABI filesystem_error : public system_error {
 public:
@@ -81,6 +82,7 @@ __throw_filesystem_error(_Args&&...) {
 }
 #  endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__filesystem/operations.h b/libcxx/include/__filesystem/operations.h
index 29b6c2f798bde..44eeed9966061 100644
--- a/libcxx/include/__filesystem/operations.h
+++ b/libcxx/include/__filesystem/operations.h
@@ -33,6 +33,7 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI path __absolute(const path&, error_code* __ec = nullptr);
 _LIBCPP_EXPORTED_FROM_ABI path __canonical(const path&, error_code* __ec = nullptr);
 _LIBCPP_EXPORTED_FROM_ABI bool
@@ -69,6 +70,7 @@ _LIBCPP_EXPORTED_FROM_ABI path __temp_directory_path(error_code* __ec = nullptr)
 _LIBCPP_EXPORTED_FROM_ABI bool __fs_is_empty(const path& __p, error_code* __ec = nullptr);
 _LIBCPP_EXPORTED_FROM_ABI void __permissions(const path&, perms, perm_options, error_code* = nullptr);
 _LIBCPP_EXPORTED_FROM_ABI space_info __space(const path&, error_code* __ec = nullptr);
+_LIBCPP_END_ABI_SENSITIVE
 
 inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p) { return __absolute(__p); }
 inline _LIBCPP_HIDE_FROM_ABI path absolute(const path& __p, error_code& __ec) { return __absolute(__p, &__ec); }
diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index a2c28bfd79bb9..e604ddf2ef39b 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -42,6 +42,7 @@ _LIBCPP_PUSH_MACROS
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
@@ -913,6 +914,7 @@ _LIBCPP_EXPORTED_FROM_ABI size_t hash_value(const path& __p) noexcept;
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 _LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__filesystem/path_iterator.h b/libcxx/include/__filesystem/path_iterator.h
index e0f601662d462..e922526046772 100644
--- a/libcxx/include/__filesystem/path_iterator.h
+++ b/libcxx/include/__filesystem/path_iterator.h
@@ -22,6 +22,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_EXPORTED_FROM_ABI path::iterator {
 public:
@@ -105,6 +106,7 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator!=(const path::iterator& __lhs, const
   return !(__lhs == __rhs);
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__filesystem/recursive_directory_iterator.h b/libcxx/include/__filesystem/recursive_directory_iterator.h
index ad01a9982b690..8a6af3e4b01c6 100644
--- a/libcxx/include/__filesystem/recursive_directory_iterator.h
+++ b/libcxx/include/__filesystem/recursive_directory_iterator.h
@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS
 #if _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
 
@@ -142,6 +143,7 @@ inline _LIBCPP_HIDE_FROM_ABI recursive_directory_iterator end(recursive_director
 
 _LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_POP
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
 
 #  if _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index 8f73d580a0d42..3b15c7d628924 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -57,6 +57,7 @@ _LIBCPP_DIAGNOSTIC_PUSH
 #  if !_LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_KEY_FUNCTION
 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wweak-vtables")
 #  endif
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI bad_function_call : public exception {
 public:
   _LIBCPP_HIDE_FROM_ABI bad_function_call() _NOEXCEPT                                    = default;
@@ -75,6 +76,7 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_function_call : public exception {
   const char* what() const _NOEXCEPT override;
 #  endif
 };
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_DIAGNOSTIC_POP
 
 [[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_function_call() {
diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table
index fca58ca296067..d46bede1a4881 100644
--- a/libcxx/include/__hash_table
+++ b/libcxx/include/__hash_table
@@ -70,7 +70,9 @@ struct __is_hash_value_type : false_type {};
 template <class _One>
 struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI size_t __next_prime(size_t __n);
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _NodePtr>
 struct __hash_node_base {
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 3c290e27c062b..8d61f685e71b1 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -42,6 +42,7 @@
 #  endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_EXPORTED_FROM_ABI locale;
 
@@ -1511,6 +1512,7 @@ private:
 };
 #  endif // _LIBCPP_HAS_WIDE_CHARACTERS
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_HAS_LOCALIZATION
diff --git a/libcxx/include/__memory/align.h b/libcxx/include/__memory/align.h
index 402eac3380925..cf7c3ba76d381 100644
--- a/libcxx/include/__memory/align.h
+++ b/libcxx/include/__memory/align.h
@@ -17,9 +17,11 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_EXPORTED_FROM_ABI void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___MEMORY_ALIGN_H
diff --git a/libcxx/include/__memory/shared_count.h b/libcxx/include/__memory/shared_count.h
index dad20bcabd7ea..0d1b2ad604325 100644
--- a/libcxx/include/__memory/shared_count.h
+++ b/libcxx/include/__memory/shared_count.h
@@ -68,6 +68,7 @@ inline _LIBCPP_HIDE_FROM_ABI _Tp __libcpp_atomic_refcount_decrement(_Tp& __t) _N
 #endif
 }
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI __shared_count {
   __shared_count(const __shared_count&);
   __shared_count& operator=(const __shared_count&);
@@ -131,6 +132,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __shared_weak_count : private __shared_count {
 private:
   virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 6d3da9778f5f3..8b1495e44de70 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -72,6 +72,7 @@ _LIBCPP_PUSH_MACROS
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr : public std::exception {
 public:
   _LIBCPP_HIDE_FROM_ABI bad_weak_ptr() _NOEXCEPT                               = default;
@@ -80,6 +81,7 @@ class _LIBCPP_EXPORTED_FROM_ABI bad_weak_ptr : public std::exception {
   ~bad_weak_ptr() _NOEXCEPT override;
   const char* what() const _NOEXCEPT override;
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 [[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_bad_weak_ptr() {
 #if _LIBCPP_HAS_EXCEPTIONS
@@ -1476,6 +1478,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
 
 #if _LIBCPP_HAS_THREADS
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI __sp_mut {
   void* __lx_;
 
@@ -1492,6 +1495,7 @@ class _LIBCPP_EXPORTED_FROM_ABI __sp_mut {
 };
 
 _LIBCPP_EXPORTED_FROM_ABI __sp_mut& __get_sp_mut(const void*);
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _Tp>
 inline _LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const shared_ptr<_Tp>*) {
diff --git a/libcxx/include/__memory_resource/memory_resource.h b/libcxx/include/__memory_resource/memory_resource.h
index f93f10fe21a2d..d353fd874d54a 100644
--- a/libcxx/include/__memory_resource/memory_resource.h
+++ b/libcxx/include/__memory_resource/memory_resource.h
@@ -21,6 +21,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace pmr {
 
@@ -82,6 +83,7 @@ null_memory_resource() noexcept;
 
 } // namespace pmr
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index 942d490ce3aea..369e8111a1eec 100644
--- a/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -21,6 +21,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace pmr {
 
@@ -112,6 +113,7 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI monotonic_buffer_resour
 
 } // namespace pmr
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__memory_resource/synchronized_pool_resource.h b/libcxx/include/__memory_resource/synchronized_pool_resource.h
index bcc1ac4a172e3..acc852108ed79 100644
--- a/libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -24,6 +24,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace pmr {
 
@@ -86,6 +87,7 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI synchronized_pool_resou
 
 } // namespace pmr
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
index 92da16c559fea..6614f00669914 100644
--- a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -22,6 +22,7 @@
 #if _LIBCPP_STD_VER >= 17
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace pmr {
 
@@ -99,6 +100,7 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_EXPORTED_FROM_ABI unsynchronized_pool_res
 
 } // namespace pmr
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/__mutex/mutex.h b/libcxx/include/__mutex/mutex.h
index 317320287902f..456e5d8da1e1d 100644
--- a/libcxx/include/__mutex/mutex.h
+++ b/libcxx/include/__mutex/mutex.h
@@ -20,6 +20,7 @@
 #if _LIBCPP_HAS_THREADS
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex {
   __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
@@ -46,6 +47,7 @@ class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mut
 
 static_assert(is_nothrow_default_constructible<mutex>::value, "the default constructor for std::mutex must be nothrow");
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP_HAS_THREADS
diff --git a/libcxx/include/__mutex/once_flag.h b/libcxx/include/__mutex/once_flag.h
index 33064499550eb..ac02859428057 100644
--- a/libcxx/include/__mutex/once_flag.h
+++ b/libcxx/include/__mutex/once_flag.h
@@ -119,7 +119,9 @@ void _LIBCPP_HIDE_FROM_ABI __call_once_proxy(void* __vp) {
   (*__p)();
 }
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI void __call_once(volatile once_flag::_State_type&, void*, void (*)(void*));
+_LIBCPP_END_ABI_SENSITIVE
 
 #ifndef _LIBCPP_CXX03_LANG
 
diff --git a/libcxx/include/__ostream/basic_ostream.h b/libcxx/include/__ostream/basic_ostream.h
index f7473a36d8ccc..cae76447b10f8 100644
--- a/libcxx/include/__ostream/basic_ostream.h
+++ b/libcxx/include/__ostream/basic_ostream.h
@@ -39,6 +39,7 @@ _LIBCPP_PUSH_MACROS
 #  include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class _CharT, class _Traits>
 class basic_ostream : virtual public basic_ios<_CharT, _Traits> {
@@ -670,6 +671,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
 #  endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/__ostream/print.h b/libcxx/include/__ostream/print.h
index a4d7506cffc48..fed6a5c90db13 100644
--- a/libcxx/include/__ostream/print.h
+++ b/libcxx/include/__ostream/print.h
@@ -82,7 +82,9 @@ _LIBCPP_HIDE_FROM_ABI inline void vprint_nonunicode(ostream& __os, string_view _
 //   native Unicode API;
 // Whether the returned FILE* is "a terminal capable of displaying Unicode"
 // is determined in the same way as the print(FILE*, ...) overloads.
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os);
+_LIBCPP_END_ABI_SENSITIVE
 
 #    if _LIBCPP_HAS_UNICODE
 template <class = void> // TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).
diff --git a/libcxx/include/__random/binomial_distribution.h b/libcxx/include/__random/binomial_distribution.h
index b4b4340827761..16b57c078cc8a 100644
--- a/libcxx/include/__random/binomial_distribution.h
+++ b/libcxx/include/__random/binomial_distribution.h
@@ -99,7 +99,9 @@ class binomial_distribution {
 
 // The LLVM C library provides this with conflicting `noexcept` attributes.
 #if !defined(_LIBCPP_MSVCRT_LIKE) && !defined(__LLVM_LIBC__)
+_LIBCPP_BEGIN_ABI_SENSITIVE
 extern "C" double lgamma_r(double, int*);
+_LIBCPP_END_ABI_SENSITIVE
 #endif
 
 inline _LIBCPP_HIDE_FROM_ABI double __libcpp_lgamma(double __d) {
diff --git a/libcxx/include/__random/random_device.h b/libcxx/include/__random/random_device.h
index 33ec585cc0efb..370e2c3b19a48 100644
--- a/libcxx/include/__random/random_device.h
+++ b/libcxx/include/__random/random_device.h
@@ -20,6 +20,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if _LIBCPP_HAS_RANDOM_DEVICE
 
@@ -74,6 +75,7 @@ class _LIBCPP_EXPORTED_FROM_ABI random_device {
 
 #endif // _LIBCPP_HAS_RANDOM_DEVICE
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 721d4d497f2a5..9f6f4cebc1de5 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -81,122 +81,108 @@ public:
   __split_buffer(const __split_buffer&)            = delete;
   __split_buffer& operator=(const __split_buffer&) = delete;
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer()
-      _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
       : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr) {}
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(__alloc_rr& __a)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __split_buffer(__alloc_rr& __a)
       : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr), __alloc_(__a) {}
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer(const __alloc_rr& __a)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __split_buffer(const __alloc_rr& __a)
       : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __cap_(nullptr), __alloc_(__a) {}
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
-  __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer(__split_buffer&& __c)
       _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __split_buffer& operator=(__split_buffer&& __c)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer& operator=(__split_buffer&& __c)
       _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value) ||
                  !__alloc_traits::propagate_on_container_move_assignment::value);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~__split_buffer();
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 ~__split_buffer();
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT { return __begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT { return __begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator begin() _NOEXCEPT { return __begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator begin() const _NOEXCEPT { return __begin_; }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT { return __end_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT { return __end_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator end() _NOEXCEPT { return __end_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 const_iterator end() const _NOEXCEPT { return __end_; }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void clear() _NOEXCEPT { __destruct_at_end(__begin_); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const {
-    return static_cast<size_type>(__end_ - __begin_);
-  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type size() const { return static_cast<size_type>(__end_ - __begin_); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const { return __end_ == __begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 bool empty() const { return __end_ == __begin_; }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const {
-    return static_cast<size_type>(__cap_ - __first_);
-  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type capacity() const { return static_cast<size_type>(__cap_ - __first_); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __front_spare() const {
-    return static_cast<size_type>(__begin_ - __first_);
-  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __front_spare() const { return static_cast<size_type>(__begin_ - __first_); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type __back_spare() const {
-    return static_cast<size_type>(__cap_ - __end_);
-  }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 size_type __back_spare() const { return static_cast<size_type>(__cap_ - __end_); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() { return *__begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const { return *__begin_; }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() { return *(__end_ - 1); }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const { return *(__end_ - 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() { return *__begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const { return *__begin_; }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() { return *(__end_ - 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const { return *(__end_ - 1); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void shrink_to_fit() _NOEXCEPT;
 
   template <class... _Args>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_front(_Args&&... __args);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void emplace_front(_Args&&... __args);
   template <class... _Args>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void emplace_back(_Args&&... __args);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void emplace_back(_Args&&... __args);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_front() { __destruct_at_begin(__begin_ + 1); }
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void pop_back() { __destruct_at_end(__end_ - 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_front() { __destruct_at_begin(__begin_ + 1); }
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back() { __destruct_at_end(__end_ - 1); }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end(size_type __n);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end(size_type __n, const_reference __x);
 
   template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
-  __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
 
   template <class _Iterator, class _Sentinel>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
-  __construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end_with_sentinel(_Iterator __first, _Sentinel __last);
 
   template <class _Iterator>
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void
-  __construct_at_end_with_size(_Iterator __first, size_type __n);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct_at_end_with_size(_Iterator __first, size_type __n);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin) {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_begin(pointer __new_begin) {
     __destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, false_type);
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_begin(pointer __new_begin, true_type);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_begin(pointer __new_begin, false_type);
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_begin(pointer __new_begin, true_type);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last) _NOEXCEPT {
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_end(pointer __new_last) _NOEXCEPT {
     __destruct_at_end(__new_last, false_type());
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void swap(__split_buffer& __x)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(__split_buffer& __x)
       _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const;
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __invariants() const;
 
 private:
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type)
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign_alloc(__split_buffer& __c, true_type)
       _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) {
     __alloc_ = std::move(__c.__alloc_);
   }
 
-  _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}
+  _LIBCPP_CONSTEXPR_SINCE_CXX20 void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {}
 
   struct _ConstructTransaction {
-    _LIBCPP_CONSTEXPR_SINCE_CXX20
-    _LIBCPP_HIDE_FROM_ABI explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT
         : __pos_(*__p),
           __end_(*__p + __n),
           __dest_(__p) {}
 
-    _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI ~_ConstructTransaction() { *__dest_ = __pos_; }
+    _LIBCPP_CONSTEXPR_SINCE_CXX20 ~_ConstructTransaction() { *__dest_ = __pos_; }
 
     pointer __pos_;
     const pointer __end_;
@@ -303,14 +289,14 @@ __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_t
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
+_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT {
   while (__new_last != __end_)
     __alloc_traits::destroy(__alloc_, std::__to_address(--__end_));
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
+_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT {
   __end_ = __new_last;
 }
@@ -470,7 +456,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 void __split_buffer<_Tp, _Allocator>::emplace_back
 }
 
 template <class _Tp, class _Allocator>
-_LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
+_LIBCPP_CONSTEXPR_SINCE_CXX20 inline void
 swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
   __x.swap(__y);
 }
diff --git a/libcxx/include/__system_error/error_category.h b/libcxx/include/__system_error/error_category.h
index 7233e22110447..d3f67db42634b 100644
--- a/libcxx/include/__system_error/error_category.h
+++ b/libcxx/include/__system_error/error_category.h
@@ -25,6 +25,7 @@ class _LIBCPP_EXPORTED_FROM_ABI error_code;
 
 class _LIBCPP_HIDDEN __do_message;
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI error_category {
 public:
   virtual ~error_category() _NOEXCEPT;
@@ -61,14 +62,17 @@ class _LIBCPP_EXPORTED_FROM_ABI error_category {
 
   friend class _LIBCPP_HIDDEN __do_message;
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 class _LIBCPP_HIDDEN __do_message : public error_category {
 public:
   string message(int __ev) const override;
 };
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 [[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& generic_category() _NOEXCEPT;
 [[__gnu__::__const__]] _LIBCPP_EXPORTED_FROM_ABI const error_category& system_category() _NOEXCEPT;
+_LIBCPP_END_ABI_SENSITIVE
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/libcxx/include/__system_error/error_code.h b/libcxx/include/__system_error/error_code.h
index f6ea40d6efcb9..48a9a53c7dfd0 100644
--- a/libcxx/include/__system_error/error_code.h
+++ b/libcxx/include/__system_error/error_code.h
@@ -39,6 +39,7 @@ namespace __adl_only {
 void make_error_code() = delete;
 } // namespace __adl_only
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI error_code {
   int __val_;
   const error_category* __cat_;
@@ -83,6 +84,7 @@ class _LIBCPP_EXPORTED_FROM_ABI error_code {
 
   _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 inline _LIBCPP_HIDE_FROM_ABI error_code make_error_code(errc __e) _NOEXCEPT {
   return error_code(static_cast<int>(__e), generic_category());
diff --git a/libcxx/include/__system_error/error_condition.h b/libcxx/include/__system_error/error_condition.h
index 34819f4b6de4c..dbf949eebdcde 100644
--- a/libcxx/include/__system_error/error_condition.h
+++ b/libcxx/include/__system_error/error_condition.h
@@ -46,6 +46,7 @@ namespace __adl_only {
 void make_error_condition() = delete;
 } // namespace __adl_only
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI error_condition {
   int __val_;
   const error_category* __cat_;
@@ -87,6 +88,7 @@ class _LIBCPP_EXPORTED_FROM_ABI error_condition {
 
   _LIBCPP_HIDE_FROM_ABI explicit operator bool() const _NOEXCEPT { return __val_ != 0; }
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 inline _LIBCPP_HIDE_FROM_ABI error_condition make_error_condition(errc __e) _NOEXCEPT {
   return error_condition(static_cast<int>(__e), generic_category());
diff --git a/libcxx/include/__system_error/system_error.h b/libcxx/include/__system_error/system_error.h
index 36ccf94cc010d..a81ae58bac63c 100644
--- a/libcxx/include/__system_error/system_error.h
+++ b/libcxx/include/__system_error/system_error.h
@@ -22,6 +22,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {
   error_code __ec_;
@@ -52,6 +53,7 @@ class _LIBCPP_EXPORTED_FROM_ABI system_error : public runtime_error {
 #endif
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #endif // _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H
diff --git a/libcxx/include/__system_error/throw_system_error.h b/libcxx/include/__system_error/throw_system_error.h
index e4605b6f014dc..3989fab5f4f45 100644
--- a/libcxx/include/__system_error/throw_system_error.h
+++ b/libcxx/include/__system_error/throw_system_error.h
@@ -18,7 +18,9 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 [[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_system_error(int __ev, const char* __what_arg);
+_LIBCPP_END_ABI_SENSITIVE
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/libcxx/include/__thread/this_thread.h b/libcxx/include/__thread/this_thread.h
index 4df137711a7fd..ac1c960b534a3 100644
--- a/libcxx/include/__thread/this_thread.h
+++ b/libcxx/include/__thread/this_thread.h
@@ -32,7 +32,9 @@ namespace this_thread {
 
 #if _LIBCPP_HAS_THREADS
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI void sleep_for(const chrono::nanoseconds& __ns);
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _Rep, class _Period>
 _LIBCPP_HIDE_FROM_ABI void sleep_for(const chrono::duration<_Rep, _Period>& __d) {
diff --git a/libcxx/include/__thread/thread.h b/libcxx/include/__thread/thread.h
index 40ea83096e738..9c7415cebd167 100644
--- a/libcxx/include/__thread/thread.h
+++ b/libcxx/include/__thread/thread.h
@@ -42,6 +42,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if _LIBCPP_HAS_THREADS
 
@@ -256,6 +257,7 @@ inline _LIBCPP_HIDE_FROM_ABI void swap(thread& __x, thread& __y) _NOEXCEPT { __x
 
 #endif // _LIBCPP_HAS_THREADS
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/__verbose_abort b/libcxx/include/__verbose_abort
index 2d45cd0eb7f5d..e06f7df909b02 100644
--- a/libcxx/include/__verbose_abort
+++ b/libcxx/include/__verbose_abort
@@ -26,8 +26,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // This function should never be called directly from the code -- it should only be called through
 // the _LIBCPP_VERBOSE_ABORT macro.
+_LIBCPP_BEGIN_ABI_SENSITIVE
 [[__noreturn__]] _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_ATTRIBUTE_FORMAT(
     __printf__, 1, 2) void __libcpp_verbose_abort(const char* __format, ...) _LIBCPP_VERBOSE_ABORT_NOEXCEPT;
+_LIBCPP_END_ABI_SENSITIVE
 
 // _LIBCPP_VERBOSE_ABORT(format, args...)
 //
diff --git a/libcxx/include/barrier b/libcxx/include/barrier
index 00e196963f11c..1ebceb6a57e99 100644
--- a/libcxx/include/barrier
+++ b/libcxx/include/barrier
@@ -97,6 +97,7 @@ using __barrier_phase_t _LIBCPP_NODEBUG = uint8_t;
 
 class __barrier_algorithm_base;
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI __barrier_algorithm_base*
 __construct_barrier_algorithm_base(ptrdiff_t& __expected);
 
@@ -105,6 +106,7 @@ __arrive_barrier_algorithm_base(__barrier_algorithm_base* __barrier, __barrier_p
 
 _LIBCPP_AVAILABILITY_SYNC _LIBCPP_EXPORTED_FROM_ABI void
 __destroy_barrier_algorithm_base(__barrier_algorithm_base* __barrier) noexcept;
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _CompletionF>
 class __barrier_base {
diff --git a/libcxx/include/codecvt b/libcxx/include/codecvt
index 9f241b734d694..0e701f1f83b1b 100644
--- a/libcxx/include/codecvt
+++ b/libcxx/include/codecvt
@@ -71,6 +71,7 @@ class codecvt_utf8_utf16
 #    if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 };
 
@@ -579,6 +580,7 @@ public:
 };
 _LIBCPP_SUPPRESS_DEPRECATED_POP
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #    endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT)
diff --git a/libcxx/include/condition_variable b/libcxx/include/condition_variable
index 7f44990547f55..14c383070b9b9 100644
--- a/libcxx/include/condition_variable
+++ b/libcxx/include/condition_variable
@@ -340,7 +340,9 @@ bool condition_variable_any::wait_for(
 
 #    endif // _LIBCPP_STD_VER >= 20
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 _LIBCPP_EXPORTED_FROM_ABI void notify_all_at_thread_exit(condition_variable&, unique_lock<mutex>);
+_LIBCPP_END_ABI_SENSITIVE
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 71c4957b691a6..c364e8a218b4b 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -220,6 +220,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #    if _LIBCPP_STD_VER >= 26 && defined(_LIBCPP_WIN32API)
 _LIBCPP_EXPORTED_FROM_ABI void* __filebuf_windows_native_handle(FILE* __file) noexcept;
@@ -1569,6 +1570,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream<char>;
 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf<char>;
 #    endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/future b/libcxx/include/future
index 28850ad618dfb..25c7977becd06 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -420,6 +420,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // enum class future_errc
 _LIBCPP_DECLARE_STRONG_ENUM(future_errc){
@@ -2061,6 +2062,7 @@ inline shared_future<_Rp&> future<_Rp&>::share() _NOEXCEPT {
 
 inline shared_future<void> future<void>::share() _NOEXCEPT { return shared_future<void>(std::move(*this)); }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/ios b/libcxx/include/ios
index 9d2968753c507..2d77956d53f92 100644
--- a/libcxx/include/ios
+++ b/libcxx/include/ios
@@ -247,6 +247,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 typedef ptrdiff_t streamsize;
 
@@ -871,6 +872,7 @@ _LIBCPP_HIDE_FROM_ABI inline ios_base& defaultfloat(ios_base& __str) {
   return __str;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/istream b/libcxx/include/istream
index 95340c739c118..f272caa895076 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -187,6 +187,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class _CharT, class _Traits>
 class basic_istream : virtual public basic_ios<_CharT, _Traits> {
@@ -1369,6 +1370,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>;
 #    endif
 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 26495497d660f..00222e076cb45 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -246,6 +246,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #    if defined(__APPLE__) || defined(__FreeBSD__)
 #      define _LIBCPP_GET_C_LOCALE 0
@@ -3678,6 +3679,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
 
 #    endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT)
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/mutex b/libcxx/include/mutex
index e058b3113073e..29897cbd03de2 100644
--- a/libcxx/include/mutex
+++ b/libcxx/include/mutex
@@ -215,6 +215,7 @@ _LIBCPP_PUSH_MACROS
 #  include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #  if _LIBCPP_HAS_THREADS
 
@@ -491,6 +492,7 @@ _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(scoped_lock);
 #    endif // _LIBCPP_STD_VER >= 17
 #  endif   // _LIBCPP_HAS_THREADS
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/print b/libcxx/include/print
index 61c3ebcd98cb8..f1a9db0152bfb 100644
--- a/libcxx/include/print
+++ b/libcxx/include/print
@@ -54,6 +54,7 @@ namespace std {
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 #  ifdef _LIBCPP_WIN32API
 _LIBCPP_EXPORTED_FROM_ABI bool __is_windows_terminal(FILE* __stream);
 
@@ -72,6 +73,7 @@ _LIBCPP_EXPORTED_FROM_ABI void __write_to_windows_console(FILE* __stream, wstrin
 #  elif __has_include(<unistd.h>)
 _LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream);
 #  endif // _LIBCPP_WIN32API
+_LIBCPP_END_ABI_SENSITIVE
 
 #  if _LIBCPP_STD_VER >= 23
 
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 12fc0787dcd5f..581ce44d60347 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -840,6 +840,7 @@ _LIBCPP_PUSH_MACROS
 #    define _LIBCPP_REGEX_COMPLEXITY_FACTOR 4096
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace regex_constants {
 
@@ -5805,6 +5806,7 @@ regex_replace(const _CharT* __s,
   return __r;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 #    if _LIBCPP_STD_VER >= 17
diff --git a/libcxx/include/shared_mutex b/libcxx/include/shared_mutex
index e6759e413dfef..7224341dbb1ba 100644
--- a/libcxx/include/shared_mutex
+++ b/libcxx/include/shared_mutex
@@ -153,6 +153,7 @@ _LIBCPP_PUSH_MACROS
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 struct _LIBCPP_EXPORTED_FROM_ABI __shared_mutex_base {
   mutex __mut_;
   condition_variable __gate1_;
@@ -181,6 +182,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI __shared_mutex_base {
   //     typedef implementation-defined native_handle_type; // See 30.2.3
   //     native_handle_type native_handle(); // See 30.2.3
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 #      if _LIBCPP_STD_VER >= 17
 class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_THREAD_SAFETY_ANNOTATION(__capability__("shared_mutex")) shared_mutex {
@@ -221,6 +223,7 @@ public:
 };
 #      endif
 
+_LIBCPP_BEGIN_ABI_SENSITIVE
 class _LIBCPP_EXPORTED_FROM_ABI
 _LIBCPP_THREAD_SAFETY_ANNOTATION(__capability__("shared_timed_mutex")) shared_timed_mutex {
   __shared_mutex_base __base_;
@@ -304,6 +307,7 @@ public:
 
   void unlock_shared() _LIBCPP_THREAD_SAFETY_ANNOTATION(__release_shared_capability__());
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 template <class _Mutex>
 class shared_lock {
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index 8462f75853408..4517d3fa50dfa 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -338,6 +338,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // Class template basic_stringbuf [stringbuf]
 
@@ -1282,6 +1283,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream<char>
 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream<char>;
 #    endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index 85e11629bd6e3..142e9fc2b8483 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -212,7 +212,9 @@ public:
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // in the dylib
+_LIBCPP_BEGIN_ABI_SENSITIVE
 [[__noreturn__]] _LIBCPP_EXPORTED_FROM_ABI void __throw_runtime_error(const char*);
+_LIBCPP_END_ABI_SENSITIVE
 
 [[__noreturn__]] inline _LIBCPP_HIDE_FROM_ABI void __throw_logic_error(const char* __msg) {
 #  if _LIBCPP_HAS_EXCEPTIONS
diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf
index eed7eb4d75ecb..2f4d202241175 100644
--- a/libcxx/include/streambuf
+++ b/libcxx/include/streambuf
@@ -132,6 +132,7 @@ _LIBCPP_PUSH_MACROS
 #    include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class _CharT, class _Traits>
 class basic_streambuf {
@@ -378,6 +379,7 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>;
 extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>;
 #    endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/string b/libcxx/include/string
index e7e541e31432d..ddd01a6723596 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -689,6 +689,7 @@ _LIBCPP_PUSH_MACROS
 #  endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // basic_string
 
@@ -4017,6 +4018,7 @@ inline constexpr bool __format::__enable_insertable<std::basic_string<wchar_t>>
 
 #  endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/include/strstream b/libcxx/include/strstream
index 1a17f8389c078..68d170b217755 100644
--- a/libcxx/include/strstream
+++ b/libcxx/include/strstream
@@ -151,6 +151,7 @@ _LIBCPP_PUSH_MACROS
 #      include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf {
 public:
@@ -348,6 +349,7 @@ public:
 private:
   strstreambuf __sb_; // exposition only
 };
+_LIBCPP_END_ABI_SENSITIVE
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 96501caaff041..01d86ee765ea0 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -380,6 +380,7 @@ _LIBCPP_PUSH_MACROS
 #  include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class _Tp>
 class valarray;
@@ -3355,6 +3356,7 @@ inline _LIBCPP_HIDE_FROM_ABI const _Tp* end(const valarray<_Tp>& __v) {
   return __v.__end_;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/algorithm.cpp b/libcxx/src/algorithm.cpp
index d388fee5f99cc..0f318d847a132 100644
--- a/libcxx/src/algorithm.cpp
+++ b/libcxx/src/algorithm.cpp
@@ -10,6 +10,7 @@
 #include <bit>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class Comp, class RandomAccessIterator>
 void __sort(RandomAccessIterator first, RandomAccessIterator last, Comp comp) {
@@ -44,4 +45,5 @@ template void __sort<__less<double>&, double*>(double*, double*, __less<double>&
 template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
 // clang-format on
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/atomic.cpp b/libcxx/src/atomic.cpp
index c1af8d6f95aae..cc69243d7f736 100644
--- a/libcxx/src/atomic.cpp
+++ b/libcxx/src/atomic.cpp
@@ -50,6 +50,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifdef __linux__
 
@@ -204,4 +205,5 @@ __libcpp_atomic_wait(__cxx_atomic_contention_t const volatile* __location, __cxx
   __libcpp_contention_wait(&__libcpp_contention_state(__location)->__contention_state, __location, __old_value);
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/barrier.cpp b/libcxx/src/barrier.cpp
index 868f1bfbaffc2..944e9fde04513 100644
--- a/libcxx/src/barrier.cpp
+++ b/libcxx/src/barrier.cpp
@@ -10,6 +10,7 @@
 #include <thread>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class __barrier_algorithm_base {
 public:
@@ -68,4 +69,5 @@ _LIBCPP_EXPORTED_FROM_ABI void __destroy_barrier_algorithm_base(__barrier_algori
   delete __barrier;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/call_once.cpp b/libcxx/src/call_once.cpp
index a398eaecfd009..a7c18fd64440b 100644
--- a/libcxx/src/call_once.cpp
+++ b/libcxx/src/call_once.cpp
@@ -16,6 +16,7 @@
 #include "include/atomic_support.h"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // If dispatch_once_f ever handles C++ exceptions, and if one can get to it
 // without illegal macros (unexpected macros not beginning with _UpperCase or
@@ -67,4 +68,5 @@ void __call_once(volatile once_flag::_State_type& flag, void* arg, void (*func)(
 #endif // !_LIBCPP_HAS_THREADS
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/charconv.cpp b/libcxx/src/charconv.cpp
index 5e8cb7d97703b..5790d13cf4e09 100644
--- a/libcxx/src/charconv.cpp
+++ b/libcxx/src/charconv.cpp
@@ -13,6 +13,7 @@
 #include "include/to_chars_floating_point.h"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifndef _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
 
@@ -86,4 +87,6 @@ template __from_chars_result<float> __from_chars_floating_point(
 
 template __from_chars_result<double> __from_chars_floating_point(
     _LIBCPP_NOESCAPE const char* __first, _LIBCPP_NOESCAPE const char* __last, chars_format __fmt);
+
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp
index 20387ea76124b..df8c1f792a738 100644
--- a/libcxx/src/chrono.cpp
+++ b/libcxx/src/chrono.cpp
@@ -64,6 +64,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace chrono {
 
@@ -262,4 +263,5 @@ steady_clock::time_point steady_clock::now() noexcept { return __libcpp_steady_c
 
 } // namespace chrono
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/condition_variable.cpp b/libcxx/src/condition_variable.cpp
index b3747603dd34f..a207012f55173 100644
--- a/libcxx/src/condition_variable.cpp
+++ b/libcxx/src/condition_variable.cpp
@@ -17,6 +17,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // ~condition_variable is defined elsewhere.
 
@@ -66,6 +67,7 @@ void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
   __thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/condition_variable_destructor.cpp b/libcxx/src/condition_variable_destructor.cpp
index f6ffe33685990..e9287b93968e1 100644
--- a/libcxx/src/condition_variable_destructor.cpp
+++ b/libcxx/src/condition_variable_destructor.cpp
@@ -19,6 +19,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifdef NEEDS_CONDVAR_DESTRUCTOR
 
@@ -37,4 +38,5 @@ class _LIBCPP_EXPORTED_FROM_ABI condition_variable {
 condition_variable::~condition_variable() { __libcpp_condvar_destroy(&__cv_); }
 #endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/error_category.cpp b/libcxx/src/error_category.cpp
index 8ae460fb5f1f4..f9aa51b5db364 100644
--- a/libcxx/src/error_category.cpp
+++ b/libcxx/src/error_category.cpp
@@ -15,6 +15,7 @@
 #include <system_error>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // class error_category
 
@@ -34,4 +35,5 @@ bool error_category::equivalent(const error_code& code, int condition) const noe
   return *this == code.category() && code.value() == condition;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/expected.cpp b/libcxx/src/expected.cpp
index f30efb5164796..202bb04c75bd8 100644
--- a/libcxx/src/expected.cpp
+++ b/libcxx/src/expected.cpp
@@ -9,5 +9,9 @@
 #include <expected>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
+
 const char* bad_expected_access<void>::what() const noexcept { return "bad access to std::expected"; }
+
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/filesystem/directory_entry.cpp b/libcxx/src/filesystem/directory_entry.cpp
index 152715243906c..88efa1ba2c903 100644
--- a/libcxx/src/filesystem/directory_entry.cpp
+++ b/libcxx/src/filesystem/directory_entry.cpp
@@ -16,6 +16,7 @@
 #include "time_utils.h"
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 error_code directory_entry::__do_refresh() noexcept {
   __data_.__reset();
@@ -70,4 +71,5 @@ error_code directory_entry::__do_refresh() noexcept {
   return failure_ec;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/filesystem/directory_iterator.cpp b/libcxx/src/filesystem/directory_iterator.cpp
index 7e8e40d17f7a0..e253b65f1564b 100644
--- a/libcxx/src/filesystem/directory_iterator.cpp
+++ b/libcxx/src/filesystem/directory_iterator.cpp
@@ -25,6 +25,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 using detail::ErrorHandler;
 
@@ -319,4 +320,5 @@ bool recursive_directory_iterator::__try_recursion(error_code* ec) {
   return false;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/filesystem/filesystem_clock.cpp b/libcxx/src/filesystem/filesystem_clock.cpp
index bec082f61c9d3..b3fb40d215381 100644
--- a/libcxx/src/filesystem/filesystem_clock.cpp
+++ b/libcxx/src/filesystem/filesystem_clock.cpp
@@ -40,6 +40,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_DIAGNOSTIC_PUSH
 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated")
@@ -74,4 +75,5 @@ _FilesystemClock::time_point _FilesystemClock::now() noexcept {
 #endif
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/filesystem/filesystem_error.cpp b/libcxx/src/filesystem/filesystem_error.cpp
index 456b902c33154..f9b2c14096b68 100644
--- a/libcxx/src/filesystem/filesystem_error.cpp
+++ b/libcxx/src/filesystem/filesystem_error.cpp
@@ -14,6 +14,7 @@
 #include "format_string.h"
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 filesystem_error::~filesystem_error() {}
 
@@ -36,4 +37,5 @@ void filesystem_error::__create_what(int __num_paths) {
   }();
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index 23c1c281ba1c7..b3c09e4d13cbb 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -75,6 +75,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 using detail::capture_errno;
 using detail::ErrorHandler;
@@ -1083,4 +1084,5 @@ path __weakly_canonical(const path& p, error_code* ec) {
   return result.lexically_normal();
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/filesystem/path.cpp b/libcxx/src/filesystem/path.cpp
index 9f7dc54fdf156..029ccb730ed48 100644
--- a/libcxx/src/filesystem/path.cpp
+++ b/libcxx/src/filesystem/path.cpp
@@ -14,6 +14,7 @@
 #include "path_parser.h"
 
 _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 using detail::ErrorHandler;
 using parser::createView;
@@ -442,4 +443,5 @@ size_t __char_to_wide(const string& str, wchar_t* out, size_t outlen) {
 }
 #endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_FILESYSTEM
diff --git a/libcxx/src/functional.cpp b/libcxx/src/functional.cpp
index cf585c2b0b65e..eb5dcb69a57ec 100644
--- a/libcxx/src/functional.cpp
+++ b/libcxx/src/functional.cpp
@@ -9,6 +9,7 @@
 #include <functional>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 bad_function_call::~bad_function_call() noexcept {}
 
@@ -20,4 +21,5 @@ size_t __hash_memory(_LIBCPP_NOESCAPE const void* ptr, size_t size) noexcept {
   return __murmur2_or_cityhash<size_t>()(ptr, size);
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp
index 7bba635e9006f..95efd10e916fa 100644
--- a/libcxx/src/future.cpp
+++ b/libcxx/src/future.cpp
@@ -10,6 +10,7 @@
 #include <string>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_HIDDEN __future_error_category : public __do_message {
 public:
@@ -194,4 +195,5 @@ shared_future<void>& shared_future<void>::operator=(const shared_future& __rhs)
   return *this;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/hash.cpp b/libcxx/src/hash.cpp
index 41c4eb480a5fc..3ee8ce27773d4 100644
--- a/libcxx/src/hash.cpp
+++ b/libcxx/src/hash.cpp
@@ -14,6 +14,7 @@
 _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace {
 
@@ -449,4 +450,5 @@ size_t __next_prime(size_t n) {
   }
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/ios.cpp b/libcxx/src/ios.cpp
index 02ce4841187fb..4b2c9eab297d7 100644
--- a/libcxx/src/ios.cpp
+++ b/libcxx/src/ios.cpp
@@ -22,6 +22,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 class _LIBCPP_HIDDEN __iostream_category : public __do_message {
 public:
@@ -382,6 +383,7 @@ bool ios_base::sync_with_stdio(bool sync) {
   return r;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/iostream.cpp b/libcxx/src/iostream.cpp
index 416725235c340..99d623d0c0ee8 100644
--- a/libcxx/src/iostream.cpp
+++ b/libcxx/src/iostream.cpp
@@ -15,6 +15,7 @@
 #define ABI_NAMESPACE_STR _LIBCPP_TOSTRING(_LIBCPP_ABI_NAMESPACE)
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 template <class StreamT, class BufferT>
 union stream_data {
@@ -135,4 +136,5 @@ ios_base::Init::Init() {
 
 ios_base::Init::~Init() {}
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 9ea59a3a19ca4..5bcbc139dbc3a 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -49,6 +49,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 struct __libcpp_unique_locale {
   __libcpp_unique_locale(const char* nm) : __loc_(__locale::__newlocale(_LIBCPP_ALL_MASK, nm, 0)) {}
@@ -5727,6 +5728,7 @@ template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t,
 template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char8_t, mbstate_t>;
 #endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp
index 16190c242c148..bfa2868fb16ff 100644
--- a/libcxx/src/memory.cpp
+++ b/libcxx/src/memory.cpp
@@ -24,6 +24,7 @@
 #include "include/atomic_support.h"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 bad_weak_ptr::~bad_weak_ptr() noexcept {}
 
@@ -145,4 +146,5 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space) {
   return r;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/memory_resource.cpp b/libcxx/src/memory_resource.cpp
index 22b5493427f0f..015487332f7e2 100644
--- a/libcxx/src/memory_resource.cpp
+++ b/libcxx/src/memory_resource.cpp
@@ -20,6 +20,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 namespace pmr {
 
@@ -497,4 +498,5 @@ void* monotonic_buffer_resource::do_allocate(size_t bytes, size_t align) {
 
 } // namespace pmr
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/mutex.cpp b/libcxx/src/mutex.cpp
index b2193e2335ee2..8964c7e807aaa 100644
--- a/libcxx/src/mutex.cpp
+++ b/libcxx/src/mutex.cpp
@@ -22,6 +22,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // ~mutex is defined elsewhere
 
@@ -140,6 +141,7 @@ void recursive_timed_mutex::unlock() noexcept {
   }
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/mutex_destructor.cpp b/libcxx/src/mutex_destructor.cpp
index 9f991721f083f..97ddbcd2ac856 100644
--- a/libcxx/src/mutex_destructor.cpp
+++ b/libcxx/src/mutex_destructor.cpp
@@ -24,6 +24,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifdef NEEDS_MUTEX_DESTRUCTOR
 class _LIBCPP_EXPORTED_FROM_ABI mutex {
@@ -39,4 +40,5 @@ class _LIBCPP_EXPORTED_FROM_ABI mutex {
 mutex::~mutex() noexcept { __libcpp_mutex_destroy(&__m_); }
 #endif // !NEEDS_MUTEX_DESTRUCTOR
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/ostream.cpp b/libcxx/src/ostream.cpp
index e0f14a8917927..7c39c94ce8fad 100644
--- a/libcxx/src/ostream.cpp
+++ b/libcxx/src/ostream.cpp
@@ -15,6 +15,7 @@
 #include "std_stream.h"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {
   // dynamic_cast requires RTTI, this only affects users whose vendor builds
@@ -38,4 +39,5 @@ _LIBCPP_EXPORTED_FROM_ABI FILE* __get_ostream_file(ostream& __os) {
   return nullptr;
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/print.cpp b/libcxx/src/print.cpp
index 3f2baa6dcc60b..be4c1a58560b5 100644
--- a/libcxx/src/print.cpp
+++ b/libcxx/src/print.cpp
@@ -25,6 +25,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if defined(_LIBCPP_WIN32API)
 
@@ -61,4 +62,5 @@ __write_to_windows_console([[maybe_unused]] FILE* __stream, [[maybe_unused]] wst
 _LIBCPP_EXPORTED_FROM_ABI bool __is_posix_terminal(FILE* __stream) { return isatty(fileno(__stream)); }
 #endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index ff53a3d786dd5..78cae73073791 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -37,6 +37,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if defined(_LIBCPP_USING_GETENTROPY)
 
@@ -178,4 +179,5 @@ double random_device::entropy() const noexcept {
 #endif
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/random_shuffle.cpp b/libcxx/src/random_shuffle.cpp
index 4f2669a6c7fa5..39c659a28ef47 100644
--- a/libcxx/src/random_shuffle.cpp
+++ b/libcxx/src/random_shuffle.cpp
@@ -17,6 +17,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if _LIBCPP_HAS_THREADS
 static constinit __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
@@ -48,4 +49,5 @@ __rs_default::result_type __rs_default::operator()() {
 
 __rs_default __rs_get() { return __rs_default(); }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/regex.cpp b/libcxx/src/regex.cpp
index 6d9f06e213466..199517b4355ab 100644
--- a/libcxx/src/regex.cpp
+++ b/libcxx/src/regex.cpp
@@ -11,6 +11,7 @@
 #include <regex>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 static const char* make_error_type_string(regex_constants::error_type ecode) {
   switch (ecode) {
@@ -396,4 +397,5 @@ void __match_any_but_newline<wchar_t>::__exec(__state& __s) const {
   }
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/shared_mutex.cpp b/libcxx/src/shared_mutex.cpp
index 6180833736956..ecdbfea7253fc 100644
--- a/libcxx/src/shared_mutex.cpp
+++ b/libcxx/src/shared_mutex.cpp
@@ -13,6 +13,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // Shared Mutex Base
 __shared_mutex_base::__shared_mutex_base() : __state_(0) {}
@@ -96,4 +97,5 @@ void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }
 bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
 void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/std_stream.h b/libcxx/src/std_stream.h
index 772e8b91ae349..2056fc3068807 100644
--- a/libcxx/src/std_stream.h
+++ b/libcxx/src/std_stream.h
@@ -24,6 +24,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 static const int __limit = 8;
 
@@ -380,6 +381,7 @@ void __stdoutbuf<_CharT>::imbue(const locale& __loc) {
   __always_noconv_ = __cv_->always_noconv();
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/stdexcept.cpp b/libcxx/src/stdexcept.cpp
index 0ee438bef02e1..8ac1c08f21c9c 100644
--- a/libcxx/src/stdexcept.cpp
+++ b/libcxx/src/stdexcept.cpp
@@ -18,6 +18,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 void __throw_runtime_error(const char* msg) {
 #if _LIBCPP_HAS_EXCEPTIONS
@@ -27,4 +28,5 @@ void __throw_runtime_error(const char* msg) {
 #endif
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index e335639883dba..731834aa01589 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -19,6 +19,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifndef _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
 
@@ -382,4 +383,5 @@ wstring to_wstring(double val) { return as_string(get_swprintf(), initial_string
 wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string<wstring>()(), L"%Lf", val); }
 #endif
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/strstream.cpp b/libcxx/src/strstream.cpp
index 70374191c6aba..8e4f260e8d25f 100644
--- a/libcxx/src/strstream.cpp
+++ b/libcxx/src/strstream.cpp
@@ -18,6 +18,7 @@ _LIBCPP_PUSH_MACROS
 #include <__undef_macros>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 strstreambuf::strstreambuf(streamsize __alsize)
     : __strmode_(__dynamic), __alsize_(__alsize), __palloc_(nullptr), __pfree_(nullptr) {}
@@ -253,6 +254,7 @@ ostrstream::~ostrstream() {}
 
 strstream::~strstream() {}
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS
diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp
index 164fb72621c17..c6a22c4e52fe2 100644
--- a/libcxx/src/system_error.cpp
+++ b/libcxx/src/system_error.cpp
@@ -27,6 +27,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #if defined(_LIBCPP_WIN32API)
 
@@ -366,4 +367,5 @@ void __throw_system_error(int ev, const char* what_arg) {
 #endif
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index db40d9df4f233..47129c7fb5f93 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -31,6 +31,7 @@
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 thread::~thread() {
   if (!__libcpp_thread_isnull(&__t_))
@@ -170,4 +171,5 @@ void __thread_struct::notify_all_at_thread_exit(condition_variable* cv, mutex* m
 
 void __thread_struct::__make_ready_at_thread_exit(__assoc_sub_state* __s) { __p_->__make_ready_at_thread_exit(__s); }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/valarray.cpp b/libcxx/src/valarray.cpp
index 6ef1f1cafc0e5..7dc5f06ed9a55 100644
--- a/libcxx/src/valarray.cpp
+++ b/libcxx/src/valarray.cpp
@@ -9,6 +9,7 @@
 #include <valarray>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 // These two symbols are part of the v1 ABI but not part of the >=v2 ABI.
 #if _LIBCPP_ABI_VERSION == 1
@@ -46,4 +47,5 @@ void gslice::__init(size_t __start) {
   }
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/vector.cpp b/libcxx/src/vector.cpp
index 3f3a906d6421f..792ff7e66b2ef 100644
--- a/libcxx/src/vector.cpp
+++ b/libcxx/src/vector.cpp
@@ -9,6 +9,7 @@
 #include <vector>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 #ifndef _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
 
@@ -27,4 +28,5 @@ void __vector_base_common<true>::__throw_out_of_range() const { std::__throw_out
 
 #endif // _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/src/verbose_abort.cpp b/libcxx/src/verbose_abort.cpp
index fd6bc4943d6ba..1ec8c613fd493 100644
--- a/libcxx/src/verbose_abort.cpp
+++ b/libcxx/src/verbose_abort.cpp
@@ -22,6 +22,7 @@ extern "C" void android_set_abort_message(const char* msg);
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_ABI_SENSITIVE
 
 _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) _LIBCPP_VERBOSE_ABORT_NOEXCEPT {
   // Write message to stderr. We do this before formatting into a
@@ -62,4 +63,5 @@ _LIBCPP_WEAK void __libcpp_verbose_abort(char const* format, ...) _LIBCPP_VERBOS
   std::abort();
 }
 
+_LIBCPP_END_ABI_SENSITIVE
 _LIBCPP_END_NAMESPACE_STD



More information about the libcxx-commits mailing list