-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[libc][NFC] Add stdint.h proxy header to fix dependency issue with <stdint.h> includes. #150303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-libc Author: None (lntue) ChangesPatch is 140.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/150303.diff 239 Files Affected:
diff --git a/libc/benchmarks/gpu/BenchmarkLogger.cpp b/libc/benchmarks/gpu/BenchmarkLogger.cpp
index 0d644fa3c37bc..d5996a74f6dd7 100644
--- a/libc/benchmarks/gpu/BenchmarkLogger.cpp
+++ b/libc/benchmarks/gpu/BenchmarkLogger.cpp
@@ -1,4 +1,5 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/string.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/OSUtil/io.h" // write_to_stderr
@@ -7,8 +8,6 @@
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/CMakeLists.txt b/libc/benchmarks/gpu/CMakeLists.txt
index b58f4fd8b1a42..6ec64bf270b53 100644
--- a/libc/benchmarks/gpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/CMakeLists.txt
@@ -45,6 +45,7 @@ add_unittest_framework_library(
LibcGpuBenchmark.h
BenchmarkLogger.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.big_int
libc.src.__support.c_string
libc.src.__support.CPP.string
diff --git a/libc/benchmarks/gpu/LibcGpuBenchmark.h b/libc/benchmarks/gpu/LibcGpuBenchmark.h
index f2cfbfbfdcdf0..a6cf62dd30ce5 100644
--- a/libc/benchmarks/gpu/LibcGpuBenchmark.h
+++ b/libc/benchmarks/gpu/LibcGpuBenchmark.h
@@ -3,6 +3,7 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
#include "benchmarks/gpu/timing/timing.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/functional.h"
#include "src/__support/CPP/limits.h"
@@ -13,8 +14,6 @@
#include "src/stdlib/rand.h"
#include "src/time/clock.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/src/math/CMakeLists.txt b/libc/benchmarks/gpu/src/math/CMakeLists.txt
index 6870c02449016..7a12ce4e61c9e 100644
--- a/libc/benchmarks/gpu/src/math/CMakeLists.txt
+++ b/libc/benchmarks/gpu/src/math/CMakeLists.txt
@@ -31,6 +31,7 @@ add_benchmark(
SRCS
sin_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.sin
libc.src.math.sinf
libc.src.stdlib.srand
@@ -51,6 +52,7 @@ add_benchmark(
SRCS
atan2_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.atan2
libc.src.stdlib.srand
libc.src.stdlib.rand
diff --git a/libc/benchmarks/gpu/src/math/platform.h b/libc/benchmarks/gpu/src/math/platform.h
index bb7825d38bd42..2dfa9f2299d46 100644
--- a/libc/benchmarks/gpu/src/math/platform.h
+++ b/libc/benchmarks/gpu/src/math/platform.h
@@ -7,9 +7,10 @@
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
#define LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
+
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
index aa5dcd33bee9c..dd7c2d342f70f 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/amdgpu/timing.h b/libc/benchmarks/gpu/timing/amdgpu/timing.h
index 0f2c04c07c921..37dbb9af5976b 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/timing.h
+++ b/libc/benchmarks/gpu/timing/amdgpu/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
#define LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
index 2723c8940814c..a19c16ee4e44d 100644
--- a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/nvptx/timing.h b/libc/benchmarks/gpu/timing/nvptx/timing.h
index 3ed97645ddc93..3c729636367aa 100644
--- a/libc/benchmarks/gpu/timing/nvptx/timing.h
+++ b/libc/benchmarks/gpu/timing/nvptx/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
#define LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/config/CMakeLists.txt b/libc/config/CMakeLists.txt
index cf38ae3eed726..4758276469f69 100644
--- a/libc/config/CMakeLists.txt
+++ b/libc/config/CMakeLists.txt
@@ -3,5 +3,6 @@ add_header_library(
HDRS
app.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
diff --git a/libc/config/gpu/app.h b/libc/config/gpu/app.h
index 148c51b702203..17ef3ae7b1ce9 100644
--- a/libc/config/gpu/app.h
+++ b/libc/config/gpu/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_GPU_APP_H
#define LLVM_LIBC_CONFIG_GPU_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// TODO: Move other global values here and export them to the host.
diff --git a/libc/config/linux/app.h b/libc/config/linux/app.h
index 188d34816454b..f3d11da9fc14c 100644
--- a/libc/config/linux/app.h
+++ b/libc/config/linux/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_LINUX_APP_H
#define LLVM_LIBC_CONFIG_LINUX_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure to capture properties of the linux/ELF TLS image.
diff --git a/libc/config/uefi/app.h b/libc/config/uefi/app.h
index 0374a47ba3402..1f181ed5f9f1f 100644
--- a/libc/config/uefi/app.h
+++ b/libc/config/uefi/app.h
@@ -9,13 +9,12 @@
#ifndef LLVM_LIBC_CONFIG_UEFI_APP_H
#define LLVM_LIBC_CONFIG_UEFI_APP_H
+#include "hdr/stdint_proxy.h"
#include "include/llvm-libc-types/EFI_HANDLE.h"
#include "include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure which captures properties of a UEFI application.
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 052a773a4fcec..5fc25d0ca5689 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -243,5 +243,14 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.offsetof_macro
)
+# stdint.h header.
+add_proxy_header_library(
+ stdint_proxy
+ HDRS
+ stdint_proxy.h
+ FULL_BUILD_DEPENDS
+ libc.include.stdint
+)
+
add_subdirectory(types)
add_subdirectory(func)
diff --git a/libc/hdr/stdint_proxy.h b/libc/hdr/stdint_proxy.h
new file mode 100644
index 0000000000000..8e815679a4e24
--- /dev/null
+++ b/libc/hdr/stdint_proxy.h
@@ -0,0 +1,18 @@
+//===-- stdint.h ----------------------------------------------------------===//
+//
+// 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_HDR_STDINT_PROXY_H
+#define LLVM_LIBC_HDR_STDINT_PROXY_H
+
+// This target is to make sure we have correct build order in full build mode,
+// that is `libc.include.stdint` is added to the dependency of all targets
+// that use <stdint.h> header.
+
+#include <stdint.h>
+
+#endif // LLVM_LIBC_HDR_STDINT_PROXY_H
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index f3bdc9f6aedd1..bf85bf69425e9 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -94,6 +94,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock
)
@@ -104,6 +105,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock64
)
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 73213826ad607..18fd3f890a343 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -101,6 +101,14 @@ add_header_macro(
.llvm-libc-types.fexcept_t
)
+add_header_macro(
+ stdint
+ ../libc/include/stdint.yaml
+ stdint.h
+ DEPENDS
+ .llvm-libc-macros.stdint_macros
+)
+
add_header_macro(
inttypes
../libc/include/inttypes.yaml
@@ -109,6 +117,7 @@ add_header_macro(
.llvm_libc_common_h
.llvm-libc-types.imaxdiv_t
.llvm-libc-macros.inttypes_macros
+ .stdint
)
add_header_macro(
@@ -119,14 +128,6 @@ add_header_macro(
.llvm-libc-macros.float_macros
)
-add_header_macro(
- stdint
- ../libc/include/stdint.yaml
- stdint.h
- DEPENDS
- .llvm-libc-macros.stdint_macros
-)
-
add_header_macro(
limits
../libc/include/limits.yaml
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 37a27cc9b7007..2196d9e23bba7 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -15,6 +15,7 @@ add_header_library(
HDRS
block.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
libc.src.__support.CPP.new
@@ -86,6 +87,7 @@ add_header_library(
blockstore.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.new
)
@@ -97,6 +99,8 @@ add_header_library(
macros/properties/architectures.h
macros/attributes.h
macros/config.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -199,6 +203,7 @@ add_header_library(
integer_to_string.h
DEPENDS
.big_int
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
@@ -215,6 +220,7 @@ add_header_library(
ryu_long_double_constants.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fp_bits
libc.src.__support.common
@@ -226,6 +232,7 @@ add_header_library(
high_precision_decimal.h
DEPENDS
.str_to_integer
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -240,6 +247,7 @@ add_header_library(
.str_to_num_result
.uint128
libc.hdr.errno_macros
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
@@ -257,6 +265,7 @@ add_header_library(
integer_literals.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.limits
)
@@ -290,6 +299,7 @@ add_header_library(
HDRS
arg_list.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
@@ -329,6 +339,7 @@ add_header_library(
DEPENDS
.math_extras
.number_pair
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.array
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -361,6 +372,7 @@ add_header_library(
hash.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
libc.src.__support.macros.attributes
diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt
index d2ba00a5384da..8b65a8839ab21 100644
--- a/libc/src/__support/CPP/CMakeLists.txt
+++ b/libc/src/__support/CPP/CMakeLists.txt
@@ -17,6 +17,7 @@ add_header_library(
DEPENDS
.limits
.type_traits
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.__support.macros.sanitizer
)
@@ -39,6 +40,8 @@ add_header_library(
functional
HDRS
functional.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
diff --git a/libc/src/__support/CPP/bit.h b/libc/src/__support/CPP/bit.h
index e491f3e032669..df1b177ecb10b 100644
--- a/libc/src/__support/CPP/bit.h
+++ b/libc/src/__support/CPP/bit.h
@@ -11,14 +11,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/limits.h" // numeric_limits
#include "src/__support/CPP/type_traits.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/CPP/functional.h b/libc/src/__support/CPP/functional.h
index 50cfa256b6682..5c43d22369717 100644
--- a/libc/src/__support/CPP/functional.h
+++ b/libc/src/__support/CPP/functional.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
+#include "hdr/stdint_proxy.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"
@@ -19,8 +20,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 3024ac62b2951..94f8b95542470 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -6,6 +6,7 @@ add_header_library(
libc.hdr.types.fenv_t
libc.hdr.fenv_macros
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.errno.errno
)
@@ -28,6 +29,7 @@ add_header_library(
HDRS
FPBits.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -72,6 +74,7 @@ add_header_library(
NormalFloat.h
DEPENDS
.fp_bits
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.common
)
@@ -248,6 +251,7 @@ add_header_library(
.nearest_integer_operations
.normal_float
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.errno.errno
libc.src.__support.common
libc.src.__support.CPP.bit
@@ -277,6 +281,7 @@ add_header_library(
.cast
.comparison_operations
.dyadic_float
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
libc.src.__support.macros.config
diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index 9e21136558a03..2f695c1583755 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
@@ -26,8 +27,6 @@
#include "src/__support/sign.h" // Sign
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index a2f285fc6fb95..b30e36fd03e9f 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -11,12 +11,11 @@
#include "FPBits.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 914155a01631d..18182ed977cce 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index dcce76b6116be..a2066d1025f63 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index aaf37c0a045af..64ab4a9189b77 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -10,11 +10,11 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/bfloat16.h b/libc/src/__support/FPUtil/bfloat16.h
index 84a0dca911691..fa45d73fba6c1 100644
--- a/libc/src/__support/FPUtil/bfloat16.h
+++ b/libc/src/__support/FPUtil/bfloat16.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/cast.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/types.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index 2f525eb5dac5a..cb2d2d59fb86c 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -10,13 +10,12 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE_ASM
#include "src/__support/macros/config.h" // For LIBC_INLINE
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index 560727c22978e..5da509796d849 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -17,8 +17,7 @@
#error "Invalid include"
#endif
-#include <stdint.h>
-
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/macros/sanitizer.h"
diff --git a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
index 2e6b297ae9349..74a991d40115e 100644
--- a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
+++ b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
@@ -16,12...
[truncated]
|
@llvm/pr-subscribers-backend-amdgpu Author: None (lntue) ChangesPatch is 140.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/150303.diff 239 Files Affected:
diff --git a/libc/benchmarks/gpu/BenchmarkLogger.cpp b/libc/benchmarks/gpu/BenchmarkLogger.cpp
index 0d644fa3c37bc..d5996a74f6dd7 100644
--- a/libc/benchmarks/gpu/BenchmarkLogger.cpp
+++ b/libc/benchmarks/gpu/BenchmarkLogger.cpp
@@ -1,4 +1,5 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/string.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/OSUtil/io.h" // write_to_stderr
@@ -7,8 +8,6 @@
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/CMakeLists.txt b/libc/benchmarks/gpu/CMakeLists.txt
index b58f4fd8b1a42..6ec64bf270b53 100644
--- a/libc/benchmarks/gpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/CMakeLists.txt
@@ -45,6 +45,7 @@ add_unittest_framework_library(
LibcGpuBenchmark.h
BenchmarkLogger.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.big_int
libc.src.__support.c_string
libc.src.__support.CPP.string
diff --git a/libc/benchmarks/gpu/LibcGpuBenchmark.h b/libc/benchmarks/gpu/LibcGpuBenchmark.h
index f2cfbfbfdcdf0..a6cf62dd30ce5 100644
--- a/libc/benchmarks/gpu/LibcGpuBenchmark.h
+++ b/libc/benchmarks/gpu/LibcGpuBenchmark.h
@@ -3,6 +3,7 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
#include "benchmarks/gpu/timing/timing.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/functional.h"
#include "src/__support/CPP/limits.h"
@@ -13,8 +14,6 @@
#include "src/stdlib/rand.h"
#include "src/time/clock.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/src/math/CMakeLists.txt b/libc/benchmarks/gpu/src/math/CMakeLists.txt
index 6870c02449016..7a12ce4e61c9e 100644
--- a/libc/benchmarks/gpu/src/math/CMakeLists.txt
+++ b/libc/benchmarks/gpu/src/math/CMakeLists.txt
@@ -31,6 +31,7 @@ add_benchmark(
SRCS
sin_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.sin
libc.src.math.sinf
libc.src.stdlib.srand
@@ -51,6 +52,7 @@ add_benchmark(
SRCS
atan2_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.atan2
libc.src.stdlib.srand
libc.src.stdlib.rand
diff --git a/libc/benchmarks/gpu/src/math/platform.h b/libc/benchmarks/gpu/src/math/platform.h
index bb7825d38bd42..2dfa9f2299d46 100644
--- a/libc/benchmarks/gpu/src/math/platform.h
+++ b/libc/benchmarks/gpu/src/math/platform.h
@@ -7,9 +7,10 @@
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
#define LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
+
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
index aa5dcd33bee9c..dd7c2d342f70f 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/amdgpu/timing.h b/libc/benchmarks/gpu/timing/amdgpu/timing.h
index 0f2c04c07c921..37dbb9af5976b 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/timing.h
+++ b/libc/benchmarks/gpu/timing/amdgpu/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
#define LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
index 2723c8940814c..a19c16ee4e44d 100644
--- a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/nvptx/timing.h b/libc/benchmarks/gpu/timing/nvptx/timing.h
index 3ed97645ddc93..3c729636367aa 100644
--- a/libc/benchmarks/gpu/timing/nvptx/timing.h
+++ b/libc/benchmarks/gpu/timing/nvptx/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
#define LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/config/CMakeLists.txt b/libc/config/CMakeLists.txt
index cf38ae3eed726..4758276469f69 100644
--- a/libc/config/CMakeLists.txt
+++ b/libc/config/CMakeLists.txt
@@ -3,5 +3,6 @@ add_header_library(
HDRS
app.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
diff --git a/libc/config/gpu/app.h b/libc/config/gpu/app.h
index 148c51b702203..17ef3ae7b1ce9 100644
--- a/libc/config/gpu/app.h
+++ b/libc/config/gpu/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_GPU_APP_H
#define LLVM_LIBC_CONFIG_GPU_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// TODO: Move other global values here and export them to the host.
diff --git a/libc/config/linux/app.h b/libc/config/linux/app.h
index 188d34816454b..f3d11da9fc14c 100644
--- a/libc/config/linux/app.h
+++ b/libc/config/linux/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_LINUX_APP_H
#define LLVM_LIBC_CONFIG_LINUX_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure to capture properties of the linux/ELF TLS image.
diff --git a/libc/config/uefi/app.h b/libc/config/uefi/app.h
index 0374a47ba3402..1f181ed5f9f1f 100644
--- a/libc/config/uefi/app.h
+++ b/libc/config/uefi/app.h
@@ -9,13 +9,12 @@
#ifndef LLVM_LIBC_CONFIG_UEFI_APP_H
#define LLVM_LIBC_CONFIG_UEFI_APP_H
+#include "hdr/stdint_proxy.h"
#include "include/llvm-libc-types/EFI_HANDLE.h"
#include "include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure which captures properties of a UEFI application.
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 052a773a4fcec..5fc25d0ca5689 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -243,5 +243,14 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.offsetof_macro
)
+# stdint.h header.
+add_proxy_header_library(
+ stdint_proxy
+ HDRS
+ stdint_proxy.h
+ FULL_BUILD_DEPENDS
+ libc.include.stdint
+)
+
add_subdirectory(types)
add_subdirectory(func)
diff --git a/libc/hdr/stdint_proxy.h b/libc/hdr/stdint_proxy.h
new file mode 100644
index 0000000000000..8e815679a4e24
--- /dev/null
+++ b/libc/hdr/stdint_proxy.h
@@ -0,0 +1,18 @@
+//===-- stdint.h ----------------------------------------------------------===//
+//
+// 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_HDR_STDINT_PROXY_H
+#define LLVM_LIBC_HDR_STDINT_PROXY_H
+
+// This target is to make sure we have correct build order in full build mode,
+// that is `libc.include.stdint` is added to the dependency of all targets
+// that use <stdint.h> header.
+
+#include <stdint.h>
+
+#endif // LLVM_LIBC_HDR_STDINT_PROXY_H
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index f3bdc9f6aedd1..bf85bf69425e9 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -94,6 +94,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock
)
@@ -104,6 +105,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock64
)
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 73213826ad607..18fd3f890a343 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -101,6 +101,14 @@ add_header_macro(
.llvm-libc-types.fexcept_t
)
+add_header_macro(
+ stdint
+ ../libc/include/stdint.yaml
+ stdint.h
+ DEPENDS
+ .llvm-libc-macros.stdint_macros
+)
+
add_header_macro(
inttypes
../libc/include/inttypes.yaml
@@ -109,6 +117,7 @@ add_header_macro(
.llvm_libc_common_h
.llvm-libc-types.imaxdiv_t
.llvm-libc-macros.inttypes_macros
+ .stdint
)
add_header_macro(
@@ -119,14 +128,6 @@ add_header_macro(
.llvm-libc-macros.float_macros
)
-add_header_macro(
- stdint
- ../libc/include/stdint.yaml
- stdint.h
- DEPENDS
- .llvm-libc-macros.stdint_macros
-)
-
add_header_macro(
limits
../libc/include/limits.yaml
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 37a27cc9b7007..2196d9e23bba7 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -15,6 +15,7 @@ add_header_library(
HDRS
block.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
libc.src.__support.CPP.new
@@ -86,6 +87,7 @@ add_header_library(
blockstore.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.new
)
@@ -97,6 +99,8 @@ add_header_library(
macros/properties/architectures.h
macros/attributes.h
macros/config.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -199,6 +203,7 @@ add_header_library(
integer_to_string.h
DEPENDS
.big_int
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
@@ -215,6 +220,7 @@ add_header_library(
ryu_long_double_constants.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fp_bits
libc.src.__support.common
@@ -226,6 +232,7 @@ add_header_library(
high_precision_decimal.h
DEPENDS
.str_to_integer
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -240,6 +247,7 @@ add_header_library(
.str_to_num_result
.uint128
libc.hdr.errno_macros
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
@@ -257,6 +265,7 @@ add_header_library(
integer_literals.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.limits
)
@@ -290,6 +299,7 @@ add_header_library(
HDRS
arg_list.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
@@ -329,6 +339,7 @@ add_header_library(
DEPENDS
.math_extras
.number_pair
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.array
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -361,6 +372,7 @@ add_header_library(
hash.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
libc.src.__support.macros.attributes
diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt
index d2ba00a5384da..8b65a8839ab21 100644
--- a/libc/src/__support/CPP/CMakeLists.txt
+++ b/libc/src/__support/CPP/CMakeLists.txt
@@ -17,6 +17,7 @@ add_header_library(
DEPENDS
.limits
.type_traits
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.__support.macros.sanitizer
)
@@ -39,6 +40,8 @@ add_header_library(
functional
HDRS
functional.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
diff --git a/libc/src/__support/CPP/bit.h b/libc/src/__support/CPP/bit.h
index e491f3e032669..df1b177ecb10b 100644
--- a/libc/src/__support/CPP/bit.h
+++ b/libc/src/__support/CPP/bit.h
@@ -11,14 +11,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/limits.h" // numeric_limits
#include "src/__support/CPP/type_traits.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/CPP/functional.h b/libc/src/__support/CPP/functional.h
index 50cfa256b6682..5c43d22369717 100644
--- a/libc/src/__support/CPP/functional.h
+++ b/libc/src/__support/CPP/functional.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
+#include "hdr/stdint_proxy.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"
@@ -19,8 +20,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 3024ac62b2951..94f8b95542470 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -6,6 +6,7 @@ add_header_library(
libc.hdr.types.fenv_t
libc.hdr.fenv_macros
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.errno.errno
)
@@ -28,6 +29,7 @@ add_header_library(
HDRS
FPBits.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -72,6 +74,7 @@ add_header_library(
NormalFloat.h
DEPENDS
.fp_bits
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.common
)
@@ -248,6 +251,7 @@ add_header_library(
.nearest_integer_operations
.normal_float
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.errno.errno
libc.src.__support.common
libc.src.__support.CPP.bit
@@ -277,6 +281,7 @@ add_header_library(
.cast
.comparison_operations
.dyadic_float
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
libc.src.__support.macros.config
diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index 9e21136558a03..2f695c1583755 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
@@ -26,8 +27,6 @@
#include "src/__support/sign.h" // Sign
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index a2f285fc6fb95..b30e36fd03e9f 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -11,12 +11,11 @@
#include "FPBits.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 914155a01631d..18182ed977cce 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index dcce76b6116be..a2066d1025f63 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index aaf37c0a045af..64ab4a9189b77 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -10,11 +10,11 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/bfloat16.h b/libc/src/__support/FPUtil/bfloat16.h
index 84a0dca911691..fa45d73fba6c1 100644
--- a/libc/src/__support/FPUtil/bfloat16.h
+++ b/libc/src/__support/FPUtil/bfloat16.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/cast.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/types.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index 2f525eb5dac5a..cb2d2d59fb86c 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -10,13 +10,12 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE_ASM
#include "src/__support/macros/config.h" // For LIBC_INLINE
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index 560727c22978e..5da509796d849 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -17,8 +17,7 @@
#error "Invalid include"
#endif
-#include <stdint.h>
-
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/macros/sanitizer.h"
diff --git a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
index 2e6b297ae9349..74a991d40115e 100644
--- a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
+++ b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
@@ -16,12...
[truncated]
|
@llvm/pr-subscribers-backend-risc-v Author: None (lntue) ChangesPatch is 140.65 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/150303.diff 239 Files Affected:
diff --git a/libc/benchmarks/gpu/BenchmarkLogger.cpp b/libc/benchmarks/gpu/BenchmarkLogger.cpp
index 0d644fa3c37bc..d5996a74f6dd7 100644
--- a/libc/benchmarks/gpu/BenchmarkLogger.cpp
+++ b/libc/benchmarks/gpu/BenchmarkLogger.cpp
@@ -1,4 +1,5 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/string.h"
#include "src/__support/CPP/string_view.h"
#include "src/__support/OSUtil/io.h" // write_to_stderr
@@ -7,8 +8,6 @@
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/CMakeLists.txt b/libc/benchmarks/gpu/CMakeLists.txt
index b58f4fd8b1a42..6ec64bf270b53 100644
--- a/libc/benchmarks/gpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/CMakeLists.txt
@@ -45,6 +45,7 @@ add_unittest_framework_library(
LibcGpuBenchmark.h
BenchmarkLogger.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.big_int
libc.src.__support.c_string
libc.src.__support.CPP.string
diff --git a/libc/benchmarks/gpu/LibcGpuBenchmark.h b/libc/benchmarks/gpu/LibcGpuBenchmark.h
index f2cfbfbfdcdf0..a6cf62dd30ce5 100644
--- a/libc/benchmarks/gpu/LibcGpuBenchmark.h
+++ b/libc/benchmarks/gpu/LibcGpuBenchmark.h
@@ -3,6 +3,7 @@
#include "benchmarks/gpu/BenchmarkLogger.h"
#include "benchmarks/gpu/timing/timing.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/functional.h"
#include "src/__support/CPP/limits.h"
@@ -13,8 +14,6 @@
#include "src/stdlib/rand.h"
#include "src/time/clock.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace benchmarks {
diff --git a/libc/benchmarks/gpu/src/math/CMakeLists.txt b/libc/benchmarks/gpu/src/math/CMakeLists.txt
index 6870c02449016..7a12ce4e61c9e 100644
--- a/libc/benchmarks/gpu/src/math/CMakeLists.txt
+++ b/libc/benchmarks/gpu/src/math/CMakeLists.txt
@@ -31,6 +31,7 @@ add_benchmark(
SRCS
sin_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.sin
libc.src.math.sinf
libc.src.stdlib.srand
@@ -51,6 +52,7 @@ add_benchmark(
SRCS
atan2_benchmark.cpp
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.math.atan2
libc.src.stdlib.srand
libc.src.stdlib.rand
diff --git a/libc/benchmarks/gpu/src/math/platform.h b/libc/benchmarks/gpu/src/math/platform.h
index bb7825d38bd42..2dfa9f2299d46 100644
--- a/libc/benchmarks/gpu/src/math/platform.h
+++ b/libc/benchmarks/gpu/src/math/platform.h
@@ -7,9 +7,10 @@
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
#define LLVM_LIBC_SRC_MATH_AMDGPU_PLATFORM_H
+
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
index aa5dcd33bee9c..dd7c2d342f70f 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/amdgpu/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/amdgpu/timing.h b/libc/benchmarks/gpu/timing/amdgpu/timing.h
index 0f2c04c07c921..37dbb9af5976b 100644
--- a/libc/benchmarks/gpu/timing/amdgpu/timing.h
+++ b/libc/benchmarks/gpu/timing/amdgpu/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
#define LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
index 2723c8940814c..a19c16ee4e44d 100644
--- a/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
+++ b/libc/benchmarks/gpu/timing/nvptx/CMakeLists.txt
@@ -3,6 +3,7 @@ add_header_library(
HDRS
timing.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.macros.config
libc.src.__support.macros.attributes
diff --git a/libc/benchmarks/gpu/timing/nvptx/timing.h b/libc/benchmarks/gpu/timing/nvptx/timing.h
index 3ed97645ddc93..3c729636367aa 100644
--- a/libc/benchmarks/gpu/timing/nvptx/timing.h
+++ b/libc/benchmarks/gpu/timing/nvptx/timing.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
#define LLVM_LIBC_UTILS_GPU_TIMING_NVPTX
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/array.h"
#include "src/__support/CPP/atomic.h"
#include "src/__support/CPP/type_traits.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Returns the overhead associated with calling the profiling region. This
diff --git a/libc/config/CMakeLists.txt b/libc/config/CMakeLists.txt
index cf38ae3eed726..4758276469f69 100644
--- a/libc/config/CMakeLists.txt
+++ b/libc/config/CMakeLists.txt
@@ -3,5 +3,6 @@ add_header_library(
HDRS
app.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
diff --git a/libc/config/gpu/app.h b/libc/config/gpu/app.h
index 148c51b702203..17ef3ae7b1ce9 100644
--- a/libc/config/gpu/app.h
+++ b/libc/config/gpu/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_GPU_APP_H
#define LLVM_LIBC_CONFIG_GPU_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// TODO: Move other global values here and export them to the host.
diff --git a/libc/config/linux/app.h b/libc/config/linux/app.h
index 188d34816454b..f3d11da9fc14c 100644
--- a/libc/config/linux/app.h
+++ b/libc/config/linux/app.h
@@ -9,11 +9,10 @@
#ifndef LLVM_LIBC_CONFIG_LINUX_APP_H
#define LLVM_LIBC_CONFIG_LINUX_APP_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure to capture properties of the linux/ELF TLS image.
diff --git a/libc/config/uefi/app.h b/libc/config/uefi/app.h
index 0374a47ba3402..1f181ed5f9f1f 100644
--- a/libc/config/uefi/app.h
+++ b/libc/config/uefi/app.h
@@ -9,13 +9,12 @@
#ifndef LLVM_LIBC_CONFIG_UEFI_APP_H
#define LLVM_LIBC_CONFIG_UEFI_APP_H
+#include "hdr/stdint_proxy.h"
#include "include/llvm-libc-types/EFI_HANDLE.h"
#include "include/llvm-libc-types/EFI_SYSTEM_TABLE.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/architectures.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
// Data structure which captures properties of a UEFI application.
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 052a773a4fcec..5fc25d0ca5689 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -243,5 +243,14 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.offsetof_macro
)
+# stdint.h header.
+add_proxy_header_library(
+ stdint_proxy
+ HDRS
+ stdint_proxy.h
+ FULL_BUILD_DEPENDS
+ libc.include.stdint
+)
+
add_subdirectory(types)
add_subdirectory(func)
diff --git a/libc/hdr/stdint_proxy.h b/libc/hdr/stdint_proxy.h
new file mode 100644
index 0000000000000..8e815679a4e24
--- /dev/null
+++ b/libc/hdr/stdint_proxy.h
@@ -0,0 +1,18 @@
+//===-- stdint.h ----------------------------------------------------------===//
+//
+// 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_HDR_STDINT_PROXY_H
+#define LLVM_LIBC_HDR_STDINT_PROXY_H
+
+// This target is to make sure we have correct build order in full build mode,
+// that is `libc.include.stdint` is added to the dependency of all targets
+// that use <stdint.h> header.
+
+#include <stdint.h>
+
+#endif // LLVM_LIBC_HDR_STDINT_PROXY_H
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index f3bdc9f6aedd1..bf85bf69425e9 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -94,6 +94,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock
)
@@ -104,6 +105,7 @@ add_proxy_header_library(
DEPENDS
libc.hdr.fcntl_overlay
FULL_BUILD_DEPENDS
+ libc.hdr.stdint_proxy
libc.include.llvm-libc-types.struct_flock64
)
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 73213826ad607..18fd3f890a343 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -101,6 +101,14 @@ add_header_macro(
.llvm-libc-types.fexcept_t
)
+add_header_macro(
+ stdint
+ ../libc/include/stdint.yaml
+ stdint.h
+ DEPENDS
+ .llvm-libc-macros.stdint_macros
+)
+
add_header_macro(
inttypes
../libc/include/inttypes.yaml
@@ -109,6 +117,7 @@ add_header_macro(
.llvm_libc_common_h
.llvm-libc-types.imaxdiv_t
.llvm-libc-macros.inttypes_macros
+ .stdint
)
add_header_macro(
@@ -119,14 +128,6 @@ add_header_macro(
.llvm-libc-macros.float_macros
)
-add_header_macro(
- stdint
- ../libc/include/stdint.yaml
- stdint.h
- DEPENDS
- .llvm-libc-macros.stdint_macros
-)
-
add_header_macro(
limits
../libc/include/limits.yaml
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 37a27cc9b7007..2196d9e23bba7 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -15,6 +15,7 @@ add_header_library(
HDRS
block.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
libc.src.__support.CPP.new
@@ -86,6 +87,7 @@ add_header_library(
blockstore.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.new
)
@@ -97,6 +99,8 @@ add_header_library(
macros/properties/architectures.h
macros/attributes.h
macros/config.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -199,6 +203,7 @@ add_header_library(
integer_to_string.h
DEPENDS
.big_int
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.algorithm
libc.src.__support.CPP.limits
@@ -215,6 +220,7 @@ add_header_library(
ryu_long_double_constants.h
DEPENDS
.libc_assert
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fp_bits
libc.src.__support.common
@@ -226,6 +232,7 @@ add_header_library(
high_precision_decimal.h
DEPENDS
.str_to_integer
+ libc.hdr.stdint_proxy
)
add_header_library(
@@ -240,6 +247,7 @@ add_header_library(
.str_to_num_result
.uint128
libc.hdr.errno_macros
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
@@ -257,6 +265,7 @@ add_header_library(
integer_literals.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.limits
)
@@ -290,6 +299,7 @@ add_header_library(
HDRS
arg_list.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
)
@@ -329,6 +339,7 @@ add_header_library(
DEPENDS
.math_extras
.number_pair
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.array
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -361,6 +372,7 @@ add_header_library(
hash.h
DEPENDS
.uint128
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.limits
libc.src.__support.macros.attributes
diff --git a/libc/src/__support/CPP/CMakeLists.txt b/libc/src/__support/CPP/CMakeLists.txt
index d2ba00a5384da..8b65a8839ab21 100644
--- a/libc/src/__support/CPP/CMakeLists.txt
+++ b/libc/src/__support/CPP/CMakeLists.txt
@@ -17,6 +17,7 @@ add_header_library(
DEPENDS
.limits
.type_traits
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.__support.macros.sanitizer
)
@@ -39,6 +40,8 @@ add_header_library(
functional
HDRS
functional.h
+ DEPENDS
+ libc.hdr.stdint_proxy
)
add_header_library(
diff --git a/libc/src/__support/CPP/bit.h b/libc/src/__support/CPP/bit.h
index e491f3e032669..df1b177ecb10b 100644
--- a/libc/src/__support/CPP/bit.h
+++ b/libc/src/__support/CPP/bit.h
@@ -11,14 +11,13 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_BIT_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/limits.h" // numeric_limits
#include "src/__support/CPP/type_traits.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/__support/macros/sanitizer.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/CPP/functional.h b/libc/src/__support/CPP/functional.h
index 50cfa256b6682..5c43d22369717 100644
--- a/libc/src/__support/CPP/functional.h
+++ b/libc/src/__support/CPP/functional.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
#define LLVM_LIBC_SRC___SUPPORT_CPP_FUNCTIONAL_H
+#include "hdr/stdint_proxy.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"
@@ -19,8 +20,6 @@
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace cpp {
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 3024ac62b2951..94f8b95542470 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -6,6 +6,7 @@ add_header_library(
libc.hdr.types.fenv_t
libc.hdr.fenv_macros
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.__support.macros.attributes
libc.src.errno.errno
)
@@ -28,6 +29,7 @@ add_header_library(
HDRS
FPBits.h
DEPENDS
+ libc.hdr.stdint_proxy
libc.src.__support.common
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
@@ -72,6 +74,7 @@ add_header_library(
NormalFloat.h
DEPENDS
.fp_bits
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.type_traits
libc.src.__support.common
)
@@ -248,6 +251,7 @@ add_header_library(
.nearest_integer_operations
.normal_float
libc.hdr.math_macros
+ libc.hdr.stdint_proxy
libc.src.errno.errno
libc.src.__support.common
libc.src.__support.CPP.bit
@@ -277,6 +281,7 @@ add_header_library(
.cast
.comparison_operations
.dyadic_float
+ libc.hdr.stdint_proxy
libc.src.__support.CPP.bit
libc.src.__support.CPP.type_traits
libc.src.__support.macros.config
diff --git a/libc/src/__support/FPUtil/FPBits.h b/libc/src/__support/FPUtil/FPBits.h
index 9e21136558a03..2f695c1583755 100644
--- a/libc/src/__support/FPUtil/FPBits.h
+++ b/libc/src/__support/FPUtil/FPBits.h
@@ -15,6 +15,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FPBITS_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
@@ -26,8 +27,6 @@
#include "src/__support/sign.h" // Sign
#include "src/__support/uint128.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/NormalFloat.h b/libc/src/__support/FPUtil/NormalFloat.h
index a2f285fc6fb95..b30e36fd03e9f 100644
--- a/libc/src/__support/FPUtil/NormalFloat.h
+++ b/libc/src/__support/FPUtil/NormalFloat.h
@@ -11,12 +11,11 @@
#include "FPBits.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 914155a01631d..18182ed977cce 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index dcce76b6116be..a2066d1025f63 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -18,9 +18,9 @@
#endif
#include <arm_acle.h>
-#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index aaf37c0a045af..64ab4a9189b77 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -10,11 +10,11 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
#include "src/__support/macros/config.h"
-#include <stdint.h>
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/bfloat16.h b/libc/src/__support/FPUtil/bfloat16.h
index 84a0dca911691..fa45d73fba6c1 100644
--- a/libc/src/__support/FPUtil/bfloat16.h
+++ b/libc/src/__support/FPUtil/bfloat16.h
@@ -9,6 +9,7 @@
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_BFLOAT16_H
+#include "hdr/stdint_proxy.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/cast.h"
@@ -17,8 +18,6 @@
#include "src/__support/macros/config.h"
#include "src/__support/macros/properties/types.h"
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index 2f525eb5dac5a..cb2d2d59fb86c 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -10,13 +10,12 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE_ASM
#include "src/__support/macros/config.h" // For LIBC_INLINE
-#include <stdint.h>
-
namespace LIBC_NAMESPACE_DECL {
namespace fputil {
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index 560727c22978e..5da509796d849 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -17,8 +17,7 @@
#error "Invalid include"
#endif
-#include <stdint.h>
-
+#include "hdr/stdint_proxy.h"
#include "hdr/types/fenv_t.h"
#include "src/__support/macros/sanitizer.h"
diff --git a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
index 2e6b297ae9349..74a991d40115e 100644
--- a/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
+++ b/libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
@@ -16,12...
[truncated]
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/20218 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/39167 Here is the relevant piece of the build log for the reference
|
…tdint.h> includes. (llvm#150303) llvm#149993
#149993