[all-commits] [llvm/llvm-project] f8ac31: Add a new AsmParserState class to capture detailed...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Apr 21 14:46:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8ac31314b4296ce8f33809154bc4ad726161e29
      https://github.com/llvm/llvm-project/commit/f8ac31314b4296ce8f33809154bc4ad726161e29
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-04-21 (Wed, 21 Apr 2021)

  Changed paths:
    M mlir/include/mlir/Parser.h
    A mlir/include/mlir/Parser/AsmParserState.h
    A mlir/lib/Parser/AsmParserState.cpp
    M mlir/lib/Parser/CMakeLists.txt
    M mlir/lib/Parser/DialectSymbolParser.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Parser/Parser.h
    M mlir/lib/Parser/ParserState.h

  Log Message:
  -----------
  Add a new AsmParserState class to capture detailed source information for .mlir files

This information isn't useful for general compilation, but is useful for building tools that process .mlir files. This class will be used in a followup to start building an LSP language server for MLIR.

Differential Revision: https://reviews.llvm.org/D100438


  Commit: 751c14fc4218e26426007f61725f673bee4e08be
      https://github.com/llvm/llvm-project/commit/751c14fc4218e26426007f61725f673bee4e08be
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-04-21 (Wed, 21 Apr 2021)

  Changed paths:
    A mlir/include/mlir/Tools/mlir-lsp-server/MlirLspServerMain.h
    M mlir/lib/CMakeLists.txt
    A mlir/lib/Tools/CMakeLists.txt
    A mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
    A mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp
    A mlir/lib/Tools/mlir-lsp-server/LSPServer.h
    A mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
    A mlir/lib/Tools/mlir-lsp-server/MLIRServer.h
    A mlir/lib/Tools/mlir-lsp-server/MlirLspServerMain.cpp
    A mlir/lib/Tools/mlir-lsp-server/lsp/Logging.cpp
    A mlir/lib/Tools/mlir-lsp-server/lsp/Logging.h
    A mlir/lib/Tools/mlir-lsp-server/lsp/Protocol.cpp
    A mlir/lib/Tools/mlir-lsp-server/lsp/Protocol.h
    A mlir/lib/Tools/mlir-lsp-server/lsp/Transport.cpp
    A mlir/lib/Tools/mlir-lsp-server/lsp/Transport.h
    M mlir/test/CMakeLists.txt
    M mlir/test/lit.cfg.py
    A mlir/test/mlir-lsp-server/definition.test
    A mlir/test/mlir-lsp-server/exit-eof.test
    A mlir/test/mlir-lsp-server/exit-with-shutdown.test
    A mlir/test/mlir-lsp-server/exit-without-shutdown.test
    A mlir/test/mlir-lsp-server/initialize-params-invalid.test
    A mlir/test/mlir-lsp-server/initialize-params.test
    A mlir/test/mlir-lsp-server/references.test
    M mlir/tools/CMakeLists.txt
    A mlir/tools/mlir-lsp-server/CMakeLists.txt
    A mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp

  Log Message:
  -----------
  [mlir][mlir-lsp] Add a new C++ LSP server for MLIR named mlir-lsp-server

This commits adds a basic LSP server for MLIR that supports resolving references and definitions. Several components of the setup are simplified to keep the size of this commit down, and will be built out in later commits. A followup commit will add a vscode language client that communicates with this server, paving the way for better IDE experience when interfacing with MLIR files.

The structure of this tool is similar to mlir-opt and mlir-translate, i.e. the implementation is structured as a library that users can call into to implement entry points that contain the dialects/passes that they are interested in.

Note: This commit contains several files, namely those in `mlir-lsp-server/lsp`, that have been copied from the LSP code in clangd and adapted for use in MLIR. This copying was decided as the best initial path forward (discussed offline by several stake holders in MLIR and clangd) given the different needs of our MLIR server, and the one for clangd. If a strong desire/need for unification arises in the future, the existence of these files in mlir-lsp-server can be reconsidered.

Differential Revision: https://reviews.llvm.org/D100439


  Commit: b810e3a552e2e0b66052370878d7885344469320
      https://github.com/llvm/llvm-project/commit/b810e3a552e2e0b66052370878d7885344469320
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-04-21 (Wed, 21 Apr 2021)

  Changed paths:
    A mlir/utils/vscode/.gitignore
    A mlir/utils/vscode/.vscode/launch.json
    A mlir/utils/vscode/.vscode/tasks.json
    A mlir/utils/vscode/.vscodeignore
    A mlir/utils/vscode/language-configuration.json
    A mlir/utils/vscode/package-lock.json
    A mlir/utils/vscode/package.json
    A mlir/utils/vscode/src/extension.ts
    A mlir/utils/vscode/tsconfig.json

  Log Message:
  -----------
  [mlir] Add a vscode language extension for MLIR

This utilizes the mlir-lsp server to provide language services for MLIR files opened in vscode. The extension currently supports syntax highlighting, as well as tracking definitions/uses/source locations for SSA values and blocks.

Differential Revision: https://reviews.llvm.org/D100607


  Commit: 52fad38d28c19d3ed2442ae53a63d56dd8c57f71
      https://github.com/llvm/llvm-project/commit/52fad38d28c19d3ed2442ae53a63d56dd8c57f71
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-04-21 (Wed, 21 Apr 2021)

  Changed paths:
    A mlir/docs/Tools/MLIRLSP.md
    A mlir/docs/includes/img/mlir-lsp-server-server_diagram.svg

  Log Message:
  -----------
  [mlir][mlir-lsp-server] Add some initial documentation on the MLIR LSP server

This covers some of the basic documentation, but is still missing some documentation/examples of features provided by the server. Feature documentation will be added in a followup.

Differential Revision: https://reviews.llvm.org/D100690


Compare: https://github.com/llvm/llvm-project/compare/7a718e163023...52fad38d28c1


More information about the All-commits mailing list