From ecb5a1b0e236a98f59863793b4cfef1f13ea225c Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Feb 2024 19:11:51 +0100 Subject: [PATCH] [libc++][NFC] Remove (#80194) The header is unused now, so we can remove it. --- libcxx/include/CMakeLists.txt | 1 - libcxx/include/experimental/__memory | 94 ---------------------------- libcxx/include/module.modulemap.in | 5 -- 3 files changed, 100 deletions(-) delete mode 100644 libcxx/include/experimental/__memory diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index 0bb23710cae8..6a845c813dc3 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -918,7 +918,6 @@ set(files execution expected experimental/__config - experimental/__memory experimental/__simd/aligned_tag.h experimental/__simd/declaration.h experimental/__simd/reference.h diff --git a/libcxx/include/experimental/__memory b/libcxx/include/experimental/__memory deleted file mode 100644 index b9dbf541d7e4..000000000000 --- 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 -#include // 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 -struct __lfts_uses_allocator<_Tp, _Alloc, false, false> : public false_type {}; - -template -struct __lfts_uses_allocator<_Tp, _Alloc, true, HasAlloc> : public true_type {}; - -template -struct __lfts_uses_allocator<_Tp, _Alloc, false, true> - : public integral_constant::value || - is_same::value > {}; - -template -struct __lfts_uses_alloc_ctor_imp { - static const int value = 0; -}; - -template -struct __lfts_uses_alloc_ctor_imp { - 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 -struct __lfts_uses_alloc_ctor - : integral_constant< - int, - __lfts_uses_alloc_ctor_imp< __lfts_uses_allocator<_Tp, _Alloc>::value, _Tp, _Alloc, _Args... >::value > {}; - -template -inline _LIBCPP_HIDE_FROM_ABI void -__user_alloc_construct_impl(integral_constant, _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 -inline _LIBCPP_HIDE_FROM_ABI void -__user_alloc_construct_impl(integral_constant, _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 -inline _LIBCPP_HIDE_FROM_ABI void -__user_alloc_construct_impl(integral_constant, _Tp* __storage, const _Allocator& __a, _Args&&... __args) { - new (__storage) _Tp(std::forward<_Args>(__args)..., __a); -} - -template -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 */ diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in index 207b44b6444b..03f71290b660 100644 --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -555,11 +555,6 @@ module std_experimental [system] { textual header "experimental/__config" export * } - // FIXME these should be private - module __memory { - header "experimental/__memory" - export * - } } // Convenience method to get all of the above modules in a single import statement.