[llvm] [mlir] [MLIR][IRDL] Added IRDL to C++ Translation (PR #133982)
Oleksandr Alex Zinenko via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 2 09:19:50 PDT 2025
=?utf-8?q?Théo?= Degioanni,=?utf-8?q?Théo?= Degioanni,
=?utf-8?q?Théo?= Degioanni,=?utf-8?q?Théo?= Degioanni,Ivan Ho
<ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,--set <--set>,Ivan Ho
<ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,=?utf-8?q?Théo?= Degioanni,
=?utf-8?q?Théo?= Degioanni,Ivan Ho <ihkh2 at cam.ac.uk>,
=?utf-8?q?Théo?= Degioanni,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho
<ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho
<38537881+hhkit at users.noreply.github.com>,=?utf-8?q?Théo?= Degioanni,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <38537881+hhkit at users.noreply.github.com>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan
Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>,
=?utf-8?q?Théo?= Degioanni,=?utf-8?q?Théo?= Degioanni,Ivan Ho
<ihkh2 at cam.ac.uk>,Ivan Ho <ihkh2 at cam.ac.uk>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/133982 at github.com>
================
@@ -0,0 +1,9 @@
+function(add_irdl_to_cpp_target target irdl_file)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${irdl_file}.cpp.inc
+ COMMAND ${MLIR_IRDL_TO_CPP_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/${irdl_file} -o ${CMAKE_CURRENT_BINARY_DIR}/${irdl_file}.cpp.inc
+ DEPENDS ${MLIR_IRDL_TO_CPP_TARGET} ${irdl_file}
+ COMMENT "Building ${irdl_file}..."
+ )
+ add_custom_target(${target} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${irdl_file}.cpp.inc)
----------------
ftynse wrote:
Do we really need both `add_custom_command` and `add_custom_target`? The latter has a `COMMAND` argument one can use directly.
I also see all tablegen'ed files explicitly marked as [`GENERATED'](https://cmake.org/cmake/help/v3.31/prop_sf/GENERATED.html#prop_sf:GENERATED) https://github.com/llvm/llvm-project/blob/84cb08e11866dda721e9a1b5a39c4e963fc36c32/mlir/cmake/modules/AddMLIR.cmake#L124-L125
https://github.com/llvm/llvm-project/pull/133982
More information about the llvm-commits
mailing list