[clangd] Minimal implementation of automatic static index (not enabled).
authorSam McCall <sam.mccall@gmail.com>
Mon, 15 Oct 2018 13:34:10 +0000 (13:34 +0000)
committerSam McCall <sam.mccall@gmail.com>
Mon, 15 Oct 2018 13:34:10 +0000 (13:34 +0000)
commit8dc9dbb61af4cd2bad8401f24c67e47bb055a64d
treef70aa57c2f4564e8b4a39b0d3de2c593d506609a
parent5abb607ebe1f44cfe78e62a782d6c7451e4fd2d5
[clangd] Minimal implementation of automatic static index (not enabled).

Summary:
See tinyurl.com/clangd-automatic-index for design and goals.

Lots of limitations to keep this patch smallish, TODOs everywhere:
 - no serialization to disk
 - no changes to dynamic index, which now has a much simpler job
 - no partitioning of symbols by file to avoid duplication of header symbols
 - no reindexing of edited files
 - only a single worker thread
 - compilation database is slurped synchronously (doesn't scale)
 - uses memindex, rebuilds after every file (should be dex, periodically)

It's not hooked up to ClangdServer/ClangdLSPServer yet: the layering
isn't clear (it should really be in ClangdServer, but ClangdLSPServer
has all the CDB interactions).

Reviewers: ioeric

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits

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

llvm-svn: 344513
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/index/Background.cpp [new file with mode: 0644]
clang-tools-extra/clangd/index/Background.h [new file with mode: 0644]
clang-tools-extra/unittests/clangd/BackgroundIndexTests.cpp [new file with mode: 0644]
clang-tools-extra/unittests/clangd/CMakeLists.txt
clang-tools-extra/unittests/clangd/SyncAPI.cpp
clang-tools-extra/unittests/clangd/SyncAPI.h