Skip to content

[libc++][NFC] Remove <experimental/__memory> #80194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

philnik777
Copy link
Contributor

The header is unused now, so we can remove it.

@philnik777 philnik777 requested a review from a team as a code owner January 31, 2024 20:55
@philnik777 philnik777 added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 31, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 31, 2024

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

The header is unused now, so we can remove it.


Full diff: https://github.com/llvm/llvm-project/pull/80194.diff

1 Files Affected:

  • (removed) libcxx/include/experimental/__memory (-94)
diff --git a/libcxx/include/experimental/__memory b/libcxx/include/experimental/__memory
deleted file mode 100644
index b9dbf541d7e48..0000000000000
--- a/libcxx/include/experimental/__memory
+++ /dev/null
@@ -1,94 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL___MEMORY
-#define _LIBCPP_EXPERIMENTAL___MEMORY
-
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <__type_traits/conditional.h>
-#include <__type_traits/is_constructible.h>
-#include <__type_traits/is_convertible.h>
-#include <__type_traits/is_same.h>
-#include <experimental/__config>
-#include <experimental/utility> // for erased_type
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS
-
-template < class _Tp, class _Alloc, bool = uses_allocator<_Tp, _Alloc>::value, bool = __has_allocator_type<_Tp>::value >
-struct __lfts_uses_allocator : public false_type {};
-
-template <class _Tp, class _Alloc>
-struct __lfts_uses_allocator<_Tp, _Alloc, false, false> : public false_type {};
-
-template <class _Tp, class _Alloc, bool HasAlloc>
-struct __lfts_uses_allocator<_Tp, _Alloc, true, HasAlloc> : public true_type {};
-
-template <class _Tp, class _Alloc>
-struct __lfts_uses_allocator<_Tp, _Alloc, false, true>
-    : public integral_constant<bool,
-                               is_convertible<_Alloc, typename _Tp::allocator_type>::value ||
-                                   is_same<erased_type, typename _Tp::allocator_type>::value > {};
-
-template <bool _UsesAlloc, class _Tp, class _Alloc, class... _Args>
-struct __lfts_uses_alloc_ctor_imp {
-  static const int value = 0;
-};
-
-template <class _Tp, class _Alloc, class... _Args>
-struct __lfts_uses_alloc_ctor_imp<true, _Tp, _Alloc, _Args...> {
-  static const bool __ic_first = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
-
-  static const bool __ic_second =
-      __conditional_t< __ic_first, false_type, is_constructible<_Tp, _Args..., _Alloc> >::value;
-
-  static_assert(__ic_first || __ic_second, "Request for uses allocator construction is ill-formed");
-
-  static const int value = __ic_first ? 1 : 2;
-};
-
-template <class _Tp, class _Alloc, class... _Args>
-struct __lfts_uses_alloc_ctor
-    : integral_constant<
-          int,
-          __lfts_uses_alloc_ctor_imp< __lfts_uses_allocator<_Tp, _Alloc>::value, _Tp, _Alloc, _Args... >::value > {};
-
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 0>, _Tp* __storage, const _Allocator&, _Args&&... __args) {
-  new (__storage) _Tp(std::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 1>, _Tp* __storage, const _Allocator& __a, _Args&&... __args) {
-  new (__storage) _Tp(allocator_arg_t(), __a, std::forward<_Args>(__args)...);
-}
-
-// FIXME: This should have a version which takes a non-const alloc.
-template <class _Tp, class _Allocator, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void
-__user_alloc_construct_impl(integral_constant<int, 2>, _Tp* __storage, const _Allocator& __a, _Args&&... __args) {
-  new (__storage) _Tp(std::forward<_Args>(__args)..., __a);
-}
-
-template <class _Tp, class _Alloc, class... _Args>
-inline _LIBCPP_HIDE_FROM_ABI void __lfts_user_alloc_construct(_Tp* __store, const _Alloc& __a, _Args&&... __args) {
-  ::std::experimental::fundamentals_v1::__user_alloc_construct_impl(
-      typename __lfts_uses_alloc_ctor<_Tp, _Alloc, _Args...>::type(), __store, __a, std::forward<_Args>(__args)...);
-}
-
-_LIBCPP_END_NAMESPACE_LFTS
-
-#endif /* _LIBCPP_EXPERIMENTAL___MEMORY */

@philnik777 philnik777 force-pushed the remove_experimental_memory branch 2 times, most recently from caab29c to 4d64a47 Compare February 1, 2024 11:27
@ldionne ldionne changed the title [libc++][NFC] Remove <__memory> [libc++][NFC] Remove <experimental/__memory> Feb 1, 2024
@@ -556,10 +556,6 @@ module std_experimental [system] {
export *
}
// FIXME these should be private
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment can be removed now?

The header is unused now, so we can remove it.
@philnik777 philnik777 force-pushed the remove_experimental_memory branch from 4d64a47 to 97819b0 Compare February 1, 2024 18:11
@philnik777 philnik777 merged commit ecb5a1b into llvm:main Feb 1, 2024
@philnik777 philnik777 deleted the remove_experimental_memory branch February 1, 2024 18:11
carlosgalvezp pushed a commit to carlosgalvezp/llvm-project that referenced this pull request Feb 1, 2024
The header is unused now, so we can remove it.
agozillon pushed a commit to agozillon/llvm-project that referenced this pull request Feb 5, 2024
The header is unused now, so we can remove it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants