[libc] rename newhdrgen to just hdrgen (#118545)
Link: #117208 Fixes: #117254
This commit is contained in:
@@ -57,7 +57,7 @@ if(LIBC_BUILD_GPU_LOADER OR ((NOT LLVM_RUNTIMES_BUILD) AND LLVM_LIBC_GPU_BUILD))
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_subdirectory(newhdrgen)
|
||||
add_subdirectory(hdrgen)
|
||||
|
||||
option(LIBC_CMAKE_VERBOSE_LOGGING
|
||||
"Log details warnings and notifications during CMake configuration." OFF)
|
||||
|
||||
@@ -112,7 +112,7 @@ function(add_gen_header target_name)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${out_file}
|
||||
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/newhdrgen/yaml_to_classes.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py
|
||||
${yaml_file}
|
||||
--h_def_file ${def_file}
|
||||
${entry_points}
|
||||
@@ -126,7 +126,7 @@ function(add_gen_header target_name)
|
||||
set(decl_out_file ${LIBC_INCLUDE_DIR}/llvm-libc-decls/${relative_path})
|
||||
add_custom_command(
|
||||
OUTPUT ${decl_out_file}
|
||||
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/newhdrgen/yaml_to_classes.py
|
||||
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py
|
||||
${yaml_file}
|
||||
--export-decls
|
||||
${entry_points}
|
||||
|
||||
@@ -3,21 +3,15 @@
|
||||
Generating Public and Internal headers
|
||||
======================================
|
||||
|
||||
This is a new implementation of the previous libc header generator. The old
|
||||
header generator (libc-hdrgen aka "Headergen") was based on TableGen, which
|
||||
created an awkward dependency on the rest of LLVM for our build system. By
|
||||
creating a new standalone Headergen we can eliminate these dependencies for
|
||||
easier cross compatibility.
|
||||
|
||||
There are 3 main components of the new Headergen. The first component are the
|
||||
YAML files that contain all the function header information and are separated by
|
||||
header specification and standard. The second component are the classes that are
|
||||
created for each component of the function header: macros, enumerations, types,
|
||||
function, arguments, and objects. The third component is the Python script that
|
||||
uses the class representation to deserialize YAML files into its specific
|
||||
components and then reserializes the components into the function header. The
|
||||
Python script also combines the generated header content with header definitions
|
||||
and extra macro and type inclusions from the .h.def file.
|
||||
There are 3 main components of the Headergen. The first component are the YAML
|
||||
files that contain all the function header information and are separated by
|
||||
header specification and standard. The second component are the classes that
|
||||
are created for each component of the function header: macros, enumerations,
|
||||
types, function, arguments, and objects. The third component is the Python
|
||||
script that uses the class representation to deserialize YAML files into its
|
||||
specific components and then reserializes the components into the function
|
||||
header. The Python script also combines the generated header content with
|
||||
header definitions and extra macro and type inclusions from the .h.def file.
|
||||
|
||||
|
||||
Instructions
|
||||
@@ -30,7 +24,7 @@ Required Versions:
|
||||
1. Keep full-build mode on when building, otherwise headers will not be
|
||||
generated.
|
||||
2. Once the build is complete, enter in the command line within the build
|
||||
directory ``ninja check-newhdrgen`` to ensure that the integration tests are
|
||||
directory ``ninja check-hdrgen`` to ensure that the integration tests are
|
||||
passing.
|
||||
3. Then enter in the command line ``ninja libc`` to generate headers. Headers
|
||||
will be in ``build/projects/libc/include`` or ``build/libc/include`` in a
|
||||
@@ -50,41 +44,41 @@ To add through the command line:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python3 libc/newhdrgen/yaml_to_classes.py
|
||||
libc/newhdrgen/yaml/[yaml_file.yaml] --add_function "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute>
|
||||
python3 libc/hdrgen/yaml_to_classes.py
|
||||
libc/hdrgen/yaml/[yaml_file.yaml] --add_function "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute>
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python3 libc/newhdrgen/yaml_to_classes.py
|
||||
libc/newhdrgen/yaml/ctype.yaml --add_function "char" example_function
|
||||
python3 libc/hdrgen/yaml_to_classes.py
|
||||
libc/hdrgen/yaml/ctype.yaml --add_function "char" example_function
|
||||
"int, void, const void" stdc example_float example_attribute
|
||||
|
||||
Keep in mind only the return_type and arguments have quotes around them. If
|
||||
you do not have any guards or attributes you may enter "null" for both.
|
||||
|
||||
3. Check the YAML file that the added function is present. You will also get a
|
||||
generated header file with the new addition in the newhdrgen directory to
|
||||
generated header file with the new addition in the hdrgen directory to
|
||||
examine.
|
||||
|
||||
If you want to sort the functions alphabetically you can check out libc/newhdrgen/yaml_functions_sorted.py.
|
||||
If you want to sort the functions alphabetically you can check out libc/hdrgen/yaml_functions_sorted.py.
|
||||
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
New Headergen has an integration test that you may run once you have configured
|
||||
your CMake within the build directory. In the command line, enter the following:
|
||||
``ninja check-newhdrgen``. The integration test is one test that ensures the
|
||||
process of YAML to classes to generate headers works properly. If there are any
|
||||
new additions on formatting headers, make sure the test is updated with the
|
||||
specific addition.
|
||||
Headergen has an integration test that you may run once you have configured
|
||||
your CMake within the build directory. In the command line, enter the
|
||||
following: ``ninja check-hdrgen``. The integration test is one test that
|
||||
ensures the process of YAML to classes to generate headers works properly. If
|
||||
there are any new additions on formatting headers, make sure the test is
|
||||
updated with the specific addition.
|
||||
|
||||
Integration Test can be found in: ``libc/newhdrgen/tests/test_integration.py``
|
||||
Integration Test can be found in: ``libc/hdrgen/tests/test_integration.py``
|
||||
|
||||
File to modify if adding something to formatting:
|
||||
``libc/newhdrgen/tests/expected_output/test_header.h``
|
||||
``libc/hdrgen/tests/expected_output/test_header.h``
|
||||
|
||||
|
||||
Common Errors
|
||||
@@ -95,7 +89,7 @@ Common Errors
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
"/llvm-project/libc/newhdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"]
|
||||
"/llvm-project/libc/hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"]
|
||||
|
||||
If you receive this error or any error pertaining to
|
||||
``function_data[function_specific_component]`` while building the headers
|
||||
@@ -123,7 +117,7 @@ Common Errors
|
||||
missing. Ensure the correct style and required files are present:
|
||||
|
||||
| ``[header_name]``
|
||||
| ``[../libc/newhdrgen/yaml/[yaml_file.yaml]``
|
||||
| ``[../libc/hdrgen/yaml/[yaml_file.yaml]``
|
||||
| ``[header_name.h.def]``
|
||||
| ``[header_name.h]``
|
||||
| ``DEPENDS``
|
||||
@@ -153,13 +147,13 @@ Common Errors
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
File "/llvm-project/libc/newhdrgen/header.py", line 60, in __str__ for
|
||||
File "/llvm-project/libc/hdrgen/header.py", line 60, in __str__ for
|
||||
function in self.functions: AttributeError: 'HeaderFile' object has no
|
||||
attribute 'functions'
|
||||
|
||||
When running ``ninja libc`` in the build directory to generate headers you
|
||||
may receive the error above. Essentially this means that in
|
||||
``libc/newhdrgen/header.py`` there is a missing attribute named functions.
|
||||
``libc/hdrgen/header.py`` there is a missing attribute named functions.
|
||||
Make sure all function components are defined within this file and there are
|
||||
no missing functions to add these components.
|
||||
|
||||
@@ -190,12 +184,12 @@ Common Errors
|
||||
Sometimes the integration test will fail but that
|
||||
still means the process is working unless the comparison between the output
|
||||
and expected_output is not showing. If that is the case make sure in
|
||||
``libc/newhdrgen/tests/test_integration.py`` there are no missing arguments
|
||||
``libc/hdrgen/tests/test_integration.py`` there are no missing arguments
|
||||
that run through the script.
|
||||
|
||||
If the integration tests are failing due to mismatching of lines or small
|
||||
errors in spacing that is nothing to worry about. If this is happening while
|
||||
you are making a new change to the formatting of the headers, then
|
||||
ensure the expected output file
|
||||
``libc/newhdrgen/tests/expected_output/test_header.h`` has the changes you
|
||||
``libc/hdrgen/tests/expected_output/test_header.h`` has the changes you
|
||||
are applying.
|
||||
|
||||
@@ -15,9 +15,9 @@ directories::
|
||||
- examples
|
||||
- fuzzing
|
||||
- hdr
|
||||
- hdrgen
|
||||
- include
|
||||
- lib
|
||||
- newhdrgen
|
||||
- src
|
||||
- startup
|
||||
- test
|
||||
@@ -89,13 +89,13 @@ The ``lib`` directory
|
||||
This directory contains a ``CMakeLists.txt`` file listing the targets for the
|
||||
public libraries ``libc.a``, ``libm.a`` etc.
|
||||
|
||||
The ``newhdrgen`` directory
|
||||
The ``hdrgen`` directory
|
||||
---------------------------
|
||||
|
||||
This directory contains the sources and specifications for the types, macros
|
||||
and entrypoint functions. These definitions are organized in the ``yaml``
|
||||
subdirectory and match the organization of the ``*.h.def`` files. This folder
|
||||
also contains the python sources for new headergen, which is what generates the
|
||||
also contains the python sources for headergen, which is what generates the
|
||||
headers.
|
||||
|
||||
The ``src`` directory
|
||||
|
||||
17
libc/hdrgen/CMakeLists.txt
Normal file
17
libc/hdrgen/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
if(LLVM_LIBC_FULL_BUILD)
|
||||
enable_testing()
|
||||
|
||||
set(NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
set(TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR}/hdrgen/output)
|
||||
|
||||
add_test(
|
||||
NAME hdrgen_integration_test
|
||||
COMMAND python3 ${NEWHDGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(check-hdrgen
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -R hdrgen_integration_test --output-on-failure
|
||||
)
|
||||
|
||||
message(STATUS "Integration test for hdrgen added.")
|
||||
endif()
|
||||
@@ -9,7 +9,7 @@ import sys
|
||||
class TestHeaderGenIntegration(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.output_dir = Path(
|
||||
args.output_dir if args.output_dir else "libc/newhdrgen/tests/output"
|
||||
args.output_dir if args.output_dir else "libc/hdrgen/tests/output"
|
||||
)
|
||||
|
||||
self.maxDiff = None
|
||||
@@ -21,7 +21,7 @@ class TestHeaderGenIntegration(unittest.TestCase):
|
||||
h_def_file = self.source_dir / h_def_file
|
||||
command = [
|
||||
"python3",
|
||||
str(self.source_dir / "libc/newhdrgen/yaml_to_classes.py"),
|
||||
str(self.source_dir / "libc/hdrgen/yaml_to_classes.py"),
|
||||
str(yaml_file),
|
||||
"--h_def_file",
|
||||
str(h_def_file),
|
||||
@@ -51,10 +51,10 @@ class TestHeaderGenIntegration(unittest.TestCase):
|
||||
self.assertEqual(gen_content, exp_content)
|
||||
|
||||
def test_generate_header(self):
|
||||
yaml_file = "libc/newhdrgen/tests/input/test_small.yaml"
|
||||
h_def_file = "libc/newhdrgen/tests/input/test_small.h.def"
|
||||
yaml_file = "libc/hdrgen/tests/input/test_small.yaml"
|
||||
h_def_file = "libc/hdrgen/tests/input/test_small.h.def"
|
||||
expected_output_file = (
|
||||
self.source_dir / "libc/newhdrgen/tests/expected_output/test_header.h"
|
||||
self.source_dir / "libc/hdrgen/tests/expected_output/test_header.h"
|
||||
)
|
||||
output_file = self.output_dir / "test_small.h"
|
||||
entry_points = {"func_b", "func_a", "func_c", "func_d", "func_e"}
|
||||
@@ -32,7 +32,7 @@ endmacro()
|
||||
|
||||
add_header_macro(
|
||||
ctype
|
||||
../libc/newhdrgen/yaml/ctype.yaml
|
||||
../libc/hdrgen/yaml/ctype.yaml
|
||||
ctype.h.def
|
||||
ctype.h
|
||||
DEPENDS
|
||||
@@ -42,7 +42,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
dirent
|
||||
../libc/newhdrgen/yaml/dirent.yaml
|
||||
../libc/hdrgen/yaml/dirent.yaml
|
||||
dirent.h.def
|
||||
dirent.h
|
||||
DEPENDS
|
||||
@@ -54,7 +54,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
fcntl
|
||||
../libc/newhdrgen/yaml/fcntl.yaml
|
||||
../libc/hdrgen/yaml/fcntl.yaml
|
||||
fcntl.h.def
|
||||
fcntl.h
|
||||
DEPENDS
|
||||
@@ -70,7 +70,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
dlfcn
|
||||
../libc/newhdrgen/yaml/dlfcn.yaml
|
||||
../libc/hdrgen/yaml/dlfcn.yaml
|
||||
dlfcn.h.def
|
||||
dlfcn.h
|
||||
DEPENDS
|
||||
@@ -80,7 +80,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
features
|
||||
../libc/newhdrgen/yaml/features.yaml
|
||||
../libc/hdrgen/yaml/features.yaml
|
||||
features.h.def
|
||||
features.h
|
||||
DEPENDS
|
||||
@@ -90,7 +90,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
fenv
|
||||
../libc/newhdrgen/yaml/fenv.yaml
|
||||
../libc/hdrgen/yaml/fenv.yaml
|
||||
fenv.h.def
|
||||
fenv.h
|
||||
DEPENDS
|
||||
@@ -102,7 +102,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
inttypes
|
||||
../libc/newhdrgen/yaml/inttypes.yaml
|
||||
../libc/hdrgen/yaml/inttypes.yaml
|
||||
inttypes.h.def
|
||||
inttypes.h
|
||||
DEPENDS
|
||||
@@ -113,7 +113,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
float
|
||||
../libc/newhdrgen/yaml/float.yaml
|
||||
../libc/hdrgen/yaml/float.yaml
|
||||
float.h.def
|
||||
float.h
|
||||
DEPENDS
|
||||
@@ -122,7 +122,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdint
|
||||
../libc/newhdrgen/yaml/stdint.yaml
|
||||
../libc/hdrgen/yaml/stdint.yaml
|
||||
stdint.h.def
|
||||
stdint.h
|
||||
DEPENDS
|
||||
@@ -131,7 +131,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
limits
|
||||
../libc/newhdrgen/yaml/limits.yaml
|
||||
../libc/hdrgen/yaml/limits.yaml
|
||||
limits.h.def
|
||||
limits.h
|
||||
DEPENDS
|
||||
@@ -140,7 +140,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
malloc
|
||||
../libc/newhdrgen/yaml/malloc.yaml
|
||||
../libc/hdrgen/yaml/malloc.yaml
|
||||
malloc.h.def
|
||||
malloc.h
|
||||
DEPENDS
|
||||
@@ -150,7 +150,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
math
|
||||
../libc/newhdrgen/yaml/math.yaml
|
||||
../libc/hdrgen/yaml/math.yaml
|
||||
math.h.def
|
||||
math.h
|
||||
DEPENDS
|
||||
@@ -165,7 +165,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdfix
|
||||
../libc/newhdrgen/yaml/stdfix.yaml
|
||||
../libc/hdrgen/yaml/stdfix.yaml
|
||||
stdfix.h.def
|
||||
stdfix.h
|
||||
DEPENDS
|
||||
@@ -178,7 +178,7 @@ file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/arpa)
|
||||
|
||||
add_header_macro(
|
||||
arpa_inet
|
||||
../libc/newhdrgen/yaml/arpa/inet.yaml
|
||||
../libc/hdrgen/yaml/arpa/inet.yaml
|
||||
arpa/inet.h.def
|
||||
arpa/inet.h
|
||||
DEPENDS
|
||||
@@ -187,7 +187,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
assert
|
||||
../libc/newhdrgen/yaml/assert.yaml
|
||||
../libc/hdrgen/yaml/assert.yaml
|
||||
assert.h.def
|
||||
assert.h
|
||||
DEPENDS
|
||||
@@ -197,7 +197,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
complex
|
||||
../libc/newhdrgen/yaml/complex.yaml
|
||||
../libc/hdrgen/yaml/complex.yaml
|
||||
complex.h.def
|
||||
complex.h
|
||||
DEPENDS
|
||||
@@ -207,7 +207,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
setjmp
|
||||
../libc/newhdrgen/yaml/setjmp.yaml
|
||||
../libc/hdrgen/yaml/setjmp.yaml
|
||||
setjmp.h.def
|
||||
setjmp.h
|
||||
DEPENDS
|
||||
@@ -217,7 +217,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
string
|
||||
../libc/newhdrgen/yaml/string.yaml
|
||||
../libc/hdrgen/yaml/string.yaml
|
||||
string.h.def
|
||||
string.h
|
||||
DEPENDS
|
||||
@@ -228,7 +228,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
strings
|
||||
../libc/newhdrgen/yaml/strings.yaml
|
||||
../libc/hdrgen/yaml/strings.yaml
|
||||
strings.h.def
|
||||
strings.h
|
||||
DEPENDS
|
||||
@@ -238,7 +238,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
search
|
||||
../libc/newhdrgen/yaml/search.yaml
|
||||
../libc/hdrgen/yaml/search.yaml
|
||||
search.h.def
|
||||
search.h
|
||||
DEPENDS
|
||||
@@ -252,7 +252,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
time
|
||||
../libc/newhdrgen/yaml/time.yaml
|
||||
../libc/hdrgen/yaml/time.yaml
|
||||
time.h.def
|
||||
time.h
|
||||
DEPENDS
|
||||
@@ -268,7 +268,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
threads
|
||||
../libc/newhdrgen/yaml/threads.yaml
|
||||
../libc/hdrgen/yaml/threads.yaml
|
||||
threads.h.def
|
||||
threads.h
|
||||
DEPENDS
|
||||
@@ -285,7 +285,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
errno
|
||||
../libc/newhdrgen/yaml/errno.yaml
|
||||
../libc/hdrgen/yaml/errno.yaml
|
||||
errno.h.def
|
||||
errno.h
|
||||
DEPENDS
|
||||
@@ -295,7 +295,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
signal
|
||||
../libc/newhdrgen/yaml/signal.yaml
|
||||
../libc/hdrgen/yaml/signal.yaml
|
||||
signal.h.def
|
||||
signal.h
|
||||
DEPENDS
|
||||
@@ -311,7 +311,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdbit
|
||||
../libc/newhdrgen/yaml/stdbit.yaml
|
||||
../libc/hdrgen/yaml/stdbit.yaml
|
||||
stdbit.h.def
|
||||
stdbit.h
|
||||
DEPENDS
|
||||
@@ -321,7 +321,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdckdint
|
||||
../libc/newhdrgen/yaml/stdckdint.yaml
|
||||
../libc/hdrgen/yaml/stdckdint.yaml
|
||||
stdckdint.h.def
|
||||
stdckdint.h
|
||||
DEPENDS
|
||||
@@ -331,7 +331,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdio
|
||||
../libc/newhdrgen/yaml/stdio.yaml
|
||||
../libc/hdrgen/yaml/stdio.yaml
|
||||
stdio.h.def
|
||||
stdio.h
|
||||
DEPENDS
|
||||
@@ -347,7 +347,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
stdlib
|
||||
../libc/newhdrgen/yaml/stdlib.yaml
|
||||
../libc/hdrgen/yaml/stdlib.yaml
|
||||
stdlib.h.def
|
||||
stdlib.h
|
||||
DEPENDS
|
||||
@@ -366,7 +366,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
unistd
|
||||
../libc/newhdrgen/yaml/unistd.yaml
|
||||
../libc/hdrgen/yaml/unistd.yaml
|
||||
unistd.h.def
|
||||
unistd.h
|
||||
DEPENDS
|
||||
@@ -385,7 +385,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
pthread
|
||||
../libc/newhdrgen/yaml/pthread.yaml
|
||||
../libc/hdrgen/yaml/pthread.yaml
|
||||
pthread.h.def
|
||||
pthread.h
|
||||
DEPENDS
|
||||
@@ -408,7 +408,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sched
|
||||
../libc/newhdrgen/yaml/sched.yaml
|
||||
../libc/hdrgen/yaml/sched.yaml
|
||||
sched.h.def
|
||||
sched.h
|
||||
DEPENDS
|
||||
@@ -425,7 +425,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
spawn
|
||||
../libc/newhdrgen/yaml/spawn.yaml
|
||||
../libc/hdrgen/yaml/spawn.yaml
|
||||
spawn.h.def
|
||||
spawn.h
|
||||
DEPENDS
|
||||
@@ -438,7 +438,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
link
|
||||
../libc/newhdrgen/yaml/link.yaml
|
||||
../libc/hdrgen/yaml/link.yaml
|
||||
link.h.def
|
||||
link.h
|
||||
DEPENDS
|
||||
@@ -448,7 +448,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
elf
|
||||
../libc/newhdrgen/yaml/elf.yaml
|
||||
../libc/hdrgen/yaml/elf.yaml
|
||||
elf.h.def
|
||||
elf.h
|
||||
DEPENDS
|
||||
@@ -462,7 +462,7 @@ file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/sys)
|
||||
|
||||
add_header_macro(
|
||||
sys_auxv
|
||||
../libc/newhdrgen/yaml/sys/auxv.yaml
|
||||
../libc/hdrgen/yaml/sys/auxv.yaml
|
||||
sys/auxv.h.def
|
||||
sys/auxv.h
|
||||
DEPENDS
|
||||
@@ -472,7 +472,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_epoll
|
||||
../libc/newhdrgen/yaml/sys/epoll.yaml
|
||||
../libc/hdrgen/yaml/sys/epoll.yaml
|
||||
sys/epoll.h.def
|
||||
sys/epoll.h
|
||||
DEPENDS
|
||||
@@ -485,7 +485,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_ioctl
|
||||
../libc/newhdrgen/yaml/sys/ioctl.yaml
|
||||
../libc/hdrgen/yaml/sys/ioctl.yaml
|
||||
sys/ioctl.h.def
|
||||
sys/ioctl.h
|
||||
DEPENDS
|
||||
@@ -495,7 +495,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_mman
|
||||
../libc/newhdrgen/yaml/sys/mman.yaml
|
||||
../libc/hdrgen/yaml/sys/mman.yaml
|
||||
sys/mman.h.def
|
||||
sys/mman.h
|
||||
DEPENDS
|
||||
@@ -508,7 +508,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_prctl
|
||||
../libc/newhdrgen/yaml/sys/prctl.yaml
|
||||
../libc/hdrgen/yaml/sys/prctl.yaml
|
||||
sys/prctl.h.def
|
||||
sys/prctl.h
|
||||
DEPENDS
|
||||
@@ -525,7 +525,7 @@ add_header(
|
||||
|
||||
add_header_macro(
|
||||
sys_random
|
||||
../libc/newhdrgen/yaml/sys/random.yaml
|
||||
../libc/hdrgen/yaml/sys/random.yaml
|
||||
sys/random.h.def
|
||||
sys/random.h
|
||||
DEPENDS
|
||||
@@ -537,7 +537,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_resource
|
||||
../libc/newhdrgen/yaml/sys/resource.yaml
|
||||
../libc/hdrgen/yaml/sys/resource.yaml
|
||||
sys/resource.h.def
|
||||
sys/resource.h
|
||||
DEPENDS
|
||||
@@ -549,7 +549,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_stat
|
||||
../libc/newhdrgen/yaml/sys/stat.yaml
|
||||
../libc/hdrgen/yaml/sys/stat.yaml
|
||||
sys/stat.h.def
|
||||
sys/stat.h
|
||||
DEPENDS
|
||||
@@ -571,7 +571,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_select
|
||||
../libc/newhdrgen/yaml/sys/select.yaml
|
||||
../libc/hdrgen/yaml/sys/select.yaml
|
||||
sys/select.h.def
|
||||
sys/select.h
|
||||
DEPENDS
|
||||
@@ -587,7 +587,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_sendfile
|
||||
../libc/newhdrgen/yaml/sys/sendfile.yaml
|
||||
../libc/hdrgen/yaml/sys/sendfile.yaml
|
||||
sys/sendfile.h.def
|
||||
sys/sendfile.h
|
||||
DEPENDS
|
||||
@@ -599,7 +599,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_socket
|
||||
../libc/newhdrgen/yaml/sys/socket.yaml
|
||||
../libc/hdrgen/yaml/sys/socket.yaml
|
||||
sys/socket.h.def
|
||||
sys/socket.h
|
||||
DEPENDS
|
||||
@@ -615,7 +615,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_statvfs
|
||||
../libc/newhdrgen/yaml/sys/statvfs.yaml
|
||||
../libc/hdrgen/yaml/sys/statvfs.yaml
|
||||
sys/statvfs.h.def
|
||||
sys/statvfs.h
|
||||
DEPENDS
|
||||
@@ -625,7 +625,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_syscall
|
||||
../libc/newhdrgen/yaml/sys/syscall.yaml
|
||||
../libc/hdrgen/yaml/sys/syscall.yaml
|
||||
sys/syscall.h.def
|
||||
sys/syscall.h
|
||||
DEPENDS
|
||||
@@ -633,7 +633,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_time
|
||||
../libc/newhdrgen/yaml/sys/time.yaml
|
||||
../libc/hdrgen/yaml/sys/time.yaml
|
||||
sys/time.h.def
|
||||
sys/time.h
|
||||
DEPENDS
|
||||
@@ -644,7 +644,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_types
|
||||
../libc/newhdrgen/yaml/sys/types.yaml
|
||||
../libc/hdrgen/yaml/sys/types.yaml
|
||||
sys/types.h.def
|
||||
sys/types.h
|
||||
DEPENDS
|
||||
@@ -674,7 +674,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_utsname
|
||||
../libc/newhdrgen/yaml/sys/utsname.yaml
|
||||
../libc/hdrgen/yaml/sys/utsname.yaml
|
||||
sys/utsname.h.def
|
||||
sys/utsname.h
|
||||
DEPENDS
|
||||
@@ -684,7 +684,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
sys_wait
|
||||
../libc/newhdrgen/yaml/sys/wait.yaml
|
||||
../libc/hdrgen/yaml/sys/wait.yaml
|
||||
sys/wait.h.def
|
||||
sys/wait.h
|
||||
DEPENDS
|
||||
@@ -697,7 +697,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
termios
|
||||
../libc/newhdrgen/yaml/termios.yaml
|
||||
../libc/hdrgen/yaml/termios.yaml
|
||||
termios.h.def
|
||||
termios.h
|
||||
DEPENDS
|
||||
@@ -712,7 +712,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
uchar
|
||||
../libc/newhdrgen/yaml/uchar.yaml
|
||||
../libc/hdrgen/yaml/uchar.yaml
|
||||
uchar.h.def
|
||||
uchar.h
|
||||
DEPENDS
|
||||
@@ -725,7 +725,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
wchar
|
||||
../libc/newhdrgen/yaml/wchar.yaml
|
||||
../libc/hdrgen/yaml/wchar.yaml
|
||||
wchar.h.def
|
||||
wchar.h
|
||||
DEPENDS
|
||||
@@ -739,7 +739,7 @@ add_header_macro(
|
||||
|
||||
add_header_macro(
|
||||
locale
|
||||
../libc/newhdrgen/yaml/locale.yaml
|
||||
../libc/hdrgen/yaml/locale.yaml
|
||||
locale.h.def
|
||||
locale.h
|
||||
DEPENDS
|
||||
@@ -754,7 +754,7 @@ if(LIBC_TARGET_OS_IS_GPU)
|
||||
|
||||
add_header_macro(
|
||||
gpu_rpc
|
||||
../libc/newhdrgen/yaml/gpu/rpc.yaml
|
||||
../libc/hdrgen/yaml/gpu/rpc.yaml
|
||||
gpu/rpc.h.def
|
||||
gpu/rpc.h
|
||||
DEPENDS
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
if(LLVM_LIBC_FULL_BUILD)
|
||||
enable_testing()
|
||||
|
||||
set(NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
set(TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR}/newhdrgen/output)
|
||||
|
||||
add_test(
|
||||
NAME newhdrgen_integration_test
|
||||
COMMAND python3 ${NEWHDGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(check-newhdrgen
|
||||
COMMAND ${CMAKE_CTEST_COMMAND} -R newhdrgen_integration_test --output-on-failure
|
||||
)
|
||||
|
||||
message(STATUS "Integration test for newhdrgen added.")
|
||||
endif()
|
||||
@@ -18,7 +18,7 @@ together with its specifications:
|
||||
```
|
||||
- Add function specs to the file:
|
||||
```
|
||||
libc/newhdrgen/yaml/math.yaml
|
||||
libc/hdrgen/yaml/math.yaml
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
Reference in New Issue
Block a user