[libc] Add proxy header math_macros.h. (#87598)

Context: https://github.com/llvm/llvm-project/pull/87017

- Add proxy header `libc/hdr/math_macros.h` that will:
  - include `<math.h>` in overlay mode,
- include `"include/llvm-libc-macros/math-macros.h"` in full build mode.
- Its corresponding CMake target `libc.hdr.math_macros` will only depend
on `libc.include.math` and `libc.include.llvm-libc-macros.math_macros`
in full build mode.
- Replace all `#include "include/llvm-libc-macros/math-macros.h"` with
`#include "hdr/math_macros.h"`.
- Add dependency to `libc.hdr.math_macros` CMake target when using
`add_fp_unittest`.
- Update the remaining dependency.
- Update bazel overlay: add `libc:hdr_math_macros` target, and replacing
all dependency on `libc:llvm_libc_macros_math_macros` with
`libc:hdr_math_macros`.
This commit is contained in:
lntue
2024-04-05 18:21:16 -04:00
committed by GitHub
parent 3b337242ee
commit 5748ad84e5
147 changed files with 222 additions and 417 deletions

View File

@@ -8,6 +8,7 @@ add_libc_fuzzer(
SingleInputSingleOutputDiff.h
TwoInputSingleOutputDiff.h
DEPENDS
libc.hdr.math_macros
libc.src.math.ceil
libc.src.math.ceilf
libc.src.math.ceill

View File

@@ -11,7 +11,7 @@
#include "src/__support/FPUtil/FPBits.h"
#include "include/llvm-libc-macros/math-macros.h"
#include "hdr/math_macros.h"
#include <stddef.h>
#include <stdint.h>

View File

@@ -22,6 +22,7 @@ add_libc_fuzzer(
SRCS
strtofloat_fuzz.cpp
DEPENDS
libc.hdr.math_macros
libc.src.stdlib.atof
libc.src.stdlib.strtof
libc.src.stdlib.strtod

View File

@@ -16,7 +16,7 @@
#include "src/__support/FPUtil/FPBits.h"
#include "include/llvm-libc-macros/math-macros.h"
#include "hdr/math_macros.h"
#include <stddef.h>
#include <stdint.h>