[libcxx-commits] [libcxx] c8b14c0 - [libc++][NFC] Fix include guard for decay_copy.h and remove underscores from the header
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 27 09:46:27 PDT 2021
Author: Louis Dionne
Date: 2021-08-27T12:45:53-04:00
New Revision: c8b14c03ec741f672f0ca1370ecdd9415d7eca7c
URL: https://github.com/llvm/llvm-project/commit/c8b14c03ec741f672f0ca1370ecdd9415d7eca7c
DIFF: https://github.com/llvm/llvm-project/commit/c8b14c03ec741f672f0ca1370ecdd9415d7eca7c.diff
LOG: [libc++][NFC] Fix include guard for decay_copy.h and remove underscores from the header
We don't use double underscores for private header names when they are
in a subdirectory with double underscores already.
Differential Revision: https://reviews.llvm.org/D108820
Added:
libcxx/include/__utility/decay_copy.h
libcxx/test/libcxx/diagnostics/detail.headers/utility/decay_copy.module.verify.cpp
Modified:
libcxx/include/CMakeLists.txt
libcxx/include/__ranges/access.h
libcxx/include/__ranges/all.h
libcxx/include/__ranges/counted.h
libcxx/include/__ranges/size.h
libcxx/include/future
libcxx/include/module.modulemap
libcxx/include/thread
Removed:
libcxx/include/__utility/__decay_copy.h
libcxx/test/libcxx/diagnostics/detail.headers/utility/__decay_copy.module.verify.cpp
################################################################################
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index a5b9b314462e9..bedce0e49e614 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -264,9 +264,9 @@ set(files
__tree
__tuple
__undef_macros
- __utility/__decay_copy.h
__utility/as_const.h
__utility/cmp.h
+ __utility/decay_copy.h
__utility/declval.h
__utility/exchange.h
__utility/forward.h
diff --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h
index 4e690c2eb450d..559711359c5a8 100644
--- a/libcxx/include/__ranges/access.h
+++ b/libcxx/include/__ranges/access.h
@@ -13,8 +13,8 @@
#include <__iterator/concepts.h>
#include <__iterator/readable_traits.h>
#include <__ranges/enable_borrowed_range.h>
-#include <__utility/__decay_copy.h>
#include <__utility/as_const.h>
+#include <__utility/decay_copy.h>
#include <__utility/forward.h>
#include <concepts>
#include <type_traits>
diff --git a/libcxx/include/__ranges/all.h b/libcxx/include/__ranges/all.h
index 45379192c70ec..affe13ee0862e 100644
--- a/libcxx/include/__ranges/all.h
+++ b/libcxx/include/__ranges/all.h
@@ -17,7 +17,7 @@
#include <__ranges/range_adaptor.h>
#include <__ranges/ref_view.h>
#include <__ranges/subrange.h>
-#include <__utility/__decay_copy.h>
+#include <__utility/decay_copy.h>
#include <__utility/declval.h>
#include <__utility/forward.h>
#include <type_traits>
diff --git a/libcxx/include/__ranges/counted.h b/libcxx/include/__ranges/counted.h
index d26f2498b3f3f..d292bcbb18498 100644
--- a/libcxx/include/__ranges/counted.h
+++ b/libcxx/include/__ranges/counted.h
@@ -18,7 +18,7 @@
#include <__memory/pointer_traits.h>
#include <__ranges/concepts.h>
#include <__ranges/subrange.h>
-#include <__utility/__decay_copy.h>
+#include <__utility/decay_copy.h>
#include <__utility/declval.h>
#include <__utility/forward.h>
#include <__utility/move.h>
diff --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h
index 663b8e6b99c28..c764a3dd7ce56 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -13,7 +13,7 @@
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/access.h>
-#include <__utility/__decay_copy.h>
+#include <__utility/decay_copy.h>
#include <__utility/forward.h>
#include <concepts>
#include <type_traits>
diff --git a/libcxx/include/__utility/__decay_copy.h b/libcxx/include/__utility/decay_copy.h
similarity index 86%
rename from libcxx/include/__utility/__decay_copy.h
rename to libcxx/include/__utility/decay_copy.h
index cc0e45a821472..1a7b399d917d1 100644
--- a/libcxx/include/__utility/__decay_copy.h
+++ b/libcxx/include/__utility/decay_copy.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
-#define _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
+#ifndef _LIBCPP___UTILITY_DECAY_COPY_H
+#define _LIBCPP___UTILITY_DECAY_COPY_H
#include <__config>
#include <__utility/forward.h>
@@ -31,4 +31,4 @@ inline _LIBCPP_INLINE_VISIBILITY typename decay<_Tp>::type __decay_copy(_Tp&& __
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP___TYPE_TRAITS_DECAY_COPY_H
+#endif // _LIBCPP___UTILITY_DECAY_COPY_H
diff --git a/libcxx/include/future b/libcxx/include/future
index 349e6afc43e4a..89acdba62bfac 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -366,7 +366,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
#include <__debug>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
-#include <__utility/__decay_copy.h>
+#include <__utility/decay_copy.h>
#include <__utility/forward.h>
#include <chrono>
#include <exception>
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index b6a39a0702d52..783f2125adbd7 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -789,9 +789,9 @@ module std [system] {
export *
module __utility {
- module __decay_copy { private header "__utility/__decay_copy.h" }
module as_const { private header "__utility/as_const.h" }
module cmp { private header "__utility/cmp.h" }
+ module decay_copy { private header "__utility/decay_copy.h" }
module declval { private header "__utility/declval.h" }
module exchange { private header "__utility/exchange.h" }
module forward { private header "__utility/forward.h" }
diff --git a/libcxx/include/thread b/libcxx/include/thread
index acfc20bce2dde..9b591976acc4f 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -87,7 +87,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <__functional_base>
#include <__mutex_base>
#include <__threading_support>
-#include <__utility/__decay_copy.h>
+#include <__utility/decay_copy.h>
#include <__utility/forward.h>
#include <chrono>
#include <cstddef>
diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/utility/__decay_copy.module.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/utility/decay_copy.module.verify.cpp
similarity index 89%
rename from libcxx/test/libcxx/diagnostics/detail.headers/utility/__decay_copy.module.verify.cpp
rename to libcxx/test/libcxx/diagnostics/detail.headers/utility/decay_copy.module.verify.cpp
index 3398a0b31e4bf..e68310754fe27 100644
--- a/libcxx/test/libcxx/diagnostics/detail.headers/utility/__decay_copy.module.verify.cpp
+++ b/libcxx/test/libcxx/diagnostics/detail.headers/utility/decay_copy.module.verify.cpp
@@ -12,5 +12,5 @@
// WARNING: This test was generated by 'generate_private_header_tests.py'
// and should not be edited manually.
-// expected-error@*:* {{use of private header from outside its module: '__utility/__decay_copy.h'}}
-#include <__utility/__decay_copy.h>
+// expected-error@*:* {{use of private header from outside its module: '__utility/decay_copy.h'}}
+#include <__utility/decay_copy.h>
More information about the libcxx-commits
mailing list