[libc++] Rename include/support to include/__support

We do ship those headers, so the directory name should not be something
that can potentially conflict with user-defined directories.

Differential Revision: https://reviews.llvm.org/D95956

GitOrigin-RevId: b51756819a85563ae063e98eeb3d6af8e44c8f64
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 9226d98..ec172f5 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -151,25 +151,25 @@
   string.h
   string_view
   strstream
-  support/android/locale_bionic.h
-  support/fuchsia/xlocale.h
-  support/ibm/limits.h
-  support/ibm/locale_mgmt_aix.h
-  support/ibm/nanosleep.h
-  support/ibm/support.h
-  support/ibm/xlocale.h
-  support/musl/xlocale.h
-  support/newlib/xlocale.h
-  support/nuttx/xlocale.h
-  support/openbsd/xlocale.h
-  support/solaris/floatingpoint.h
-  support/solaris/wchar.h
-  support/solaris/xlocale.h
-  support/win32/limits_msvc_win32.h
-  support/win32/locale_win32.h
-  support/xlocale/__nop_locale_mgmt.h
-  support/xlocale/__posix_l_fallback.h
-  support/xlocale/__strtonum_fallback.h
+  __support/android/locale_bionic.h
+  __support/fuchsia/xlocale.h
+  __support/ibm/limits.h
+  __support/ibm/locale_mgmt_aix.h
+  __support/ibm/nanosleep.h
+  __support/ibm/support.h
+  __support/ibm/xlocale.h
+  __support/musl/xlocale.h
+  __support/newlib/xlocale.h
+  __support/nuttx/xlocale.h
+  __support/openbsd/xlocale.h
+  __support/solaris/floatingpoint.h
+  __support/solaris/wchar.h
+  __support/solaris/xlocale.h
+  __support/win32/limits_msvc_win32.h
+  __support/win32/locale_win32.h
+  __support/xlocale/__nop_locale_mgmt.h
+  __support/xlocale/__posix_l_fallback.h
+  __support/xlocale/__strtonum_fallback.h
   system_error
   tgmath.h
   thread
diff --git a/include/__locale b/include/__locale
index a2da7d7..77e5faa 100644
--- a/include/__locale
+++ b/include/__locale
@@ -21,30 +21,30 @@
 #include <locale.h>
 #if defined(_LIBCPP_MSVCRT_LIKE)
 # include <cstring>
-# include <support/win32/locale_win32.h>
+# include <__support/win32/locale_win32.h>
 #elif defined(__NuttX__)
-# include <support/nuttx/xlocale.h>
+# include <__support/nuttx/xlocale.h>
 #elif defined(_AIX) || defined(__MVS__)
-# include <support/ibm/xlocale.h>
+# include <__support/ibm/xlocale.h>
 #elif defined(__ANDROID__)
-# include <support/android/locale_bionic.h>
+# include <__support/android/locale_bionic.h>
 #elif defined(__sun__)
 # include <xlocale.h>
-# include <support/solaris/xlocale.h>
+# include <__support/solaris/xlocale.h>
 #elif defined(_NEWLIB_VERSION)
-# include <support/newlib/xlocale.h>
+# include <__support/newlib/xlocale.h>
 #elif defined(__OpenBSD__)
-# include <support/openbsd/xlocale.h>
+# include <__support/openbsd/xlocale.h>
 #elif (defined(__APPLE__)      || defined(__FreeBSD__) \
     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
 # include <xlocale.h>
 #elif defined(__Fuchsia__)
-# include <support/fuchsia/xlocale.h>
+# include <__support/fuchsia/xlocale.h>
 #elif defined(__wasi__)
 // WASI libc uses musl's locales support.
-# include <support/musl/xlocale.h>
+# include <__support/musl/xlocale.h>
 #elif defined(_LIBCPP_HAS_MUSL_LIBC)
-# include <support/musl/xlocale.h>
+# include <__support/musl/xlocale.h>
 #endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/include/support/android/locale_bionic.h b/include/__support/android/locale_bionic.h
similarity index 89%
rename from include/support/android/locale_bionic.h
rename to include/__support/android/locale_bionic.h
index f05a6a0..8c6d4bd 100644
--- a/include/support/android/locale_bionic.h
+++ b/include/__support/android/locale_bionic.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------- support/android/locale_bionic.h ------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -28,13 +28,13 @@
 #include <android/api-level.h>
 #include <android/ndk-version.h>
 #if __ANDROID_API__ < 21
-#include <support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__posix_l_fallback.h>
 #endif
 // In NDK versions later than 16, locale-aware functions are provided by
 // legacy_stdlib_inlines.h
 #if __NDK_MAJOR__ <= 16
 #if __ANDROID_API__ < 21
-#include <support/xlocale/__strtonum_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
 #elif __ANDROID_API__ < 26
 
 #if defined(__cplusplus)
diff --git a/include/support/fuchsia/xlocale.h b/include/__support/fuchsia/xlocale.h
similarity index 74%
rename from include/support/fuchsia/xlocale.h
rename to include/__support/fuchsia/xlocale.h
index b86ce9e..e8def81 100644
--- a/include/support/fuchsia/xlocale.h
+++ b/include/__support/fuchsia/xlocale.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------- support/fuchsia/xlocale.h ------------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -14,8 +14,8 @@
 
 #include <cstdlib>
 #include <cwchar>
-#include <support/xlocale/__posix_l_fallback.h>
-#include <support/xlocale/__strtonum_fallback.h>
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
 
 #endif // defined(__Fuchsia__)
 
diff --git a/include/support/ibm/limits.h b/include/__support/ibm/limits.h
similarity index 97%
rename from include/support/ibm/limits.h
rename to include/__support/ibm/limits.h
index d1c59f0..45f1f1e 100644
--- a/include/support/ibm/limits.h
+++ b/include/__support/ibm/limits.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===--------------------- support/ibm/limits.h ---------------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/ibm/locale_mgmt_aix.h b/include/__support/ibm/locale_mgmt_aix.h
similarity index 96%
rename from include/support/ibm/locale_mgmt_aix.h
rename to include/__support/ibm/locale_mgmt_aix.h
index e452dc3..4f658c3 100644
--- a/include/support/ibm/locale_mgmt_aix.h
+++ b/include/__support/ibm/locale_mgmt_aix.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------- support/ibm/locale_mgmt_aix.h --------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/ibm/nanosleep.h b/include/__support/ibm/nanosleep.h
similarity index 100%
rename from include/support/ibm/nanosleep.h
rename to include/__support/ibm/nanosleep.h
diff --git a/include/support/ibm/support.h b/include/__support/ibm/support.h
similarity index 94%
rename from include/support/ibm/support.h
rename to include/__support/ibm/support.h
index 0569cbe..a7751b0 100644
--- a/include/support/ibm/support.h
+++ b/include/__support/ibm/support.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===----------------------- support/ibm/support.h ----------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/ibm/xlocale.h b/include/__support/ibm/xlocale.h
similarity index 96%
rename from include/support/ibm/xlocale.h
rename to include/__support/ibm/xlocale.h
index fde137c..ad07a25 100644
--- a/include/support/ibm/xlocale.h
+++ b/include/__support/ibm/xlocale.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===--------------------- support/ibm/xlocale.h -------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -9,7 +9,8 @@
 
 #ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
 #define _LIBCPP_SUPPORT_IBM_XLOCALE_H
-#include <support/ibm/locale_mgmt_aix.h>
+
+#include <__support/ibm/locale_mgmt_aix.h>
 
 #include "cstdlib"
 
@@ -218,7 +219,7 @@
 #elif defined(__MVS__)
 #include <wctype.h>
 // POSIX routines
-#include <support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__posix_l_fallback.h>
 #endif // defined(__MVS__)
 
 // The following are not POSIX routines.  These are quick-and-dirty hacks
diff --git a/include/support/musl/xlocale.h b/include/__support/musl/xlocale.h
similarity index 95%
rename from include/support/musl/xlocale.h
rename to include/__support/musl/xlocale.h
index 722d13f..2508a8e 100644
--- a/include/support/musl/xlocale.h
+++ b/include/__support/musl/xlocale.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------- support/musl/xlocale.h ------------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/newlib/xlocale.h b/include/__support/newlib/xlocale.h
similarity index 82%
rename from include/support/newlib/xlocale.h
rename to include/__support/newlib/xlocale.h
index 25fa798..b75f926 100644
--- a/include/support/newlib/xlocale.h
+++ b/include/__support/newlib/xlocale.h
@@ -17,9 +17,9 @@
 #include <ctype.h>
 #if !defined(__NEWLIB__) || __NEWLIB__ < 2 || \
     __NEWLIB__ == 2 && __NEWLIB_MINOR__ < 5
-#include <support/xlocale/__nop_locale_mgmt.h>
-#include <support/xlocale/__posix_l_fallback.h>
-#include <support/xlocale/__strtonum_fallback.h>
+#include <__support/xlocale/__nop_locale_mgmt.h>
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
 #endif
 
 #endif // _NEWLIB_VERSION
diff --git a/include/support/nuttx/xlocale.h b/include/__support/nuttx/xlocale.h
similarity index 70%
rename from include/support/nuttx/xlocale.h
rename to include/__support/nuttx/xlocale.h
index b70d620..be738e3 100644
--- a/include/support/nuttx/xlocale.h
+++ b/include/__support/nuttx/xlocale.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-------------------- support/nuttx/xlocale.h -------------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -11,8 +11,8 @@
 #define _LIBCPP_SUPPORT_NUTTX_XLOCALE_H
 
 #if defined(__NuttX__)
-#include <support/xlocale/__posix_l_fallback.h>
-#include <support/xlocale/__strtonum_fallback.h>
+#include <__support/xlocale/__posix_l_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
 #endif // __NuttX__
 
 #endif
diff --git a/include/support/openbsd/xlocale.h b/include/__support/openbsd/xlocale.h
similarity index 77%
rename from include/support/openbsd/xlocale.h
rename to include/__support/openbsd/xlocale.h
index fbfaedd..1136fa3 100644
--- a/include/support/openbsd/xlocale.h
+++ b/include/__support/openbsd/xlocale.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-------------------- support/openbsd/xlocale.h -----------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -14,6 +14,6 @@
 #include <clocale>
 #include <cwctype>
 #include <ctype.h>
-#include <support/xlocale/__strtonum_fallback.h>
+#include <__support/xlocale/__strtonum_fallback.h>
 
 #endif
diff --git a/include/support/solaris/floatingpoint.h b/include/__support/solaris/floatingpoint.h
similarity index 100%
rename from include/support/solaris/floatingpoint.h
rename to include/__support/solaris/floatingpoint.h
diff --git a/include/support/solaris/wchar.h b/include/__support/solaris/wchar.h
similarity index 100%
rename from include/support/solaris/wchar.h
rename to include/__support/solaris/wchar.h
diff --git a/include/support/solaris/xlocale.h b/include/__support/solaris/xlocale.h
similarity index 100%
rename from include/support/solaris/xlocale.h
rename to include/__support/solaris/xlocale.h
diff --git a/include/support/win32/limits_msvc_win32.h b/include/__support/win32/limits_msvc_win32.h
similarity index 96%
rename from include/support/win32/limits_msvc_win32.h
rename to include/__support/win32/limits_msvc_win32.h
index 7bb8355..758d246 100644
--- a/include/support/win32/limits_msvc_win32.h
+++ b/include/__support/win32/limits_msvc_win32.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------ support/win32/limits_msvc_win32.h -----------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/win32/locale_win32.h b/include/__support/win32/locale_win32.h
similarity index 98%
rename from include/support/win32/locale_win32.h
rename to include/__support/win32/locale_win32.h
index 897c36b..d32a7a8 100644
--- a/include/support/win32/locale_win32.h
+++ b/include/__support/win32/locale_win32.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===--------------------- support/win32/locale_win32.h -------------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/xlocale/__nop_locale_mgmt.h b/include/__support/xlocale/__nop_locale_mgmt.h
similarity index 94%
rename from include/support/xlocale/__nop_locale_mgmt.h
rename to include/__support/xlocale/__nop_locale_mgmt.h
index f33d389..57b1884 100644
--- a/include/support/xlocale/__nop_locale_mgmt.h
+++ b/include/__support/xlocale/__nop_locale_mgmt.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------  support/xlocale/__nop_locale_mgmt.h -----------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/xlocale/__posix_l_fallback.h b/include/__support/xlocale/__posix_l_fallback.h
similarity index 97%
rename from include/support/xlocale/__posix_l_fallback.h
rename to include/__support/xlocale/__posix_l_fallback.h
index f3df6c4..00d69d1 100644
--- a/include/support/xlocale/__posix_l_fallback.h
+++ b/include/__support/xlocale/__posix_l_fallback.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===--------------- support/xlocale/__posix_l_fallback.h -----------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/support/xlocale/__strtonum_fallback.h b/include/__support/xlocale/__strtonum_fallback.h
similarity index 96%
rename from include/support/xlocale/__strtonum_fallback.h
rename to include/__support/xlocale/__strtonum_fallback.h
index df38598..1172a5d 100644
--- a/include/support/xlocale/__strtonum_fallback.h
+++ b/include/__support/xlocale/__strtonum_fallback.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-------------- support/xlocale/__strtonum_fallback.h -----------------===//
+//===-----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/include/__threading_support b/include/__threading_support
index 473c9c3..de572f3 100644
--- a/include/__threading_support
+++ b/include/__threading_support
@@ -17,7 +17,7 @@
 #include <errno.h>
 
 #ifdef __MVS__
-# include <support/ibm/nanosleep.h>
+# include <__support/ibm/nanosleep.h>
 #endif
 
 #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
diff --git a/include/bit b/include/bit
index fe36017..f8c37c3 100644
--- a/include/bit
+++ b/include/bit
@@ -62,7 +62,7 @@
 #include <__debug>
 
 #if defined(__IBMCPP__)
-#include "support/ibm/support.h"
+#include "__support/ibm/support.h"
 #endif
 #if defined(_LIBCPP_COMPILER_MSVC)
 #include <intrin.h>
diff --git a/include/limits b/include/limits
index 6d5d1e1..8f97cd1 100644
--- a/include/limits
+++ b/include/limits
@@ -105,11 +105,11 @@
 #include <type_traits>
 
 #if defined(_LIBCPP_COMPILER_MSVC)
-#include "support/win32/limits_msvc_win32.h"
+#include "__support/win32/limits_msvc_win32.h"
 #endif // _LIBCPP_MSVCRT
 
 #if defined(__IBMCPP__)
-#include "support/ibm/limits.h"
+#include "__support/ibm/limits.h"
 #endif // __IBMCPP__
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 224299b..76227d3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -109,7 +109,7 @@
 if (LIBCXX_CONFIGURE_IDE)
   file(GLOB_RECURSE LIBCXX_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*)
   if(WIN32)
-    file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/support/win32/*.h)
+    file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/__support/win32/*.h)
     list(APPEND LIBCXX_HEADERS ${LIBCXX_WIN32_HEADERS})
   endif()
   # Force them all into the headers dir on MSVC, otherwise they end up at
diff --git a/src/locale.cpp b/src/locale.cpp
index f109389..a0209d0 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -29,7 +29,7 @@
 #include "cwctype"
 #include "__sso_allocator"
 #if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
-#include "support/win32/locale_win32.h"
+#include "__support/win32/locale_win32.h"
 #elif !defined(__BIONIC__) && !defined(__NuttX__)
 #include <langinfo.h>
 #endif
diff --git a/src/support/solaris/xlocale.cpp b/src/support/solaris/xlocale.cpp
index d68a39f..d25adcd 100644
--- a/src/support/solaris/xlocale.cpp
+++ b/src/support/solaris/xlocale.cpp
@@ -8,7 +8,7 @@
 
 #ifdef __sun__
 
-#include "support/solaris/xlocale.h"
+#include "__support/solaris/xlocale.h"
 #include <stdarg.h>
 #include <stdio.h>
 #include <sys/localedef.h>
diff --git a/src/support/win32/locale_win32.cpp b/src/support/win32/locale_win32.cpp
index b7062db..e7c6005 100644
--- a/src/support/win32/locale_win32.cpp
+++ b/src/support/win32/locale_win32.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-------------------- support/win32/locale_win32.cpp ------------------===//
+//===----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/src/support/win32/support.cpp b/src/support/win32/support.cpp
index d156e02..52453f5 100644
--- a/src/support/win32/support.cpp
+++ b/src/support/win32/support.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===----------------------- support/win32/support.h ----------------------===//
+//===----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
diff --git a/src/support/win32/thread_win32.cpp b/src/support/win32/thread_win32.cpp
index 83e7e9f..35c4c87 100644
--- a/src/support/win32/thread_win32.cpp
+++ b/src/support/win32/thread_win32.cpp
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===-------------------- support/win32/thread_win32.cpp ------------------===//
+//===----------------------------------------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.