Skip to content

Commit 829226d

Browse files
Revert "[libc] Disable old headergen checks unless enabled (#104522)"
This reverts commit f668708.
1 parent 89a1f14 commit 829226d

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

libc/CMakeLists.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,31 @@ set(LIBC_NAMESPACE ${default_namespace}
5050
CACHE STRING "The namespace to use to enclose internal implementations. Must start with '__llvm_libc'."
5151
)
5252

53-
option(LIBC_USE_NEW_HEADER_GEN "Generate header files using new headergen instead of the old one" ON)
5453

55-
if(LIBC_USE_NEW_HEADER_GEN)
56-
add_subdirectory(newhdrgen)
57-
else()
58-
if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD)
59-
if(NOT LIBC_HDRGEN_EXE)
60-
# We need to set up hdrgen first since other targets depend on it.
61-
add_subdirectory(utils/LibcTableGenUtil)
62-
add_subdirectory(utils/HdrGen)
63-
# Calling add_tablegen sets variables like LIBC_TABLEGEN_EXE in
64-
# PARENT_SCOPE which get lost until saved in the cache.
65-
set(LIBC_TABLEGEN_EXE "${LIBC_TABLEGEN_EXE}" CACHE INTERNAL "")
66-
set(LIBC_TABLEGEN_TARGET "${LIBC_TABLEGEN_TARGET}" CACHE INTERNAL "")
67-
else()
68-
message(STATUS "Will use ${LIBC_HDRGEN_EXE} for libc header generation.")
69-
endif()
54+
add_subdirectory(newhdrgen)
55+
56+
57+
if(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD)
58+
if(NOT LIBC_HDRGEN_EXE)
59+
# We need to set up hdrgen first since other targets depend on it.
60+
add_subdirectory(utils/LibcTableGenUtil)
61+
add_subdirectory(utils/HdrGen)
62+
# Calling add_tablegen sets variables like LIBC_TABLEGEN_EXE in
63+
# PARENT_SCOPE which get lost until saved in the cache.
64+
set(LIBC_TABLEGEN_EXE "${LIBC_TABLEGEN_EXE}" CACHE INTERNAL "")
65+
set(LIBC_TABLEGEN_TARGET "${LIBC_TABLEGEN_TARGET}" CACHE INTERNAL "")
66+
else()
67+
message(STATUS "Will use ${LIBC_HDRGEN_EXE} for libc header generation.")
7068
endif()
7169
endif()
72-
7370
# We will build the GPU utilities if we are not doing a runtimes build.
7471
option(LIBC_BUILD_GPU_LOADER "Always build the GPU loader utilities" OFF)
7572
if(LIBC_BUILD_GPU_LOADER OR (LLVM_LIBC_GPU_BUILD AND NOT LLVM_RUNTIMES_BUILD))
7673
add_subdirectory(utils/gpu)
7774
endif()
7875

76+
option(LIBC_USE_NEW_HEADER_GEN "Generate header files using new headergen instead of the old one" ON)
77+
7978
set(NEED_LIBC_HDRGEN FALSE)
8079
if(NOT LLVM_RUNTIMES_BUILD)
8180
if("libc" IN_LIST LLVM_ENABLE_RUNTIMES)

libc/include/CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,21 +420,19 @@ add_header_macro(
420420
.llvm-libc-types.posix_spawn_file_actions_t
421421
)
422422

423-
add_header_macro(
423+
add_gen_header(
424424
link
425-
../libc/newhdrgen/yaml/link.yaml
426-
link.h.def
427-
link.h
425+
DEF_FILE link.h.def
426+
GEN_HDR link.h
428427
DEPENDS
429428
.llvm_libc_common_h
430429
.llvm-libc-macros.link_macros
431430
)
432431

433-
add_header_macro(
432+
add_gen_header(
434433
elf
435-
../libc/newhdrgen/yaml/elf.yaml
436-
elf.h.def
437-
elf.h
434+
DEF_FILE elf.h.def
435+
GEN_HDR elf.h
438436
DEPENDS
439437
.llvm-libc-macros.elf_macros
440438
)

llvm/runtimes/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,7 @@ if(build_runtimes)
521521
endforeach()
522522
endif()
523523
if("libc" IN_LIST LLVM_ENABLE_PROJECTS AND
524-
(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD) AND
525-
(NOT LIBC_USE_NEW_HEADER_GEN))
524+
(LLVM_LIBC_FULL_BUILD OR LLVM_LIBC_GPU_BUILD))
526525
if(LIBC_HDRGEN_EXE)
527526
set(hdrgen_exe ${LIBC_HDRGEN_EXE})
528527
else()

0 commit comments

Comments
 (0)