forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Add fir-lsp-server (llvm#114059)
This patch adds a fir-lsp-server tool for editor support for editing fir files, using the existing MLIR lsp server support. See https://mlir.llvm.org/docs/Tools/MLIRLSP/ for more information.
- Loading branch information
1 parent
95c2d79
commit dda20ea
Showing
3 changed files
with
27 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(LLVM_LINK_COMPONENTS | ||
Core | ||
Support | ||
AsmParser | ||
) | ||
|
||
add_flang_tool(fir-lsp-server fir-lsp-server.cpp) | ||
|
||
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS) | ||
target_link_libraries(fir-lsp-server PRIVATE | ||
CUFDialect | ||
FIRDialect | ||
HLFIRDialect | ||
MLIRLspServerLib | ||
${dialect_libs} | ||
${extension_libs}) |
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,9 @@ | ||
#include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h" | ||
#include "flang/Optimizer/Support/InitFIR.h" | ||
|
||
int main(int argc, char **argv) { | ||
mlir::DialectRegistry registry; | ||
fir::support::registerNonCodegenDialects(registry); | ||
fir::support::addFIRExtensions(registry); | ||
return mlir::failed(mlir::MlirLspServerMain(argc, argv, registry)); | ||
} |