[libc-commits] [libc] bcdbd0b - Revert "[libc][NFC] split type_traits / utility in separate files (#65314)"
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Wed Sep 6 01:48:41 PDT 2023
Author: Guillaume Chatelet
Date: 2023-09-06T08:47:45Z
New Revision: bcdbd0bd0b4b7e5bf6d61ff94db592044d1f5a39
URL: https://github.com/llvm/llvm-project/commit/bcdbd0bd0b4b7e5bf6d61ff94db592044d1f5a39
DIFF: https://github.com/llvm/llvm-project/commit/bcdbd0bd0b4b7e5bf6d61ff94db592044d1f5a39.diff
LOG: Revert "[libc][NFC] split type_traits / utility in separate files (#65314)"
This reverts commit b793c7e530b6f218deb4a355b6375b7fef41ebb1.
It broke the libc-x86_64-debian-gcc-fullbuild-dbg build bot.
https://lab.llvm.org/buildbot/#/builders/250/builds/9776
Added:
Modified:
libc/src/__support/CPP/functional.h
libc/src/__support/CPP/type_traits.h
libc/src/__support/CPP/utility.h
utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Removed:
libc/src/__support/CPP/type_traits/add_lvalue_reference.h
libc/src/__support/CPP/type_traits/add_pointer.h
libc/src/__support/CPP/type_traits/add_rvalue_reference.h
libc/src/__support/CPP/type_traits/bool_constant.h
libc/src/__support/CPP/type_traits/conditional.h
libc/src/__support/CPP/type_traits/decay.h
libc/src/__support/CPP/type_traits/enable_if.h
libc/src/__support/CPP/type_traits/false_type.h
libc/src/__support/CPP/type_traits/integral_constant.h
libc/src/__support/CPP/type_traits/is_arithmetic.h
libc/src/__support/CPP/type_traits/is_array.h
libc/src/__support/CPP/type_traits/is_base_of.h
libc/src/__support/CPP/type_traits/is_class.h
libc/src/__support/CPP/type_traits/is_const.h
libc/src/__support/CPP/type_traits/is_convertible.h
libc/src/__support/CPP/type_traits/is_destructible.h
libc/src/__support/CPP/type_traits/is_enum.h
libc/src/__support/CPP/type_traits/is_floating_point.h
libc/src/__support/CPP/type_traits/is_function.h
libc/src/__support/CPP/type_traits/is_integral.h
libc/src/__support/CPP/type_traits/is_lvalue_reference.h
libc/src/__support/CPP/type_traits/is_null_pointer.h
libc/src/__support/CPP/type_traits/is_pointer.h
libc/src/__support/CPP/type_traits/is_reference.h
libc/src/__support/CPP/type_traits/is_rvalue_reference.h
libc/src/__support/CPP/type_traits/is_same.h
libc/src/__support/CPP/type_traits/is_signed.h
libc/src/__support/CPP/type_traits/is_trivially_constructible.h
libc/src/__support/CPP/type_traits/is_trivially_copyable.h
libc/src/__support/CPP/type_traits/is_trivially_destructible.h
libc/src/__support/CPP/type_traits/is_union.h
libc/src/__support/CPP/type_traits/is_unsigned.h
libc/src/__support/CPP/type_traits/is_void.h
libc/src/__support/CPP/type_traits/make_signed.h
libc/src/__support/CPP/type_traits/make_unsigned.h
libc/src/__support/CPP/type_traits/remove_all_extents.h
libc/src/__support/CPP/type_traits/remove_cv.h
libc/src/__support/CPP/type_traits/remove_cvref.h
libc/src/__support/CPP/type_traits/remove_extent.h
libc/src/__support/CPP/type_traits/remove_reference.h
libc/src/__support/CPP/type_traits/true_type.h
libc/src/__support/CPP/type_traits/type_identity.h
libc/src/__support/CPP/type_traits/void_t.h
libc/src/__support/CPP/utility/declval.h
libc/src/__support/CPP/utility/forward.h
libc/src/__support/CPP/utility/integer_sequence.h
libc/src/__support/CPP/utility/move.h
################################################################################
diff --git a/libc/src/__support/CPP/functional.h b/libc/src/__support/CPP/functional.h
index 5ddb988d3312566..e346011debab10c 100644
--- a/libc/src/__support/CPP/functional.h
+++ b/libc/src/__support/CPP/functional.h
@@ -9,13 +9,8 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_FUNCTIONAL_H
#define LLVM_LIBC_SRC_SUPPORT_CPP_FUNCTIONAL_H
-#include "src/__support/CPP/type_traits/enable_if.h"
-#include "src/__support/CPP/type_traits/is_convertible.h"
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/is_void.h"
-#include "src/__support/CPP/type_traits/remove_cvref.h"
-#include "src/__support/CPP/type_traits/remove_reference.h"
-#include "src/__support/CPP/utility/forward.h"
+#include "src/__support/CPP/type_traits.h"
+#include "src/__support/CPP/utility.h"
#include "src/__support/macros/attributes.h"
#include <stdint.h>
@@ -35,7 +30,7 @@ template <typename Ret, typename... Params> class function<Ret(Params...)> {
template <typename Callable>
LIBC_INLINE static Ret callback_fn(intptr_t callable, Params... params) {
return (*reinterpret_cast<Callable *>(callable))(
- cpp::forward<Params>(params)...);
+ forward<Params>(params)...);
}
public:
@@ -47,18 +42,18 @@ template <typename Ret, typename... Params> class function<Ret(Params...)> {
LIBC_INLINE function(
Callable &&callable,
// This is not the copy-constructor.
- enable_if_t<!cpp::is_same_v<remove_cvref_t<Callable>, function>> * =
+ enable_if_t<!is_same<remove_cvref_t<Callable>, function>::value> * =
nullptr,
// Functor must be callable and return a suitable type.
- enable_if_t<cpp::is_void_v<Ret> ||
- cpp::is_convertible_v<
+ enable_if_t<is_void_v<Ret> ||
+ is_convertible_v<
decltype(declval<Callable>()(declval<Params>()...)), Ret>>
* = nullptr)
- : callback(callback_fn<cpp::remove_reference_t<Callable>>),
+ : callback(callback_fn<remove_reference_t<Callable>>),
callable(reinterpret_cast<intptr_t>(&callable)) {}
LIBC_INLINE Ret operator()(Params... params) const {
- return callback(callable, cpp::forward<Params>(params)...);
+ return callback(callable, forward<Params>(params)...);
}
LIBC_INLINE explicit operator bool() const { return callback; }
diff --git a/libc/src/__support/CPP/type_traits.h b/libc/src/__support/CPP/type_traits.h
index 7794b39e0d8f4c3..aa0a6375e20200d 100644
--- a/libc/src/__support/CPP/type_traits.h
+++ b/libc/src/__support/CPP/type_traits.h
@@ -1,4 +1,4 @@
-//===-- Self contained C++ type_traits --------------------------*- C++ -*-===//
+//===-- Self contained C++ type traits --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,51 +6,344 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_H
-
-#include "src/__support/CPP/type_traits/add_lvalue_reference.h"
-#include "src/__support/CPP/type_traits/add_pointer.h"
-#include "src/__support/CPP/type_traits/add_rvalue_reference.h"
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/conditional.h"
-#include "src/__support/CPP/type_traits/decay.h"
-#include "src/__support/CPP/type_traits/enable_if.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/integral_constant.h"
-#include "src/__support/CPP/type_traits/is_arithmetic.h"
-#include "src/__support/CPP/type_traits/is_array.h"
-#include "src/__support/CPP/type_traits/is_base_of.h"
-#include "src/__support/CPP/type_traits/is_class.h"
-#include "src/__support/CPP/type_traits/is_const.h"
-#include "src/__support/CPP/type_traits/is_convertible.h"
-#include "src/__support/CPP/type_traits/is_destructible.h"
-#include "src/__support/CPP/type_traits/is_enum.h"
-#include "src/__support/CPP/type_traits/is_floating_point.h"
-#include "src/__support/CPP/type_traits/is_function.h"
-#include "src/__support/CPP/type_traits/is_integral.h"
-#include "src/__support/CPP/type_traits/is_lvalue_reference.h"
-#include "src/__support/CPP/type_traits/is_null_pointer.h"
-#include "src/__support/CPP/type_traits/is_pointer.h"
-#include "src/__support/CPP/type_traits/is_reference.h"
-#include "src/__support/CPP/type_traits/is_rvalue_reference.h"
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/is_signed.h"
-#include "src/__support/CPP/type_traits/is_trivially_constructible.h"
-#include "src/__support/CPP/type_traits/is_trivially_copyable.h"
-#include "src/__support/CPP/type_traits/is_trivially_destructible.h"
-#include "src/__support/CPP/type_traits/is_union.h"
-#include "src/__support/CPP/type_traits/is_unsigned.h"
-#include "src/__support/CPP/type_traits/is_void.h"
-#include "src/__support/CPP/type_traits/make_signed.h"
-#include "src/__support/CPP/type_traits/make_unsigned.h"
-#include "src/__support/CPP/type_traits/remove_all_extents.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/CPP/type_traits/remove_cvref.h"
-#include "src/__support/CPP/type_traits/remove_extent.h"
-#include "src/__support/CPP/type_traits/remove_reference.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/CPP/type_traits/type_identity.h"
-#include "src/__support/CPP/type_traits/void_t.h"
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_H
+#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_TYPETRAITS_H
+#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPETRAITS_H
+
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+
+#include <stddef.h> // For size_t.
+
+namespace __llvm_libc {
+namespace cpp {
+
+template <typename T> struct type_identity {
+ using type = T;
+};
+
+template <bool B, typename T> struct enable_if;
+template <typename T> struct enable_if<true, T> : type_identity<T> {};
+template <bool B, typename T = void>
+using enable_if_t = typename enable_if<B, T>::type;
+
+template <typename T, T v> struct integral_constant {
+ using value_type = T;
+ LIBC_INLINE_VAR static constexpr T value = v;
+};
+using true_type = cpp::integral_constant<bool, true>;
+using false_type = cpp::integral_constant<bool, false>;
+
+template <bool V> using bool_constant = integral_constant<bool, V>;
+
+template <class T>
+struct is_trivially_copyable
+ : public integral_constant<bool, __is_trivially_copyable(T)> {};
+
+template <class T, class... Args>
+struct is_trivially_constructible
+ : integral_constant<bool, __is_trivially_constructible(T, Args...)> {};
+
+template <typename T, typename U> struct is_same : cpp::false_type {};
+template <typename T> struct is_same<T, T> : cpp::true_type {};
+template <typename T, typename U>
+LIBC_INLINE_VAR constexpr bool is_same_v = is_same<T, U>::value;
+
+template <class T> struct is_const : cpp::false_type {};
+template <class T> struct is_const<const T> : cpp::true_type {};
+template <class T>
+LIBC_INLINE_VAR constexpr bool is_const_v = is_const<T>::value;
+
+template <typename T> struct remove_cv : type_identity<T> {};
+template <typename T> struct remove_cv<const T> : type_identity<T> {};
+template <typename T> struct remove_cv<volatile T> : type_identity<T> {};
+template <typename T> struct remove_cv<const volatile T> : type_identity<T> {};
+template <typename T> using remove_cv_t = typename remove_cv<T>::type;
+
+template <typename T> struct remove_reference : type_identity<T> {};
+template <typename T> struct remove_reference<T &> : type_identity<T> {};
+template <typename T> struct remove_reference<T &&> : type_identity<T> {};
+template <typename T>
+using remove_reference_t = typename remove_reference<T>::type;
+
+template <typename T> struct add_rvalue_reference : type_identity<T &&> {};
+
+template <typename T> struct remove_cvref {
+ using type = remove_cv_t<remove_reference_t<T>>;
+};
+template <typename T> using remove_cvref_t = typename remove_cvref<T>::type;
+
+namespace details {
+template <typename T, typename... Args>
+LIBC_INLINE constexpr bool is_unqualified_any_of() {
+ return (... || is_same_v<remove_cv_t<T>, Args>);
+}
+} // namespace details
+
+template <typename T> struct is_integral {
+ LIBC_INLINE_VAR static constexpr bool value = details::is_unqualified_any_of<
+ T,
+#ifdef __SIZEOF_INT128__
+ __int128_t, __uint128_t,
+#endif
+ char, signed char, unsigned char, short, unsigned short, int,
+ unsigned int, long, unsigned long, long long, unsigned long long, bool>();
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_integral_v = is_integral<T>::value;
+
+template <typename T> struct is_enum {
+ LIBC_INLINE_VAR static constexpr bool value = __is_enum(T);
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_enum_v = is_enum<T>::value;
+
+template <typename T> struct is_pointer : cpp::false_type {};
+template <typename T> struct is_pointer<T *> : cpp::true_type {};
+template <typename T> struct is_pointer<T *const> : cpp::true_type {};
+template <typename T> struct is_pointer<T *volatile> : cpp::true_type {};
+template <typename T> struct is_pointer<T *const volatile> : cpp::true_type {};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_pointer_v = is_pointer<T>::value;
+
+template <typename T> struct is_floating_point {
+ LIBC_INLINE_VAR static constexpr bool value =
+ details::is_unqualified_any_of<T, float, double, long double>();
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_floating_point_v =
+ is_floating_point<T>::value;
+
+template <typename T> struct is_arithmetic {
+ LIBC_INLINE_VAR static constexpr bool value =
+ is_integral<T>::value || is_floating_point<T>::value;
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
+
+namespace details {
+template <typename T, bool = is_arithmetic<T>::value>
+struct is_signed : integral_constant<bool, (T(-1) < T(0))> {};
+template <typename T> struct is_signed<T, false> : false_type {};
+
+template <typename T, bool = is_arithmetic<T>::value>
+struct is_unsigned : integral_constant<bool, (T(-1) > T(0))> {};
+template <typename T> struct is_unsigned<T, false> : false_type {};
+} // namespace details
+
+template <typename T> struct is_signed {
+ LIBC_INLINE_VAR static constexpr bool value = details::is_signed<T>::value;
+ LIBC_INLINE constexpr operator bool() const { return value; }
+ LIBC_INLINE constexpr bool operator()() const { return value; }
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_signed_v = is_signed<T>::value;
+
+template <typename T> struct is_unsigned {
+ LIBC_INLINE_VAR static constexpr bool value = details::is_unsigned<T>::value;
+ LIBC_INLINE constexpr operator bool() const { return value; }
+ LIBC_INLINE constexpr bool operator()() const { return value; }
+};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_unsigned_v = is_unsigned<T>::value;
+
+template <typename T> struct make_unsigned;
+template <> struct make_unsigned<char> : type_identity<unsigned char> {};
+template <> struct make_unsigned<signed char> : type_identity<unsigned char> {};
+template <> struct make_unsigned<short> : type_identity<unsigned short> {};
+template <> struct make_unsigned<int> : type_identity<unsigned int> {};
+template <> struct make_unsigned<long> : type_identity<unsigned long> {};
+template <>
+struct make_unsigned<long long> : type_identity<unsigned long long> {};
+template <>
+struct make_unsigned<unsigned char> : type_identity<unsigned char> {};
+template <>
+struct make_unsigned<unsigned short> : type_identity<unsigned short> {};
+template <> struct make_unsigned<unsigned int> : type_identity<unsigned int> {};
+template <>
+struct make_unsigned<unsigned long> : type_identity<unsigned long> {};
+template <>
+struct make_unsigned<unsigned long long> : type_identity<unsigned long long> {};
+#ifdef __SIZEOF_INT128__
+template <> struct make_unsigned<__int128_t> : type_identity<__uint128_t> {};
+template <> struct make_unsigned<__uint128_t> : type_identity<__uint128_t> {};
+#endif
+template <typename T> using make_unsigned_t = typename make_unsigned<T>::type;
+
+template <typename T> struct make_signed;
+template <> struct make_signed<char> : type_identity<char> {};
+template <> struct make_signed<signed char> : type_identity<char> {};
+template <> struct make_signed<short> : type_identity<short> {};
+template <> struct make_signed<int> : type_identity<int> {};
+template <> struct make_signed<long> : type_identity<long> {};
+template <> struct make_signed<long long> : type_identity<long long> {};
+template <> struct make_signed<unsigned char> : type_identity<char> {};
+template <> struct make_signed<unsigned short> : type_identity<short> {};
+template <> struct make_signed<unsigned int> : type_identity<int> {};
+template <> struct make_signed<unsigned long> : type_identity<long> {};
+template <>
+struct make_signed<unsigned long long> : type_identity<long long> {};
+#ifdef __SIZEOF_INT128__
+template <> struct make_signed<__int128_t> : type_identity<__int128_t> {};
+template <> struct make_signed<__uint128_t> : type_identity<__int128_t> {};
+#endif
+template <typename T> using make_signed_t = typename make_signed<T>::type;
+
+// Compile time type selection.
+template <bool B, typename T, typename F>
+struct conditional : type_identity<T> {};
+template <typename T, typename F>
+struct conditional<false, T, F> : type_identity<F> {};
+template <bool B, typename T, typename F>
+using conditional_t = typename conditional<B, T, F>::type;
+
+template <typename T>
+struct is_void : is_same<void, typename remove_cv<T>::type> {};
+template <typename T>
+LIBC_INLINE_VAR constexpr bool is_void_v = is_void<T>::value;
+template <class T> T declval();
+
+// Compile time checks on implicit conversions.
+namespace details {
+template <typename...> using void_t = void;
+template <typename T> void convertible_to_helper(T);
+} // namespace details
+
+template <typename F, typename T, typename = void>
+LIBC_INLINE_VAR constexpr bool is_convertible_v = false;
+
+// FIXME: This should use LIBC_INLINE_VAR, but clang buggily complains about
+// this when LIBC_INLINE_VAR uses [[clang::internal_linkage]].
+template <typename F, typename T>
+constexpr bool
+ is_convertible_v<F, T,
+ details::void_t<decltype(details::convertible_to_helper<T>(
+ declval<F>()))>> = true;
+
+namespace details {
+#if LIBC_HAS_BUILTIN(__is_lvalue_reference) && \
+ LIBC_HAS_BUILTIN(__is_rvalue_reference) && \
+ LIBC_HAS_BUILTIN(__is_reference)
+
+template <typename T>
+struct is_lvalue_reference : bool_constant<__is_lvalue_reference(T)> {};
+template <typename T>
+struct is_rvalue_reference : bool_constant<__is_rvalue_reference(T)> {};
+template <typename T> struct is_reference : bool_constant<__is_reference(T)> {};
+
+#else // LIBC_HAS_BUILTIN(__is_lvalue_reference) && etc...
+
+template <typename T> struct is_lvalue_reference : public false_type {};
+template <typename T> struct is_lvalue_reference<T &> : public true_type {};
+
+template <typename T> struct is_rvalue_reference : public false_type {};
+template <typename T> struct is_rvalue_reference<T &&> : public true_type {};
+
+template <typename T> struct is_reference : public false_type {};
+template <typename T> struct is_reference<T &> : public true_type {};
+template <typename T> struct is_reference<T &&> : public true_type {};
+
+#endif // LIBC_HAS_BUILTIN(__is_lvalue_reference) && etc...
+
+#if LIBC_HAS_BUILTIN(__remove_all_extents)
+template <typename T> using __remove_all_extents_t = __remove_all_extents(T);
+#else
+template <typename T> struct remove_all_extents {
+ typedef T type;
+};
+template <typename T> struct remove_all_extents<T[]> {
+ typedef typename remove_all_extents<T>::type type;
+};
+template <typename T, size_t _Np> struct remove_all_extents<T[_Np]> {
+ typedef typename remove_all_extents<T>::type type;
+};
+
+template <typename T>
+using __remove_all_extents_t = typename remove_all_extents<T>::type;
+#endif // LIBC_HAS_BUILTIN(__remove_all_extents)
+
+#if LIBC_HAS_BUILTIN(__is_function)
+
+template <typename T>
+struct is_function : integral_constant<bool, __is_function(T)> {};
+
+#else
+
+template <typename T>
+struct is_function
+ : public integral_constant<bool, !(is_reference<T>::value ||
+ is_const<const T>::value)> {};
+
+#endif // LIBC_HAS_BUILTIN(__is_function)
+
+#if LIBC_HAS_BUILTIN(__is_destructible)
+
+template <typename T>
+struct is_destructible : bool_constant<__is_destructible(T)> {};
+
+#else // LIBC_HAS_BUILTIN(__is_destructible)
+
+// if it's a reference, return true
+// if it's a function, return false
+// if it's void, return false
+// if it's an array of unknown bound, return false
+// Otherwise, return "declval<T&>().~T()" is well-formed
+// where T is remove_all_extents<T>::type
+
+template <typename> struct __is_destructible_apply {
+ typedef int type;
+};
+
+template <typename T> struct __is_destructor_wellformed {
+ template <typename T1>
+ static true_type __test(
+ typename __is_destructible_apply<decltype(declval<T1 &>().~T1())>::type);
+
+ template <typename T1> static false_type __test(...);
+
+ static const bool value = decltype(__test<T>(12))::value;
+};
+
+template <typename T, bool> struct __destructible_imp;
+
+template <typename T>
+struct __destructible_imp<T, false>
+ : public integral_constant<
+ bool, __is_destructor_wellformed<__remove_all_extents_t<T>>::value> {
+};
+
+template <typename T> struct __destructible_imp<T, true> : public true_type {};
+
+template <typename T, bool> struct __destructible_false;
+template <typename T>
+struct __destructible_false<T, false>
+ : public __destructible_imp<T, is_reference<T>::value> {};
+template <typename T>
+struct __destructible_false<T, true> : public false_type {};
+
+template <typename T>
+struct is_destructible : public __destructible_false<T, is_function<T>::value> {
+};
+template <typename T> struct is_destructible<T[]> : public false_type {};
+template <> struct is_destructible<void> : public false_type {};
+
+#endif // LIBC_HAS_BUILTIN(__is_destructible)
+} // namespace details
+
+#if LIBC_HAS_BUILTIN(__is_trivially_destructible)
+
+template <typename T>
+struct is_trivially_destructible
+ : public integral_constant<bool, __is_trivially_destructible(T)> {};
+
+#else
+template <typename T>
+struct is_trivially_destructible
+ : public integral_constant<
+ bool, __llvm_libc::cpp::details::is_destructible<T>::value
+ &&__has_trivial_destructor(T)> {};
+#endif // LIBC_HAS_BUILTIN(__is_trivially_destructible)
+
+} // namespace cpp
+} // namespace __llvm_libc
+
+#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPETRAITS_H
diff --git a/libc/src/__support/CPP/type_traits/add_lvalue_reference.h b/libc/src/__support/CPP/type_traits/add_lvalue_reference.h
deleted file mode 100644
index 7cb22ac03bb033c..000000000000000
--- a/libc/src/__support/CPP/type_traits/add_lvalue_reference.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- add_lvalue_reference type_traits ------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// add_lvalue_reference
-namespace detail {
-template <class T> // Note that `cv void&` is a substitution failure
-auto try_add_lvalue_reference(int) -> cpp::type_identity<T &>;
-template <class T> // Handle T = cv void case
-auto try_add_lvalue_reference(...) -> cpp::type_identity<T>;
-} // namespace detail
-template <class T>
-struct add_lvalue_reference : decltype(detail::try_add_lvalue_reference<T>(0)) {
-};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_LVALUE_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/add_pointer.h b/libc/src/__support/CPP/type_traits/add_pointer.h
deleted file mode 100644
index 543259ea1ca8f44..000000000000000
--- a/libc/src/__support/CPP/type_traits/add_pointer.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- add_pointer type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_POINTER_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_POINTER_H
-
-#include "src/__support/CPP/type_traits/remove_reference.h"
-#include "src/__support/CPP/type_traits/type_identity.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// add_pointer
-namespace detail {
-template <class T>
-auto try_add_pointer(int) -> cpp::type_identity<cpp::remove_reference_t<T> *>;
-template <class T> auto try_add_pointer(...) -> cpp::type_identity<T>;
-} // namespace detail
-template <class T>
-struct add_pointer : decltype(detail::try_add_pointer<T>(0)) {};
-template <class T> using add_pointer_t = typename add_pointer<T>::type;
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_POINTER_H
diff --git a/libc/src/__support/CPP/type_traits/add_rvalue_reference.h b/libc/src/__support/CPP/type_traits/add_rvalue_reference.h
deleted file mode 100644
index b912cef59b68f87..000000000000000
--- a/libc/src/__support/CPP/type_traits/add_rvalue_reference.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- add_rvalue_reference type_traits ------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// add_rvalue_reference
-namespace detail {
-template <class T>
-auto try_add_rvalue_reference(int) -> cpp::type_identity<T &&>;
-template <class T> auto try_add_rvalue_reference(...) -> cpp::type_identity<T>;
-} // namespace detail
-template <class T>
-struct add_rvalue_reference : decltype(detail::try_add_rvalue_reference<T>(0)) {
-};
-template <class T>
-using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ADD_RVALUE_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/bool_constant.h b/libc/src/__support/CPP/type_traits/bool_constant.h
deleted file mode 100644
index 6fcfb8e82e4d803..000000000000000
--- a/libc/src/__support/CPP/type_traits/bool_constant.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===-- bool_constant type_traits -------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_BOOL_CONSTANT_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_BOOL_CONSTANT_H
-
-#include "src/__support/CPP/type_traits/integral_constant.h"
-
-namespace __llvm_libc::cpp {
-
-// bool_constant
-template <bool V> using bool_constant = cpp::integral_constant<bool, V>;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_BOOL_CONSTANT_H
diff --git a/libc/src/__support/CPP/type_traits/conditional.h b/libc/src/__support/CPP/type_traits/conditional.h
deleted file mode 100644
index f9917c2a7264cee..000000000000000
--- a/libc/src/__support/CPP/type_traits/conditional.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- conditional type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_CONDITIONAL_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_CONDITIONAL_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// conditional
-template <bool B, typename T, typename F>
-struct conditional : type_identity<T> {};
-template <typename T, typename F>
-struct conditional<false, T, F> : type_identity<F> {};
-template <bool B, typename T, typename F>
-using conditional_t = typename conditional<B, T, F>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_CONDITIONAL_H
diff --git a/libc/src/__support/CPP/type_traits/decay.h b/libc/src/__support/CPP/type_traits/decay.h
deleted file mode 100644
index f3f9cfc5eaa006d..000000000000000
--- a/libc/src/__support/CPP/type_traits/decay.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- decay type_traits ---------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_DECAY_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_DECAY_H
-
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-#include "src/__support/CPP/type_traits/add_pointer.h"
-#include "src/__support/CPP/type_traits/conditional.h"
-#include "src/__support/CPP/type_traits/is_array.h"
-#include "src/__support/CPP/type_traits/is_function.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/CPP/type_traits/remove_extent.h"
-#include "src/__support/CPP/type_traits/remove_reference.h"
-
-namespace __llvm_libc::cpp {
-
-// decay
-template <class T> class decay {
- using U = cpp::remove_reference_t<T>;
-
-public:
- using type = conditional_t<
- cpp::is_array_v<U>, cpp::add_pointer_t<cpp::remove_extent_t<U>>,
- cpp::conditional_t<cpp::is_function_v<U>, cpp::add_pointer_t<U>,
- cpp::remove_cv_t<U>>>;
-};
-template <class T> using decay_t = typename decay<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_DECAY_H
diff --git a/libc/src/__support/CPP/type_traits/enable_if.h b/libc/src/__support/CPP/type_traits/enable_if.h
deleted file mode 100644
index 51d7252fc3e48d8..000000000000000
--- a/libc/src/__support/CPP/type_traits/enable_if.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- enable_if type_traits -----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ENABLE_IF_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ENABLE_IF_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// enable_if
-template <bool B, typename T> struct enable_if;
-template <typename T> struct enable_if<true, T> : type_identity<T> {};
-template <bool B, typename T = void>
-using enable_if_t = typename enable_if<B, T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_ENABLE_IF_H
diff --git a/libc/src/__support/CPP/type_traits/false_type.h b/libc/src/__support/CPP/type_traits/false_type.h
deleted file mode 100644
index 8dc6fc66d288787..000000000000000
--- a/libc/src/__support/CPP/type_traits/false_type.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===-- false_type type_traits ----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_FALSE_TYPE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_FALSE_TYPE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-
-namespace __llvm_libc::cpp {
-
-// false_type
-using false_type = cpp::bool_constant<false>;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_FALSE_TYPE_H
diff --git a/libc/src/__support/CPP/type_traits/integral_constant.h b/libc/src/__support/CPP/type_traits/integral_constant.h
deleted file mode 100644
index 21bdbccf073a612..000000000000000
--- a/libc/src/__support/CPP/type_traits/integral_constant.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- integral_constant type_traits ---------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_INTEGRAL_CONSTANT_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_INTEGRAL_CONSTANT_H
-
-#include "src/__support/macros/attributes.h" // LIBC_INLINE_VAR
-
-namespace __llvm_libc::cpp {
-
-// integral_constant
-template <typename T, T v> struct integral_constant {
- using value_type = T;
- LIBC_INLINE_VAR static constexpr T value = v;
-};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_INTEGRAL_CONSTANT_H
diff --git a/libc/src/__support/CPP/type_traits/is_arithmetic.h b/libc/src/__support/CPP/type_traits/is_arithmetic.h
deleted file mode 100644
index cc651b11b204820..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_arithmetic.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//===-- is_arithmetic type_traits -------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARITHMETIC_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARITHMETIC_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/is_floating_point.h"
-#include "src/__support/CPP/type_traits/is_integral.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_arithmetic
-template <typename T>
-struct is_arithmetic : cpp::bool_constant<(cpp::is_integral_v<T> ||
- cpp::is_floating_point_v<T>)> {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARITHMETIC_H
diff --git a/libc/src/__support/CPP/type_traits/is_array.h b/libc/src/__support/CPP/type_traits/is_array.h
deleted file mode 100644
index c04a2edb6c77ef9..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- is_array type_traits ------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARRAY_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARRAY_H
-
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-
-#include <stddef.h> // For size_t
-
-namespace __llvm_libc::cpp {
-
-// is_array
-template <class T> struct is_array : false_type {};
-template <class T> struct is_array<T[]> : true_type {};
-template <class T, size_t N> struct is_array<T[N]> : true_type {};
-template <class T>
-LIBC_INLINE_VAR constexpr bool is_array_v = is_array<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ARRAY_H
diff --git a/libc/src/__support/CPP/type_traits/is_base_of.h b/libc/src/__support/CPP/type_traits/is_base_of.h
deleted file mode 100644
index 7820c83f7cbcad4..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_base_of.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//===-- is_base_of type_traits ----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_BASE_OF_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_BASE_OF_H
-
-#include "src/__support/CPP/type_traits/add_rvalue_reference.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/is_class.h"
-#include "src/__support/CPP/type_traits/remove_all_extents.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_base_of
-namespace detail {
-template <typename B> cpp::true_type __test_ptr_conv(const volatile B *);
-template <typename> cpp::false_type __test_ptr_conv(const volatile void *);
-
-template <typename B, typename D>
-auto is_base_of(int) -> decltype(__test_ptr_conv<B>(static_cast<D *>(nullptr)));
-
-template <typename, typename>
-auto is_base_of(...) -> cpp::true_type; // private or ambiguous base
-
-} // namespace detail
-
-template <typename Base, typename Derived>
-struct is_base_of
- : cpp::bool_constant<
- cpp::is_class_v<Base> &&
- cpp::is_class_v<Derived> &&decltype(detail::is_base_of<Base, Derived>(
- 0))::value> {};
-template <typename Base, typename Derived>
-LIBC_INLINE_VAR constexpr bool is_base_of_v = is_base_of<Base, Derived>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_BASE_OF_H
diff --git a/libc/src/__support/CPP/type_traits/is_class.h b/libc/src/__support/CPP/type_traits/is_class.h
deleted file mode 100644
index 93b3c3d5df33ed9..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_class.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- is_class type_traits ------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CLASS_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CLASS_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/is_union.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_class
-namespace detail {
-template <class T> cpp::bool_constant<!cpp::is_union_v<T>> test(int T::*);
-template <class> cpp::false_type test(...);
-} // namespace detail
-template <class T> struct is_class : decltype(detail::test<T>(nullptr)) {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_class_v = is_class<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CLASS_H
diff --git a/libc/src/__support/CPP/type_traits/is_const.h b/libc/src/__support/CPP/type_traits/is_const.h
deleted file mode 100644
index 5434e2982d95cf4..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_const.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- is_const type_traits ------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONST_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONST_H
-
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_const
-template <class T> struct is_const : cpp::false_type {};
-template <class T> struct is_const<const T> : cpp::true_type {};
-template <class T>
-LIBC_INLINE_VAR constexpr bool is_const_v = is_const<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONST_H
diff --git a/libc/src/__support/CPP/type_traits/is_convertible.h b/libc/src/__support/CPP/type_traits/is_convertible.h
deleted file mode 100644
index a7292c3461d4841..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_convertible.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//===-- is_convertible type_traits ------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONVERTIBLE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONVERTIBLE_H
-
-#include "src/__support/CPP/type_traits/is_void.h"
-#include "src/__support/CPP/utility/declval.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_convertible
-namespace detail {
-template <class T>
-auto test_returnable(int)
- -> decltype(void(static_cast<T (*)()>(nullptr)), cpp::true_type{});
-template <class> auto test_returnable(...) -> cpp::false_type;
-
-template <class From, class To>
-auto test_implicitly_convertible(int)
- -> decltype(void(cpp::declval<void (&)(To)>()(cpp::declval<From>())),
- cpp::true_type{});
-template <class, class>
-auto test_implicitly_convertible(...) -> cpp::false_type;
-} // namespace detail
-
-template <class From, class To>
-struct is_convertible
- : cpp::bool_constant<
- (decltype(detail::test_returnable<To>(0))::value &&
- decltype(detail::test_implicitly_convertible<From, To>(0))::value) ||
- (cpp::is_void_v<From> && cpp::is_void_v<To>)> {};
-
-template <class From, class To>
-LIBC_INLINE_VAR constexpr bool is_convertible_v =
- is_convertible<From, To>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_CONVERTIBLE_H
diff --git a/libc/src/__support/CPP/type_traits/is_destructible.h b/libc/src/__support/CPP/type_traits/is_destructible.h
deleted file mode 100644
index 38b64a90e4253a8..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_destructible.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//===-- is_destructible type_traits -----------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_DESTRUCTIBLE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_DESTRUCTIBLE_H
-
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/is_function.h"
-#include "src/__support/CPP/type_traits/is_reference.h"
-#include "src/__support/CPP/type_traits/remove_all_extents.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// is_destructible
-#if LIBC_HAS_BUILTIN(__is_destructible)
-template <typename T>
-struct is_destructible : bool_constant<__is_destructible(T)> {};
-#else
-// if it's a reference, return true
-// if it's a function, return false
-// if it's void, return false
-// if it's an array of unknown bound, return false
-// Otherwise, return "declval<T&>().~T()" is well-formed
-// where T is remove_all_extents<T>::type
-template <typename> struct __is_destructible_apply : cpp::type_identity<int> {};
-template <typename T> struct __is_destructor_wellformed {
- template <typename T1>
- static cpp::true_type __test(
- typename __is_destructible_apply<decltype(declval<T1 &>().~T1())>::type);
- template <typename T1> static cpp::false_type __test(...);
- static const bool value = decltype(__test<T>(12))::value;
-};
-template <typename T, bool> struct __destructible_imp;
-template <typename T>
-struct __destructible_imp<T, false>
- : public bool_constant<
- __is_destructor_wellformed<cpp::remove_all_extents_t<T>>::value> {};
-template <typename T>
-struct __destructible_imp<T, true> : public cpp::true_type {};
-template <typename T, bool> struct __destructible_false;
-template <typename T>
-struct __destructible_false<T, false>
- : public __destructible_imp<T, is_reference<T>::value> {};
-template <typename T>
-struct __destructible_false<T, true> : public cpp::false_type {};
-template <typename T>
-struct is_destructible : public __destructible_false<T, is_function<T>::value> {
-};
-template <typename T> struct is_destructible<T[]> : public false_type {};
-template <> struct is_destructible<void> : public false_type {};
-#endif
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_DESTRUCTIBLE_H
diff --git a/libc/src/__support/CPP/type_traits/is_enum.h b/libc/src/__support/CPP/type_traits/is_enum.h
deleted file mode 100644
index 4914df30c3cd11b..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_enum.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- is_enum type_traits -------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ENUM_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ENUM_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_enum
-template <typename T> struct is_enum : bool_constant<__is_enum(T)> {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_enum_v = is_enum<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_ENUM_H
diff --git a/libc/src/__support/CPP/type_traits/is_floating_point.h b/libc/src/__support/CPP/type_traits/is_floating_point.h
deleted file mode 100644
index 746d0e36c92ebaa..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_floating_point.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===-- is_floating_point type_traits ---------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FLOATING_POINT_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FLOATING_POINT_H
-
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_floating_point
-template <typename T> struct is_floating_point {
-private:
- template <typename Head, typename... Args>
- LIBC_INLINE_VAR static constexpr bool __is_unqualified_any_of() {
- return (... || is_same_v<remove_cv_t<Head>, Args>);
- }
-
-public:
- LIBC_INLINE_VAR static constexpr bool value =
- __is_unqualified_any_of<T, float, double, long double>();
-};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_floating_point_v =
- is_floating_point<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FLOATING_POINT_H
diff --git a/libc/src/__support/CPP/type_traits/is_function.h b/libc/src/__support/CPP/type_traits/is_function.h
deleted file mode 100644
index 3a8b3486e8f3ad5..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_function.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- is_function type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FUNCTION_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FUNCTION_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/is_const.h"
-#include "src/__support/CPP/type_traits/is_reference.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_function
-#if LIBC_HAS_BUILTIN(__is_function)
-template <typename T>
-struct is_function : integral_constant<bool, __is_function(T)> {};
-#else
-template <typename T>
-struct is_function
- : public bool_constant<!(is_reference_v<T> || is_const_v<const T>)> {};
-#endif
-template <class T>
-LIBC_INLINE_VAR constexpr bool is_function_v = is_function<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_FUNCTION_H
diff --git a/libc/src/__support/CPP/type_traits/is_integral.h b/libc/src/__support/CPP/type_traits/is_integral.h
deleted file mode 100644
index 0113a5bf9113934..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_integral.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===-- is_integral type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_INTEGRAL_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_INTEGRAL_H
-
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_integral
-template <typename T> struct is_integral {
-private:
- template <typename Head, typename... Args>
- LIBC_INLINE_VAR static constexpr bool __is_unqualified_any_of() {
- return (... || is_same_v<remove_cv_t<Head>, Args>);
- }
-
-public:
- LIBC_INLINE_VAR static constexpr bool value = __is_unqualified_any_of<
- T,
-#ifdef __SIZEOF_INT128__
- __int128_t, __uint128_t,
-#endif
- char, signed char, unsigned char, short, unsigned short, int,
- unsigned int, long, unsigned long, long long, unsigned long long, bool>();
-};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_integral_v = is_integral<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_INTEGRAL_H
diff --git a/libc/src/__support/CPP/type_traits/is_lvalue_reference.h b/libc/src/__support/CPP/type_traits/is_lvalue_reference.h
deleted file mode 100644
index fe7f4f7252530fe..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_lvalue_reference.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===-- is_lvalue_reference type_traits -------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_LVALUE_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_LVALUE_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_lvalue_reference
-#if LIBC_HAS_BUILTIN(__is_lvalue_reference)
-template <typename T>
-struct is_lvalue_reference : bool_constant<__is_lvalue_reference(T)> {};
-#else
-template <typename T> struct is_lvalue_reference : public false_type {};
-template <typename T> struct is_lvalue_reference<T &> : public true_type {};
-#endif
-template <class T>
-LIBC_INLINE_VAR constexpr bool is_lvalue_reference_v =
- is_lvalue_reference<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_LVALUE_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/is_null_pointer.h b/libc/src/__support/CPP/type_traits/is_null_pointer.h
deleted file mode 100644
index e5c024b1b3898bc..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_null_pointer.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- is_null_pointer type_traits -----------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_NULL_POINTER_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_NULL_POINTER_H
-
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_null_pointer
-using nullptr_t = decltype(nullptr);
-template <class T>
-struct is_null_pointer : cpp::is_same<cpp::nullptr_t, cpp::remove_cv_t<T>> {};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_NULL_POINTER_H
diff --git a/libc/src/__support/CPP/type_traits/is_pointer.h b/libc/src/__support/CPP/type_traits/is_pointer.h
deleted file mode 100644
index f7af8752e8d8998..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_pointer.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- is_pointer type_traits ----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_POINTER_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_POINTER_H
-
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_pointer
-template <typename T> struct is_pointer : cpp::false_type {};
-template <typename T> struct is_pointer<T *> : cpp::true_type {};
-template <typename T> struct is_pointer<T *const> : cpp::true_type {};
-template <typename T> struct is_pointer<T *volatile> : cpp::true_type {};
-template <typename T> struct is_pointer<T *const volatile> : cpp::true_type {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_pointer_v = is_pointer<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_POINTER_H
diff --git a/libc/src/__support/CPP/type_traits/is_reference.h b/libc/src/__support/CPP/type_traits/is_reference.h
deleted file mode 100644
index 147b65ebfe7b780..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_reference.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===-- is_reference type_traits --------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_reference
-#if LIBC_HAS_BUILTIN(__is_reference)
-template <typename T> struct is_reference : bool_constant<__is_reference(T)> {};
-#else
-template <typename T> struct is_reference : public false_type {};
-template <typename T> struct is_reference<T &> : public true_type {};
-template <typename T> struct is_reference<T &&> : public true_type {};
-#endif
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h b/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
deleted file mode 100644
index 33b2037df013810..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_rvalue_reference.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- is_rvalue_reference type_traits -------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_RVALUE_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_RVALUE_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_rvalue_reference
-#if LIBC_HAS_BUILTIN(__is_rvalue_reference)
-template <typename T>
-struct is_rvalue_reference : bool_constant<__is_rvalue_reference(T)> {};
-#else
-template <typename T> struct is_rvalue_reference : public false_type {};
-template <typename T> struct is_rvalue_reference<T &&> : public true_type {};
-#endif
-template <class T>
-using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_RVALUE_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/is_same.h b/libc/src/__support/CPP/type_traits/is_same.h
deleted file mode 100644
index f8fa7ed2f350c6c..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_same.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- is_same type_traits -------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
-
-#include "src/__support/CPP/type_traits/false_type.h"
-#include "src/__support/CPP/type_traits/true_type.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_same
-template <typename T, typename U> struct is_same : cpp::false_type {};
-template <typename T> struct is_same<T, T> : cpp::true_type {};
-template <typename T, typename U>
-LIBC_INLINE_VAR constexpr bool is_same_v = is_same<T, U>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SAME_H
diff --git a/libc/src/__support/CPP/type_traits/is_signed.h b/libc/src/__support/CPP/type_traits/is_signed.h
deleted file mode 100644
index a4e6dbcf3d62e7a..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_signed.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- is_signed type_traits -----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SIGNED_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SIGNED_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/is_arithmetic.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_signed
-template <typename T>
-struct is_signed : bool_constant<(is_arithmetic_v<T> && (T(-1) < T(0)))> {
- LIBC_INLINE constexpr operator bool() const { return is_signed::value; }
- LIBC_INLINE constexpr bool operator()() const { return is_signed::value; }
-};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_signed_v = is_signed<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_SIGNED_H
diff --git a/libc/src/__support/CPP/type_traits/is_trivially_constructible.h b/libc/src/__support/CPP/type_traits/is_trivially_constructible.h
deleted file mode 100644
index 3053e7b9ac53b7e..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_trivially_constructible.h
+++ /dev/null
@@ -1,22 +0,0 @@
-//===-- is_trivially_constructible type_traits ------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
-
-#include "src/__support/CPP/type_traits/integral_constant.h"
-
-namespace __llvm_libc::cpp {
-
-// is_trivially_constructible
-template <class T, class... Args>
-struct is_trivially_constructible
- : integral_constant<bool, __is_trivially_constructible(T, Args...)> {};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H
diff --git a/libc/src/__support/CPP/type_traits/is_trivially_copyable.h b/libc/src/__support/CPP/type_traits/is_trivially_copyable.h
deleted file mode 100644
index a1b5a0cb26c5fcb..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_trivially_copyable.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- is_trivially_copyable type_traits -----------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
-
-#include "src/__support/CPP/type_traits/integral_constant.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_trivially_copyable
-template <class T>
-struct is_trivially_copyable
- : public integral_constant<bool, __is_trivially_copyable(T)> {};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H
diff --git a/libc/src/__support/CPP/type_traits/is_trivially_destructible.h b/libc/src/__support/CPP/type_traits/is_trivially_destructible.h
deleted file mode 100644
index 5eab5aa08460436..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_trivially_destructible.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===-- is_trivially_destructible type_traits -------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/is_destructible.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// is_trivially_destructible
-#if LIBC_HAS_BUILTIN(__is_trivially_destructible)
-template <typename T>
-struct is_trivially_destructible
- : public bool_constant<__is_trivially_destructible(T)> {};
-#else
-template <typename T>
-struct is_trivially_destructible
- : public bool_constant<cpp::is_destructible_v<T> &&__has_trivial_destructor(
- T)> {};
-#endif // LIBC_HAS_BUILTIN(__is_trivially_destructible)
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_trivially_destructible_v =
- is_trivially_destructible<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H
diff --git a/libc/src/__support/CPP/type_traits/is_union.h b/libc/src/__support/CPP/type_traits/is_union.h
deleted file mode 100644
index 354dbd160844b36..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_union.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//===-- is_union type_traits ------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNION_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNION_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_union
-template <class T> struct is_union : bool_constant<__is_union(T)> {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_union_v = is_union<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNION_H
diff --git a/libc/src/__support/CPP/type_traits/is_unsigned.h b/libc/src/__support/CPP/type_traits/is_unsigned.h
deleted file mode 100644
index 6510c1304cf344d..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_unsigned.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- is_unsigned type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNSIGNED_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNSIGNED_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-#include "src/__support/CPP/type_traits/is_arithmetic.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_unsigned
-template <typename T>
-struct is_unsigned : bool_constant<(is_arithmetic_v<T> && (T(-1) > T(0)))> {
- LIBC_INLINE constexpr operator bool() const { return is_unsigned::value; }
- LIBC_INLINE constexpr bool operator()() const { return is_unsigned::value; }
-};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_unsigned_v = is_unsigned<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_UNSIGNED_H
diff --git a/libc/src/__support/CPP/type_traits/is_void.h b/libc/src/__support/CPP/type_traits/is_void.h
deleted file mode 100644
index be054f0860c26c6..000000000000000
--- a/libc/src/__support/CPP/type_traits/is_void.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- is_void type_traits -------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_VOID_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_VOID_H
-
-#include "src/__support/CPP/type_traits/is_same.h"
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// is_void
-template <typename T> struct is_void : is_same<void, remove_cv_t<T>> {};
-template <typename T>
-LIBC_INLINE_VAR constexpr bool is_void_v = is_void<T>::value;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_IS_VOID_H
diff --git a/libc/src/__support/CPP/type_traits/make_signed.h b/libc/src/__support/CPP/type_traits/make_signed.h
deleted file mode 100644
index c896c4590232533..000000000000000
--- a/libc/src/__support/CPP/type_traits/make_signed.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- make_signed type_traits ---------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_SIGNED_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_SIGNED_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// make_signed
-template <typename T> struct make_signed;
-template <> struct make_signed<char> : type_identity<char> {};
-template <> struct make_signed<signed char> : type_identity<char> {};
-template <> struct make_signed<short> : type_identity<short> {};
-template <> struct make_signed<int> : type_identity<int> {};
-template <> struct make_signed<long> : type_identity<long> {};
-template <> struct make_signed<long long> : type_identity<long long> {};
-template <> struct make_signed<unsigned char> : type_identity<char> {};
-template <> struct make_signed<unsigned short> : type_identity<short> {};
-template <> struct make_signed<unsigned int> : type_identity<int> {};
-template <> struct make_signed<unsigned long> : type_identity<long> {};
-template <>
-struct make_signed<unsigned long long> : type_identity<long long> {};
-#ifdef __SIZEOF_INT128__
-template <> struct make_signed<__int128_t> : type_identity<__int128_t> {};
-template <> struct make_signed<__uint128_t> : type_identity<__int128_t> {};
-#endif
-template <typename T> using make_signed_t = typename make_signed<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_SIGNED_H
diff --git a/libc/src/__support/CPP/type_traits/make_unsigned.h b/libc/src/__support/CPP/type_traits/make_unsigned.h
deleted file mode 100644
index 5cd7c3cd4c86395..000000000000000
--- a/libc/src/__support/CPP/type_traits/make_unsigned.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//===-- make_unsigned type_traits -------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_UNSIGNED_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_UNSIGNED_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// make_unsigned
-
-template <typename T> struct make_unsigned;
-template <> struct make_unsigned<char> : type_identity<unsigned char> {};
-template <> struct make_unsigned<signed char> : type_identity<unsigned char> {};
-template <> struct make_unsigned<short> : type_identity<unsigned short> {};
-template <> struct make_unsigned<int> : type_identity<unsigned int> {};
-template <> struct make_unsigned<long> : type_identity<unsigned long> {};
-template <>
-struct make_unsigned<long long> : type_identity<unsigned long long> {};
-template <>
-struct make_unsigned<unsigned char> : type_identity<unsigned char> {};
-template <>
-struct make_unsigned<unsigned short> : type_identity<unsigned short> {};
-template <> struct make_unsigned<unsigned int> : type_identity<unsigned int> {};
-template <>
-struct make_unsigned<unsigned long> : type_identity<unsigned long> {};
-template <>
-struct make_unsigned<unsigned long long> : type_identity<unsigned long long> {};
-#ifdef __SIZEOF_INT128__
-template <> struct make_unsigned<__int128_t> : type_identity<__uint128_t> {};
-template <> struct make_unsigned<__uint128_t> : type_identity<__uint128_t> {};
-#endif
-template <typename T> using make_unsigned_t = typename make_unsigned<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_MAKE_UNSIGNED_H
diff --git a/libc/src/__support/CPP/type_traits/remove_all_extents.h b/libc/src/__support/CPP/type_traits/remove_all_extents.h
deleted file mode 100644
index 7799032ad52556e..000000000000000
--- a/libc/src/__support/CPP/type_traits/remove_all_extents.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- remove_all_extents type_traits --------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-#include "src/__support/macros/config.h"
-
-namespace __llvm_libc::cpp {
-
-// remove_all_extents
-#if LIBC_HAS_BUILTIN(__remove_all_extents)
-template <typename T> using remove_all_extents_t = __remove_all_extents(T);
-template <typename T>
-struct remove_all_extents : cpp::type_identity<remove_all_extents_t<T>> {};
-#else
-template <typename T> struct remove_all_extents {
- using type = T;
-};
-template <typename T> struct remove_all_extents<T[]> {
- using type = typename remove_all_extents<T>::type;
-};
-template <typename T, size_t _Np> struct remove_all_extents<T[_Np]> {
- using type = typename remove_all_extents<T>::type;
-};
-template <typename T>
-using remove_all_extents_t = typename remove_all_extents<T>::type;
-#endif
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_ALL_EXTENTS_H
diff --git a/libc/src/__support/CPP/type_traits/remove_cv.h b/libc/src/__support/CPP/type_traits/remove_cv.h
deleted file mode 100644
index 8ce41d64de277f3..000000000000000
--- a/libc/src/__support/CPP/type_traits/remove_cv.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//===-- remove_cv type_traits -----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CV_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CV_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// remove_cv
-template <class T> struct remove_cv : cpp::type_identity<T> {};
-template <class T> struct remove_cv<const T> : cpp::type_identity<T> {};
-template <class T> struct remove_cv<volatile T> : cpp::type_identity<T> {};
-template <class T>
-struct remove_cv<const volatile T> : cpp::type_identity<T> {};
-template <class T> using remove_cv_t = typename remove_cv<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CV_H
diff --git a/libc/src/__support/CPP/type_traits/remove_cvref.h b/libc/src/__support/CPP/type_traits/remove_cvref.h
deleted file mode 100644
index 68eb479f548d4a0..000000000000000
--- a/libc/src/__support/CPP/type_traits/remove_cvref.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- remove_cvref type_traits --------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CVREF_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CVREF_H
-
-#include "src/__support/CPP/type_traits/remove_cv.h"
-#include "src/__support/CPP/type_traits/remove_reference.h"
-
-namespace __llvm_libc::cpp {
-
-// remove_cvref
-template <typename T> struct remove_cvref {
- using type = remove_cv_t<remove_reference_t<T>>;
-};
-template <typename T> using remove_cvref_t = typename remove_cvref<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_CVREF_H
diff --git a/libc/src/__support/CPP/type_traits/remove_extent.h b/libc/src/__support/CPP/type_traits/remove_extent.h
deleted file mode 100644
index cc92f8fd080bf29..000000000000000
--- a/libc/src/__support/CPP/type_traits/remove_extent.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- remove_extent type_traits -------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// remove_extent
-template <class T> struct remove_extent : cpp::type_identity<T> {};
-template <class T> struct remove_extent<T[]> : cpp::type_identity<T> {};
-template <class T, size_t N>
-struct remove_extent<T[N]> : cpp::type_identity<T> {};
-template <class T> using remove_extent_t = typename remove_extent<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_EXTENT_H
diff --git a/libc/src/__support/CPP/type_traits/remove_reference.h b/libc/src/__support/CPP/type_traits/remove_reference.h
deleted file mode 100644
index b1cb17679273827..000000000000000
--- a/libc/src/__support/CPP/type_traits/remove_reference.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- remove_reference type_traits ----------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// remove_reference
-template <class T> struct remove_reference : cpp::type_identity<T> {};
-template <class T> struct remove_reference<T &> : cpp::type_identity<T> {};
-template <class T> struct remove_reference<T &&> : cpp::type_identity<T> {};
-template <class T>
-using remove_reference_t = typename remove_reference<T>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
diff --git a/libc/src/__support/CPP/type_traits/true_type.h b/libc/src/__support/CPP/type_traits/true_type.h
deleted file mode 100644
index 41f1fcadf189503..000000000000000
--- a/libc/src/__support/CPP/type_traits/true_type.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===-- true_type type_traits -----------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TRUE_TYPE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TRUE_TYPE_H
-
-#include "src/__support/CPP/type_traits/bool_constant.h"
-
-namespace __llvm_libc::cpp {
-
-// true_type
-using true_type = cpp::bool_constant<true>;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TRUE_TYPE_H
diff --git a/libc/src/__support/CPP/type_traits/type_identity.h b/libc/src/__support/CPP/type_traits/type_identity.h
deleted file mode 100644
index eaba0a9fbec47f4..000000000000000
--- a/libc/src/__support/CPP/type_traits/type_identity.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===-- type_identity type_traits -------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TYPE_IDENTITY_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TYPE_IDENTITY_H
-
-namespace __llvm_libc::cpp {
-
-// type_identity
-template <typename T> struct type_identity {
- using type = T;
-};
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_TYPE_IDENTITY_H
diff --git a/libc/src/__support/CPP/type_traits/void_t.h b/libc/src/__support/CPP/type_traits/void_t.h
deleted file mode 100644
index 237e7ce9744151b..000000000000000
--- a/libc/src/__support/CPP/type_traits/void_t.h
+++ /dev/null
@@ -1,26 +0,0 @@
-//===-- void_t type_traits --------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_VOID_T_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_VOID_T_H
-
-#include "src/__support/CPP/type_traits/type_identity.h"
-
-namespace __llvm_libc::cpp {
-
-// void_t
-
-namespace detail {
-template <typename... Ts> struct make_void : cpp::type_identity<void> {};
-} // namespace detail
-
-template <typename... Ts>
-using void_t = typename detail::make_void<Ts...>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_TYPE_TRAITS_VOID_T_H
diff --git a/libc/src/__support/CPP/utility.h b/libc/src/__support/CPP/utility.h
index 105d3a21dc2b00d..40455d5e61f8797 100644
--- a/libc/src/__support/CPP/utility.h
+++ b/libc/src/__support/CPP/utility.h
@@ -9,9 +9,48 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_H
#define LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_H
-#include "src/__support/CPP/utility/declval.h"
-#include "src/__support/CPP/utility/forward.h"
-#include "src/__support/CPP/utility/integer_sequence.h"
-#include "src/__support/CPP/utility/move.h"
+#include "src/__support/CPP/type_traits.h"
+#include "src/__support/macros/attributes.h"
+
+namespace __llvm_libc::cpp {
+
+template <typename T, T... Ints> struct integer_sequence {
+ static_assert(is_integral_v<T>);
+ template <T Next> using append = integer_sequence<T, Ints..., Next>;
+};
+
+namespace internal {
+
+template <typename T, int N> struct make_integer_sequence {
+ using type =
+ typename make_integer_sequence<T, N - 1>::type::template append<N>;
+};
+
+template <typename T> struct make_integer_sequence<T, -1> {
+ using type = integer_sequence<T>;
+};
+
+} // namespace internal
+
+template <typename T, int N>
+using make_integer_sequence =
+ typename internal::make_integer_sequence<T, N - 1>::type;
+
+template <typename T>
+LIBC_INLINE constexpr T &&forward(typename remove_reference<T>::type &value) {
+ return static_cast<T &&>(value);
+}
+
+template <typename T>
+LIBC_INLINE constexpr T &&forward(typename remove_reference<T>::type &&value) {
+ return static_cast<T &&>(value);
+}
+
+template <typename T>
+LIBC_INLINE constexpr typename remove_reference<T>::type &&move(T &&value) {
+ return static_cast<typename remove_reference<T>::type &&>(value);
+}
+
+} // namespace __llvm_libc::cpp
#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_H
diff --git a/libc/src/__support/CPP/utility/declval.h b/libc/src/__support/CPP/utility/declval.h
deleted file mode 100644
index 9261ceb9332d518..000000000000000
--- a/libc/src/__support/CPP/utility/declval.h
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-- declval utility -----------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_DECLVAL_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_DECLVAL_H
-
-#include "src/__support/CPP/type_traits/add_rvalue_reference.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// declval
-namespace detail {
-template <typename T> LIBC_INLINE_VAR constexpr bool always_false = false;
-}
-
-template <typename T> cpp::add_rvalue_reference_t<T> declval() {
- static_assert(detail::always_false<T>,
- "declval not allowed in an evaluated context");
-}
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_DECLVAL_H
diff --git a/libc/src/__support/CPP/utility/forward.h b/libc/src/__support/CPP/utility/forward.h
deleted file mode 100644
index a6698a589cb40e0..000000000000000
--- a/libc/src/__support/CPP/utility/forward.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- forward utility -----------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_FORWARD_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_FORWARD_H
-
-#include "src/__support/CPP/type_traits/is_lvalue_reference.h"
-#include "src/__support/CPP/type_traits/remove_reference.h"
-#include "src/__support/macros/attributes.h"
-
-namespace __llvm_libc::cpp {
-
-// forward
-template <typename T>
-LIBC_INLINE constexpr T &&forward(remove_reference_t<T> &value) {
- return static_cast<T &&>(value);
-}
-
-template <typename T>
-LIBC_INLINE constexpr T &&forward(remove_reference_t<T> &&value) {
- static_assert(!is_lvalue_reference_v<T>,
- "cannot forward an rvalue as an lvalue");
- return static_cast<T &&>(value);
-}
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_FORWARD_H
diff --git a/libc/src/__support/CPP/utility/integer_sequence.h b/libc/src/__support/CPP/utility/integer_sequence.h
deleted file mode 100644
index 471567f714f882d..000000000000000
--- a/libc/src/__support/CPP/utility/integer_sequence.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- integer_sequence utility --------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_INTEGER_SEQUENCE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_INTEGER_SEQUENCE_H
-
-#include "src/__support/CPP/type_traits/is_integral.h"
-
-namespace __llvm_libc::cpp {
-
-// integer_sequence
-template <typename T, T... Ints> struct integer_sequence {
- static_assert(cpp::is_integral_v<T>);
- template <T Next> using append = integer_sequence<T, Ints..., Next>;
-};
-
-namespace detail {
-template <typename T, int N> struct make_integer_sequence {
- using type =
- typename make_integer_sequence<T, N - 1>::type::template append<N>;
-};
-template <typename T> struct make_integer_sequence<T, -1> {
- using type = integer_sequence<T>;
-};
-} // namespace detail
-
-template <typename T, int N>
-using make_integer_sequence =
- typename detail::make_integer_sequence<T, N - 1>::type;
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_INTEGER_SEQUENCE_H
diff --git a/libc/src/__support/CPP/utility/move.h b/libc/src/__support/CPP/utility/move.h
deleted file mode 100644
index 3cc73c76ce9aff0..000000000000000
--- a/libc/src/__support/CPP/utility/move.h
+++ /dev/null
@@ -1,22 +0,0 @@
-//===-- move utility --------------------------------------------*- 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 LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_MOVE_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_MOVE_H
-
-#include "src/__support/CPP/type_traits/remove_reference.h"
-
-namespace __llvm_libc::cpp {
-
-// move
-template <class T> constexpr cpp::remove_reference_t<T> &&move(T &&t) {
- return static_cast<typename cpp::remove_reference_t<T> &&>(t);
-}
-
-} // namespace __llvm_libc::cpp
-
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UTILITY_MOVE_H
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index bdf260a783baa2b..32f627405ad3be2 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -284,53 +284,7 @@ libc_support_library(
libc_support_library(
name = "__support_cpp_type_traits",
- hdrs = [
- "src/__support/CPP/type_traits.h",
- "src/__support/CPP/type_traits/add_lvalue_reference.h",
- "src/__support/CPP/type_traits/add_pointer.h",
- "src/__support/CPP/type_traits/add_rvalue_reference.h",
- "src/__support/CPP/type_traits/bool_constant.h",
- "src/__support/CPP/type_traits/conditional.h",
- "src/__support/CPP/type_traits/decay.h",
- "src/__support/CPP/type_traits/enable_if.h",
- "src/__support/CPP/type_traits/false_type.h",
- "src/__support/CPP/type_traits/integral_constant.h",
- "src/__support/CPP/type_traits/is_arithmetic.h",
- "src/__support/CPP/type_traits/is_array.h",
- "src/__support/CPP/type_traits/is_base_of.h",
- "src/__support/CPP/type_traits/is_class.h",
- "src/__support/CPP/type_traits/is_const.h",
- "src/__support/CPP/type_traits/is_convertible.h",
- "src/__support/CPP/type_traits/is_destructible.h",
- "src/__support/CPP/type_traits/is_enum.h",
- "src/__support/CPP/type_traits/is_floating_point.h",
- "src/__support/CPP/type_traits/is_function.h",
- "src/__support/CPP/type_traits/is_integral.h",
- "src/__support/CPP/type_traits/is_lvalue_reference.h",
- "src/__support/CPP/type_traits/is_null_pointer.h",
- "src/__support/CPP/type_traits/is_pointer.h",
- "src/__support/CPP/type_traits/is_reference.h",
- "src/__support/CPP/type_traits/is_rvalue_reference.h",
- "src/__support/CPP/type_traits/is_same.h",
- "src/__support/CPP/type_traits/is_signed.h",
- "src/__support/CPP/type_traits/is_trivially_constructible.h",
- "src/__support/CPP/type_traits/is_trivially_copyable.h",
- "src/__support/CPP/type_traits/is_trivially_destructible.h",
- "src/__support/CPP/type_traits/is_union.h",
- "src/__support/CPP/type_traits/is_unsigned.h",
- "src/__support/CPP/type_traits/is_void.h",
- "src/__support/CPP/type_traits/make_signed.h",
- "src/__support/CPP/type_traits/make_unsigned.h",
- "src/__support/CPP/type_traits/remove_all_extents.h",
- "src/__support/CPP/type_traits/remove_cv.h",
- "src/__support/CPP/type_traits/remove_cvref.h",
- "src/__support/CPP/type_traits/remove_extent.h",
- "src/__support/CPP/type_traits/remove_reference.h",
- "src/__support/CPP/type_traits/true_type.h",
- "src/__support/CPP/type_traits/type_identity.h",
- "src/__support/CPP/type_traits/void_t.h",
- "src/__support/CPP/utility/declval.h",
- ],
+ hdrs = ["src/__support/CPP/type_traits.h"],
deps = [
":__support_macros_attributes",
":__support_macros_config",
@@ -340,13 +294,7 @@ libc_support_library(
libc_support_library(
name = "__support_cpp_utility",
- hdrs = [
- "src/__support/CPP/utility.h",
- "src/__support/CPP/utility/declval.h",
- "src/__support/CPP/utility/forward.h",
- "src/__support/CPP/utility/integer_sequence.h",
- "src/__support/CPP/utility/move.h",
- ],
+ hdrs = ["src/__support/CPP/utility.h"],
deps = [
":__support_cpp_type_traits",
":__support_macros_attributes",
More information about the libc-commits
mailing list