[mlir][Tablegen-LSP] Add support for a compilation database
authorRiver Riddle <riddleriver@gmail.com>
Mon, 9 May 2022 22:05:03 +0000 (15:05 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Fri, 27 May 2022 09:39:49 +0000 (02:39 -0700)
commitdc9fb65c4ffedc983c29bb0cddebf6fc4e9146e6
treee28e56ab8edc56d920f08aa61d931e5f9edff477
parent786c687810a5e3db4c64312018de25c65527c40c
[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
15 files changed:
mlir/cmake/modules/AddMLIR.cmake
mlir/lib/Tools/lsp-server-support/CMakeLists.txt
mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp [moved from mlir/lib/Tools/mlir-pdll-lsp-server/CompilationDatabase.cpp with 61% similarity]
mlir/lib/Tools/lsp-server-support/CompilationDatabase.h [moved from mlir/lib/Tools/mlir-pdll-lsp-server/CompilationDatabase.h with 61% similarity]
mlir/lib/Tools/mlir-pdll-lsp-server/CMakeLists.txt
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
mlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp
mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
mlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
mlir/test/tblgen-lsp-server/compilation_database.test [new file with mode: 0644]
mlir/test/tblgen-lsp-server/include/included.td [new file with mode: 0644]
mlir/test/tblgen-lsp-server/lit.local.cfg [new file with mode: 0644]
mlir/utils/vscode/package.json
mlir/utils/vscode/src/config.ts
mlir/utils/vscode/src/mlirContext.ts