| 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/Dialect/Func/IR/FuncOps.h" |
| 14 | #include "mlir/Dialect/LLVMIR/LLVMDialectDecl.h" |
| 15 | #include "mlir/Dialect/MemRef/IR/MemRef.h" |
| 16 | #include "mlir/IR/DialectRegistry.h" |
| 17 | #include "mlir/InitAllDialects.h" |
| 18 | #include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h" |
| 19 | #include "clang/CIR/InitAllDialects.h" |
| 20 | |
| 21 | int main(int argc, char **argv) { |
| 22 | mlir::DialectRegistry registry; |
| 23 | cir::registerAllDialects(registry); |
| 24 | registry.insert<mlir::memref::MemRefDialect, mlir::LLVM::LLVMDialect, |
| 25 | mlir::func::FuncDialect>(); |
| 26 | return failed(Result: mlir::MlirLspServerMain(argc, argv, registry)); |
| 27 | } |
| 28 |