[llvm] 861386d - [libc++] Remove <experimental/filesystem> header
Joe Loser via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 12 16:45:14 PST 2022
Author: Joe Loser
Date: 2022-02-12T19:43:57-05:00
New Revision: 861386dbd6ff0d91636b7c674c2abb2eccd9d3f2
URL: https://github.com/llvm/llvm-project/commit/861386dbd6ff0d91636b7c674c2abb2eccd9d3f2
DIFF: https://github.com/llvm/llvm-project/commit/861386dbd6ff0d91636b7c674c2abb2eccd9d3f2.diff
LOG: [libc++] Remove <experimental/filesystem> header
`<filesystem>` header has been around for a while now, so we can safely remove
`<experimental/filesystem>` header. `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`
suggests we were going to remove `<experimental/filesystem>` in llvm 11 release,
but we never did. So, remove the experimental header now, its associated tests,
and the `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM` macro.
Differential Revision: https://reviews.llvm.org/D119603
Added:
Modified:
libcxx/docs/ReleaseNotes.rst
libcxx/include/CMakeLists.txt
libcxx/include/experimental/__config
libcxx/include/module.modulemap
libcxx/test/libcxx/double_include.sh.cpp
libcxx/test/libcxx/min_max_macros.compile.pass.cpp
libcxx/test/libcxx/nasty_macros.compile.pass.cpp
libcxx/test/libcxx/no_assert_include.compile.pass.cpp
libcxx/utils/generate_header_tests.py
llvm/utils/gn/secondary/libcxx/include/BUILD.gn
Removed:
libcxx/include/experimental/filesystem
libcxx/test/libcxx/experimental/filesystem/deprecated.verify.cpp
libcxx/test/libcxx/experimental/filesystem/version.pass.cpp
libcxx/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
libcxx/test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp
################################################################################
diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 0bf24b982150..58b45065e2e2 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -46,6 +46,9 @@ API Changes
they were not supposed to set ``_LIBCPP_ABI_UNSTABLE`` manually, however we
still feel that it is worth mentioning in the release notes in case some users
had been doing it.
+- The header ``<experimental/filesystem>`` has been removed. Instead, use
+ ``<filesystem>`` header. The associated macro
+ ``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has also been removed.
ABI Changes
-----------
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 40ada5c9ce9e..877befc6b96b 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -450,7 +450,6 @@ set(files
experimental/algorithm
experimental/coroutine
experimental/deque
- experimental/filesystem
experimental/forward_list
experimental/functional
experimental/iterator
diff --git a/libcxx/include/experimental/__config b/libcxx/include/experimental/__config
index 7cbb7f425e41..a71b348c0490 100644
--- a/libcxx/include/experimental/__config
+++ b/libcxx/include/experimental/__config
@@ -32,19 +32,6 @@
#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
-#if defined(_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM)
-# define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM /* nothing */
-#else
-# define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM __attribute__((deprecated("std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.")))
-#endif
-
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
- _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM { \
- inline namespace v1 {
-
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
- } } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
-
#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
#define _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES
#endif
diff --git a/libcxx/include/experimental/filesystem b/libcxx/include/experimental/filesystem
deleted file mode 100644
index 8f3fa38a3fdb..000000000000
--- a/libcxx/include/experimental/filesystem
+++ /dev/null
@@ -1,256 +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_FILESYSTEM
-#define _LIBCPP_EXPERIMENTAL_FILESYSTEM
-/*
- filesystem synopsis
-
- namespace std { namespace experimental { namespace filesystem { inline namespace v1 {
-
- class path;
-
- void swap(path& lhs, path& rhs) noexcept;
- size_t hash_value(const path& p) noexcept;
-
- bool operator==(const path& lhs, const path& rhs) noexcept;
- bool operator!=(const path& lhs, const path& rhs) noexcept;
- bool operator< (const path& lhs, const path& rhs) noexcept;
- bool operator<=(const path& lhs, const path& rhs) noexcept;
- bool operator> (const path& lhs, const path& rhs) noexcept;
- bool operator>=(const path& lhs, const path& rhs) noexcept;
-
- path operator/ (const path& lhs, const path& rhs);
-
- // fs.path.io operators are friends of path.
- template <class charT, class traits>
- friend basic_ostream<charT, traits>&
- operator<<(basic_ostream<charT, traits>& os, const path& p);
-
- template <class charT, class traits>
- friend basic_istream<charT, traits>&
- operator>>(basic_istream<charT, traits>& is, path& p);
-
- template <class Source>
- path u8path(const Source& source);
- template <class InputIterator>
- path u8path(InputIterator first, InputIterator last);
-
- class filesystem_error;
- class directory_entry;
-
- class directory_iterator;
-
- // enable directory_iterator range-based for statements
- directory_iterator begin(directory_iterator iter) noexcept;
- directory_iterator end(const directory_iterator&) noexcept;
-
- class recursive_directory_iterator;
-
- // enable recursive_directory_iterator range-based for statements
- recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
- recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
-
- class file_status;
-
- struct space_info
- {
- uintmax_t capacity;
- uintmax_t free;
- uintmax_t available;
- };
-
- enum class file_type;
- enum class perms;
- enum class perm_options;
- enum class copy_options;
- enum class directory_options;
-
- typedef chrono::time_point<trivial-clock> file_time_type;
-
- // operational functions
-
- path absolute(const path& p);
- path absolute(const path& p, error_code &ec);
-
- path canonical(const path& p);
- path canonical(const path& p, error_code& ec);
-
- void copy(const path& from, const path& to);
- void copy(const path& from, const path& to, error_code& ec);
- void copy(const path& from, const path& to, copy_options options);
- void copy(const path& from, const path& to, copy_options options,
- error_code& ec);
-
- bool copy_file(const path& from, const path& to);
- bool copy_file(const path& from, const path& to, error_code& ec);
- bool copy_file(const path& from, const path& to, copy_options option);
- bool copy_file(const path& from, const path& to, copy_options option,
- error_code& ec);
-
- void copy_symlink(const path& existing_symlink, const path& new_symlink);
- void copy_symlink(const path& existing_symlink, const path& new_symlink,
- error_code& ec) noexcept;
-
- bool create_directories(const path& p);
- bool create_directories(const path& p, error_code& ec);
-
- bool create_directory(const path& p);
- bool create_directory(const path& p, error_code& ec) noexcept;
-
- bool create_directory(const path& p, const path& attributes);
- bool create_directory(const path& p, const path& attributes,
- error_code& ec) noexcept;
-
- void create_directory_symlink(const path& to, const path& new_symlink);
- void create_directory_symlink(const path& to, const path& new_symlink,
- error_code& ec) noexcept;
-
- void create_hard_link(const path& to, const path& new_hard_link);
- void create_hard_link(const path& to, const path& new_hard_link,
- error_code& ec) noexcept;
-
- void create_symlink(const path& to, const path& new_symlink);
- void create_symlink(const path& to, const path& new_symlink,
- error_code& ec) noexcept;
-
- path current_path();
- path current_path(error_code& ec);
- void current_path(const path& p);
- void current_path(const path& p, error_code& ec) noexcept;
-
- bool exists(file_status s) noexcept;
- bool exists(const path& p);
- bool exists(const path& p, error_code& ec) noexcept;
-
- bool equivalent(const path& p1, const path& p2);
- bool equivalent(const path& p1, const path& p2, error_code& ec) noexcept;
-
- uintmax_t file_size(const path& p);
- uintmax_t file_size(const path& p, error_code& ec) noexcept;
-
- uintmax_t hard_link_count(const path& p);
- uintmax_t hard_link_count(const path& p, error_code& ec) noexcept;
-
- bool is_block_file(file_status s) noexcept;
- bool is_block_file(const path& p);
- bool is_block_file(const path& p, error_code& ec) noexcept;
-
- bool is_character_file(file_status s) noexcept;
- bool is_character_file(const path& p);
- bool is_character_file(const path& p, error_code& ec) noexcept;
-
- bool is_directory(file_status s) noexcept;
- bool is_directory(const path& p);
- bool is_directory(const path& p, error_code& ec) noexcept;
-
- bool is_empty(const path& p);
- bool is_empty(const path& p, error_code& ec) noexcept;
-
- bool is_fifo(file_status s) noexcept;
- bool is_fifo(const path& p);
- bool is_fifo(const path& p, error_code& ec) noexcept;
-
- bool is_other(file_status s) noexcept;
- bool is_other(const path& p);
- bool is_other(const path& p, error_code& ec) noexcept;
-
- bool is_regular_file(file_status s) noexcept;
- bool is_regular_file(const path& p);
- bool is_regular_file(const path& p, error_code& ec) noexcept;
-
- bool is_socket(file_status s) noexcept;
- bool is_socket(const path& p);
- bool is_socket(const path& p, error_code& ec) noexcept;
-
- bool is_symlink(file_status s) noexcept;
- bool is_symlink(const path& p);
- bool is_symlink(const path& p, error_code& ec) noexcept;
-
- file_time_type last_write_time(const path& p);
- file_time_type last_write_time(const path& p, error_code& ec) noexcept;
- void last_write_time(const path& p, file_time_type new_time);
- void last_write_time(const path& p, file_time_type new_time,
- error_code& ec) noexcept;
-
- void permissions(const path& p, perms prms,
- perm_options opts=perm_options::replace);
- void permissions(const path& p, perms prms, error_code& ec) noexcept;
- void permissions(const path& p, perms prms, perm_options opts,
- error_code& ec);
-
- path proximate(const path& p, error_code& ec);
- path proximate(const path& p, const path& base = current_path());
- path proximate(const path& p, const path& base, error_code &ec);
-
- path read_symlink(const path& p);
- path read_symlink(const path& p, error_code& ec);
-
- path relative(const path& p, error_code& ec);
- path relative(const path& p, const path& base=current_path());
- path relative(const path& p, const path& base, error_code& ec);
-
- bool remove(const path& p);
- bool remove(const path& p, error_code& ec) noexcept;
-
- uintmax_t remove_all(const path& p);
- uintmax_t remove_all(const path& p, error_code& ec);
-
- void rename(const path& from, const path& to);
- void rename(const path& from, const path& to, error_code& ec) noexcept;
-
- void resize_file(const path& p, uintmax_t size);
- void resize_file(const path& p, uintmax_t size, error_code& ec) noexcept;
-
- space_info space(const path& p);
- space_info space(const path& p, error_code& ec) noexcept;
-
- file_status status(const path& p);
- file_status status(const path& p, error_code& ec) noexcept;
-
- bool status_known(file_status s) noexcept;
-
- file_status symlink_status(const path& p);
- file_status symlink_status(const path& p, error_code& ec) noexcept;
-
- path temp_directory_path();
- path temp_directory_path(error_code& ec);
-
- path weakly_canonical(path const& p);
- path weakly_canonical(path const& p, error_code& ec);
-
-
-} } } } // namespaces std::experimental::filesystem::v1
-
-*/
-
-#include <experimental/__config>
-#include <filesystem>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-#ifndef _LIBCPP_CXX03_LANG
-
-#define __cpp_lib_experimental_filesystem 201406
-
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
-
-using namespace _VSTD_FS;
-
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
-
-#endif // !_LIBCPP_CXX03_LANG
-
-_LIBCPP_POP_MACROS
-
-#endif // _LIBCPP_EXPERIMENTAL_FILESYSTEM
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index 6a55bf3f42d7..572705330fe0 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1020,10 +1020,6 @@ module std [system] {
header "experimental/deque"
export *
}
- module filesystem {
- header "experimental/filesystem"
- export *
- }
module forward_list {
header "experimental/forward_list"
export *
diff --git a/libcxx/test/libcxx/double_include.sh.cpp b/libcxx/test/libcxx/double_include.sh.cpp
index 41591b77991e..6e2c2ab0e6f9 100644
--- a/libcxx/test/libcxx/double_include.sh.cpp
+++ b/libcxx/test/libcxx/double_include.sh.cpp
@@ -210,9 +210,6 @@
# include <experimental/coroutine>
# endif
# include <experimental/deque>
-# ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
-# include <experimental/filesystem>
-# endif
# include <experimental/forward_list>
# include <experimental/functional>
# include <experimental/iterator>
diff --git a/libcxx/test/libcxx/experimental/filesystem/deprecated.verify.cpp b/libcxx/test/libcxx/experimental/filesystem/deprecated.verify.cpp
deleted file mode 100644
index d9064e182e82..000000000000
--- a/libcxx/test/libcxx/experimental/filesystem/deprecated.verify.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// <experimental/filesystem>
-
-#include <experimental/filesystem>
-
-using namespace std::experimental::filesystem; // expected-warning {{'filesystem' is deprecated: std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/filesystem/version.pass.cpp b/libcxx/test/libcxx/experimental/filesystem/version.pass.cpp
deleted file mode 100644
index 70c3ba742222..000000000000
--- a/libcxx/test/libcxx/experimental/filesystem/version.pass.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// <experimental/filesystem>
-
-#define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM
-
-#include <experimental/filesystem>
-
-#include "test_macros.h"
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION not defined
-#endif
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
index 3d0425a3542a..4bde1336de02 100644
--- a/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ b/libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -329,10 +329,6 @@ TEST_MACROS();
# endif
# include <experimental/deque>
TEST_MACROS();
-# ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
-# include <experimental/filesystem>
-TEST_MACROS();
-# endif
# include <experimental/forward_list>
TEST_MACROS();
# include <experimental/functional>
diff --git a/libcxx/test/libcxx/nasty_macros.compile.pass.cpp b/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
index 652939833161..d94e3b3a54ec 100644
--- a/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
+++ b/libcxx/test/libcxx/nasty_macros.compile.pass.cpp
@@ -320,9 +320,6 @@
# include <experimental/coroutine>
# endif
# include <experimental/deque>
-# ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
-# include <experimental/filesystem>
-# endif
# include <experimental/forward_list>
# include <experimental/functional>
# include <experimental/iterator>
diff --git a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
index 8f16a6386c22..37e88f7db0c4 100644
--- a/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ b/libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -205,9 +205,6 @@
# include <experimental/coroutine>
# endif
# include <experimental/deque>
-# ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY
-# include <experimental/filesystem>
-# endif
# include <experimental/forward_list>
# include <experimental/functional>
# include <experimental/iterator>
diff --git a/libcxx/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
deleted file mode 100644
index 58cadb53e49a..000000000000
--- a/libcxx/test/std/experimental/filesystem/fs.req.macros/feature_macro.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// <experimental/filesystem>
-
-// #define __cpp_lib_experimental_filesystem 201406L
-
-#include <experimental/filesystem>
-#include "test_macros.h"
-
-#if TEST_STD_VER >= 11
-#ifndef __cpp_lib_experimental_filesystem
-#error Filesystem feature test macro is not defined (__cpp_lib_experimental_filesystem)
-#elif __cpp_lib_experimental_filesystem != 201406L
-#error Filesystem feature test macro has an incorrect value (__cpp_lib_experimental_filesystem)
-#endif
-#else // TEST_STD_VER < 11
-#ifdef __cpp_lib_experimental_filesystem
-#error Filesystem feature test macro should not be defined in c++03
-#endif
-#endif
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp b/libcxx/test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp
deleted file mode 100644
index 7a82fe6cd474..000000000000
--- a/libcxx/test/std/experimental/filesystem/fs.req.namespace/namespace.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcpp-has-no-filesystem-library
-
-// <experimental/filesystem>
-
-// namespace std::experimental::filesystem::v1
-
-#include <experimental/filesystem>
-#include <type_traits>
-
-#include "test_macros.h"
-
-int main(int, char**) {
- static_assert(std::is_same<
- std::experimental::filesystem::path,
- std::experimental::filesystem::v1::path
- >::value, "");
-
- return 0;
-}
diff --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py
index 9b7af9bac03e..55bbc58e39b5 100755
--- a/libcxx/utils/generate_header_tests.py
+++ b/libcxx/utils/generate_header_tests.py
@@ -29,7 +29,6 @@ def get_libcxx_paths():
"shared_mutex": ["ifndef _LIBCPP_HAS_NO_THREADS"],
"thread": ["ifndef _LIBCPP_HAS_NO_THREADS"],
- "experimental/filesystem": ["ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY"],
"filesystem": ["ifndef _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY"],
"format": ["ifndef _LIBCPP_HAS_NO_INCOMPLETE_FORMAT"],
diff --git a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
index 164923f0014b..42cd8e84e92c 100644
--- a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
@@ -504,7 +504,6 @@ if (current_toolchain == default_toolchain) {
"experimental/algorithm",
"experimental/coroutine",
"experimental/deque",
- "experimental/filesystem",
"experimental/forward_list",
"experimental/functional",
"experimental/iterator",
More information about the llvm-commits
mailing list