@@ -44,15 +44,15 @@ To add through the command line:
44
44
45
45
.. code-block :: none
46
46
47
- python3 libc/hdrgen/yaml_to_classes.py
48
- libc/hdrgen/yaml/[yaml_file.yaml] --add_function "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute>
47
+ python3 libc/utils/ hdrgen/yaml_to_classes.py
48
+ libc/utils/ hdrgen/yaml/[yaml_file.yaml] --add_function "<return_type>" <function_name> "<function_arg1, function_arg2>" <standard> <guard> <attribute>
49
49
50
50
Example:
51
51
52
52
.. code-block :: none
53
53
54
- python3 libc/hdrgen/yaml_to_classes.py
55
- libc/hdrgen/yaml/ctype.yaml --add_function "char" example_function
54
+ python3 libc/utils/ hdrgen/yaml_to_classes.py
55
+ libc/utils/ hdrgen/yaml/ctype.yaml --add_function "char" example_function
56
56
"int, void, const void" stdc example_float example_attribute
57
57
58
58
Keep in mind only the return_type and arguments have quotes around them. If
@@ -62,7 +62,8 @@ To add through the command line:
62
62
generated header file with the new addition in the hdrgen directory to
63
63
examine.
64
64
65
- If you want to sort the functions alphabetically you can check out libc/hdrgen/yaml_functions_sorted.py.
65
+ If you want to sort the functions alphabetically you can check out
66
+ libc/utils/hdrgen/yaml_functions_sorted.py.
66
67
67
68
68
69
Testing
@@ -75,10 +76,10 @@ ensures the process of YAML to classes to generate headers works properly. If
75
76
there are any new additions on formatting headers, make sure the test is
76
77
updated with the specific addition.
77
78
78
- Integration Test can be found in: ``libc/hdrgen/tests/test_integration.py ``
79
+ Integration Test can be found in: ``libc/utils/ hdrgen/tests/test_integration.py ``
79
80
80
81
File to modify if adding something to formatting:
81
- ``libc/hdrgen/tests/expected_output/test_header.h ``
82
+ ``libc/utils/ hdrgen/tests/expected_output/test_header.h ``
82
83
83
84
84
85
Common Errors
@@ -89,7 +90,7 @@ Common Errors
89
90
90
91
.. code-block :: none
91
92
92
- "/llvm-project/libc/hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"]
93
+ "/llvm-project/libc/utils/ hdrgen/yaml_to_classes.py", line 67, in yaml_to_classes function_data["return_type"]
93
94
94
95
If you receive this error or any error pertaining to
95
96
``function_data[function_specific_component] `` while building the headers
@@ -117,7 +118,7 @@ Common Errors
117
118
missing. Ensure the correct style and required files are present:
118
119
119
120
| ``[header_name]``
120
- | ``[../libc/hdrgen/yaml/[yaml_file.yaml]``
121
+ | ``[../libc/utils/ hdrgen/yaml/[yaml_file.yaml]``
121
122
| ``[header_name.h.def]``
122
123
| ``[header_name.h]``
123
124
| ``DEPENDS``
@@ -147,13 +148,13 @@ Common Errors
147
148
148
149
.. code-block :: none
149
150
150
- File "/llvm-project/libc/hdrgen/header.py", line 60, in __str__ for
151
+ File "/llvm-project/libc/utils/ hdrgen/header.py", line 60, in __str__ for
151
152
function in self.functions: AttributeError: 'HeaderFile' object has no
152
153
attribute 'functions'
153
154
154
155
When running ``ninja libc `` in the build directory to generate headers you
155
156
may receive the error above. Essentially this means that in
156
- ``libc/hdrgen/header.py `` there is a missing attribute named functions.
157
+ ``libc/utils/ hdrgen/header.py `` there is a missing attribute named functions.
157
158
Make sure all function components are defined within this file and there are
158
159
no missing functions to add these components.
159
160
@@ -184,12 +185,12 @@ Common Errors
184
185
Sometimes the integration test will fail but that
185
186
still means the process is working unless the comparison between the output
186
187
and expected_output is not showing. If that is the case make sure in
187
- ``libc/hdrgen/tests/test_integration.py `` there are no missing arguments
188
+ ``libc/utils/ hdrgen/tests/test_integration.py `` there are no missing arguments
188
189
that run through the script.
189
190
190
191
If the integration tests are failing due to mismatching of lines or small
191
192
errors in spacing that is nothing to worry about. If this is happening while
192
193
you are making a new change to the formatting of the headers, then
193
194
ensure the expected output file
194
- ``libc/hdrgen/tests/expected_output/test_header.h `` has the changes you
195
+ ``libc/utils/ hdrgen/tests/expected_output/test_header.h `` has the changes you
195
196
are applying.
0 commit comments