[all-commits] [llvm/llvm-project] dc9fb6: [mlir][Tablegen-LSP] Add support for a compilation...

River Riddle via All-commits all-commits at lists.llvm.org
Fri May 27 02:40:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dc9fb65c4ffedc983c29bb0cddebf6fc4e9146e6
      https://github.com/llvm/llvm-project/commit/dc9fb65c4ffedc983c29bb0cddebf6fc4e9146e6
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-27 (Fri, 27 May 2022)

  Changed paths:
    M mlir/cmake/modules/AddMLIR.cmake
    M mlir/lib/Tools/lsp-server-support/CMakeLists.txt
    A mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp
    A mlir/lib/Tools/lsp-server-support/CompilationDatabase.h
    M mlir/lib/Tools/mlir-pdll-lsp-server/CMakeLists.txt
    R mlir/lib/Tools/mlir-pdll-lsp-server/CompilationDatabase.cpp
    R mlir/lib/Tools/mlir-pdll-lsp-server/CompilationDatabase.h
    M mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
    A mlir/test/tblgen-lsp-server/compilation_database.test
    A mlir/test/tblgen-lsp-server/include/included.td
    A mlir/test/tblgen-lsp-server/lit.local.cfg
    M mlir/utils/vscode/package.json
    M mlir/utils/vscode/src/config.ts
    M mlir/utils/vscode/src/mlirContext.ts

  Log Message:
  -----------
  [mlir][Tablegen-LSP] Add support for a compilation database

This provides a format for externally specifying the include directories
for a source file. The format of the tablegen database is exactly the
same as that for PDLL, namely it includes the absolute source file name and
the set of include directories. The database format is shared to simplify
the infra, and also because the format itself is general enough to share. Even
if we desire to expand in the future to contain the actual compilation command,
nothing there is specific enough that we would need two different formats.

As with PDLL, support for generating the database is added to our mlir_tablegen
cmake command.

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


  Commit: 682ca00e218d60fef49936a38f174e54e85886cb
      https://github.com/llvm/llvm-project/commit/682ca00e218d60fef49936a38f174e54e85886cb
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-27 (Fri, 27 May 2022)

  Changed paths:
    M mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp
    M mlir/lib/Tools/lsp-server-support/SourceMgrUtils.h
    M mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
    A mlir/test/tblgen-lsp-server/document-links.test
    A mlir/test/tblgen-lsp-server/hover.test
    M mlir/test/tblgen-lsp-server/initialize-params.test

  Log Message:
  -----------
  [mlir][Tablegen-LSP] Add support for include file link and hover

This allows for following links to include files. This support is effectively
identical to the logic in the PDLL language server, and code is shared as
much as possible.

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


  Commit: 8d021670c31dcb760ad3d301eb5fdfdf38733324
      https://github.com/llvm/llvm-project/commit/8d021670c31dcb760ad3d301eb5fdfdf38733324
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-05-27 (Fri, 27 May 2022)

  Changed paths:
    M mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
    M mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
    A mlir/test/tblgen-lsp-server/definition.test
    M mlir/test/tblgen-lsp-server/initialize-params.test
    A mlir/test/tblgen-lsp-server/references.test

  Log Message:
  -----------
  [mlir][Tablegen-LSP] Add support for a tracking definitions and references

This essentially builds an index for the parsed records and record values (fields).
This covers quite a few cases, but is limited by the currently lackluster location
tracking in tablegen. A followup will work on plumbing more locations through
tablegen, which should greatly improve what we can do here.

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


Compare: https://github.com/llvm/llvm-project/compare/786c687810a5...8d021670c31d


More information about the All-commits mailing list