Skip to content

[libc++] Remove experimental pmr headers now shipped in mainline #73172

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 2 commits into from
Nov 27, 2023

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Nov 22, 2023

Several experimental headers around std::pmr have been slated for removal for a while now. This patch actually performs the removal and cleanups from the code base.

@ldionne ldionne requested a review from a team as a code owner November 22, 2023 21:33
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Nov 22, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2023

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

Several experimental headers around std::pmr have been slated for removal for a while now. This patch actually performs the removal and cleanups from the code base.


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

86 Files Affected:

  • (modified) libcxx/docs/DesignDocs/ExperimentalFeatures.rst (+6-6)
  • (modified) libcxx/docs/ReleaseNotes/18.rst (+6-6)
  • (modified) libcxx/include/CMakeLists.txt (-11)
  • (modified) libcxx/include/__std_clang_module (-13)
  • (modified) libcxx/include/experimental/__config (-4)
  • (removed) libcxx/include/experimental/deque (-52)
  • (removed) libcxx/include/experimental/forward_list (-52)
  • (removed) libcxx/include/experimental/list (-52)
  • (removed) libcxx/include/experimental/map (-62)
  • (removed) libcxx/include/experimental/memory_resource (-444)
  • (removed) libcxx/include/experimental/regex (-69)
  • (removed) libcxx/include/experimental/set (-62)
  • (removed) libcxx/include/experimental/string (-73)
  • (removed) libcxx/include/experimental/unordered_map (-78)
  • (removed) libcxx/include/experimental/unordered_set (-64)
  • (removed) libcxx/include/experimental/vector (-52)
  • (modified) libcxx/include/module.modulemap.in (-45)
  • (modified) libcxx/src/CMakeLists.txt (+1-1)
  • (added) libcxx/src/experimental/keep.cpp (+3)
  • (removed) libcxx/src/experimental/memory_resource.cpp (-149)
  • (removed) libcxx/src/experimental/memory_resource_init_helper.h (-2)
  • (removed) libcxx/test/libcxx/experimental/lit.local.cfg (-3)
  • (removed) libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp (-41)
  • (removed) libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp (-179)
  • (removed) libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp (-44)
  • (removed) libcxx/test/libcxx/experimental/memory/memory.resource.global/global_memory_resource_lifetime.pass.cpp (-65)
  • (removed) libcxx/test/libcxx/experimental/memory/memory.resource.global/new_delete_resource_lifetime.pass.cpp (-57)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx03.csv (-43)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx11.csv (-43)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx14.csv (-43)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx17.csv (-43)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx20.csv (-43)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx23.csv (-27)
  • (modified) libcxx/test/libcxx/transitive_includes/cxx26.csv (-27)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/assign.pass.cpp (-34)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/copy.pass.cpp (-53)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/default.pass.cpp (-56)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/memory_resource_convert.pass.cpp (-53)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.ctor/other_alloc.pass.cpp (-61)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/equal.pass.cpp (-141)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.eq/not_equal.pass.cpp (-112)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp (-117)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair.pass.cpp (-57)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_const_lvalue_pair.pass.cpp (-148)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp (-144)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp (-149)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair.pass.cpp (-168)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_piecewise_pair_evil.pass.cpp (-144)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_types.pass.cpp (-232)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.pass.cpp (-69)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/destroy.pass.cpp (-56)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/resource.pass.cpp (-61)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/select_on_container_copy_construction.pass.cpp (-57)
  • (removed) libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.overview/nothing_to_do.pass.cpp (-11)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_copy.pass.cpp (-61)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/alloc_move.pass.cpp (-52)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.ctor/default.pass.cpp (-48)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_allocate_and_deallocate.pass.cpp (-120)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/do_is_equal.pass.cpp (-91)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.overview/overview.pass.cpp (-47)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_deque_synop.pass.cpp (-40)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_forward_list_synop.pass.cpp (-40)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_list_synop.pass.cpp (-40)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_map_synop.pass.cpp (-72)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_regex_synop.pass.cpp (-63)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_set_synop.pass.cpp (-70)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_string_synop.pass.cpp (-80)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_map_synop.pass.cpp (-90)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_unordered_set_synop.pass.cpp (-88)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.aliases/header_vector_synop.pass.cpp (-40)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.global/default_resource.pass.cpp (-81)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.global/new_delete_resource.pass.cpp (-106)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.global/null_memory_resource.pass.cpp (-120)
  • (removed) libcxx/test/std/experimental/memory/memory.resource.synop/nothing_to_do.pass.cpp (-13)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/construct.verify.cpp (-28)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/equal.pass.cpp (-82)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.eq/not_equal.pass.cpp (-83)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.overview/nothing_to_do.pass.cpp (-11)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.priv/private_members.verify.cpp (-30)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/allocate.pass.cpp (-95)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/deallocate.pass.cpp (-81)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/dtor.pass.cpp (-67)
  • (removed) libcxx/test/std/experimental/memory/memory.resource/memory.resource.public/is_equal.pass.cpp (-101)
  • (removed) libcxx/test/support/test_memory_resource.h (-170)
  • (modified) libcxx/test/support/uses_alloc_types.h (+1-11)
  • (modified) libcxx/utils/libcxx/header_information.py (-12)
diff --git a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
index 4cd6bf3a7fcd50d..dc2ae6a25aa5d01 100644
--- a/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
+++ b/libcxx/docs/DesignDocs/ExperimentalFeatures.rst
@@ -106,19 +106,19 @@ Most (but not all) of the features of the LFTS were accepted into C++17.
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
 | 8.2.2   | ``weak_ptr`` enhancements                             | Not yet            | Never added                              |                         |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.5     | ``memory_resource``                                   | Not yet            |                                          |                         |
+| 8.5     | ``memory_resource``                                   | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.6     | ``polymorphic_allocator``                             | Not yet            |                                          |                         |
+| 8.6     | ``polymorphic_allocator``                             | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
 | 8.7     | ``resource_adaptor``                                  |                    | n/a                                      | Not part of C++17       |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.8     | Access to program-wide ``memory_resource`` objects    | Not yet            |                                          |                         |
+| 8.8     | Access to program-wide ``memory_resource`` objects    | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.9     | Pool resource classes                                 | Not yet            |                                          |                         |
+| 8.9     | Pool resource classes                                 | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.10    | ``monotonic_buffer_resource``                         | Not yet            |                                          |                         |
+| 8.10    | ``monotonic_buffer_resource``                         | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
-| 8.11    | Alias templates using polymorphic memory resources    | Not yet            |                                          |                         |
+| 8.11    | Alias templates using polymorphic memory resources    | 16.0               | 18.0                                     | Removed                 |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
 | 8.12    | Non-owning pointers                                   |                    | n/a                                      | Not part of C++17       |
 +---------+-------------------------------------------------------+--------------------+------------------------------------------+-------------------------+
diff --git a/libcxx/docs/ReleaseNotes/18.rst b/libcxx/docs/ReleaseNotes/18.rst
index 1a5b959eac6ce66..5e5a27cc0e1f6cf 100644
--- a/libcxx/docs/ReleaseNotes/18.rst
+++ b/libcxx/docs/ReleaseNotes/18.rst
@@ -87,6 +87,12 @@ Deprecations and Removals
   macro is provided to restore the previous behavior, and it will be supported in the LLVM 18 release only.
   In LLVM 19 and beyond, ``_LIBCPP_ENABLE_NARROWING_CONVERSIONS_IN_VARIANT`` will not be honored anymore.
 
+- The headers ``<experimental/deque>``, ``<experimental/forward_list>``, ``<experimental/list>``,
+  ``<experimental/map>``, ``<experimental/memory_resource>``, ``<experimental/regex>``, ``<experimental/set>``,
+  ``<experimental/string>``, ``<experimental/unordered_map>``, ``<experimental/unordered_set>``,
+  and ``<experimental/vector>`` have been removed in LLVM 18, as all their contents will have been
+  implemented in namespace ``std`` for at least two releases.
+
 Upcoming Deprecations and Removals
 ----------------------------------
 
@@ -97,12 +103,6 @@ LLVM 18
   Please see the updated documentation about the hardening modes in libc++ and in particular the
   ``_LIBCPP_VERBOSE_ABORT`` macro for details.
 
-- The headers ``<experimental/deque>``, ``<experimental/forward_list>``, ``<experimental/list>``,
-  ``<experimental/map>``, ``<experimental/memory_resource>``, ``<experimental/regex>``, ``<experimental/set>``,
-  ``<experimental/string>``, ``<experimental/unordered_map>``, ``<experimental/unordered_set>``,
-  and ``<experimental/vector>`` will be removed in LLVM 18, as all their contents will have been implemented in
-  namespace ``std`` for at least two releases.
-
 LLVM 19
 ~~~~~~~
 
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 889d7fedbf2965f..0bc58d15f1f0910 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -920,23 +920,12 @@ set(files
   experimental/__simd/traits.h
   experimental/__simd/utility.h
   experimental/__simd/vec_ext.h
-  experimental/deque
-  experimental/forward_list
   experimental/iterator
-  experimental/list
-  experimental/map
   experimental/memory
-  experimental/memory_resource
   experimental/propagate_const
-  experimental/regex
-  experimental/set
   experimental/simd
-  experimental/string
   experimental/type_traits
-  experimental/unordered_map
-  experimental/unordered_set
   experimental/utility
-  experimental/vector
   ext/__hash
   ext/hash_map
   ext/hash_set
diff --git a/libcxx/include/__std_clang_module b/libcxx/include/__std_clang_module
index 10ac3ccb8f329f4..18d6ce6b46c1f6e 100644
--- a/libcxx/include/__std_clang_module
+++ b/libcxx/include/__std_clang_module
@@ -86,25 +86,12 @@
 #include <exception>
 #include <execution>
 #include <expected>
-#include <experimental/deque>
-#include <experimental/forward_list>
 #include <experimental/iterator>
-#include <experimental/list>
-#include <experimental/map>
 #include <experimental/memory>
-#include <experimental/memory_resource>
 #include <experimental/propagate_const>
-#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-#  include <experimental/regex>
-#endif
-#include <experimental/set>
 #include <experimental/simd>
-#include <experimental/string>
 #include <experimental/type_traits>
-#include <experimental/unordered_map>
-#include <experimental/unordered_set>
 #include <experimental/utility>
-#include <experimental/vector>
 #include <fenv.h>
 #include <filesystem>
 #include <float.h>
diff --git a/libcxx/include/experimental/__config b/libcxx/include/experimental/__config
index 65227c8b4052049..c86fd36dc558ea7 100644
--- a/libcxx/include/experimental/__config
+++ b/libcxx/include/experimental/__config
@@ -28,10 +28,6 @@
 #define _LIBCPP_END_NAMESPACE_LFTS_V2  } } }
 #define _VSTD_LFTS_V2 _VSTD_EXPERIMENTAL::fundamentals_v2
 
-#define _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR _LIBCPP_BEGIN_NAMESPACE_LFTS namespace pmr {
-#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
-#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-
 // TODO: support more targets
 #if defined(__AVX__)
 #define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
diff --git a/libcxx/include/experimental/deque b/libcxx/include/experimental/deque
deleted file mode 100644
index 46962afbb795eb4..000000000000000
--- a/libcxx/include/experimental/deque
+++ /dev/null
@@ -1,52 +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_DEQUE
-#define _LIBCPP_EXPERIMENTAL_DEQUE
-
-/*
-    experimental/deque synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
-  template <class T>
-  using deque = std::deque<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <deque>
-#include <experimental/__config>
-#include <experimental/memory_resource>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */
diff --git a/libcxx/include/experimental/forward_list b/libcxx/include/experimental/forward_list
deleted file mode 100644
index 5d2686deb27681f..000000000000000
--- a/libcxx/include/experimental/forward_list
+++ /dev/null
@@ -1,52 +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_FORWARD_LIST
-#define _LIBCPP_EXPERIMENTAL_FORWARD_LIST
-
-/*
-    experimental/forward_list synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
-  template <class T>
-  using forward_list = std::forward_list<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <forward_list>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */
diff --git a/libcxx/include/experimental/list b/libcxx/include/experimental/list
deleted file mode 100644
index 06abe8702241e35..000000000000000
--- a/libcxx/include/experimental/list
+++ /dev/null
@@ -1,52 +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_LIST
-#define _LIBCPP_EXPERIMENTAL_LIST
-
-/*
-    experimental/list synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
-  template <class T>
-  using list = std::list<T,polymorphic_allocator<T>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <list>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _ValueT>
-using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_LIST */
diff --git a/libcxx/include/experimental/map b/libcxx/include/experimental/map
deleted file mode 100644
index 8ec94e4a5bc86dd..000000000000000
--- a/libcxx/include/experimental/map
+++ /dev/null
@@ -1,62 +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_MAP
-#define _LIBCPP_EXPERIMENTAL_MAP
-
-/*
-    experimental/map synopsis
-
-// C++1z
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
-  template <class Key, class T, class Compare = less<Key>>
-  using map = std::map<Key, T, Compare,
-                       polymorphic_allocator<pair<const Key,T>>>;
-
-  template <class Key, class T, class Compare = less<Key>>
-  using multimap = std::multimap<Key, T, Compare,
-                                 polymorphic_allocator<pair<const Key,T>>>;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <experimental/__config>
-#include <experimental/memory_resource>
-#include <map>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#ifndef _LIBCPP_CXX03_LANG
-
-template <class _Key, class _Value, class  _Compare = less<_Key>>
-using map = _VSTD::map<_Key, _Value, _Compare,
-                        polymorphic_allocator<pair<const _Key, _Value>>>;
-
-template <class _Key, class _Value, class  _Compare = less<_Key>>
-using multimap = _VSTD::multimap<_Key, _Value, _Compare,
-                        polymorphic_allocator<pair<const _Key, _Value>>>;
-
-#endif // _LIBCPP_CXX03_LANG
-
-_LIBCPP_END_NAMESPACE_LFTS_PMR
-
-#endif /* _LIBCPP_EXPERIMENTAL_MAP */
diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource
deleted file mode 100644
index 8ae8322ae1a63e9..000000000000000
--- a/libcxx/include/experimental/memory_resource
+++ /dev/null
@@ -1,444 +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_RESOURCE
-#define _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
-
-/**
-    experimental/memory_resource synopsis
-
-// C++1y
-
-namespace std {
-namespace experimental {
-inline namespace fundamentals_v1 {
-namespace pmr {
-
-  class memory_resource;
-
-  bool operator==(const memory_resource& a,
-                  const memory_resource& b) noexcept;
-  bool operator!=(const memory_resource& a,
-                  const memory_resource& b) noexcept;
-
-  template <class Tp> class polymorphic_allocator;
-
-  template <class T1, class T2>
-  bool operator==(const polymorphic_allocator<T1>& a,
-                  const polymorphic_allocator<T2>& b) noexcept;
-  template <class T1, class T2>
-  bool operator!=(const polymorphic_allocator<T1>& a,
-                  const polymorphic_allocator<T2>& b) noexcept;
-
-  // The name resource_adaptor_imp is for exposition only.
-  template <class Allocator> class resource_adaptor_imp;
-
-  template <class Allocator>
-    using resource_adaptor = resource_adaptor_imp<
-      allocator_traits<Allocator>::rebind_alloc<char>>;
-
-  // Global memory resources
-  memory_resource* new_delete_resource() noexcept;
-  memory_resource* null_memory_resource() noexcept;
-
-  // The default memory resource
-  memory_resource* set_default_resource(memory_resource* r) noexcept;
-  memory_resource* get_default_resource() noexcept;
-
-  // Standard memory resources
-  struct pool_options;
-  class synchronized_pool_resource;
-  class unsynchronized_pool_resource;
-  class monotonic_buffer_resource;
-
-} // namespace pmr
-} // namespace fundamentals_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <__assert> // all public C++ headers provide the assertion handler
-#include <__memory/allocator_traits.h>
-#include <__type_traits/aligned_storage.h>
-#include <__utility/move.h>
-#include <cstddef>
-#include <experimental/__config>
-#include <experimental/__memory>
-#include <limits>
-#include <new>
-#include <stdexcept>
-#include <tuple>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
-
-#define _LIBCPP_DEPCREATED_MEMORY_RESOURCE(name)                                                                       \
-  _LIBCPP_DEPRECATED_("'std::experimental::pmr::" name                                                                 \
-                      "' is deprecated and will be removed in LLVM 18. Use 'std::pmr::" name "' instead.")
-
-#ifndef _LIBCPP_CXX03_LANG
-
-// Round __s up to next multiple of __a.
-inline _LIBCPP_INLINE_VISIBILITY
-size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT
-{
-    _LIBCPP_ASSERT_UNCATEGORIZED(__s + __a > __s, "aligned allocation size overflows");
-    return (__s + __a - 1) & ~(__a - 1);
-}
-
-// 8.5, memory.resource
-class _LIBCPP_DEPCREATED_MEMORY_RESOURCE("memory_resource") _LIBCPP_EXPORTED_FROM_ABI memory_resource
-{
-    static const size_t __max_align = _LIBCPP_ALIGNOF(max_align_t);
-
-// 8.5.2, memory.resource.public
-public:
-    _LIBCPP_HIDE_FROM_ABI_VIRTUAL virtual ~memory_resource() = default;
-
-    _LIBCPP_INLINE_VISIBILITY
-    void* allocate(size_t __bytes, size_t __align = __max_align)
-        { return do_allocate(__bytes, __align); }
-
-    _LIBCPP_INLINE_VISIBILITY
-    void deallocate(void * __p, size_t __bytes, size_t __align = __max_align)
-        { do_deallocate(__p, __bytes, __align); }
-
-    _LIBCPP_INLINE_VISIBILITY
-    bool is_equal(memory_resource const & __other) const _NOEXCEPT
-        { return do_is_equal(__other); }
-
-// 8.5.3, memory.resource.priv
-private:
-    virtual void* do_allocate(size_t, size_t) = 0;
-    virtual void do_deallocate(void*, size_t, size_t) = 0;
-    virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
-};
-
-// 8.5.4, memory.resource.eq
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator==(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
-bool operator==(memory_resource const & __lhs,
-                memory_resource const & __rhs) _NOEXCEPT
-{
-    return &__lhs == &__rhs || __lhs.is_equal(__rhs);
-}
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator!=(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(memory_resource const & __lhs,
-                memory_resource const & __rhs) _NOEXCEPT
-{
-    return !(__lhs == __rhs);
-}
-
-_LIBCPP_DEPCREATED_MEMORY_RESOURCE("new_delete_resource()") _L...
[truncated]

Copy link

github-actions bot commented Nov 22, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@ldionne ldionne force-pushed the review/remove-experimental-headers branch from 119ccaf to 59fd0d0 Compare November 23, 2023 15:26
Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! LGTM modulo one nit.

Several experimental headers around std::pmr have been slated for removal
for a while now. This patch actually performs the removal and cleanups
from the code base.
@ldionne ldionne force-pushed the review/remove-experimental-headers branch from cca2937 to 3dc1978 Compare November 27, 2023 15:54
@ldionne ldionne merged commit 12bb291 into llvm:main Nov 27, 2023
@ldionne ldionne deleted the review/remove-experimental-headers branch November 27, 2023 15:54
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