diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:31:57 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:33:27 +0900 |
commit | df025ebf872052c0761d44a3ef9b65e9675af8a8 (patch) | |
tree | 9b4e94583e2536546d6606270bcdf846c95e1ba2 /libc/docs/dev | |
parent | 4428c9d0b1344179f85a72e183a44796976521e3 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/loop.zip llvm-users/chapuni/cov/single/loop.tar.gz llvm-users/chapuni/cov/single/loop.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/loopusers/chapuni/cov/single/loop
Conflicts:
clang/lib/CodeGen/CoverageMappingGen.cpp
Diffstat (limited to 'libc/docs/dev')
-rw-r--r-- | libc/docs/dev/header_generation.rst | 27 | ||||
-rw-r--r-- | libc/docs/dev/source_tree_layout.rst | 10 |
2 files changed, 14 insertions, 23 deletions
diff --git a/libc/docs/dev/header_generation.rst b/libc/docs/dev/header_generation.rst index 2c586cc..a946106 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 "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute> + python3 libc/utils/hdrgen/yaml_to_classes.py + libc/include/[yaml_file.yaml] --add_function "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute> 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/include/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/include/[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 bd9d6ca..62c0434 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 --------------------- |