[libc] [llvm] [libc] Add proxy headers for fenv types. (PR #88467)
Job Henandez Lara via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 15:42:11 PDT 2024
https://github.com/Jobhdez updated https://github.com/llvm/llvm-project/pull/88467
>From c96fd7051e79ecb3ead0b9848f0f4045debee35e Mon Sep 17 00:00:00 2001
From: Job Hernandez <hj93 at protonmail.com>
Date: Thu, 11 Apr 2024 19:27:29 -0700
Subject: [PATCH 1/5] [libc] Add proxy headers for fenv.h types
---
libc/hdr/CMakeLists.txt | 18 +++++++++++++++
libc/hdr/fenv_t.h | 22 +++++++++++++++++++
libc/hdr/fexcept_t.h | 22 +++++++++++++++++++
libc/src/__support/FPUtil/CMakeLists.txt | 3 ++-
libc/src/__support/FPUtil/aarch64/FEnvImpl.h | 2 +-
.../FPUtil/aarch64/fenv_darwin_impl.h | 2 +-
libc/src/__support/FPUtil/arm/FEnvImpl.h | 2 +-
libc/src/__support/FPUtil/riscv/FEnvImpl.h | 1 +
libc/src/__support/FPUtil/x86_64/FEnvImpl.h | 2 +-
libc/src/fenv/CMakeLists.txt | 3 ++-
libc/src/fenv/fegetenv.h | 2 +-
libc/src/fenv/fegetexceptflag.cpp | 3 +--
libc/src/fenv/feholdexcept.cpp | 2 +-
libc/src/fenv/feholdexcept.h | 2 +-
libc/src/fenv/fesetenv.h | 2 +-
libc/src/fenv/fesetexceptflag.cpp | 3 ++-
libc/src/fenv/feupdateenv.h | 2 +-
libc/test/UnitTest/FPExceptMatcher.cpp | 2 +-
libc/test/src/fenv/exception_flags_test.cpp | 2 +-
libc/test/src/fenv/feholdexcept_test.cpp | 3 +--
libc/test/src/fenv/feupdateenv_test.cpp | 2 +-
libc/test/src/fenv/getenv_and_setenv_test.cpp | 3 +--
.../llvm-project-overlay/libc/BUILD.bazel | 13 +++++++++++
.../libc/test/src/fenv/BUILD.bazel | 4 ++++
24 files changed, 101 insertions(+), 21 deletions(-)
create mode 100644 libc/hdr/fenv_t.h
create mode 100644 libc/hdr/fexcept_t.h
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 4ca7db5e98d607..a2cd1fc767448f 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -40,3 +40,21 @@ add_proxy_header_library(
libc.include.llvm-libc-macros.fenv_macros
libc.incude.fenv
)
+
+add_proxy_header_library(
+ fenv_t
+ HDRS
+ fenv_t.h
+ FULL_BUILD_DEPENDS
+ libc.include.llvm-libc-types.fenv_t
+ libc.incude.fenv
+)
+
+add_proxy_header_library(
+ fexcept_t
+ HDRS
+ fexcept_t.h
+ FULL_BUILD_DEPENDS
+ libc.include.llvm-libc-types.fexcept_t
+ libc.incude.fenv
+)
diff --git a/libc/hdr/fenv_t.h b/libc/hdr/fenv_t.h
new file mode 100644
index 00000000000000..dc2dd0217a16f3
--- /dev/null
+++ b/libc/hdr/fenv_t.h
@@ -0,0 +1,22 @@
+//===-- Definition of macros from fenv_t.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_FENV_T_H
+#define LLVM_LIBC_HDR_FENV_T_H
+
+#ifdef LIBC_FULL_BUILD
+
+#include "include/llvm-libc-types/fenv_t.h"
+
+#else // Overlay mode
+
+#include <fenv.h>
+
+#endif // LLVM_LIBC_FULL_BUILD
+
+#endif // LLVM_LIBC_HDR_FENV_T_H
diff --git a/libc/hdr/fexcept_t.h b/libc/hdr/fexcept_t.h
new file mode 100644
index 00000000000000..7a6702516f0a35
--- /dev/null
+++ b/libc/hdr/fexcept_t.h
@@ -0,0 +1,22 @@
+//===-- Definition of macros from fexcept_t.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_FEXCEPT_T_H
+#define LLVM_LIBC_HDR_FEXCEPT_T_H
+
+#ifdef LIBC_FULL_BUILD
+
+#include "include/llvm-libc-types/fexcept_t.h"
+
+#else // Overlay mode
+
+#include <fenv.h>
+
+#endif // LLVM_LIBC_FULL_BUILD
+
+#endif // LLVM_LIBC_HDR_FENV_T_H
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index 0b5ea836894302..f6de0793558d44 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -3,7 +3,8 @@ add_header_library(
HDRS
FEnvImpl.h
DEPENDS
- libc.include.fenv
+ libc.hdr.fenv_t
+ libc.hdr.fexcept_t
libc.hdr.fenv_macros
libc.hdr.math_macros
libc.src.__support.macros.attributes
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 4b593cdd8cc4e4..29cb0ed799c1dd 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -17,10 +17,10 @@
#endif
#include <arm_acle.h>
-#include <fenv.h>
#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 773d6bfe9f8923..78f0edea2f5a4e 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -17,10 +17,10 @@
#endif
#include <arm_acle.h>
-#include <fenv.h>
#include <stdint.h>
#include "hdr/fenv_macros.h"
+#include "hdr/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index ddb0edcf827800..5897d79b0fb424 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -10,9 +10,9 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
-#include <fenv.h>
#include <stdint.h>
namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index a5224330f339a1..fe6e5b8515d31f 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -10,6 +10,7 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
#include "hdr/fenv_macros.h"
+#include "hdr/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
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index b73b70e907790f..00615784cb3969 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -16,9 +16,9 @@
#error "Invalid include"
#endif
-#include <fenv.h>
#include <stdint.h>
+#include "hdr/fenv_t.h"
#include "src/__support/macros/sanitizer.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/CMakeLists.txt b/libc/src/fenv/CMakeLists.txt
index 5dcf21de04f1a0..827dcc968e9897 100644
--- a/libc/src/fenv/CMakeLists.txt
+++ b/libc/src/fenv/CMakeLists.txt
@@ -5,7 +5,8 @@ add_entrypoint_object(
HDRS
fegetround.h
DEPENDS
- libc.include.fenv
+ libc.hdr.fenv_t
+ libc.hdr.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
diff --git a/libc/src/fenv/fegetenv.h b/libc/src/fenv/fegetenv.h
index 658316482984e1..97070afc3f8242 100644
--- a/libc/src/fenv/fegetenv.h
+++ b/libc/src/fenv/fegetenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEGETENV_H
#define LLVM_LIBC_SRC_FENV_FEGETENV_H
-#include <fenv.h>
+#include "hdr/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fegetexceptflag.cpp b/libc/src/fenv/fegetexceptflag.cpp
index c6160da7afbde2..a80fdef17c3f6a 100644
--- a/libc/src/fenv/fegetexceptflag.cpp
+++ b/libc/src/fenv/fegetexceptflag.cpp
@@ -6,12 +6,11 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fexcept_t.h"
#include "src/fenv/fegetexceptflag.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
-#include <fenv.h>
-
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(int, fegetexceptflag, (fexcept_t * flagp, int excepts)) {
diff --git a/libc/src/fenv/feholdexcept.cpp b/libc/src/fenv/feholdexcept.cpp
index f264c5ae251d33..112c20135b90e7 100644
--- a/libc/src/fenv/feholdexcept.cpp
+++ b/libc/src/fenv/feholdexcept.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fenv_t.h"
#include "src/fenv/feholdexcept.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
-#include <fenv.h>
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/feholdexcept.h b/libc/src/fenv/feholdexcept.h
index bbefc4ecbd41b2..5118ce4beee7bc 100644
--- a/libc/src/fenv/feholdexcept.h
+++ b/libc/src/fenv/feholdexcept.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
#define LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
-#include <fenv.h>
+#include "hdr/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fesetenv.h b/libc/src/fenv/fesetenv.h
index 8b56bebc2e36d4..2b070cb822482f 100644
--- a/libc/src/fenv/fesetenv.h
+++ b/libc/src/fenv/fesetenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FESETENV_H
#define LLVM_LIBC_SRC_FENV_FESETENV_H
-#include <fenv.h>
+#include "hdr/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fesetexceptflag.cpp b/libc/src/fenv/fesetexceptflag.cpp
index 3ff8e270dc0a74..b5a546875e531b 100644
--- a/libc/src/fenv/fesetexceptflag.cpp
+++ b/libc/src/fenv/fesetexceptflag.cpp
@@ -6,10 +6,11 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fexcept_t.h"
#include "src/fenv/fesetexceptflag.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
-#include <fenv.h>
+
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/feupdateenv.h b/libc/src/fenv/feupdateenv.h
index 294c041ddeae79..f1314c64ded8de 100644
--- a/libc/src/fenv/feupdateenv.h
+++ b/libc/src/fenv/feupdateenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
#define LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
-#include <fenv.h>
+#include "hdr/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index 1601b7e53f2be1..1fba118b3fd0f6 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -8,7 +8,7 @@
#include "FPExceptMatcher.h"
-#include <fenv.h>
+#include "hdr/fenv_t.h"
#include <memory>
#include <setjmp.h>
#include <signal.h>
diff --git a/libc/test/src/fenv/exception_flags_test.cpp b/libc/test/src/fenv/exception_flags_test.cpp
index 434adc06b1a36a..19f9ab1bf0b1ba 100644
--- a/libc/test/src/fenv/exception_flags_test.cpp
+++ b/libc/test/src/fenv/exception_flags_test.cpp
@@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fexcept_t.h"
#include "src/fenv/fegetexceptflag.h"
#include "src/fenv/fesetexceptflag.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "test/UnitTest/Test.h"
-#include <fenv.h>
TEST(LlvmLibcFenvTest, GetExceptFlagAndSetExceptFlag) {
// We will disable all exceptions to prevent invocation of the exception
diff --git a/libc/test/src/fenv/feholdexcept_test.cpp b/libc/test/src/fenv/feholdexcept_test.cpp
index 735c7705ff49c6..714368aecb5cd5 100644
--- a/libc/test/src/fenv/feholdexcept_test.cpp
+++ b/libc/test/src/fenv/feholdexcept_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fenv_t.h"
#include "src/fenv/feholdexcept.h"
#include "src/__support/FPUtil/FEnvImpl.h"
@@ -13,8 +14,6 @@
#include "test/UnitTest/FPExceptMatcher.h"
#include "test/UnitTest/Test.h"
-#include <fenv.h>
-
TEST(LlvmLibcFEnvTest, RaiseAndCrash) {
#if defined(LIBC_TARGET_ARCH_IS_ANY_ARM) || \
defined(LIBC_TARGET_ARCH_IS_ANY_RISCV)
diff --git a/libc/test/src/fenv/feupdateenv_test.cpp b/libc/test/src/fenv/feupdateenv_test.cpp
index 96f253f76077a0..ddc60dd8b2f3c3 100644
--- a/libc/test/src/fenv/feupdateenv_test.cpp
+++ b/libc/test/src/fenv/feupdateenv_test.cpp
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fenv_t.h"
#include "src/fenv/feupdateenv.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "test/UnitTest/Test.h"
-#include <fenv.h>
#include <signal.h>
TEST(LlvmLibcFEnvTest, UpdateEnvTest) {
diff --git a/libc/test/src/fenv/getenv_and_setenv_test.cpp b/libc/test/src/fenv/getenv_and_setenv_test.cpp
index 8184a5c3bb9997..8bbff66377cd6b 100644
--- a/libc/test/src/fenv/getenv_and_setenv_test.cpp
+++ b/libc/test/src/fenv/getenv_and_setenv_test.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/fenv_t.h"
#include "src/fenv/fegetenv.h"
#include "src/fenv/fegetround.h"
#include "src/fenv/fesetenv.h"
@@ -14,8 +15,6 @@
#include "src/__support/FPUtil/FEnvImpl.h"
#include "test/UnitTest/Test.h"
-#include <fenv.h>
-
TEST(LlvmLibcFenvTest, GetEnvAndSetEnv) {
// We will disable all exceptions to prevent invocation of the exception
// handler.
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index d38dc3029f74ff..9fb3c1645ff5f0 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -118,6 +118,16 @@ libc_support_library(
hdrs = ["hdr/fenv_macros.h"],
)
+libc_support_library(
+ name = "hdr_fenv_t",
+ hdrs = ["hdr/fenv_t.h"],
+)
+
+libc_support_library(
+ name = "hdr_fexcept_t",
+ hdrs = ["hdr/fexcept_t.h"],
+)
+
############################### Support libraries ##############################
libc_support_library(
@@ -749,6 +759,7 @@ libc_support_library(
":errno",
":hdr_fenv_macros",
":hdr_math_macros",
+ ":hdr_fenv_t"
],
)
@@ -1224,6 +1235,7 @@ libc_function(
deps = [
":__support_common",
":__support_fputil_fenv_impl",
+ ":hdr_fexcept_t"
],
)
@@ -1234,6 +1246,7 @@ libc_function(
deps = [
":__support_common",
":__support_fputil_fenv_impl",
+ ":hdr_fexcept_t",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
index bce1dd786a8508..8bebd644baa76e 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
@@ -65,6 +65,7 @@ libc_test(
"//libc:__support_fputil_fenv_impl",
"//libc:__support_macros_properties_architectures",
"//libc/test/UnitTest:fp_test_helpers",
+ "//libc:hdr_fenv_t",
],
)
@@ -77,6 +78,7 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
+ "//libc:hdr_fexcept_t",
],
)
@@ -115,6 +117,7 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
+ "//libc:hdr_fenv_t",
],
)
@@ -129,5 +132,6 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
+ "//libc:hdr_fenv_t",
],
)
>From 94cd81ec00de4daa09a69040d986f1f6464fa638 Mon Sep 17 00:00:00 2001
From: Job Hernandez <hj93 at protonmail.com>
Date: Thu, 11 Apr 2024 19:28:22 -0700
Subject: [PATCH 2/5] format code
---
libc/src/fenv/fegetexceptflag.cpp | 2 +-
libc/src/fenv/feholdexcept.cpp | 2 +-
libc/src/fenv/fesetexceptflag.cpp | 3 +--
libc/test/src/fenv/exception_flags_test.cpp | 1 -
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/libc/src/fenv/fegetexceptflag.cpp b/libc/src/fenv/fegetexceptflag.cpp
index a80fdef17c3f6a..2a5c25f382bbbc 100644
--- a/libc/src/fenv/fegetexceptflag.cpp
+++ b/libc/src/fenv/fegetexceptflag.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fexcept_t.h"
#include "src/fenv/fegetexceptflag.h"
+#include "hdr/fexcept_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
diff --git a/libc/src/fenv/feholdexcept.cpp b/libc/src/fenv/feholdexcept.cpp
index 112c20135b90e7..41835f4d5ad051 100644
--- a/libc/src/fenv/feholdexcept.cpp
+++ b/libc/src/fenv/feholdexcept.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fenv_t.h"
#include "src/fenv/feholdexcept.h"
+#include "hdr/fenv_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
diff --git a/libc/src/fenv/fesetexceptflag.cpp b/libc/src/fenv/fesetexceptflag.cpp
index b5a546875e531b..5ef887c0824a6b 100644
--- a/libc/src/fenv/fesetexceptflag.cpp
+++ b/libc/src/fenv/fesetexceptflag.cpp
@@ -6,12 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fexcept_t.h"
#include "src/fenv/fesetexceptflag.h"
+#include "hdr/fexcept_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
-
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(int, fesetexceptflag,
diff --git a/libc/test/src/fenv/exception_flags_test.cpp b/libc/test/src/fenv/exception_flags_test.cpp
index 19f9ab1bf0b1ba..b0ce6e8cdff017 100644
--- a/libc/test/src/fenv/exception_flags_test.cpp
+++ b/libc/test/src/fenv/exception_flags_test.cpp
@@ -13,7 +13,6 @@
#include "src/__support/FPUtil/FEnvImpl.h"
#include "test/UnitTest/Test.h"
-
TEST(LlvmLibcFenvTest, GetExceptFlagAndSetExceptFlag) {
// We will disable all exceptions to prevent invocation of the exception
// handler.
>From 717e3c67b4e1c7c08f74e70e190891792015e155 Mon Sep 17 00:00:00 2001
From: Job Hernandez <hj93 at protonmail.com>
Date: Fri, 12 Apr 2024 05:26:43 -0700
Subject: [PATCH 3/5] address review
---
libc/test/UnitTest/CMakeLists.txt | 1 +
libc/test/UnitTest/FPExceptMatcher.cpp | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index 4411170502ed69..c0777c90a9a950 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -135,6 +135,7 @@ add_unittest_framework_library(
LibcTest
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.fenv_impl
+ libc.hdr.fenv_t
)
add_unittest_framework_library(
diff --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index 1fba118b3fd0f6..aad913a3fa18bd 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -9,6 +9,7 @@
#include "FPExceptMatcher.h"
#include "hdr/fenv_t.h"
+#include "src/FPUtil/FEnvImpl.h"
#include <memory>
#include <setjmp.h>
#include <signal.h>
@@ -36,12 +37,12 @@ FPExceptMatcher::FPExceptMatcher(FunctionCaller *func) {
caughtExcept = false;
fenv_t oldEnv;
- fegetenv(&oldEnv);
+ fputil::get_env(&oldEnv);
if (sigsetjmp(jumpBuffer, 1) == 0)
funcUP->call();
// We restore the previous floating point environment after
// the call to the function which can potentially raise SIGFPE.
- fesetenv(&oldEnv);
+ fputil::set_env(&oldEnv);
signal(SIGFPE, oldSIGFPEHandler);
exceptionRaised = caughtExcept;
}
>From 595b0815e36e77ba13ab9b21ea764771ffa424c6 Mon Sep 17 00:00:00 2001
From: Job Hernandez <hj93 at protonmail.com>
Date: Fri, 12 Apr 2024 05:43:03 -0700
Subject: [PATCH 4/5] fix typo
---
libc/src/__support/FPUtil/CMakeLists.txt | 1 -
libc/src/fenv/CMakeLists.txt | 8 ++++++--
libc/test/UnitTest/FPExceptMatcher.cpp | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index f6de0793558d44..a1abb9248ff59f 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -4,7 +4,6 @@ add_header_library(
FEnvImpl.h
DEPENDS
libc.hdr.fenv_t
- libc.hdr.fexcept_t
libc.hdr.fenv_macros
libc.hdr.math_macros
libc.src.__support.macros.attributes
diff --git a/libc/src/fenv/CMakeLists.txt b/libc/src/fenv/CMakeLists.txt
index 827dcc968e9897..3c2acecda86161 100644
--- a/libc/src/fenv/CMakeLists.txt
+++ b/libc/src/fenv/CMakeLists.txt
@@ -5,8 +5,6 @@ add_entrypoint_object(
HDRS
fegetround.h
DEPENDS
- libc.hdr.fenv_t
- libc.hdr.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -72,6 +70,7 @@ add_entrypoint_object(
fegetenv.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -85,6 +84,7 @@ add_entrypoint_object(
fesetenv.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -98,6 +98,7 @@ add_entrypoint_object(
fegetexceptflag.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -124,6 +125,7 @@ add_entrypoint_object(
fesetexceptflag.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -137,6 +139,7 @@ add_entrypoint_object(
feholdexcept.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -150,6 +153,7 @@ add_entrypoint_object(
feupdateenv.h
DEPENDS
libc.hdr.fenv_macros
+ libc.hdr.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
diff --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index aad913a3fa18bd..b576fd9b709742 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -9,7 +9,7 @@
#include "FPExceptMatcher.h"
#include "hdr/fenv_t.h"
-#include "src/FPUtil/FEnvImpl.h"
+#include "src/__support/FPUtil/FEnvImpl.h"
#include <memory>
#include <setjmp.h>
#include <signal.h>
>From 77e08d9160272043808f696d1b060d6fa02849a4 Mon Sep 17 00:00:00 2001
From: Job Hernandez <hj93 at protonmail.com>
Date: Fri, 12 Apr 2024 15:41:50 -0700
Subject: [PATCH 5/5] address review
---
libc/hdr/CMakeLists.txt | 18 -------------
libc/hdr/types/CMakeLists.txt | 18 +++++++++++++
libc/hdr/{ => types}/fenv_t.h | 0
libc/hdr/{ => types}/fexcept_t.h | 0
libc/src/__support/FPUtil/CMakeLists.txt | 2 +-
libc/src/__support/FPUtil/aarch64/FEnvImpl.h | 2 +-
.../FPUtil/aarch64/fenv_darwin_impl.h | 2 +-
libc/src/__support/FPUtil/arm/FEnvImpl.h | 2 +-
libc/src/__support/FPUtil/riscv/FEnvImpl.h | 2 +-
libc/src/__support/FPUtil/x86_64/FEnvImpl.h | 2 +-
libc/src/fenv/CMakeLists.txt | 12 ++++-----
libc/src/fenv/fegetenv.h | 2 +-
libc/src/fenv/fegetexceptflag.cpp | 2 +-
libc/src/fenv/feholdexcept.cpp | 2 +-
libc/src/fenv/feholdexcept.h | 2 +-
libc/src/fenv/fesetenv.h | 2 +-
libc/src/fenv/fesetexceptflag.cpp | 2 +-
libc/src/fenv/feupdateenv.h | 2 +-
libc/test/UnitTest/CMakeLists.txt | 2 +-
libc/test/UnitTest/FPExceptMatcher.cpp | 2 +-
libc/test/src/fenv/exception_flags_test.cpp | 2 +-
libc/test/src/fenv/feholdexcept_test.cpp | 2 +-
libc/test/src/fenv/feupdateenv_test.cpp | 2 +-
libc/test/src/fenv/getenv_and_setenv_test.cpp | 2 +-
.../llvm-project-overlay/libc/BUILD.bazel | 25 ++++++++++---------
.../libc/test/UnitTest/BUILD.bazel | 1 +
.../libc/test/src/fenv/BUILD.bazel | 8 +++---
27 files changed, 61 insertions(+), 59 deletions(-)
rename libc/hdr/{ => types}/fenv_t.h (100%)
rename libc/hdr/{ => types}/fexcept_t.h (100%)
diff --git a/libc/hdr/CMakeLists.txt b/libc/hdr/CMakeLists.txt
index 001caec5e13482..fb7c342f92b78f 100644
--- a/libc/hdr/CMakeLists.txt
+++ b/libc/hdr/CMakeLists.txt
@@ -41,24 +41,6 @@ add_proxy_header_library(
libc.include.fenv
)
-add_proxy_header_library(
- fenv_t
- HDRS
- fenv_t.h
- FULL_BUILD_DEPENDS
- libc.include.llvm-libc-types.fenv_t
- libc.incude.fenv
-)
-
-add_proxy_header_library(
- fexcept_t
- HDRS
- fexcept_t.h
- FULL_BUILD_DEPENDS
- libc.include.llvm-libc-types.fexcept_t
- libc.incude.fenv
-)
-
add_proxy_header_library(
signal_macros
HDRS
diff --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index b685d82fd8cc84..ecb952b60cc061 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -21,3 +21,21 @@ add_proxy_header_library(
FULL_BUILD_DEPENDS
libc.include.llvm-libc-types.struct_timespec
)
+
+add_proxy_header_library(
+ fenv_t
+ HDRS
+ fenv_t.h
+ FULL_BUILD_DEPENDS
+ libc.include.llvm-libc-types.fenv_t
+ libc.incude.fenv
+)
+
+add_proxy_header_library(
+ fexcept_t
+ HDRS
+ fexcept_t.h
+ FULL_BUILD_DEPENDS
+ libc.include.llvm-libc-types.fexcept_t
+ libc.incude.fenv
+)
diff --git a/libc/hdr/fenv_t.h b/libc/hdr/types/fenv_t.h
similarity index 100%
rename from libc/hdr/fenv_t.h
rename to libc/hdr/types/fenv_t.h
diff --git a/libc/hdr/fexcept_t.h b/libc/hdr/types/fexcept_t.h
similarity index 100%
rename from libc/hdr/fexcept_t.h
rename to libc/hdr/types/fexcept_t.h
diff --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index a1abb9248ff59f..01ca4254c79962 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -3,7 +3,7 @@ add_header_library(
HDRS
FEnvImpl.h
DEPENDS
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
libc.hdr.fenv_macros
libc.hdr.math_macros
libc.src.__support.macros.attributes
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 29cb0ed799c1dd..d1d92169475d15 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "hdr/fenv_macros.h"
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 78f0edea2f5a4e..5b59ba38d67bb6 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "hdr/fenv_macros.h"
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index 5897d79b0fb424..78fbda4f7afff1 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -10,7 +10,7 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
#include "hdr/fenv_macros.h"
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
#include <stdint.h>
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index fe6e5b8515d31f..6e940453f7a94d 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -10,7 +10,7 @@
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
#include "hdr/fenv_macros.h"
-#include "hdr/fenv_t.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
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index 00615784cb3969..0595658d7df328 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -18,7 +18,7 @@
#include <stdint.h>
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/macros/sanitizer.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/CMakeLists.txt b/libc/src/fenv/CMakeLists.txt
index 3c2acecda86161..a28a7ca4c2d821 100644
--- a/libc/src/fenv/CMakeLists.txt
+++ b/libc/src/fenv/CMakeLists.txt
@@ -70,7 +70,7 @@ add_entrypoint_object(
fegetenv.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -84,7 +84,7 @@ add_entrypoint_object(
fesetenv.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -98,7 +98,7 @@ add_entrypoint_object(
fegetexceptflag.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fexcept_t
+ libc.hdr.types.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -125,7 +125,7 @@ add_entrypoint_object(
fesetexceptflag.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fexcept_t
+ libc.hdr.types.fexcept_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -139,7 +139,7 @@ add_entrypoint_object(
feholdexcept.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
@@ -153,7 +153,7 @@ add_entrypoint_object(
feupdateenv.h
DEPENDS
libc.hdr.fenv_macros
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
libc.src.__support.FPUtil.fenv_impl
COMPILE_OPTIONS
-O2
diff --git a/libc/src/fenv/fegetenv.h b/libc/src/fenv/fegetenv.h
index 97070afc3f8242..8d330296474021 100644
--- a/libc/src/fenv/fegetenv.h
+++ b/libc/src/fenv/fegetenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEGETENV_H
#define LLVM_LIBC_SRC_FENV_FEGETENV_H
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fegetexceptflag.cpp b/libc/src/fenv/fegetexceptflag.cpp
index 2a5c25f382bbbc..72f31bf7abd52c 100644
--- a/libc/src/fenv/fegetexceptflag.cpp
+++ b/libc/src/fenv/fegetexceptflag.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/fenv/fegetexceptflag.h"
-#include "hdr/fexcept_t.h"
+#include "hdr/types/fexcept_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
diff --git a/libc/src/fenv/feholdexcept.cpp b/libc/src/fenv/feholdexcept.cpp
index 41835f4d5ad051..e5ca257e2be5d2 100644
--- a/libc/src/fenv/feholdexcept.cpp
+++ b/libc/src/fenv/feholdexcept.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/fenv/feholdexcept.h"
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
diff --git a/libc/src/fenv/feholdexcept.h b/libc/src/fenv/feholdexcept.h
index 5118ce4beee7bc..e53619e12feaf6 100644
--- a/libc/src/fenv/feholdexcept.h
+++ b/libc/src/fenv/feholdexcept.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
#define LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fesetenv.h b/libc/src/fenv/fesetenv.h
index 2b070cb822482f..8636711cb1fee2 100644
--- a/libc/src/fenv/fesetenv.h
+++ b/libc/src/fenv/fesetenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FESETENV_H
#define LLVM_LIBC_SRC_FENV_FESETENV_H
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/src/fenv/fesetexceptflag.cpp b/libc/src/fenv/fesetexceptflag.cpp
index 5ef887c0824a6b..628f33dcb9c4ba 100644
--- a/libc/src/fenv/fesetexceptflag.cpp
+++ b/libc/src/fenv/fesetexceptflag.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "src/fenv/fesetexceptflag.h"
-#include "hdr/fexcept_t.h"
+#include "hdr/types/fexcept_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/common.h"
diff --git a/libc/src/fenv/feupdateenv.h b/libc/src/fenv/feupdateenv.h
index f1314c64ded8de..3c9c88b36e728b 100644
--- a/libc/src/fenv/feupdateenv.h
+++ b/libc/src/fenv/feupdateenv.h
@@ -9,7 +9,7 @@
#ifndef LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
#define LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
namespace LIBC_NAMESPACE {
diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index c0777c90a9a950..9113eca388e05b 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -135,7 +135,7 @@ add_unittest_framework_library(
LibcTest
libc.src.__support.FPUtil.fp_bits
libc.src.__support.FPUtil.fenv_impl
- libc.hdr.fenv_t
+ libc.hdr.types.fenv_t
)
add_unittest_framework_library(
diff --git a/libc/test/UnitTest/FPExceptMatcher.cpp b/libc/test/UnitTest/FPExceptMatcher.cpp
index b576fd9b709742..53ea72ad9ddd8d 100644
--- a/libc/test/UnitTest/FPExceptMatcher.cpp
+++ b/libc/test/UnitTest/FPExceptMatcher.cpp
@@ -8,7 +8,7 @@
#include "FPExceptMatcher.h"
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include <memory>
#include <setjmp.h>
diff --git a/libc/test/src/fenv/exception_flags_test.cpp b/libc/test/src/fenv/exception_flags_test.cpp
index b0ce6e8cdff017..d1d8bfcc53db56 100644
--- a/libc/test/src/fenv/exception_flags_test.cpp
+++ b/libc/test/src/fenv/exception_flags_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fexcept_t.h"
+#include "hdr/types/fexcept_t.h"
#include "src/fenv/fegetexceptflag.h"
#include "src/fenv/fesetexceptflag.h"
diff --git a/libc/test/src/fenv/feholdexcept_test.cpp b/libc/test/src/fenv/feholdexcept_test.cpp
index 714368aecb5cd5..0689d89ab233a3 100644
--- a/libc/test/src/fenv/feholdexcept_test.cpp
+++ b/libc/test/src/fenv/feholdexcept_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/fenv/feholdexcept.h"
#include "src/__support/FPUtil/FEnvImpl.h"
diff --git a/libc/test/src/fenv/feupdateenv_test.cpp b/libc/test/src/fenv/feupdateenv_test.cpp
index ddc60dd8b2f3c3..251b8566aac3d6 100644
--- a/libc/test/src/fenv/feupdateenv_test.cpp
+++ b/libc/test/src/fenv/feupdateenv_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/fenv/feupdateenv.h"
#include "src/__support/FPUtil/FEnvImpl.h"
diff --git a/libc/test/src/fenv/getenv_and_setenv_test.cpp b/libc/test/src/fenv/getenv_and_setenv_test.cpp
index 8bbff66377cd6b..f767e8ab9b2fb8 100644
--- a/libc/test/src/fenv/getenv_and_setenv_test.cpp
+++ b/libc/test/src/fenv/getenv_and_setenv_test.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "hdr/fenv_t.h"
+#include "hdr/types/fenv_t.h"
#include "src/fenv/fegetenv.h"
#include "src/fenv/fegetround.h"
#include "src/fenv/fesetenv.h"
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index bfab7aee64b211..51ca7ac343b26b 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -119,15 +119,6 @@ libc_support_library(
)
libc_support_library(
- name = "hdr_fenv_t",
- hdrs = ["hdr/fenv_t.h"],
-)
-
-libc_support_library(
- name = "hdr_fexcept_t",
- hdrs = ["hdr/fexcept_t.h"],
-
- libc_support_library(
name = "hdr_signal_macros",
hdrs = ["hdr/signal_macros.h"],
)
@@ -154,6 +145,16 @@ libc_support_library(
hdrs = ["hdr/types/struct_timespec.h"],
)
+libc_support_library(
+ name = "types_fenv_t",
+ hdrs = ["hdr/types/fenv_t.h"],
+)
+
+libc_support_library(
+ name = "types_fexcept_t",
+ hdrs = ["hdr/types/fexcept_t.h"],
+)
+
############################### Support libraries ##############################
libc_support_library(
@@ -785,7 +786,7 @@ libc_support_library(
":errno",
":hdr_fenv_macros",
":hdr_math_macros",
- ":hdr_fenv_t"
+ ":types_fenv_t"
],
)
@@ -1261,7 +1262,7 @@ libc_function(
deps = [
":__support_common",
":__support_fputil_fenv_impl",
- ":hdr_fexcept_t"
+ ":types_fexcept_t"
],
)
@@ -1272,7 +1273,7 @@ libc_function(
deps = [
":__support_common",
":__support_fputil_fenv_impl",
- ":hdr_fexcept_t",
+ ":types_fexcept_t",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
index 82c015a7eeda03..b1140a5a160903 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
@@ -87,6 +87,7 @@ libc_support_library(
"//libc:__support_fputil_rounding_mode",
"//libc:hdr_math_macros",
"//libc:hdr_fenv_macros",
+ "//libc:types_fenv_t",
],
)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
index 8bebd644baa76e..359db0723dfd3c 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/fenv/BUILD.bazel
@@ -65,7 +65,7 @@ libc_test(
"//libc:__support_fputil_fenv_impl",
"//libc:__support_macros_properties_architectures",
"//libc/test/UnitTest:fp_test_helpers",
- "//libc:hdr_fenv_t",
+ "//libc:types_fenv_t",
],
)
@@ -78,7 +78,7 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
- "//libc:hdr_fexcept_t",
+ "//libc:types_fexcept_t",
],
)
@@ -117,7 +117,7 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
- "//libc:hdr_fenv_t",
+ "//libc:types_fenv_t",
],
)
@@ -132,6 +132,6 @@ libc_test(
],
deps = [
"//libc:__support_fputil_fenv_impl",
- "//libc:hdr_fenv_t",
+ "//libc:types_fenv_t",
],
)
More information about the llvm-commits
mailing list