[Mlir-commits] [mlir] ebc77f0 - [mlir:LSP] Link the test dialect into mlir-lsp-server

River Riddle llvmlistbot at llvm.org
Wed May 25 21:22:34 PDT 2022


Author: River Riddle
Date: 2022-05-25T20:54:27-07:00
New Revision: ebc77f012fb81da9b707446bf1f5a8651f59739e

URL: https://github.com/llvm/llvm-project/commit/ebc77f012fb81da9b707446bf1f5a8651f59739e
DIFF: https://github.com/llvm/llvm-project/commit/ebc77f012fb81da9b707446bf1f5a8651f59739e.diff

LOG: [mlir:LSP] Link the test dialect into mlir-lsp-server

This allows for more easily interacting with lit files that utilize
the test dialect.

Added: 
    

Modified: 
    mlir/tools/mlir-lsp-server/CMakeLists.txt
    mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-lsp-server/CMakeLists.txt b/mlir/tools/mlir-lsp-server/CMakeLists.txt
index 204c7aeac292..14aa12467615 100644
--- a/mlir/tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/tools/mlir-lsp-server/CMakeLists.txt
@@ -21,6 +21,7 @@ if(MLIR_INCLUDE_TESTS)
     MLIRTestPass
     MLIRTestReducer
     MLIRTestRewrite
+    MLIRTestTransformDialect
     MLIRTestTransforms
     )
 endif()

diff  --git a/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp b/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
index 05d6958e1342..ac62de0b4ab1 100644
--- a/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
+++ b/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp
@@ -13,8 +13,19 @@
 
 using namespace mlir;
 
+#ifdef MLIR_INCLUDE_TESTS
+namespace test {
+void registerTestDialect(DialectRegistry &);
+void registerTestTransformDialectExtension(DialectRegistry &);
+} // namespace test
+#endif
+
 int main(int argc, char **argv) {
   DialectRegistry registry;
   registerAllDialects(registry);
+#ifdef MLIR_INCLUDE_TESTS
+  ::test::registerTestDialect(registry);
+  ::test::registerTestTransformDialectExtension(registry);
+#endif
   return failed(MlirLspServerMain(argc, argv, registry));
 }


        


More information about the Mlir-commits mailing list