File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ add_clang_subdirectory(apinotes-test)
66if (CLANG_ENABLE_CIR)
77 add_clang_subdirectory(cir-opt)
88 add_clang_subdirectory(cir-translate)
9+ add_clang_subdirectory(cir-lsp-server)
910endif ()
1011add_clang_subdirectory(clang-diff)
1112add_clang_subdirectory(clang-format)
Original file line number Diff line number Diff line change 1+ get_property (dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
2+ get_property (conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
3+
4+ include_directories (${LLVM_MAIN_SRC_DIR} /../mlir/include )
5+ include_directories (${CMAKE_BINARY_DIR} /tools/mlir/include )
6+
7+ set (LIBS
8+ ${dialect_libs}
9+ ${conversion_libs}
10+ ${test_libs}
11+ clangCIR
12+ clangCIRLoweringDirectToLLVM
13+ MLIRCIR
14+ MLIRAffineAnalysis
15+ MLIRAnalysis
16+ MLIRDialect
17+ MLIRLspServerLib
18+ MLIRParser
19+ MLIRPass
20+ MLIRTransforms
21+ MLIRTransformUtils
22+ MLIRSupport
23+ MLIRIR
24+ )
25+
26+ add_mlir_tool(cir-lsp-server
27+ cir-lsp-server.cpp
28+
29+ DEPENDS
30+ ${LIBS}
31+ )
32+
33+ target_link_libraries (cir-lsp-server PRIVATE ${LIBS} )
34+ llvm_update_compile_flags(cir-lsp-server)
Original file line number Diff line number Diff line change 1+ // ===----------------------------------------------------------------------===//
2+ //
3+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+ // See https://llvm.org/LICENSE.txt for license information.
5+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+ //
7+ // ===----------------------------------------------------------------------===//
8+ //
9+ // A language server for ClangIR
10+ //
11+ // ===----------------------------------------------------------------------===//
12+
13+ #include " mlir/IR/Dialect.h"
14+ #include " mlir/IR/MLIRContext.h"
15+ #include " mlir/InitAllDialects.h"
16+ #include " mlir/Tools/mlir-lsp-server/MlirLspServerMain.h"
17+ #include " clang/CIR/Dialect/IR/CIRDialect.h"
18+
19+ int main (int argc, char **argv) {
20+ mlir::DialectRegistry registry;
21+ mlir::registerAllDialects (registry);
22+ registry.insert <cir::CIRDialect>();
23+ return failed (mlir::MlirLspServerMain (argc, argv, registry));
24+ }
You can’t perform that action at this time.
0 commit comments