[clangd] Move DirBasedCDB broadcasting onto its own thread.
authorSam McCall <sam.mccall@gmail.com>
Wed, 13 Jan 2021 14:31:20 +0000 (15:31 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 20 Jan 2021 10:22:55 +0000 (11:22 +0100)
commitde4ba7073bd7e200aca704e6a26403e07bc246a5
tree2920fba26f674e80a7f3175b65eaa3781c08b04e
parent536a1b0ea21163eaee53652c527ea20cf45bc675
[clangd] Move DirBasedCDB broadcasting onto its own thread.

This is on the critical path (it blocks getting the compile command for
the first file).

It's not trivially fast: it involves processing all filenames in the CDB
and doing some IO to look for shadowing CDBs.

And we may make this slower soon - making CDB configurable implies evaluating
the config for each listed to see which ones really are owned by the
broadcasted CDB.

Differential Revision: https://reviews.llvm.org/D94606
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
clang-tools-extra/clangd/GlobalCompilationDatabase.h
clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp