[mlir][tblgen] Refact mlir-tblgen main into its own library
authorMarkus Böck <markus.boeck02@gmail.com>
Wed, 3 Aug 2022 21:43:41 +0000 (23:43 +0200)
committerMarkus Böck <markus.boeck02@gmail.com>
Sat, 6 Aug 2022 12:07:37 +0000 (14:07 +0200)
commit1c5a50e32815a49a41d79ff529ca8611ee49c5c8
treec78c1b736f0f442e6a4d10f99746eb3b66882e8c
parentc59c8a515f54e262ececfd1056d402212117f22c
[mlir][tblgen] Refact mlir-tblgen main into its own library

This has previously been done for `mlir-opt` and `mlir-reduce` and roughly the same approach has been done here.

The use case for having a separate library is that it is easier for downstream to make custom TableGen backends/executable that work on top of the utilities that are defined in `mlir/TableGen`.
The customization point here is the same one as for any upstream TableGen backends: One can add a new generator by simply creating a global instance of `mlir::GenRegistration`.

Differential Revision: https://reviews.llvm.org/D131112
mlir/include/mlir/Tools/mlir-tblgen/MlirTblgenMain.h [new file with mode: 0644]
mlir/lib/TableGen/CMakeLists.txt
mlir/lib/TableGen/GenInfo.cpp [new file with mode: 0644]
mlir/lib/Tools/CMakeLists.txt
mlir/lib/Tools/mlir-tblgen/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Tools/mlir-tblgen/MlirTblgenMain.cpp [new file with mode: 0644]
mlir/tools/mlir-tblgen/CMakeLists.txt
mlir/tools/mlir-tblgen/mlir-tblgen.cpp