Skip to content

Commit 75bbf4d

Browse files
author
Job Henandez Lara
authored
[libc] Add proxy headers for fenv types. (#88467)
Fixes #88187
1 parent 58c5f50 commit 75bbf4d

26 files changed

+108
-24
lines changed

libc/hdr/types/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,21 @@ add_proxy_header_library(
2121
FULL_BUILD_DEPENDS
2222
libc.include.llvm-libc-types.struct_timespec
2323
)
24+
25+
add_proxy_header_library(
26+
fenv_t
27+
HDRS
28+
fenv_t.h
29+
FULL_BUILD_DEPENDS
30+
libc.include.llvm-libc-types.fenv_t
31+
libc.incude.fenv
32+
)
33+
34+
add_proxy_header_library(
35+
fexcept_t
36+
HDRS
37+
fexcept_t.h
38+
FULL_BUILD_DEPENDS
39+
libc.include.llvm-libc-types.fexcept_t
40+
libc.incude.fenv
41+
)

libc/hdr/types/fenv_t.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Definition of macros from fenv_t.h --------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_HDR_FENV_T_H
10+
#define LLVM_LIBC_HDR_FENV_T_H
11+
12+
#ifdef LIBC_FULL_BUILD
13+
14+
#include "include/llvm-libc-types/fenv_t.h"
15+
16+
#else // Overlay mode
17+
18+
#include <fenv.h>
19+
20+
#endif // LLVM_LIBC_FULL_BUILD
21+
22+
#endif // LLVM_LIBC_HDR_FENV_T_H

libc/hdr/types/fexcept_t.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Definition of macros from fexcept_t.h -----------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_HDR_FEXCEPT_T_H
10+
#define LLVM_LIBC_HDR_FEXCEPT_T_H
11+
12+
#ifdef LIBC_FULL_BUILD
13+
14+
#include "include/llvm-libc-types/fexcept_t.h"
15+
16+
#else // Overlay mode
17+
18+
#include <fenv.h>
19+
20+
#endif // LLVM_LIBC_FULL_BUILD
21+
22+
#endif // LLVM_LIBC_HDR_FENV_T_H

libc/src/__support/FPUtil/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ add_header_library(
33
HDRS
44
FEnvImpl.h
55
DEPENDS
6-
libc.include.fenv
6+
libc.hdr.types.fenv_t
77
libc.hdr.fenv_macros
88
libc.hdr.math_macros
99
libc.src.__support.macros.attributes

libc/src/__support/FPUtil/aarch64/FEnvImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#endif
1818

1919
#include <arm_acle.h>
20-
#include <fenv.h>
2120
#include <stdint.h>
2221

2322
#include "hdr/fenv_macros.h"
23+
#include "hdr/types/fenv_t.h"
2424
#include "src/__support/FPUtil/FPBits.h"
2525

2626
namespace LIBC_NAMESPACE {

libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#endif
1818

1919
#include <arm_acle.h>
20-
#include <fenv.h>
2120
#include <stdint.h>
2221

2322
#include "hdr/fenv_macros.h"
23+
#include "hdr/types/fenv_t.h"
2424
#include "src/__support/FPUtil/FPBits.h"
2525

2626
namespace LIBC_NAMESPACE {

libc/src/__support/FPUtil/arm/FEnvImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
1111

1212
#include "hdr/fenv_macros.h"
13+
#include "hdr/types/fenv_t.h"
1314
#include "src/__support/FPUtil/FPBits.h"
1415
#include "src/__support/macros/attributes.h" // For LIBC_INLINE
15-
#include <fenv.h>
1616
#include <stdint.h>
1717

1818
namespace LIBC_NAMESPACE {

libc/src/__support/FPUtil/riscv/FEnvImpl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
1111

1212
#include "hdr/fenv_macros.h"
13+
#include "hdr/types/fenv_t.h"
1314
#include "src/__support/FPUtil/FPBits.h"
1415
#include "src/__support/macros/attributes.h" // For LIBC_INLINE_ASM
1516
#include "src/__support/macros/config.h" // For LIBC_INLINE

libc/src/__support/FPUtil/x86_64/FEnvImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#error "Invalid include"
1717
#endif
1818

19-
#include <fenv.h>
2019
#include <stdint.h>
2120

21+
#include "hdr/types/fenv_t.h"
2222
#include "src/__support/macros/sanitizer.h"
2323

2424
namespace LIBC_NAMESPACE {

libc/src/fenv/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ add_entrypoint_object(
55
HDRS
66
fegetround.h
77
DEPENDS
8-
libc.include.fenv
98
libc.src.__support.FPUtil.fenv_impl
109
COMPILE_OPTIONS
1110
-O2
@@ -71,6 +70,7 @@ add_entrypoint_object(
7170
fegetenv.h
7271
DEPENDS
7372
libc.hdr.fenv_macros
73+
libc.hdr.types.fenv_t
7474
libc.src.__support.FPUtil.fenv_impl
7575
COMPILE_OPTIONS
7676
-O2
@@ -84,6 +84,7 @@ add_entrypoint_object(
8484
fesetenv.h
8585
DEPENDS
8686
libc.hdr.fenv_macros
87+
libc.hdr.types.fenv_t
8788
libc.src.__support.FPUtil.fenv_impl
8889
COMPILE_OPTIONS
8990
-O2
@@ -97,6 +98,7 @@ add_entrypoint_object(
9798
fegetexceptflag.h
9899
DEPENDS
99100
libc.hdr.fenv_macros
101+
libc.hdr.types.fexcept_t
100102
libc.src.__support.FPUtil.fenv_impl
101103
COMPILE_OPTIONS
102104
-O2
@@ -123,6 +125,7 @@ add_entrypoint_object(
123125
fesetexceptflag.h
124126
DEPENDS
125127
libc.hdr.fenv_macros
128+
libc.hdr.types.fexcept_t
126129
libc.src.__support.FPUtil.fenv_impl
127130
COMPILE_OPTIONS
128131
-O2
@@ -136,6 +139,7 @@ add_entrypoint_object(
136139
feholdexcept.h
137140
DEPENDS
138141
libc.hdr.fenv_macros
142+
libc.hdr.types.fenv_t
139143
libc.src.__support.FPUtil.fenv_impl
140144
COMPILE_OPTIONS
141145
-O2
@@ -149,6 +153,7 @@ add_entrypoint_object(
149153
feupdateenv.h
150154
DEPENDS
151155
libc.hdr.fenv_macros
156+
libc.hdr.types.fenv_t
152157
libc.src.__support.FPUtil.fenv_impl
153158
COMPILE_OPTIONS
154159
-O2

0 commit comments

Comments
 (0)