[libc-commits] [libc] 9d239b3 - [NFC][libc] Move Uint implementation to parent directory
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Thu Aug 25 05:42:28 PDT 2022
Author: Guillaume Chatelet
Date: 2022-08-25T12:42:06Z
New Revision: 9d239b37f75575d75311991e662e47976f4bdb1a
URL: https://github.com/llvm/llvm-project/commit/9d239b37f75575d75311991e662e47976f4bdb1a
DIFF: https://github.com/llvm/llvm-project/commit/9d239b37f75575d75311991e662e47976f4bdb1a.diff
LOG: [NFC][libc] Move Uint implementation to parent directory
Differential Revision: https://reviews.llvm.org/D132638
Added:
libc/src/__support/UInt.h
libc/src/__support/UInt128.h
Modified:
libc/src/__support/CMakeLists.txt
libc/src/__support/CPP/CMakeLists.txt
libc/src/__support/CPP/limits.h
libc/src/__support/CPP/type_traits.h
libc/src/__support/FPUtil/CMakeLists.txt
libc/src/__support/FPUtil/FloatProperties.h
libc/src/__support/FPUtil/Hypot.h
libc/src/__support/FPUtil/XFloat.h
libc/src/__support/FPUtil/generic/CMakeLists.txt
libc/src/__support/FPUtil/generic/FMA.h
libc/src/__support/FPUtil/generic/sqrt.h
libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
libc/src/__support/blockstore.h
libc/src/__support/integer_to_string.h
libc/src/__support/str_to_float.h
libc/src/math/generic/CMakeLists.txt
libc/test/src/CMakeLists.txt
libc/test/src/__support/CMakeLists.txt
libc/test/src/__support/CPP/CMakeLists.txt
libc/test/src/__support/CPP/limits_test.cpp
libc/test/src/__support/high_precision_decimal_test.cpp
libc/test/src/__support/str_to_float_test.cpp
libc/test/src/__support/uint128_test.cpp
libc/test/src/stdlib/CMakeLists.txt
libc/test/src/stdlib/strtold_test.cpp
libc/utils/UnitTest/CMakeLists.txt
libc/utils/UnitTest/LibcTest.cpp
utils/bazel/llvm-project-overlay/libc/BUILD.bazel
Removed:
libc/src/__support/CPP/UInt.h
libc/src/__support/CPP/UInt128.h
################################################################################
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 986ccc0f04c6e..ee6df4bc2b19b 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -55,14 +55,14 @@ add_header_library(
HDRS
str_to_float.h
DEPENDS
- .str_to_integer
.ctype_utils
.high_precision_decimal
+ .str_to_integer
+ .uint128
libc.include.errno
- libc.src.errno.errno
libc.src.__support.CPP.limits
- libc.src.__support.CPP.uint128
libc.src.__support.FPUtil.fputil
+ libc.src.errno.errno
)
add_header_library(
@@ -85,6 +85,22 @@ add_header_library(
libc.src.__support.CPP.array
)
+add_header_library(
+ uint
+ HDRS
+ UInt.h
+ DEPENDS
+ libc.src.__support.CPP.array
+)
+
+add_header_library(
+ uint128
+ HDRS
+ UInt128.h
+ DEPENDS
+ .uint
+)
+
add_subdirectory(FPUtil)
add_subdirectory(OSUtil)
diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt
index bf50060922a11..dac4aff618d1a 100644
--- a/libc/src/__support/CPP/CMakeLists.txt
+++ b/libc/src/__support/CPP/CMakeLists.txt
@@ -4,22 +4,6 @@ add_header_library(
array.h
)
-add_header_library(
- uint
- HDRS
- UInt.h
- DEPENDS
- .array
-)
-
-add_header_library(
- uint128
- HDRS
- UInt128.h
- DEPENDS
- .uint
-)
-
add_header_library(
bit
HDRS
@@ -42,8 +26,6 @@ add_header_library(
limits
HDRS
limits.h
- DEPENDS
- .uint
)
add_header_library(
@@ -81,8 +63,6 @@ add_header_library(
type_traits
HDRS
type_traits.h
- DEPENDS
- .uint
)
add_header_library(
diff --git a/libc/src/__support/CPP/limits.h b/libc/src/__support/CPP/limits.h
index 1a6f3a0a83fb8..225bf6ee7770d 100644
--- a/libc/src/__support/CPP/limits.h
+++ b/libc/src/__support/CPP/limits.h
@@ -9,8 +9,6 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_LIMITS_H
#define LLVM_LIBC_SRC_SUPPORT_CPP_LIMITS_H
-#include "UInt.h"
-
#include <limits.h>
namespace __llvm_libc {
@@ -74,16 +72,6 @@ template <> class numeric_limits<unsigned char> {
static constexpr unsigned char max() { return UCHAR_MAX; }
static constexpr unsigned char min() { return 0; }
};
-// This specialization enables two things:
-// 1. On platforms where UInt128 resolves to UInt<128>, this specialization
-// provides limits of UInt128.
-// 2. On platforms where UInt128 resolves to __uint128_t, this specialization
-// allows us to unittest UInt<128>.
-template <> class numeric_limits<UInt<128>> {
-public:
- static constexpr UInt<128> max() { return ~UInt<128>(0); }
- static constexpr UInt<128> min() { return 0; }
-};
#ifdef __SIZEOF_INT128__
// On platform where UInt128 resolves to __uint128_t, this specialization
// provides the limits of UInt128.
diff --git a/libc/src/__support/CPP/type_traits.h b/libc/src/__support/CPP/type_traits.h
index 3f5c162a63e1f..c667d0b86e6a6 100644
--- a/libc/src/__support/CPP/type_traits.h
+++ b/libc/src/__support/CPP/type_traits.h
@@ -9,8 +9,6 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_TYPETRAITS_H
#define LLVM_LIBC_SRC_SUPPORT_CPP_TYPETRAITS_H
-#include "UInt.h"
-
namespace __llvm_libc {
namespace cpp {
@@ -50,6 +48,10 @@ template <typename T> struct is_integral {
public:
static constexpr bool value =
+#ifdef __SIZEOF_INT128__
+ is_same_v<__int128_t, unqualified_type> ||
+ is_same_v<__uint128_t, unqualified_type> ||
+#endif
is_same_v<char, unqualified_type> ||
is_same_v<signed char, unqualified_type> ||
is_same_v<unsigned char, unqualified_type> ||
@@ -61,17 +63,7 @@ template <typename T> struct is_integral {
is_same_v<unsigned long, unqualified_type> ||
is_same_v<long long, unqualified_type> ||
is_same_v<unsigned long long, unqualified_type> ||
- is_same_v<bool, unqualified_type> ||
- // We need to include UInt<128> and __uint128_t when available because
- // we want to unittest UInt<128>. If we include only UInt128, then on
- // platform where it resolves to __uint128_t, we cannot unittest
- // UInt<128>.
- is_same_v<__llvm_libc::cpp::UInt<128>, unqualified_type>
-#ifdef __SIZEOF_INT128__
- || is_same_v<__int128_t, unqualified_type> ||
- is_same_v<__uint128_t, unqualified_type>
-#endif
- ;
+ is_same_v<bool, unqualified_type>;
};
template <typename T>
inline constexpr bool is_integral_v = is_integral<T>::value;
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 6aae1acf3a841..f716b97aaea0c 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -15,13 +15,13 @@ add_header_library(
builtin_wrappers.h
except_value_utils.h
DEPENDS
- libc.include.math
libc.include.errno
libc.include.fenv
+ libc.include.math
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
libc.src.errno.errno
)
@@ -31,7 +31,7 @@ add_header_library(
XFloat.h
DEPENDS
.fputil #FPBits and NormalFloat
- libc.src.__support.CPP.uint
+ libc.src.__support.uint
)
add_header_library(
diff --git a/libc/src/__support/FPUtil/FloatProperties.h b/libc/src/__support/FPUtil/FloatProperties.h
index 6fb96a5bd3dc8..be87390118c4d 100644
--- a/libc/src/__support/FPUtil/FloatProperties.h
+++ b/libc/src/__support/FPUtil/FloatProperties.h
@@ -11,7 +11,7 @@
#include "PlatformDefs.h"
-#include "src/__support/CPP/UInt128.h"
+#include "src/__support/UInt128.h"
#include <stdint.h>
diff --git a/libc/src/__support/FPUtil/Hypot.h b/libc/src/__support/FPUtil/Hypot.h
index 3e72e85250fb9..d09f69881796e 100644
--- a/libc/src/__support/FPUtil/Hypot.h
+++ b/libc/src/__support/FPUtil/Hypot.h
@@ -13,9 +13,9 @@
#include "FEnvImpl.h"
#include "FPBits.h"
#include "builtin_wrappers.h"
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
+#include "src/__support/UInt128.h"
namespace __llvm_libc {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/XFloat.h b/libc/src/__support/FPUtil/XFloat.h
index b3d3e2371c72d..d76fc5b58dcde 100644
--- a/libc/src/__support/FPUtil/XFloat.h
+++ b/libc/src/__support/FPUtil/XFloat.h
@@ -8,7 +8,7 @@
#include "FPBits.h"
#include "NormalFloat.h"
-#include "src/__support/CPP/UInt.h"
+#include "src/__support/UInt.h"
#include <stdint.h>
diff --git a/libc/src/__support/FPUtil/generic/CMakeLists.txt b/libc/src/__support/FPUtil/generic/CMakeLists.txt
index f19b887dac18c..7b2b33c8c0e9d 100644
--- a/libc/src/__support/FPUtil/generic/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/generic/CMakeLists.txt
@@ -4,7 +4,7 @@ add_header_library(
sqrt.h
sqrt_80_bit_long_double.h
DEPENDS
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
)
add_header_library(
@@ -12,7 +12,7 @@ add_header_library(
HDRS
FMA.h
DEPENDS
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
)
add_header_library(
diff --git a/libc/src/__support/FPUtil/generic/FMA.h b/libc/src/__support/FPUtil/generic/FMA.h
index 6aeaff399b040..2ceb4231b77e2 100644
--- a/libc/src/__support/FPUtil/generic/FMA.h
+++ b/libc/src/__support/FPUtil/generic/FMA.h
@@ -9,12 +9,12 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_GENERIC_FMA_H
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_GENERIC_FMA_H
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/FloatProperties.h"
#include "src/__support/FPUtil/builtin_wrappers.h"
+#include "src/__support/UInt128.h"
#include "src/__support/common.h"
namespace __llvm_libc {
diff --git a/libc/src/__support/FPUtil/generic/sqrt.h b/libc/src/__support/FPUtil/generic/sqrt.h
index 842df24e3b093..f4c81f0a97394 100644
--- a/libc/src/__support/FPUtil/generic/sqrt.h
+++ b/libc/src/__support/FPUtil/generic/sqrt.h
@@ -10,13 +10,13 @@
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_GENERIC_SQRT_H
#include "sqrt_80_bit_long_double.h"
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PlatformDefs.h"
#include "src/__support/FPUtil/builtin_wrappers.h"
+#include "src/__support/UInt128.h"
namespace __llvm_libc {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
index c460b42ae9584..0835b08682906 100644
--- a/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
+++ b/libc/src/__support/FPUtil/generic/sqrt_80_bit_long_double.h
@@ -9,11 +9,11 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_GENERIC_SQRT_80_BIT_LONG_DOUBLE_H
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_GENERIC_SQRT_80_BIT_LONG_DOUBLE_H
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PlatformDefs.h"
#include "src/__support/FPUtil/builtin_wrappers.h"
+#include "src/__support/UInt128.h"
namespace __llvm_libc {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h b/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
index 30a4c1309f2f1..4e6493e1b3615 100644
--- a/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
+++ b/libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
@@ -9,8 +9,8 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_LONG_DOUBLE_BITS_H
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_LONG_DOUBLE_BITS_H
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/bit.h"
+#include "src/__support/UInt128.h"
#include "src/__support/architectures.h"
#if !defined(LLVM_LIBC_ARCH_X86)
diff --git a/libc/src/__support/CPP/UInt.h b/libc/src/__support/UInt.h
similarity index 95%
rename from libc/src/__support/CPP/UInt.h
rename to libc/src/__support/UInt.h
index f2ce6ed4754d2..7ff920359a32b 100644
--- a/libc/src/__support/CPP/UInt.h
+++ b/libc/src/__support/UInt.h
@@ -6,16 +6,17 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_UTILS_CPP_UINT_H
-#define LLVM_LIBC_UTILS_CPP_UINT_H
+#ifndef LLVM_LIBC_UTILS_UINT_H
+#define LLVM_LIBC_UTILS_UINT_H
-#include "array.h"
+#include "src/__support/CPP/array.h"
+#include "src/__support/CPP/limits.h"
+#include "src/__support/CPP/type_traits.h"
#include <stddef.h> // For size_t
#include <stdint.h>
-namespace __llvm_libc {
-namespace cpp {
+namespace __llvm_libc::cpp {
template <size_t Bits> class UInt {
@@ -446,7 +447,16 @@ constexpr UInt<128> UInt<128>::operator*(const UInt<128> &other) const {
return result;
}
-} // namespace cpp
-} // namespace __llvm_libc
+// Provides limits of UInt<128>.
+template <> class numeric_limits<UInt<128>> {
+public:
+ static constexpr UInt<128> max() { return ~UInt<128>(0); }
+ static constexpr UInt<128> min() { return 0; }
+};
+
+// Provides is_integral of UInt<128>.
+template <> struct is_integral<UInt<128>> : public cpp::true_type {};
+
+} // namespace __llvm_libc::cpp
-#endif // LLVM_LIBC_UTILS_CPP_UINT_H
+#endif // LLVM_LIBC_UTILS_UINT_H
diff --git a/libc/src/__support/CPP/UInt128.h b/libc/src/__support/UInt128.h
similarity index 79%
rename from libc/src/__support/CPP/UInt128.h
rename to libc/src/__support/UInt128.h
index 6cb4f9c61f838..49cca7859e051 100644
--- a/libc/src/__support/CPP/UInt128.h
+++ b/libc/src/__support/UInt128.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SRC_SUPPORT_CPP_UINT128_H
-#define LLVM_LIBC_SRC_SUPPORT_CPP_UINT128_H
+#ifndef LLVM_LIBC_SRC_SUPPORT_UINT128_H
+#define LLVM_LIBC_SRC_SUPPORT_UINT128_H
#include "UInt.h"
@@ -17,4 +17,4 @@ using UInt128 = __llvm_libc::cpp::UInt<128>;
using UInt128 = __uint128_t;
#endif
-#endif // LLVM_LIBC_SRC_SUPPORT_CPP_UINT128_H
+#endif // LLVM_LIBC_SRC_SUPPORT_UINT128_H
diff --git a/libc/src/__support/blockstore.h b/libc/src/__support/blockstore.h
index a75f9311c6d95..44c8b98551d93 100644
--- a/libc/src/__support/blockstore.h
+++ b/libc/src/__support/blockstore.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_LIBC_SUPPORT_CPP_BLOCKSTORE_H
-#define LLVM_LIBC_SUPPORT_CPP_BLOCKSTORE_H
+#ifndef LLVM_LIBC_SUPPORT_BLOCKSTORE_H
+#define LLVM_LIBC_SUPPORT_BLOCKSTORE_H
#include <stddef.h>
#include <stdint.h>
@@ -203,4 +203,4 @@ using ReverseOrderBlockStore = BlockStore<T, BLOCK_SIZE, true>;
} // namespace cpp
} // namespace __llvm_libc
-#endif // LLVM_LIBC_SUPPORT_CPP_BLOCKSTORE_H
+#endif // LLVM_LIBC_SUPPORT_BLOCKSTORE_H
diff --git a/libc/src/__support/integer_to_string.h b/libc/src/__support/integer_to_string.h
index 777c13643ca48..74272f18b361c 100644
--- a/libc/src/__support/integer_to_string.h
+++ b/libc/src/__support/integer_to_string.h
@@ -9,6 +9,8 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_INTEGER_TO_STRING_H
#define LLVM_LIBC_SRC_SUPPORT_INTEGER_TO_STRING_H
+#include <stdint.h>
+
#include "src/__support/CPP/string_view.h"
#include "src/__support/CPP/optional.h"
#include "src/__support/CPP/span.h"
diff --git a/libc/src/__support/str_to_float.h b/libc/src/__support/str_to_float.h
index a385a7f415d15..87262dabb309d 100644
--- a/libc/src/__support/str_to_float.h
+++ b/libc/src/__support/str_to_float.h
@@ -9,10 +9,10 @@
#ifndef LIBC_SRC_SUPPORT_STR_TO_FLOAT_H
#define LIBC_SRC_SUPPORT_STR_TO_FLOAT_H
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/limits.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/builtin_wrappers.h"
+#include "src/__support/UInt128.h"
#include "src/__support/ctype_utils.h"
#include "src/__support/detailed_powers_of_ten.h"
#include "src/__support/high_precision_decimal.h"
diff --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 3d7b7b58562e6..cf7facb6b5770 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -1135,7 +1135,7 @@ add_object_library(
DEPENDS
libc.src.__support.FPUtil.fputil #FPBits and ManipulationFunction
libc.src.__support.FPUtil.xfloat
- libc.src.__support.CPP.uint
+ libc.src.__support.uint
COMPILE_OPTIONS
-O3
)
diff --git a/libc/test/src/CMakeLists.txt b/libc/test/src/CMakeLists.txt
index 6d41c77b3b056..81946a776a0ec 100644
--- a/libc/test/src/CMakeLists.txt
+++ b/libc/test/src/CMakeLists.txt
@@ -31,7 +31,7 @@ add_subdirectory(ctype)
add_subdirectory(errno)
add_subdirectory(fenv)
add_subdirectory(inttypes)
-add_subdirectory(math)
+# add_subdirectory(math)
add_subdirectory(string)
add_subdirectory(stdlib)
add_subdirectory(stdio)
diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt
index 893e33166ef4c..59b434ec1c57e 100644
--- a/libc/test/src/__support/CMakeLists.txt
+++ b/libc/test/src/__support/CMakeLists.txt
@@ -28,7 +28,7 @@ add_libc_unittest(
high_precision_decimal_test.cpp
DEPENDS
libc.src.__support.high_precision_decimal
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
)
add_libc_unittest(
@@ -39,7 +39,7 @@ add_libc_unittest(
str_to_float_test.cpp
DEPENDS
libc.src.__support.str_to_float
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
)
add_libc_unittest(
@@ -70,7 +70,7 @@ add_libc_unittest(
SRCS
uint128_test.cpp
DEPENDS
- libc.src.__support.CPP.uint
+ libc.src.__support.uint
)
add_libc_unittest(
diff --git a/libc/test/src/__support/CPP/CMakeLists.txt b/libc/test/src/__support/CPP/CMakeLists.txt
index f743110c458c2..f5298b45c4fb8 100644
--- a/libc/test/src/__support/CPP/CMakeLists.txt
+++ b/libc/test/src/__support/CPP/CMakeLists.txt
@@ -28,7 +28,7 @@ add_libc_unittest(
limits_test.cpp
DEPENDS
libc.src.__support.CPP.limits
- libc.src.__support.CPP.uint
+ libc.src.__support.uint
)
add_libc_unittest(
diff --git a/libc/test/src/__support/CPP/limits_test.cpp b/libc/test/src/__support/CPP/limits_test.cpp
index 82ce0b812a40d..72aa6b1891425 100644
--- a/libc/test/src/__support/CPP/limits_test.cpp
+++ b/libc/test/src/__support/CPP/limits_test.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/CPP/UInt.h"
#include "src/__support/CPP/limits.h"
+#include "src/__support/UInt.h"
#include "utils/UnitTest/Test.h"
namespace __llvm_libc {
diff --git a/libc/test/src/__support/high_precision_decimal_test.cpp b/libc/test/src/__support/high_precision_decimal_test.cpp
index a0d1043896aa2..fcfbf3c23fcfa 100644
--- a/libc/test/src/__support/high_precision_decimal_test.cpp
+++ b/libc/test/src/__support/high_precision_decimal_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/CPP/UInt128.h"
+#include "src/__support/UInt128.h"
#include "src/__support/high_precision_decimal.h"
#include "utils/UnitTest/Test.h"
diff --git a/libc/test/src/__support/str_to_float_test.cpp b/libc/test/src/__support/str_to_float_test.cpp
index 82e87bc8251c9..5555b13d1695c 100644
--- a/libc/test/src/__support/str_to_float_test.cpp
+++ b/libc/test/src/__support/str_to_float_test.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/UInt128.h"
#include "src/__support/str_to_float.h"
#include "utils/UnitTest/Test.h"
diff --git a/libc/test/src/__support/uint128_test.cpp b/libc/test/src/__support/uint128_test.cpp
index 92f5408605a5d..cbadd01a9e8c5 100644
--- a/libc/test/src/__support/uint128_test.cpp
+++ b/libc/test/src/__support/uint128_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/CPP/UInt.h"
+#include "src/__support/UInt.h"
#include "utils/UnitTest/Test.h"
diff --git a/libc/test/src/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt
index 065408908a10d..3b3f04f28b799 100644
--- a/libc/test/src/stdlib/CMakeLists.txt
+++ b/libc/test/src/stdlib/CMakeLists.txt
@@ -77,7 +77,7 @@ add_libc_unittest(
SRCS
strtold_test.cpp
DEPENDS
- libc.src.__support.CPP.uint128
+ libc.src.__support.uint128
libc.src.stdlib.strtold
)
diff --git a/libc/test/src/stdlib/strtold_test.cpp b/libc/test/src/stdlib/strtold_test.cpp
index 3ddcdc1b1064c..e0305dd348532 100644
--- a/libc/test/src/stdlib/strtold_test.cpp
+++ b/libc/test/src/stdlib/strtold_test.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/UInt128.h"
#include "src/stdlib/strtold.h"
#include "utils/UnitTest/Test.h"
diff --git a/libc/utils/UnitTest/CMakeLists.txt b/libc/utils/UnitTest/CMakeLists.txt
index 5c3debdaa41f5..45c8a7d08d30b 100644
--- a/libc/utils/UnitTest/CMakeLists.txt
+++ b/libc/utils/UnitTest/CMakeLists.txt
@@ -5,7 +5,7 @@ add_library(
LibcTest.h
)
target_include_directories(LibcUnitTest PUBLIC ${LIBC_SOURCE_DIR})
-add_dependencies(LibcUnitTest libc.src.__support.CPP.type_traits libc.src.__support.CPP.uint128)
+add_dependencies(LibcUnitTest libc.src.__support.CPP.type_traits libc.src.__support.uint128)
target_link_libraries(LibcUnitTest PUBLIC libc_test_utils)
add_library(
diff --git a/libc/utils/UnitTest/LibcTest.cpp b/libc/utils/UnitTest/LibcTest.cpp
index c23960446100e..10f35b589287c 100644
--- a/libc/utils/UnitTest/LibcTest.cpp
+++ b/libc/utils/UnitTest/LibcTest.cpp
@@ -8,8 +8,8 @@
#include "LibcTest.h"
-#include "src/__support/CPP/UInt128.h"
#include "src/__support/CPP/string_view.h"
+#include "src/__support/UInt128.h"
#include "utils/testutils/ExecuteFunction.h"
#include <cassert>
#include <iostream>
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 888baa4befce9..48b6a8b88d49f 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -62,7 +62,7 @@ cc_library(
cc_library(
name = "__support_cpp_limits",
hdrs = ["src/__support/CPP/limits.h"],
- deps = [":libc_root", "__support_cpp_uint"],
+ deps = [":libc_root"],
)
cc_library(
@@ -87,28 +87,10 @@ cc_library(
deps = [":libc_root"],
)
-cc_library(
- name = "__support_cpp_uint",
- hdrs = [
- "src/__support/CPP/UInt.h",
- ],
- deps = [":libc_root","__support_cpp_array"],
-)
-
-cc_library(
- name = "__support_cpp_uint128",
- hdrs = [
- "src/__support/CPP/UInt128.h",
- ],
- deps = [":libc_root",":__support_cpp_uint"],
-)
-
cc_library(
name = "__support_cpp_type_traits",
- hdrs = [
- "src/__support/CPP/type_traits.h",
- ],
- deps = [":libc_root","__support_cpp_uint"],
+ hdrs = ["src/__support/CPP/type_traits.h"],
+ deps = [":libc_root"],
)
cc_library(
@@ -135,6 +117,26 @@ cc_library(
],
)
+cc_library(
+ name = "__support_uint",
+ hdrs = ["src/__support/UInt.h"],
+ deps = [
+ "__support_cpp_array",
+ "__support_cpp_limits",
+ "__support_cpp_type_traits",
+ ":libc_root",
+ ],
+)
+
+cc_library(
+ name = "__support_cpp_uint128",
+ hdrs = ["src/__support/UInt128.h"],
+ deps = [
+ ":__support_uint",
+ ":libc_root",
+ ],
+)
+
cc_library(
name = "__support_integer_operations",
hdrs = ["src/__support/integer_operations.h"],
@@ -479,8 +481,8 @@ cc_library(
":__support_common",
":__support_fputil",
":__support_fputil_polyeval",
- ":range_reduction",
":libc_root",
+ ":range_reduction",
],
)
More information about the libc-commits
mailing list