[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur reopened 
https://github.com/llvm/llvm-project/pull/89746
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89746

>From 61ffad5a99c584ddb05a32b5d5bf54ecbf6c774b Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 21 May 2024 22:32:39 +0200
Subject: [PATCH 1/2] [libclc] Revise IDE folder structure

---
 libclc/CMakeLists.txt| 13 -
 libclc/cmake/modules/AddLibclc.cmake |  5 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 5ce1795243085..bacc0d83ba211 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 3.20.0)
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX C)
+set(LLVM_SUBPROJECT_TITLE "libclc")
 
 set(CMAKE_CXX_STANDARD 17)
 
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL 
CMAKE_CURRENT_SOURCE_DI
 foreach( tool IN ITEMS clang llvm-as llvm-link opt )
   find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} 
NO_DEFAULT_PATH )
   add_executable( libclc::${tool} IMPORTED GLOBAL )
-  set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION 
${LLVM_TOOL_${tool}} )
+  set_target_properties( libclc::${tool} PROPERTIES
+IMPORTED_LOCATION ${LLVM_TOOL_${tool}}
+FOLDER "libclc/Tools"
+  )
 endforeach()
   endif()
 else()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
 else()
   add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
 endif()
+set_target_properties( prepare_builtins PROPERTIES FOLDER "libclc/Codegenning")
 target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
 # These were not properly reported in early LLVM and we don't need them
 target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "generate_convert.cl" DEPENDS convert.cl )
+set_target_properties( "generate_convert.cl" PROPERTIES FOLDER 
"libclc/Codegenning" )
 
 add_custom_command(
   OUTPUT clspv-convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
+set_target_properties( "clspv-generate_convert.cl" PROPERTIES FOLDER 
"libclc/Codegenning" )
 
 enable_testing()
 
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 DEPENDS ${builtins_link_lib}
   )
   add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" )
+  set_target_properties( "prepare-${spv_suffix}" PROPERTIES FOLDER 
"libclc/Codegenning" )
   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
  DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
 else()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
   )
   set_target_properties( ${builtins_opt_lib_tgt}
 PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc
+   FOLDER "libclc/Device IR/Opt"
   )
 
   set( builtins_opt_lib 
$ )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
 DEPENDS ${builtins_opt_lib} prepare_builtins )
   add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
+  set_target_properties( "prepare-${obj_suffix}" PROPERTIES FOLDER 
"libclc/Device IR/Prepare" )
 
   # nvptx-- targets don't include workitem builtins
   if( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 add_custom_target( ${alias_suffix} ALL
   COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} 
${alias_suffix}
   DEPENDS prepare-${obj_suffix} )
+set_target_properties( "${alias_suffix}" PROPERTIES FOLDER 
"libclc/Device IR/Aliases" )
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION 
"${CMAKE_INSTALL_DATADIR}/clc" )
   endforeach( a )
 endif()
diff --git a/libclc/cmake/modules/AddLibclc.cmake 
b/libclc/cmake/modules/AddLibclc.cmake
index 7f4620fa6a21d..0276c145ff20a 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -110,7 +110,10 @@ function(link_bc)
   )
 
   add_custom_target( ${ARG_TARGET} ALL DEPENDS ${ARG_TARGET}.bc )
-  set_target_properties( ${ARG_TARGET} PROPERTIES TARGET_FILE ${ARG_TARGET}.bc 
)
+  set_target_properties( ${ARG_TARGET} PROPERTIES
+TARGET_FILE ${ARG_TARGET}.bc
+FOLDER "libclc/Device IR/Linking"
+  )
 endfunction()
 
 # Decomposes and returns variables based on a libclc triple and architecture

>From 015bf75aa9277c516b229e3c7412470da70b2d8b Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Sat, 25 May 2024 13:36:12 +0200
Subject: [PATCH 2/2] Address review from #89750

---
 libclc/CMakeLists.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff 

[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89746
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89746

>From 61ffad5a99c584ddb05a32b5d5bf54ecbf6c774b Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 21 May 2024 22:32:39 +0200
Subject: [PATCH] [libclc] Revise IDE folder structure

---
 libclc/CMakeLists.txt| 13 -
 libclc/cmake/modules/AddLibclc.cmake |  5 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 5ce1795243085..bacc0d83ba211 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 3.20.0)
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX C)
+set(LLVM_SUBPROJECT_TITLE "libclc")
 
 set(CMAKE_CXX_STANDARD 17)
 
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL 
CMAKE_CURRENT_SOURCE_DI
 foreach( tool IN ITEMS clang llvm-as llvm-link opt )
   find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} 
NO_DEFAULT_PATH )
   add_executable( libclc::${tool} IMPORTED GLOBAL )
-  set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION 
${LLVM_TOOL_${tool}} )
+  set_target_properties( libclc::${tool} PROPERTIES
+IMPORTED_LOCATION ${LLVM_TOOL_${tool}}
+FOLDER "libclc/Tools"
+  )
 endforeach()
   endif()
 else()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
 else()
   add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
 endif()
+set_target_properties( prepare_builtins PROPERTIES FOLDER "libclc/Codegenning")
 target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
 # These were not properly reported in early LLVM and we don't need them
 target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "generate_convert.cl" DEPENDS convert.cl )
+set_target_properties( "generate_convert.cl" PROPERTIES FOLDER 
"libclc/Codegenning" )
 
 add_custom_command(
   OUTPUT clspv-convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
+set_target_properties( "clspv-generate_convert.cl" PROPERTIES FOLDER 
"libclc/Codegenning" )
 
 enable_testing()
 
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 DEPENDS ${builtins_link_lib}
   )
   add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" )
+  set_target_properties( "prepare-${spv_suffix}" PROPERTIES FOLDER 
"libclc/Codegenning" )
   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
  DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
 else()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
   )
   set_target_properties( ${builtins_opt_lib_tgt}
 PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc
+   FOLDER "libclc/Device IR/Opt"
   )
 
   set( builtins_opt_lib 
$ )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
 DEPENDS ${builtins_opt_lib} prepare_builtins )
   add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
+  set_target_properties( "prepare-${obj_suffix}" PROPERTIES FOLDER 
"libclc/Device IR/Prepare" )
 
   # nvptx-- targets don't include workitem builtins
   if( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 add_custom_target( ${alias_suffix} ALL
   COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} 
${alias_suffix}
   DEPENDS prepare-${obj_suffix} )
+set_target_properties( "${alias_suffix}" PROPERTIES FOLDER 
"libclc/Device IR/Aliases" )
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION 
"${CMAKE_INSTALL_DATADIR}/clc" )
   endforeach( a )
 endif()
diff --git a/libclc/cmake/modules/AddLibclc.cmake 
b/libclc/cmake/modules/AddLibclc.cmake
index 7f4620fa6a21d..0276c145ff20a 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -110,7 +110,10 @@ function(link_bc)
   )
 
   add_custom_target( ${ARG_TARGET} ALL DEPENDS ${ARG_TARGET}.bc )
-  set_target_properties( ${ARG_TARGET} PROPERTIES TARGET_FILE ${ARG_TARGET}.bc 
)
+  set_target_properties( ${ARG_TARGET} PROPERTIES
+TARGET_FILE ${ARG_TARGET}.bc
+FOLDER "libclc/Device IR/Linking"
+  )
 endfunction()
 
 # Decomposes and returns variables based on a libclc triple and architecture

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89746
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libclc] [libclc] Revise IDE folder structure (PR #89746)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89746

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the libclc part. See #89153 for the entire series and 
motivation.

Update the folder titles for targets in the monorepository that have not seen 
taken care of for some time. These are the folders that targets are organized 
in Visual Studio and XCode (`set_property(TARGET  PROPERTY FOLDER 
"")`) when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically 
deduce the folder. This reduces the number of 
`set_property`/`set_target_property`, but are still necessary when 
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A 
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root 
CMakeLists.txt.

>From 24ed445050def3e41569cc25bc04dd3dc107c04f Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:25:53 +0200
Subject: [PATCH] [libclc] Revise IDE folder structure

---
 libclc/CMakeLists.txt| 13 -
 libclc/cmake/modules/AddLibclc.cmake |  5 -
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 5ce17952430854..05e0061d42298a 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 3.20.0)
 
 project( libclc VERSION 0.2.0 LANGUAGES CXX C)
+set(LLVM_SUBPROJECT_TITLE "libclc")
 
 set(CMAKE_CXX_STANDARD 17)
 
@@ -54,7 +55,10 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL 
CMAKE_CURRENT_SOURCE_DI
 foreach( tool IN ITEMS clang llvm-as llvm-link opt )
   find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} 
NO_DEFAULT_PATH )
   add_executable( libclc::${tool} IMPORTED GLOBAL )
-  set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION 
${LLVM_TOOL_${tool}} )
+  set_target_properties( libclc::${tool} PROPERTIES
+IMPORTED_LOCATION ${LLVM_TOOL_${tool}}
+FOLDER "libclc/Tools"
+  )
 endforeach()
   endif()
 else()
@@ -168,6 +172,7 @@ if( LIBCLC_STANDALONE_BUILD )
 else()
   add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
 endif()
+set_target_properties( prepare_builtins PROPERTIES FOLDER 
"libclc/Tablegenning")
 target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
 # These were not properly reported in early LLVM and we don't need them
 target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
@@ -225,12 +230,14 @@ add_custom_command(
   COMMAND ${Python3_EXECUTABLE} ${script_loc} > convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "generate_convert.cl" DEPENDS convert.cl )
+set_target_properties( "generate_convert.cl" PROPERTIES FOLDER 
"libclc/Tablegenning" )
 
 add_custom_command(
   OUTPUT clspv-convert.cl
   COMMAND ${Python3_EXECUTABLE} ${script_loc} --clspv > clspv-convert.cl
   DEPENDS ${script_loc} )
 add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
+set_target_properties( "clspv-generate_convert.cl" PROPERTIES FOLDER 
"libclc/Tablegenning" )
 
 enable_testing()
 
@@ -394,6 +401,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 DEPENDS ${builtins_link_lib}
   )
   add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" )
+  set_target_properties( "prepare-${spv_suffix}" PROPERTIES FOLDER 
"libclc/Tablegenning" )
   install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
  DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
 else()
@@ -410,6 +418,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
   )
   set_target_properties( ${builtins_opt_lib_tgt}
 PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc
+   FOLDER "libclc/BC Genning"
   )
 
   set( builtins_opt_lib 
$ )
@@ -420,6 +429,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
 DEPENDS ${builtins_opt_lib} prepare_builtins )
   add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
+  set_target_properties( "prepare-${obj_suffix}" PROPERTIES FOLDER 
"libclc/BC Genning" )
 
   # nvptx-- targets don't include workitem builtins
   if( NOT clang_triple MATCHES ".*ptx.*--$" )
@@ -434,6 +444,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
 add_custom_target( ${alias_suffix} ALL
   COMMAND ${CMAKE_COMMAND} -E create_symlink ${obj_suffix} 
${alias_suffix}
   DEPENDS prepare-${obj_suffix} )
+set_target_properties( "${alias_suffix}" PROPERTIES FOLDER "libclc/BC 
Genning" )
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${alias_suffix} DESTINATION 
"${CMAKE_INSTALL_DATADIR}/clc" )