Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if( EXISTS ${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )

# If we've requested a custom binary directory, there are some otherwise
# optional tools which we want to ensure are present.
if( NOT TARGET libclc::llvm-spirv OR NOT TARGET libclc::libclc-remangler )
if( NOT TARGET llvm-spirv_target OR NOT TARGET libclc-remangler_target )
message( FATAL_ERROR "libclc toolchain incomplete!" )
endif()
endif()
Expand Down
9 changes: 5 additions & 4 deletions libclc/cmake/modules/AddLibclc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -449,20 +449,21 @@ function(add_libclc_builtin_set)
set( obj_suffix_mangled "${obj_suffix}")
endif()
# All permutations of [l32, l64] and [signed, unsigned]
get_host_tool_path(libclc-remangler LIBCLC_REMANGLER libclc-remangler_exe libclc-remangler_target)
foreach(long_width ${long_widths})
foreach(signedness ${char_signedness})
# Remangle
set( builtins_remangle_path
"${LIBCLC_LIBRARY_OUTPUT_INTDIR}/remangled-${long_width}-${signedness}_char.${obj_suffix_mangled}" )
add_custom_command( OUTPUT "${builtins_remangle_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBCLC_LIBRARY_OUTPUT_INTDIR}
COMMAND libclc::libclc-remangler
COMMAND ${libclc-remangler_exe}
-o "${builtins_remangle_path}"
--long-width=${long_width}
--char-signedness=${signedness}
--input-ir=${builtins_lib}
${dummy_in}
DEPENDS ${builtins_lib} libclc::libclc-remangler ${dummy_in})
DEPENDS ${builtins_lib} ${libclc-remangler_target} ${dummy_in})
add_custom_target( "remangled-${long_width}-${signedness}_char.${obj_suffix_mangled}" ALL
DEPENDS "${builtins_remangle_path}" "${dummy_in}")
set_target_properties("remangled-${long_width}-${signedness}_char.${obj_suffix_mangled}"
Expand All @@ -489,12 +490,12 @@ function(add_libclc_builtin_set)
math(EXPR libclc-remangler-test-no "${libclc-remangler-test-no}+1")
set(current-test "libclc-remangler-test-${obj_suffix}-${libclc-remangler-test-no}")
add_custom_target(${current-test}
COMMAND libclc::libclc-remangler
COMMAND ${libclc-remangler_exe}
--long-width=l32
--char-signedness=signed
--input-ir=${target-ir}
${dummy_in} -t -o -
DEPENDS ${builtins_lib} "${dummy_in}" libclc::libclc-remangler)
DEPENDS ${builtins_lib} "${dummy_in}" ${libclc-remangler_target})
list(APPEND libclc-remangler-tests ${current-test})
endforeach()
endif()
Expand Down
6 changes: 1 addition & 5 deletions libclc/utils/libclc-remangler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ clang_target_link_libraries(libclc-remangler
LLVMOption
)

# If we've not already imported a libclc-remangler tool from an external build,
# set it up now.
if(NOT TARGET libclc::libclc-remangler)
add_executable(libclc::libclc-remangler ALIAS libclc-remangler)
endif()
setup_host_tool(libclc-remangler LIBCLC_REMANGLER libclc-remangler_exe libclc-remangler_target)