From 32de5a5893641b96a1441516c151b55096c57a27 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 11 Sep 2024 17:47:33 -0400 Subject: [PATCH] [libc++] Remove obsolete header restrictions for _LIBCPP_HAS_NO_THREADS (#107437) The _LIBCPP_HAS_NO_THREADS carve-out does not result in hard errors anymore, but the patch that changed that forgot to update the header restrictions we use to auto-generate several files. We can also remove the restrictions for the no-localization build and no-wide-characters, but doing it is less straightforward so I'm leaving it out of this patch. --- libcxx/include/__std_clang_module | 28 ++++++----------------- libcxx/modules/std.cppm.in | 28 ++++++----------------- libcxx/utils/libcxx/header_information.py | 9 -------- 3 files changed, 14 insertions(+), 51 deletions(-) diff --git a/libcxx/include/__std_clang_module b/libcxx/include/__std_clang_module index 18d6ce6b46c1f6..572528669a1e15 100644 --- a/libcxx/include/__std_clang_module +++ b/libcxx/include/__std_clang_module @@ -33,9 +33,7 @@ #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) # include #endif -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #include @@ -101,9 +99,7 @@ # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) @@ -120,9 +116,7 @@ # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) @@ -153,13 +147,9 @@ # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) @@ -175,9 +165,7 @@ #include #include #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif @@ -192,9 +180,7 @@ #endif #include #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #include diff --git a/libcxx/modules/std.cppm.in b/libcxx/modules/std.cppm.in index ad8a639b7f71a1..653f9933ba67c7 100644 --- a/libcxx/modules/std.cppm.in +++ b/libcxx/modules/std.cppm.in @@ -23,9 +23,7 @@ module; #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) # include #endif -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #include @@ -76,9 +74,7 @@ module; # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include @@ -94,9 +90,7 @@ module; # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) @@ -123,13 +117,9 @@ module; # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) @@ -137,9 +127,7 @@ module; #endif #include #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) # include #endif @@ -152,9 +140,7 @@ module; # include #endif #include -#if !defined(_LIBCPP_HAS_NO_THREADS) -# include -#endif +#include #include #include #include diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py index 166c9a77c08e70..694402141e1fab 100644 --- a/libcxx/utils/libcxx/header_information.py +++ b/libcxx/utils/libcxx/header_information.py @@ -31,15 +31,6 @@ "strstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)", "syncstream": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)", - # headers with #error directives - "barrier": "!defined(_LIBCPP_HAS_NO_THREADS)", - "future": "!defined(_LIBCPP_HAS_NO_THREADS)", - "latch": "!defined(_LIBCPP_HAS_NO_THREADS)", - "semaphore": "!defined(_LIBCPP_HAS_NO_THREADS)", - "shared_mutex": "!defined(_LIBCPP_HAS_NO_THREADS)", - "stop_token": "!defined(_LIBCPP_HAS_NO_THREADS)", - "thread": "!defined(_LIBCPP_HAS_NO_THREADS)", - # headers with #error directives "wchar.h": "!defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)", "wctype.h": "!defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)",