-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change introduces the tool `ttmlir-lsp-server`. It will fall under `build/bin`, and is built alongside the rest of the compiler via `cmake --build build`. This is a language server that should be used alongside your IDE/Text editor to give you IDE like features while editing .mlir files. For more info, please see https://mlir.llvm.org/docs/Tools/MLIRLSP/ Closes #1383
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
add_subdirectory(ttmlir-opt) | ||
add_subdirectory(ttmlir-lsp-server) | ||
add_subdirectory(ttmlir-translate) | ||
add_subdirectory(explorer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) | ||
get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS) | ||
|
||
set(LIBS ${dialect_libs} ${conversion_libs} ${extension_libs} | ||
MLIROptLib | ||
MLIRTargetCpp | ||
TTMLIRStatic | ||
MLIRLspServerLib | ||
) | ||
|
||
add_llvm_executable(ttmlir-lsp-server ttmlir-lsp-server.cpp DISABLE_LLVM_LINK_LLVM_DYLIB) | ||
llvm_update_compile_flags(ttmlir-lsp-server) | ||
target_link_libraries(ttmlir-lsp-server PRIVATE ${LIBS}) | ||
|
||
mlir_check_all_link_libraries(ttmlir-lsp-server) | ||
|
||
install(TARGETS ttmlir-lsp-server DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Test EXCLUDE_FROM_ALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "mlir/InitAllDialects.h" | ||
#include "ttmlir/RegisterAll.h" | ||
|
||
#include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h" | ||
|
||
int main(int argc, char **argv) { | ||
mlir::DialectRegistry registry; | ||
mlir::tt::registerAllDialects(registry); | ||
|
||
return mlir::failed(mlir::MlirLspServerMain(argc, argv, registry)); | ||
} |