Skip to content

Commit 06c831d

Browse files
[libc] rename newhdrgen to just hdrgen (#118545)
Link: #117208 Fixes: #117254
1 parent d5ba143 commit 06c831d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+115
-121
lines changed

libc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if(LIBC_BUILD_GPU_LOADER OR ((NOT LLVM_RUNTIMES_BUILD) AND LLVM_LIBC_GPU_BUILD))
5757
return()
5858
endif()
5959

60-
add_subdirectory(newhdrgen)
60+
add_subdirectory(hdrgen)
6161

6262
option(LIBC_CMAKE_VERBOSE_LOGGING
6363
"Log details warnings and notifications during CMake configuration." OFF)

libc/cmake/modules/LLVMLibCHeaderRules.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function(add_gen_header target_name)
112112

113113
add_custom_command(
114114
OUTPUT ${out_file}
115-
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/newhdrgen/yaml_to_classes.py
115+
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py
116116
${yaml_file}
117117
--h_def_file ${def_file}
118118
${entry_points}
@@ -126,7 +126,7 @@ function(add_gen_header target_name)
126126
set(decl_out_file ${LIBC_INCLUDE_DIR}/llvm-libc-decls/${relative_path})
127127
add_custom_command(
128128
OUTPUT ${decl_out_file}
129-
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/newhdrgen/yaml_to_classes.py
129+
COMMAND ${Python3_EXECUTABLE} ${LIBC_SOURCE_DIR}/hdrgen/yaml_to_classes.py
130130
${yaml_file}
131131
--export-decls
132132
${entry_points}

libc/docs/dev/header_generation.rst

Lines changed: 30 additions & 36 deletions

libc/docs/dev/source_tree_layout.rst

Lines changed: 3 additions & 3 deletions

libc/hdrgen/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
if(LLVM_LIBC_FULL_BUILD)
2+
enable_testing()
3+
4+
set(NEWHDGEN_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
5+
set(TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR}/hdrgen/output)
6+
7+
add_test(
8+
NAME hdrgen_integration_test
9+
COMMAND python3 ${NEWHDGEN_TESTS_DIR}/test_integration.py --output_dir ${TEST_OUTPUT_DIR}
10+
)
11+
12+
add_custom_target(check-hdrgen
13+
COMMAND ${CMAKE_CTEST_COMMAND} -R hdrgen_integration_test --output-on-failure
14+
)
15+
16+
message(STATUS "Integration test for hdrgen added.")
17+
endif()
File renamed without changes.
File renamed without changes.

libc/newhdrgen/tests/test_integration.py renamed to libc/hdrgen/tests/test_integration.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class TestHeaderGenIntegration(unittest.TestCase):
1010
def setUp(self):
1111
self.output_dir = Path(
12-
args.output_dir if args.output_dir else "libc/newhdrgen/tests/output"
12+
args.output_dir if args.output_dir else "libc/hdrgen/tests/output"
1313
)
1414

1515
self.maxDiff = None
@@ -21,7 +21,7 @@ def run_script(self, yaml_file, h_def_file, output_dir, entry_points):
2121
h_def_file = self.source_dir / h_def_file
2222
command = [
2323
"python3",
24-
str(self.source_dir / "libc/newhdrgen/yaml_to_classes.py"),
24+
str(self.source_dir / "libc/hdrgen/yaml_to_classes.py"),
2525
str(yaml_file),
2626
"--h_def_file",
2727
str(h_def_file),
@@ -51,10 +51,10 @@ def compare_files(self, generated_file, expected_file):
5151
self.assertEqual(gen_content, exp_content)
5252

5353
def test_generate_header(self):
54-
yaml_file = "libc/newhdrgen/tests/input/test_small.yaml"
55-
h_def_file = "libc/newhdrgen/tests/input/test_small.h.def"
54+
yaml_file = "libc/hdrgen/tests/input/test_small.yaml"
55+
h_def_file = "libc/hdrgen/tests/input/test_small.h.def"
5656
expected_output_file = (
57-
self.source_dir / "libc/newhdrgen/tests/expected_output/test_header.h"
57+
self.source_dir / "libc/hdrgen/tests/expected_output/test_header.h"
5858
)
5959
output_file = self.output_dir / "test_small.h"
6060
entry_points = {"func_b", "func_a", "func_c", "func_d", "func_e"}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)