From 30ad8f77151d429b9f4b66e2983c3beb2e7e798f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 28 Dec 2024 00:40:49 -0800 Subject: [PATCH] [libc] Move hdrgen into utils/ subdirectory --- libc/CMakeLists.txt | 2 - libc/cmake/modules/LLVMLibCHeaderRules.cmake | 5 +- libc/docs/dev/header_generation.rst | 27 ++--- libc/docs/dev/source_tree_layout.rst | 10 -- libc/docs/full_cross_build.rst | 14 +-- libc/include/CMakeLists.txt | 110 +++++++++--------- libc/src/math/docs/add_math_function.md | 2 +- libc/utils/CMakeLists.txt | 2 + libc/{ => utils}/hdrgen/CMakeLists.txt | 4 +- libc/utils/hdrgen/README.rst | 5 + .../classes/enumeration.py | 0 .../class_implementation/classes/function.py | 0 .../class_implementation/classes/macro.py | 0 .../class_implementation/classes/object.py | 0 .../class_implementation/classes/type.py | 0 libc/{ => utils}/hdrgen/gpu_headers.py | 0 libc/{ => utils}/hdrgen/header.py | 0 .../tests/expected_output/test_header.h | 0 .../hdrgen/tests/input/test_small.h.def | 0 .../hdrgen/tests/input/test_small.yaml | 0 .../hdrgen/tests/test_integration.py | 12 +- libc/{ => utils}/hdrgen/yaml/arpa/inet.yaml | 0 libc/{ => utils}/hdrgen/yaml/assert.yaml | 0 libc/{ => utils}/hdrgen/yaml/complex.yaml | 0 libc/{ => utils}/hdrgen/yaml/ctype.yaml | 0 libc/{ => utils}/hdrgen/yaml/dirent.yaml | 0 libc/{ => utils}/hdrgen/yaml/dlfcn.yaml | 0 libc/{ => utils}/hdrgen/yaml/elf.yaml | 0 libc/{ => utils}/hdrgen/yaml/errno.yaml | 0 libc/{ => utils}/hdrgen/yaml/fcntl.yaml | 0 libc/{ => utils}/hdrgen/yaml/features.yaml | 0 libc/{ => utils}/hdrgen/yaml/fenv.yaml | 0 libc/{ => utils}/hdrgen/yaml/float.yaml | 0 libc/{ => utils}/hdrgen/yaml/inttypes.yaml | 0 libc/{ => utils}/hdrgen/yaml/limits.yaml | 0 libc/{ => utils}/hdrgen/yaml/link.yaml | 0 libc/{ => utils}/hdrgen/yaml/locale.yaml | 0 libc/{ => utils}/hdrgen/yaml/malloc.yaml | 0 libc/{ => utils}/hdrgen/yaml/math.yaml | 0 libc/{ => utils}/hdrgen/yaml/pthread.yaml | 0 libc/{ => utils}/hdrgen/yaml/sched.yaml | 0 libc/{ => utils}/hdrgen/yaml/search.yaml | 0 libc/{ => utils}/hdrgen/yaml/setjmp.yaml | 0 libc/{ => utils}/hdrgen/yaml/signal.yaml | 0 libc/{ => utils}/hdrgen/yaml/spawn.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdbit.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdckdint.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdfix.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdint.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdio.yaml | 0 libc/{ => utils}/hdrgen/yaml/stdlib.yaml | 0 libc/{ => utils}/hdrgen/yaml/string.yaml | 0 libc/{ => utils}/hdrgen/yaml/strings.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/auxv.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/epoll.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/ioctl.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/mman.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/prctl.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/random.yaml | 0 .../{ => utils}/hdrgen/yaml/sys/resource.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/select.yaml | 0 .../{ => utils}/hdrgen/yaml/sys/sendfile.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/socket.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/stat.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/statvfs.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/syscall.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/time.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/types.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/utsname.yaml | 0 libc/{ => utils}/hdrgen/yaml/sys/wait.yaml | 0 libc/{ => utils}/hdrgen/yaml/termios.yaml | 0 libc/{ => utils}/hdrgen/yaml/threads.yaml | 0 libc/{ => utils}/hdrgen/yaml/time.yaml | 0 libc/{ => utils}/hdrgen/yaml/uchar.yaml | 0 libc/{ => utils}/hdrgen/yaml/unistd.yaml | 0 libc/{ => utils}/hdrgen/yaml/wchar.yaml | 0 .../hdrgen/yaml_functions_sorted.py | 0 libc/{ => utils}/hdrgen/yaml_to_classes.py | 0 78 files changed, 95 insertions(+), 98 deletions(-) rename libc/{ => utils}/hdrgen/CMakeLists.txt (68%) create mode 100644 libc/utils/hdrgen/README.rst rename libc/{ => utils}/hdrgen/class_implementation/classes/enumeration.py (100%) rename libc/{ => utils}/hdrgen/class_implementation/classes/function.py (100%) rename libc/{ => utils}/hdrgen/class_implementation/classes/macro.py (100%) rename libc/{ => utils}/hdrgen/class_implementation/classes/object.py (100%) rename libc/{ => utils}/hdrgen/class_implementation/classes/type.py (100%) rename libc/{ => utils}/hdrgen/gpu_headers.py (100%) rename libc/{ => utils}/hdrgen/header.py (100%) rename libc/{ => utils}/hdrgen/tests/expected_output/test_header.h (100%) rename libc/{ => utils}/hdrgen/tests/input/test_small.h.def (100%) rename libc/{ => utils}/hdrgen/tests/input/test_small.yaml (100%) rename libc/{ => utils}/hdrgen/tests/test_integration.py (84%) rename libc/{ => utils}/hdrgen/yaml/arpa/inet.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/assert.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/complex.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/ctype.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/dirent.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/dlfcn.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/elf.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/errno.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/fcntl.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/features.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/fenv.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/float.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/inttypes.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/limits.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/link.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/locale.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/malloc.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/math.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/pthread.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sched.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/search.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/setjmp.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/signal.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/spawn.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdbit.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdckdint.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdfix.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdint.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdio.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/stdlib.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/string.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/strings.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/auxv.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/epoll.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/ioctl.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/mman.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/prctl.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/random.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/resource.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/select.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/sendfile.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/socket.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/stat.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/statvfs.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/syscall.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/time.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/types.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/utsname.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/sys/wait.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/termios.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/threads.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/time.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/uchar.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/unistd.yaml (100%) rename libc/{ => utils}/hdrgen/yaml/wchar.yaml (100%) rename libc/{ => utils}/hdrgen/yaml_functions_sorted.py (100%) rename libc/{ => utils}/hdrgen/yaml_to_classes.py (100%) diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 00a07ea3c8ac7..6f1c180a3f192 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -64,8 +64,6 @@ if(LIBC_BUILD_GPU_LOADER OR ((NOT LLVM_RUNTIMES_BUILD) AND LLVM_LIBC_GPU_BUILD)) return() endif() -add_subdirectory(hdrgen) - option(LIBC_CMAKE_VERBOSE_LOGGING "Log details warnings and notifications during CMake configuration." OFF) diff --git a/libc/cmake/modules/LLVMLibCHeaderRules.cmake b/libc/cmake/modules/LLVMLibCHeaderRules.cmake index 31a88f0ef93be..0de5e14359cfb 100644 --- a/libc/cmake/modules/LLVMLibCHeaderRules.cmake +++ b/libc/cmake/modules/LLVMLibCHeaderRules.cmake @@ -110,9 +110,10 @@ function(add_gen_header target_name) set(entry_points "${TARGET_ENTRYPOINT_NAME_LIST}") list(TRANSFORM entry_points PREPEND "--e=") + set(LIBC_HDRGEN "${LIBC_SOURCE_DIR}/utils/hdrgen/yaml_to_classes.py") add_custom_command( OUTPUT ${out_file} - COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py + COMMAND ${Python3_EXECUTABLE} ${LIBC_HDRGEN} ${yaml_file} --h_def_file ${def_file} ${entry_points} @@ -126,7 +127,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}/hdrgen/yaml_to_classes.py + COMMAND ${Python3_EXECUTABLE} ${LIBC_HDRGEN} ${yaml_file} --export-decls ${entry_points} diff --git a/libc/docs/dev/header_generation.rst b/libc/docs/dev/header_generation.rst index 2c586cc87b699..17a8d7af3a2c8 100644 --- a/libc/docs/dev/header_generation.rst +++ b/libc/docs/dev/header_generation.rst @@ -44,15 +44,15 @@ To add through the command line: .. code-block:: none - python3 libc/hdrgen/yaml_to_classes.py - libc/hdrgen/yaml/[yaml_file.yaml] --add_function "" "" + python3 libc/utils/hdrgen/yaml_to_classes.py + libc/utils/hdrgen/yaml/[yaml_file.yaml] --add_function "" "" Example: .. code-block:: none - python3 libc/hdrgen/yaml_to_classes.py - libc/hdrgen/yaml/ctype.yaml --add_function "char" example_function + python3 libc/utils/hdrgen/yaml_to_classes.py + libc/utils/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 @@ -62,7 +62,8 @@ To add through the command line: 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/hdrgen/yaml_functions_sorted.py. +If you want to sort the functions alphabetically you can check out +libc/utils/hdrgen/yaml_functions_sorted.py. Testing @@ -75,10 +76,10 @@ 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/hdrgen/tests/test_integration.py`` +Integration Test can be found in: ``libc/utils/hdrgen/tests/test_integration.py`` File to modify if adding something to formatting: -``libc/hdrgen/tests/expected_output/test_header.h`` +``libc/utils/hdrgen/tests/expected_output/test_header.h`` Common Errors @@ -89,7 +90,7 @@ Common Errors .. code-block:: none - "/llvm-project/libc/hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"] + "/llvm-project/libc/utils/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 @@ -117,7 +118,7 @@ Common Errors missing. Ensure the correct style and required files are present: | ``[header_name]`` - | ``[../libc/hdrgen/yaml/[yaml_file.yaml]`` + | ``[../libc/utils/hdrgen/yaml/[yaml_file.yaml]`` | ``[header_name.h.def]`` | ``[header_name.h]`` | ``DEPENDS`` @@ -147,13 +148,13 @@ Common Errors .. code-block:: none - File "/llvm-project/libc/hdrgen/header.py", line 60, in __str__ for + File "/llvm-project/libc/utils/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/hdrgen/header.py`` there is a missing attribute named functions. + ``libc/utils/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. @@ -184,12 +185,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/hdrgen/tests/test_integration.py`` there are no missing arguments + ``libc/utils/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/hdrgen/tests/expected_output/test_header.h`` has the changes you + ``libc/utils/hdrgen/tests/expected_output/test_header.h`` has the changes you are applying. diff --git a/libc/docs/dev/source_tree_layout.rst b/libc/docs/dev/source_tree_layout.rst index bd9d6ca453e08..62c0434a0b2aa 100644 --- a/libc/docs/dev/source_tree_layout.rst +++ b/libc/docs/dev/source_tree_layout.rst @@ -15,7 +15,6 @@ directories:: - examples - fuzzing - hdr - - hdrgen - include - lib - src @@ -88,15 +87,6 @@ The ``lib`` directory This directory contains a ``CMakeLists.txt`` file listing the targets for the public libraries ``libc.a``, ``libm.a`` etc. -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 headergen, which is what generates the -headers. - The ``src`` directory --------------------- diff --git a/libc/docs/full_cross_build.rst b/libc/docs/full_cross_build.rst index 5f57169d228ef..cd1ec89e5d5e9 100644 --- a/libc/docs/full_cross_build.rst +++ b/libc/docs/full_cross_build.rst @@ -8,7 +8,7 @@ Full Cross Build :depth: 1 :local: -.. note:: +.. note:: Fullbuild requires running headergen, which is a python program that depends on pyyaml. The minimum versions are listed on the :ref:`header_generation` page, as well as additional information. @@ -95,8 +95,8 @@ configure step. Bootstrap cross build ===================== -In this recipe, the clang compiler and the ``libc-hdrgen`` binary, both are -built automatically before building the libc for the target. +In this recipe, the clang compiler is built automatically before building +the libc for the target. CMake configure step -------------------- @@ -151,8 +151,8 @@ built using any of the three recipes described above. Building for the GPU ==================== -To build for a GPU architecture, it should only be necessary to specify the -target triple as one of the supported GPU targets. Currently, this is either -``nvptx64-nvidia-cuda`` for NVIDIA GPUs or ``amdgcn-amd-amdhsa`` for AMD GPUs. -More detailed information is provided in the :ref:`GPU +To build for a GPU architecture, it should only be necessary to specify the +target triple as one of the supported GPU targets. Currently, this is either +``nvptx64-nvidia-cuda`` for NVIDIA GPUs or ``amdgcn-amd-amdhsa`` for AMD GPUs. +More detailed information is provided in the :ref:`GPU documentation`. diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt index 3a05c01abba5a..e490840cafedb 100644 --- a/libc/include/CMakeLists.txt +++ b/libc/include/CMakeLists.txt @@ -32,7 +32,7 @@ endmacro() add_header_macro( ctype - ../libc/hdrgen/yaml/ctype.yaml + ../libc/utils/hdrgen/yaml/ctype.yaml ctype.h.def ctype.h DEPENDS @@ -42,7 +42,7 @@ add_header_macro( add_header_macro( dirent - ../libc/hdrgen/yaml/dirent.yaml + ../libc/utils/hdrgen/yaml/dirent.yaml dirent.h.def dirent.h DEPENDS @@ -54,7 +54,7 @@ add_header_macro( add_header_macro( fcntl - ../libc/hdrgen/yaml/fcntl.yaml + ../libc/utils/hdrgen/yaml/fcntl.yaml fcntl.h.def fcntl.h DEPENDS @@ -70,7 +70,7 @@ add_header_macro( add_header_macro( dlfcn - ../libc/hdrgen/yaml/dlfcn.yaml + ../libc/utils/hdrgen/yaml/dlfcn.yaml dlfcn.h.def dlfcn.h DEPENDS @@ -80,7 +80,7 @@ add_header_macro( add_header_macro( features - ../libc/hdrgen/yaml/features.yaml + ../libc/utils/hdrgen/yaml/features.yaml features.h.def features.h DEPENDS @@ -90,7 +90,7 @@ add_header_macro( add_header_macro( fenv - ../libc/hdrgen/yaml/fenv.yaml + ../libc/utils/hdrgen/yaml/fenv.yaml fenv.h.def fenv.h DEPENDS @@ -102,7 +102,7 @@ add_header_macro( add_header_macro( inttypes - ../libc/hdrgen/yaml/inttypes.yaml + ../libc/utils/hdrgen/yaml/inttypes.yaml inttypes.h.def inttypes.h DEPENDS @@ -113,7 +113,7 @@ add_header_macro( add_header_macro( float - ../libc/hdrgen/yaml/float.yaml + ../libc/utils/hdrgen/yaml/float.yaml float.h.def float.h DEPENDS @@ -122,7 +122,7 @@ add_header_macro( add_header_macro( stdint - ../libc/hdrgen/yaml/stdint.yaml + ../libc/utils/hdrgen/yaml/stdint.yaml stdint.h.def stdint.h DEPENDS @@ -131,7 +131,7 @@ add_header_macro( add_header_macro( limits - ../libc/hdrgen/yaml/limits.yaml + ../libc/utils/hdrgen/yaml/limits.yaml limits.h.def limits.h DEPENDS @@ -140,7 +140,7 @@ add_header_macro( add_header_macro( malloc - ../libc/hdrgen/yaml/malloc.yaml + ../libc/utils/hdrgen/yaml/malloc.yaml malloc.h.def malloc.h DEPENDS @@ -150,7 +150,7 @@ add_header_macro( add_header_macro( math - ../libc/hdrgen/yaml/math.yaml + ../libc/utils/hdrgen/yaml/math.yaml math.h.def math.h DEPENDS @@ -165,7 +165,7 @@ add_header_macro( add_header_macro( stdfix - ../libc/hdrgen/yaml/stdfix.yaml + ../libc/utils/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/hdrgen/yaml/arpa/inet.yaml + ../libc/utils/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/hdrgen/yaml/assert.yaml + ../libc/utils/hdrgen/yaml/assert.yaml assert.h.def assert.h DEPENDS @@ -197,7 +197,7 @@ add_header_macro( add_header_macro( complex - ../libc/hdrgen/yaml/complex.yaml + ../libc/utils/hdrgen/yaml/complex.yaml complex.h.def complex.h DEPENDS @@ -207,7 +207,7 @@ add_header_macro( add_header_macro( setjmp - ../libc/hdrgen/yaml/setjmp.yaml + ../libc/utils/hdrgen/yaml/setjmp.yaml setjmp.h.def setjmp.h DEPENDS @@ -217,7 +217,7 @@ add_header_macro( add_header_macro( string - ../libc/hdrgen/yaml/string.yaml + ../libc/utils/hdrgen/yaml/string.yaml string.h.def string.h DEPENDS @@ -228,7 +228,7 @@ add_header_macro( add_header_macro( strings - ../libc/hdrgen/yaml/strings.yaml + ../libc/utils/hdrgen/yaml/strings.yaml strings.h.def strings.h DEPENDS @@ -238,7 +238,7 @@ add_header_macro( add_header_macro( search - ../libc/hdrgen/yaml/search.yaml + ../libc/utils/hdrgen/yaml/search.yaml search.h.def search.h DEPENDS @@ -252,7 +252,7 @@ add_header_macro( add_header_macro( time - ../libc/hdrgen/yaml/time.yaml + ../libc/utils/hdrgen/yaml/time.yaml time.h.def time.h DEPENDS @@ -268,7 +268,7 @@ add_header_macro( add_header_macro( threads - ../libc/hdrgen/yaml/threads.yaml + ../libc/utils/hdrgen/yaml/threads.yaml threads.h.def threads.h DEPENDS @@ -285,7 +285,7 @@ add_header_macro( add_header_macro( errno - ../libc/hdrgen/yaml/errno.yaml + ../libc/utils/hdrgen/yaml/errno.yaml errno.h.def errno.h DEPENDS @@ -295,7 +295,7 @@ add_header_macro( add_header_macro( signal - ../libc/hdrgen/yaml/signal.yaml + ../libc/utils/hdrgen/yaml/signal.yaml signal.h.def signal.h DEPENDS @@ -311,7 +311,7 @@ add_header_macro( add_header_macro( stdbit - ../libc/hdrgen/yaml/stdbit.yaml + ../libc/utils/hdrgen/yaml/stdbit.yaml stdbit.h.def stdbit.h DEPENDS @@ -321,7 +321,7 @@ add_header_macro( add_header_macro( stdckdint - ../libc/hdrgen/yaml/stdckdint.yaml + ../libc/utils/hdrgen/yaml/stdckdint.yaml stdckdint.h.def stdckdint.h DEPENDS @@ -331,7 +331,7 @@ add_header_macro( add_header_macro( stdio - ../libc/hdrgen/yaml/stdio.yaml + ../libc/utils/hdrgen/yaml/stdio.yaml stdio.h.def stdio.h DEPENDS @@ -347,7 +347,7 @@ add_header_macro( add_header_macro( stdlib - ../libc/hdrgen/yaml/stdlib.yaml + ../libc/utils/hdrgen/yaml/stdlib.yaml stdlib.h.def stdlib.h DEPENDS @@ -366,7 +366,7 @@ add_header_macro( add_header_macro( unistd - ../libc/hdrgen/yaml/unistd.yaml + ../libc/utils/hdrgen/yaml/unistd.yaml unistd.h.def unistd.h DEPENDS @@ -385,7 +385,7 @@ add_header_macro( add_header_macro( pthread - ../libc/hdrgen/yaml/pthread.yaml + ../libc/utils/hdrgen/yaml/pthread.yaml pthread.h.def pthread.h DEPENDS @@ -409,7 +409,7 @@ add_header_macro( add_header_macro( sched - ../libc/hdrgen/yaml/sched.yaml + ../libc/utils/hdrgen/yaml/sched.yaml sched.h.def sched.h DEPENDS @@ -426,7 +426,7 @@ add_header_macro( add_header_macro( spawn - ../libc/hdrgen/yaml/spawn.yaml + ../libc/utils/hdrgen/yaml/spawn.yaml spawn.h.def spawn.h DEPENDS @@ -439,7 +439,7 @@ add_header_macro( add_header_macro( link - ../libc/hdrgen/yaml/link.yaml + ../libc/utils/hdrgen/yaml/link.yaml link.h.def link.h DEPENDS @@ -449,7 +449,7 @@ add_header_macro( add_header_macro( elf - ../libc/hdrgen/yaml/elf.yaml + ../libc/utils/hdrgen/yaml/elf.yaml elf.h.def elf.h DEPENDS @@ -463,7 +463,7 @@ file(MAKE_DIRECTORY ${LIBC_INCLUDE_DIR}/sys) add_header_macro( sys_auxv - ../libc/hdrgen/yaml/sys/auxv.yaml + ../libc/utils/hdrgen/yaml/sys/auxv.yaml sys/auxv.h.def sys/auxv.h DEPENDS @@ -473,7 +473,7 @@ add_header_macro( add_header_macro( sys_epoll - ../libc/hdrgen/yaml/sys/epoll.yaml + ../libc/utils/hdrgen/yaml/sys/epoll.yaml sys/epoll.h.def sys/epoll.h DEPENDS @@ -486,7 +486,7 @@ add_header_macro( add_header_macro( sys_ioctl - ../libc/hdrgen/yaml/sys/ioctl.yaml + ../libc/utils/hdrgen/yaml/sys/ioctl.yaml sys/ioctl.h.def sys/ioctl.h DEPENDS @@ -496,7 +496,7 @@ add_header_macro( add_header_macro( sys_mman - ../libc/hdrgen/yaml/sys/mman.yaml + ../libc/utils/hdrgen/yaml/sys/mman.yaml sys/mman.h.def sys/mman.h DEPENDS @@ -509,7 +509,7 @@ add_header_macro( add_header_macro( sys_prctl - ../libc/hdrgen/yaml/sys/prctl.yaml + ../libc/utils/hdrgen/yaml/sys/prctl.yaml sys/prctl.h.def sys/prctl.h DEPENDS @@ -526,7 +526,7 @@ add_header( add_header_macro( sys_random - ../libc/hdrgen/yaml/sys/random.yaml + ../libc/utils/hdrgen/yaml/sys/random.yaml sys/random.h.def sys/random.h DEPENDS @@ -538,7 +538,7 @@ add_header_macro( add_header_macro( sys_resource - ../libc/hdrgen/yaml/sys/resource.yaml + ../libc/utils/hdrgen/yaml/sys/resource.yaml sys/resource.h.def sys/resource.h DEPENDS @@ -550,7 +550,7 @@ add_header_macro( add_header_macro( sys_stat - ../libc/hdrgen/yaml/sys/stat.yaml + ../libc/utils/hdrgen/yaml/sys/stat.yaml sys/stat.h.def sys/stat.h DEPENDS @@ -572,7 +572,7 @@ add_header_macro( add_header_macro( sys_select - ../libc/hdrgen/yaml/sys/select.yaml + ../libc/utils/hdrgen/yaml/sys/select.yaml sys/select.h.def sys/select.h DEPENDS @@ -588,7 +588,7 @@ add_header_macro( add_header_macro( sys_sendfile - ../libc/hdrgen/yaml/sys/sendfile.yaml + ../libc/utils/hdrgen/yaml/sys/sendfile.yaml sys/sendfile.h.def sys/sendfile.h DEPENDS @@ -600,7 +600,7 @@ add_header_macro( add_header_macro( sys_socket - ../libc/hdrgen/yaml/sys/socket.yaml + ../libc/utils/hdrgen/yaml/sys/socket.yaml sys/socket.h.def sys/socket.h DEPENDS @@ -616,7 +616,7 @@ add_header_macro( add_header_macro( sys_statvfs - ../libc/hdrgen/yaml/sys/statvfs.yaml + ../libc/utils/hdrgen/yaml/sys/statvfs.yaml sys/statvfs.h.def sys/statvfs.h DEPENDS @@ -626,7 +626,7 @@ add_header_macro( add_header_macro( sys_syscall - ../libc/hdrgen/yaml/sys/syscall.yaml + ../libc/utils/hdrgen/yaml/sys/syscall.yaml sys/syscall.h.def sys/syscall.h DEPENDS @@ -634,7 +634,7 @@ add_header_macro( add_header_macro( sys_time - ../libc/hdrgen/yaml/sys/time.yaml + ../libc/utils/hdrgen/yaml/sys/time.yaml sys/time.h.def sys/time.h DEPENDS @@ -645,7 +645,7 @@ add_header_macro( add_header_macro( sys_types - ../libc/hdrgen/yaml/sys/types.yaml + ../libc/utils/hdrgen/yaml/sys/types.yaml sys/types.h.def sys/types.h DEPENDS @@ -675,7 +675,7 @@ add_header_macro( add_header_macro( sys_utsname - ../libc/hdrgen/yaml/sys/utsname.yaml + ../libc/utils/hdrgen/yaml/sys/utsname.yaml sys/utsname.h.def sys/utsname.h DEPENDS @@ -685,7 +685,7 @@ add_header_macro( add_header_macro( sys_wait - ../libc/hdrgen/yaml/sys/wait.yaml + ../libc/utils/hdrgen/yaml/sys/wait.yaml sys/wait.h.def sys/wait.h DEPENDS @@ -698,7 +698,7 @@ add_header_macro( add_header_macro( termios - ../libc/hdrgen/yaml/termios.yaml + ../libc/utils/hdrgen/yaml/termios.yaml termios.h.def termios.h DEPENDS @@ -713,7 +713,7 @@ add_header_macro( add_header_macro( uchar - ../libc/hdrgen/yaml/uchar.yaml + ../libc/utils/hdrgen/yaml/uchar.yaml uchar.h.def uchar.h DEPENDS @@ -726,7 +726,7 @@ add_header_macro( add_header_macro( wchar - ../libc/hdrgen/yaml/wchar.yaml + ../libc/utils/hdrgen/yaml/wchar.yaml wchar.h.def wchar.h DEPENDS @@ -740,7 +740,7 @@ add_header_macro( add_header_macro( locale - ../libc/hdrgen/yaml/locale.yaml + ../libc/utils/hdrgen/yaml/locale.yaml locale.h.def locale.h DEPENDS diff --git a/libc/src/math/docs/add_math_function.md b/libc/src/math/docs/add_math_function.md index f02d502399e2b..7d45bd02c4ff2 100644 --- a/libc/src/math/docs/add_math_function.md +++ b/libc/src/math/docs/add_math_function.md @@ -18,7 +18,7 @@ together with its specifications: ``` - Add function specs to the file: ``` - libc/hdrgen/yaml/math.yaml + libc/utils/hdrgen/yaml/math.yaml ``` ## Implementation diff --git a/libc/utils/CMakeLists.txt b/libc/utils/CMakeLists.txt index 11f25503cc13e..a33c13a045a8a 100644 --- a/libc/utils/CMakeLists.txt +++ b/libc/utils/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(hdrgen) + if(LLVM_INCLUDE_TESTS) add_subdirectory(MPFRWrapper) endif() diff --git a/libc/hdrgen/CMakeLists.txt b/libc/utils/hdrgen/CMakeLists.txt similarity index 68% rename from libc/hdrgen/CMakeLists.txt rename to libc/utils/hdrgen/CMakeLists.txt index 8ebde4e3e4588..c6827da215055 100644 --- a/libc/hdrgen/CMakeLists.txt +++ b/libc/utils/hdrgen/CMakeLists.txt @@ -1,12 +1,12 @@ if(LLVM_LIBC_FULL_BUILD) enable_testing() - set(NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests) + set(HDRGEN_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} + COMMAND python3 ${HDRGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR} ) add_custom_target(check-hdrgen diff --git a/libc/utils/hdrgen/README.rst b/libc/utils/hdrgen/README.rst new file mode 100644 index 0000000000000..d16e6c5ccaec1 --- /dev/null +++ b/libc/utils/hdrgen/README.rst @@ -0,0 +1,5 @@ +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 directory also contains the Python sources for hdrgen, which is +what generates the headers. diff --git a/libc/hdrgen/class_implementation/classes/enumeration.py b/libc/utils/hdrgen/class_implementation/classes/enumeration.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/enumeration.py rename to libc/utils/hdrgen/class_implementation/classes/enumeration.py diff --git a/libc/hdrgen/class_implementation/classes/function.py b/libc/utils/hdrgen/class_implementation/classes/function.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/function.py rename to libc/utils/hdrgen/class_implementation/classes/function.py diff --git a/libc/hdrgen/class_implementation/classes/macro.py b/libc/utils/hdrgen/class_implementation/classes/macro.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/macro.py rename to libc/utils/hdrgen/class_implementation/classes/macro.py diff --git a/libc/hdrgen/class_implementation/classes/object.py b/libc/utils/hdrgen/class_implementation/classes/object.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/object.py rename to libc/utils/hdrgen/class_implementation/classes/object.py diff --git a/libc/hdrgen/class_implementation/classes/type.py b/libc/utils/hdrgen/class_implementation/classes/type.py similarity index 100% rename from libc/hdrgen/class_implementation/classes/type.py rename to libc/utils/hdrgen/class_implementation/classes/type.py diff --git a/libc/hdrgen/gpu_headers.py b/libc/utils/hdrgen/gpu_headers.py similarity index 100% rename from libc/hdrgen/gpu_headers.py rename to libc/utils/hdrgen/gpu_headers.py diff --git a/libc/hdrgen/header.py b/libc/utils/hdrgen/header.py similarity index 100% rename from libc/hdrgen/header.py rename to libc/utils/hdrgen/header.py diff --git a/libc/hdrgen/tests/expected_output/test_header.h b/libc/utils/hdrgen/tests/expected_output/test_header.h similarity index 100% rename from libc/hdrgen/tests/expected_output/test_header.h rename to libc/utils/hdrgen/tests/expected_output/test_header.h diff --git a/libc/hdrgen/tests/input/test_small.h.def b/libc/utils/hdrgen/tests/input/test_small.h.def similarity index 100% rename from libc/hdrgen/tests/input/test_small.h.def rename to libc/utils/hdrgen/tests/input/test_small.h.def diff --git a/libc/hdrgen/tests/input/test_small.yaml b/libc/utils/hdrgen/tests/input/test_small.yaml similarity index 100% rename from libc/hdrgen/tests/input/test_small.yaml rename to libc/utils/hdrgen/tests/input/test_small.yaml diff --git a/libc/hdrgen/tests/test_integration.py b/libc/utils/hdrgen/tests/test_integration.py similarity index 84% rename from libc/hdrgen/tests/test_integration.py rename to libc/utils/hdrgen/tests/test_integration.py index 8ea6d8a708073..ce80026e7bccd 100644 --- a/libc/hdrgen/tests/test_integration.py +++ b/libc/utils/hdrgen/tests/test_integration.py @@ -9,19 +9,19 @@ class TestHeaderGenIntegration(unittest.TestCase): def setUp(self): self.output_dir = Path( - args.output_dir if args.output_dir else "libc/hdrgen/tests/output" + args.output_dir if args.output_dir else "libc/utils/hdrgen/tests/output" ) self.maxDiff = None - self.source_dir = Path(__file__).resolve().parent.parent.parent.parent + self.source_dir = Path(__file__).resolve().parent.parent.parent.parent.parent def run_script(self, yaml_file, h_def_file, output_dir, entry_points): yaml_file = self.source_dir / yaml_file h_def_file = self.source_dir / h_def_file command = [ "python3", - str(self.source_dir / "libc/hdrgen/yaml_to_classes.py"), + str(self.source_dir / "libc/utils/hdrgen/yaml_to_classes.py"), str(yaml_file), "--h_def_file", str(h_def_file), @@ -51,10 +51,10 @@ def compare_files(self, generated_file, expected_file): self.assertEqual(gen_content, exp_content) def test_generate_header(self): - yaml_file = "libc/hdrgen/tests/input/test_small.yaml" - h_def_file = "libc/hdrgen/tests/input/test_small.h.def" + yaml_file = "libc/utils/hdrgen/tests/input/test_small.yaml" + h_def_file = "libc/utils/hdrgen/tests/input/test_small.h.def" expected_output_file = ( - self.source_dir / "libc/hdrgen/tests/expected_output/test_header.h" + self.source_dir / "libc/utils/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"} diff --git a/libc/hdrgen/yaml/arpa/inet.yaml b/libc/utils/hdrgen/yaml/arpa/inet.yaml similarity index 100% rename from libc/hdrgen/yaml/arpa/inet.yaml rename to libc/utils/hdrgen/yaml/arpa/inet.yaml diff --git a/libc/hdrgen/yaml/assert.yaml b/libc/utils/hdrgen/yaml/assert.yaml similarity index 100% rename from libc/hdrgen/yaml/assert.yaml rename to libc/utils/hdrgen/yaml/assert.yaml diff --git a/libc/hdrgen/yaml/complex.yaml b/libc/utils/hdrgen/yaml/complex.yaml similarity index 100% rename from libc/hdrgen/yaml/complex.yaml rename to libc/utils/hdrgen/yaml/complex.yaml diff --git a/libc/hdrgen/yaml/ctype.yaml b/libc/utils/hdrgen/yaml/ctype.yaml similarity index 100% rename from libc/hdrgen/yaml/ctype.yaml rename to libc/utils/hdrgen/yaml/ctype.yaml diff --git a/libc/hdrgen/yaml/dirent.yaml b/libc/utils/hdrgen/yaml/dirent.yaml similarity index 100% rename from libc/hdrgen/yaml/dirent.yaml rename to libc/utils/hdrgen/yaml/dirent.yaml diff --git a/libc/hdrgen/yaml/dlfcn.yaml b/libc/utils/hdrgen/yaml/dlfcn.yaml similarity index 100% rename from libc/hdrgen/yaml/dlfcn.yaml rename to libc/utils/hdrgen/yaml/dlfcn.yaml diff --git a/libc/hdrgen/yaml/elf.yaml b/libc/utils/hdrgen/yaml/elf.yaml similarity index 100% rename from libc/hdrgen/yaml/elf.yaml rename to libc/utils/hdrgen/yaml/elf.yaml diff --git a/libc/hdrgen/yaml/errno.yaml b/libc/utils/hdrgen/yaml/errno.yaml similarity index 100% rename from libc/hdrgen/yaml/errno.yaml rename to libc/utils/hdrgen/yaml/errno.yaml diff --git a/libc/hdrgen/yaml/fcntl.yaml b/libc/utils/hdrgen/yaml/fcntl.yaml similarity index 100% rename from libc/hdrgen/yaml/fcntl.yaml rename to libc/utils/hdrgen/yaml/fcntl.yaml diff --git a/libc/hdrgen/yaml/features.yaml b/libc/utils/hdrgen/yaml/features.yaml similarity index 100% rename from libc/hdrgen/yaml/features.yaml rename to libc/utils/hdrgen/yaml/features.yaml diff --git a/libc/hdrgen/yaml/fenv.yaml b/libc/utils/hdrgen/yaml/fenv.yaml similarity index 100% rename from libc/hdrgen/yaml/fenv.yaml rename to libc/utils/hdrgen/yaml/fenv.yaml diff --git a/libc/hdrgen/yaml/float.yaml b/libc/utils/hdrgen/yaml/float.yaml similarity index 100% rename from libc/hdrgen/yaml/float.yaml rename to libc/utils/hdrgen/yaml/float.yaml diff --git a/libc/hdrgen/yaml/inttypes.yaml b/libc/utils/hdrgen/yaml/inttypes.yaml similarity index 100% rename from libc/hdrgen/yaml/inttypes.yaml rename to libc/utils/hdrgen/yaml/inttypes.yaml diff --git a/libc/hdrgen/yaml/limits.yaml b/libc/utils/hdrgen/yaml/limits.yaml similarity index 100% rename from libc/hdrgen/yaml/limits.yaml rename to libc/utils/hdrgen/yaml/limits.yaml diff --git a/libc/hdrgen/yaml/link.yaml b/libc/utils/hdrgen/yaml/link.yaml similarity index 100% rename from libc/hdrgen/yaml/link.yaml rename to libc/utils/hdrgen/yaml/link.yaml diff --git a/libc/hdrgen/yaml/locale.yaml b/libc/utils/hdrgen/yaml/locale.yaml similarity index 100% rename from libc/hdrgen/yaml/locale.yaml rename to libc/utils/hdrgen/yaml/locale.yaml diff --git a/libc/hdrgen/yaml/malloc.yaml b/libc/utils/hdrgen/yaml/malloc.yaml similarity index 100% rename from libc/hdrgen/yaml/malloc.yaml rename to libc/utils/hdrgen/yaml/malloc.yaml diff --git a/libc/hdrgen/yaml/math.yaml b/libc/utils/hdrgen/yaml/math.yaml similarity index 100% rename from libc/hdrgen/yaml/math.yaml rename to libc/utils/hdrgen/yaml/math.yaml diff --git a/libc/hdrgen/yaml/pthread.yaml b/libc/utils/hdrgen/yaml/pthread.yaml similarity index 100% rename from libc/hdrgen/yaml/pthread.yaml rename to libc/utils/hdrgen/yaml/pthread.yaml diff --git a/libc/hdrgen/yaml/sched.yaml b/libc/utils/hdrgen/yaml/sched.yaml similarity index 100% rename from libc/hdrgen/yaml/sched.yaml rename to libc/utils/hdrgen/yaml/sched.yaml diff --git a/libc/hdrgen/yaml/search.yaml b/libc/utils/hdrgen/yaml/search.yaml similarity index 100% rename from libc/hdrgen/yaml/search.yaml rename to libc/utils/hdrgen/yaml/search.yaml diff --git a/libc/hdrgen/yaml/setjmp.yaml b/libc/utils/hdrgen/yaml/setjmp.yaml similarity index 100% rename from libc/hdrgen/yaml/setjmp.yaml rename to libc/utils/hdrgen/yaml/setjmp.yaml diff --git a/libc/hdrgen/yaml/signal.yaml b/libc/utils/hdrgen/yaml/signal.yaml similarity index 100% rename from libc/hdrgen/yaml/signal.yaml rename to libc/utils/hdrgen/yaml/signal.yaml diff --git a/libc/hdrgen/yaml/spawn.yaml b/libc/utils/hdrgen/yaml/spawn.yaml similarity index 100% rename from libc/hdrgen/yaml/spawn.yaml rename to libc/utils/hdrgen/yaml/spawn.yaml diff --git a/libc/hdrgen/yaml/stdbit.yaml b/libc/utils/hdrgen/yaml/stdbit.yaml similarity index 100% rename from libc/hdrgen/yaml/stdbit.yaml rename to libc/utils/hdrgen/yaml/stdbit.yaml diff --git a/libc/hdrgen/yaml/stdckdint.yaml b/libc/utils/hdrgen/yaml/stdckdint.yaml similarity index 100% rename from libc/hdrgen/yaml/stdckdint.yaml rename to libc/utils/hdrgen/yaml/stdckdint.yaml diff --git a/libc/hdrgen/yaml/stdfix.yaml b/libc/utils/hdrgen/yaml/stdfix.yaml similarity index 100% rename from libc/hdrgen/yaml/stdfix.yaml rename to libc/utils/hdrgen/yaml/stdfix.yaml diff --git a/libc/hdrgen/yaml/stdint.yaml b/libc/utils/hdrgen/yaml/stdint.yaml similarity index 100% rename from libc/hdrgen/yaml/stdint.yaml rename to libc/utils/hdrgen/yaml/stdint.yaml diff --git a/libc/hdrgen/yaml/stdio.yaml b/libc/utils/hdrgen/yaml/stdio.yaml similarity index 100% rename from libc/hdrgen/yaml/stdio.yaml rename to libc/utils/hdrgen/yaml/stdio.yaml diff --git a/libc/hdrgen/yaml/stdlib.yaml b/libc/utils/hdrgen/yaml/stdlib.yaml similarity index 100% rename from libc/hdrgen/yaml/stdlib.yaml rename to libc/utils/hdrgen/yaml/stdlib.yaml diff --git a/libc/hdrgen/yaml/string.yaml b/libc/utils/hdrgen/yaml/string.yaml similarity index 100% rename from libc/hdrgen/yaml/string.yaml rename to libc/utils/hdrgen/yaml/string.yaml diff --git a/libc/hdrgen/yaml/strings.yaml b/libc/utils/hdrgen/yaml/strings.yaml similarity index 100% rename from libc/hdrgen/yaml/strings.yaml rename to libc/utils/hdrgen/yaml/strings.yaml diff --git a/libc/hdrgen/yaml/sys/auxv.yaml b/libc/utils/hdrgen/yaml/sys/auxv.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/auxv.yaml rename to libc/utils/hdrgen/yaml/sys/auxv.yaml diff --git a/libc/hdrgen/yaml/sys/epoll.yaml b/libc/utils/hdrgen/yaml/sys/epoll.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/epoll.yaml rename to libc/utils/hdrgen/yaml/sys/epoll.yaml diff --git a/libc/hdrgen/yaml/sys/ioctl.yaml b/libc/utils/hdrgen/yaml/sys/ioctl.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/ioctl.yaml rename to libc/utils/hdrgen/yaml/sys/ioctl.yaml diff --git a/libc/hdrgen/yaml/sys/mman.yaml b/libc/utils/hdrgen/yaml/sys/mman.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/mman.yaml rename to libc/utils/hdrgen/yaml/sys/mman.yaml diff --git a/libc/hdrgen/yaml/sys/prctl.yaml b/libc/utils/hdrgen/yaml/sys/prctl.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/prctl.yaml rename to libc/utils/hdrgen/yaml/sys/prctl.yaml diff --git a/libc/hdrgen/yaml/sys/random.yaml b/libc/utils/hdrgen/yaml/sys/random.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/random.yaml rename to libc/utils/hdrgen/yaml/sys/random.yaml diff --git a/libc/hdrgen/yaml/sys/resource.yaml b/libc/utils/hdrgen/yaml/sys/resource.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/resource.yaml rename to libc/utils/hdrgen/yaml/sys/resource.yaml diff --git a/libc/hdrgen/yaml/sys/select.yaml b/libc/utils/hdrgen/yaml/sys/select.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/select.yaml rename to libc/utils/hdrgen/yaml/sys/select.yaml diff --git a/libc/hdrgen/yaml/sys/sendfile.yaml b/libc/utils/hdrgen/yaml/sys/sendfile.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/sendfile.yaml rename to libc/utils/hdrgen/yaml/sys/sendfile.yaml diff --git a/libc/hdrgen/yaml/sys/socket.yaml b/libc/utils/hdrgen/yaml/sys/socket.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/socket.yaml rename to libc/utils/hdrgen/yaml/sys/socket.yaml diff --git a/libc/hdrgen/yaml/sys/stat.yaml b/libc/utils/hdrgen/yaml/sys/stat.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/stat.yaml rename to libc/utils/hdrgen/yaml/sys/stat.yaml diff --git a/libc/hdrgen/yaml/sys/statvfs.yaml b/libc/utils/hdrgen/yaml/sys/statvfs.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/statvfs.yaml rename to libc/utils/hdrgen/yaml/sys/statvfs.yaml diff --git a/libc/hdrgen/yaml/sys/syscall.yaml b/libc/utils/hdrgen/yaml/sys/syscall.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/syscall.yaml rename to libc/utils/hdrgen/yaml/sys/syscall.yaml diff --git a/libc/hdrgen/yaml/sys/time.yaml b/libc/utils/hdrgen/yaml/sys/time.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/time.yaml rename to libc/utils/hdrgen/yaml/sys/time.yaml diff --git a/libc/hdrgen/yaml/sys/types.yaml b/libc/utils/hdrgen/yaml/sys/types.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/types.yaml rename to libc/utils/hdrgen/yaml/sys/types.yaml diff --git a/libc/hdrgen/yaml/sys/utsname.yaml b/libc/utils/hdrgen/yaml/sys/utsname.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/utsname.yaml rename to libc/utils/hdrgen/yaml/sys/utsname.yaml diff --git a/libc/hdrgen/yaml/sys/wait.yaml b/libc/utils/hdrgen/yaml/sys/wait.yaml similarity index 100% rename from libc/hdrgen/yaml/sys/wait.yaml rename to libc/utils/hdrgen/yaml/sys/wait.yaml diff --git a/libc/hdrgen/yaml/termios.yaml b/libc/utils/hdrgen/yaml/termios.yaml similarity index 100% rename from libc/hdrgen/yaml/termios.yaml rename to libc/utils/hdrgen/yaml/termios.yaml diff --git a/libc/hdrgen/yaml/threads.yaml b/libc/utils/hdrgen/yaml/threads.yaml similarity index 100% rename from libc/hdrgen/yaml/threads.yaml rename to libc/utils/hdrgen/yaml/threads.yaml diff --git a/libc/hdrgen/yaml/time.yaml b/libc/utils/hdrgen/yaml/time.yaml similarity index 100% rename from libc/hdrgen/yaml/time.yaml rename to libc/utils/hdrgen/yaml/time.yaml diff --git a/libc/hdrgen/yaml/uchar.yaml b/libc/utils/hdrgen/yaml/uchar.yaml similarity index 100% rename from libc/hdrgen/yaml/uchar.yaml rename to libc/utils/hdrgen/yaml/uchar.yaml diff --git a/libc/hdrgen/yaml/unistd.yaml b/libc/utils/hdrgen/yaml/unistd.yaml similarity index 100% rename from libc/hdrgen/yaml/unistd.yaml rename to libc/utils/hdrgen/yaml/unistd.yaml diff --git a/libc/hdrgen/yaml/wchar.yaml b/libc/utils/hdrgen/yaml/wchar.yaml similarity index 100% rename from libc/hdrgen/yaml/wchar.yaml rename to libc/utils/hdrgen/yaml/wchar.yaml diff --git a/libc/hdrgen/yaml_functions_sorted.py b/libc/utils/hdrgen/yaml_functions_sorted.py similarity index 100% rename from libc/hdrgen/yaml_functions_sorted.py rename to libc/utils/hdrgen/yaml_functions_sorted.py diff --git a/libc/hdrgen/yaml_to_classes.py b/libc/utils/hdrgen/yaml_to_classes.py similarity index 100% rename from libc/hdrgen/yaml_to_classes.py rename to libc/utils/hdrgen/yaml_to_classes.py