aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__memory/allocator_traits.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__memory/allocator_traits.h47
1 files changed, 16 insertions, 31 deletions
diff --git a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
index 4658098d64c9..c5db3e896fad 100644
--- a/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
+++ b/contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
@@ -263,14 +263,14 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
};
#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static pointer allocate(allocator_type& __a, size_type __n) {
return __a.allocate(__n);
}
template <class _Ap = _Alloc, class =
__enable_if_t<__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint) {
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
return __a.allocate(__n, __hint);
@@ -278,38 +278,34 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
}
template <class _Ap = _Alloc, class = void, class =
__enable_if_t<!__has_allocate_hint<_Ap, size_type, const_void_pointer>::value> >
- _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer) {
return __a.allocate(__n);
}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT {
__a.deallocate(__p, __n);
}
template <class _Tp, class... _Args, class =
__enable_if_t<__has_construct<allocator_type, _Tp*, _Args...>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args) {
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
- __a.construct(__p, _VSTD::forward<_Args>(__args)...);
+ __a.construct(__p, std::forward<_Args>(__args)...);
_LIBCPP_SUPPRESS_DEPRECATED_POP
}
template <class _Tp, class... _Args, class = void, class =
__enable_if_t<!__has_construct<allocator_type, _Tp*, _Args...>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static void construct(allocator_type&, _Tp* __p, _Args&&... __args) {
-#if _LIBCPP_STD_VER >= 20
- _VSTD::construct_at(__p, _VSTD::forward<_Args>(__args)...);
-#else
- ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
-#endif
+ std::__construct_at(__p, std::forward<_Args>(__args)...);
}
template <class _Tp, class =
__enable_if_t<__has_destroy<allocator_type, _Tp*>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static void destroy(allocator_type& __a, _Tp* __p) {
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
__a.destroy(__p);
@@ -317,18 +313,14 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
}
template <class _Tp, class = void, class =
__enable_if_t<!__has_destroy<allocator_type, _Tp*>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static void destroy(allocator_type&, _Tp* __p) {
-#if _LIBCPP_STD_VER >= 20
- _VSTD::destroy_at(__p);
-#else
- __p->~_Tp();
-#endif
+ std::__destroy_at(__p);
}
template <class _Ap = _Alloc, class =
__enable_if_t<__has_max_size<const _Ap>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static size_type max_size(const allocator_type& __a) _NOEXCEPT {
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
return __a.max_size();
@@ -336,20 +328,20 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
}
template <class _Ap = _Alloc, class = void, class =
__enable_if_t<!__has_max_size<const _Ap>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static size_type max_size(const allocator_type&) _NOEXCEPT {
return numeric_limits<size_type>::max() / sizeof(value_type);
}
template <class _Ap = _Alloc, class =
__enable_if_t<__has_select_on_container_copy_construction<const _Ap>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
return __a.select_on_container_copy_construction();
}
template <class _Ap = _Alloc, class = void, class =
__enable_if_t<!__has_select_on_container_copy_construction<const _Ap>::value> >
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
static allocator_type select_on_container_copy_construction(const allocator_type& __a) {
return __a;
}
@@ -408,14 +400,7 @@ struct __is_cpp17_copy_insertable<_Alloc, __enable_if_t<
#ifdef _LIBCPP_HAS_ASAN_CONTAINER_ANNOTATIONS_FOR_ALL_ALLOCATORS
template <class _Alloc>
-struct __asan_annotate_container_with_allocator
-# if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1600
- : true_type {};
-# else
- // TODO(LLVM-18): Remove the special-casing
- : false_type {};
-# endif
-
+struct __asan_annotate_container_with_allocator : true_type {};
template <class _Tp>
struct __asan_annotate_container_with_allocator<allocator<_Tp> > : true_type {};
#endif