[PATCH] D64745: [clangd] BackgroundIndex stores shards to the closest project
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 09:14:16 PDT 2019
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
LG apart from the second global CDB
================
Comment at: clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp:128
+ : IndexStorageMapMu(llvm::make_unique<std::mutex>()),
+ CDB(llvm::make_unique<DirectoryBasedGlobalCompilationDatabase>(
+ llvm::None)) {
----------------
Why does this have its own CDB? AFAICS it can use the shared CDB, possibly indirecting through a std::function
================
Comment at: clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp:149
+ std::unique_ptr<BackgroundIndexStorage> create(PathRef CDBDirectory) {
+ assert(!CDBDirectory.empty() &&
+ "Tried to create storage for empty directory!");
----------------
This assertion will be hit if home_directory() fails. It shouldn't, but... maybe keep the "return nullstorage" to cover this case (and also the assert?)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64745/new/
https://reviews.llvm.org/D64745
More information about the cfe-commits
mailing list