This also turns off implicit discovery of additional compilation
databases.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
94 ↗ | (On Diff #208173) | The duplication here is a bit troublesome. And we have divergences in behavior - probably not important ones, but I can't say I know for sure. (e.g. here we won't create the CDB as a side-effect of getPathInfo() if there's a CompileCommandsDir, and will return the dir even if the CDB doesn't exist) I think we might want to have some central logic parameterized by a struct, e.g. struct DirectoryBasedCompilationDatabase::Lookup { // inputs PathRef File; bool ShouldBroadcast; // outputs tooling::CompilationDatabase *CDB; ProjectInfo Info; bool EverBroadcast; }; lookupCDB(Lookup); // replaces getCDBInDirLocked |
176 ↗ | (On Diff #208173) | here we're locking/unlocking the mutex maybe thousands of times, to do mostly redundant lookups into the cache Seems worth doing at least one of:
|
clang-tools-extra/clangd/index/Background.cpp | ||
653 ↗ | (On Diff #208173) | This looks like a bad assertion: it should be OK to provide compile commands but not project info. (Otherwise getProjectInfo should be pure virtual, but I'm concerned about the raciness if we're going to insist they're consistent but not provide any way of synchronizing) I'd suggest we should just not index such files (for now). Later we can start passing "" to the index storage factory to get the fallback storage (I think today we pass "", but the factory doesn't handle it - oops!) |
clang-tools-extra/clangd/index/Background.cpp | ||
---|---|---|
653 ↗ | (On Diff #208173) | actually we have a nullstorage for that, which just logs a messsage and doesn't persist the shard. |
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
118 ↗ | (On Diff #208686) | return Path == Result.PI.SourceRoot? |
125 ↗ | (On Diff #208686) | (Why not do this in the one pass above? Doesn't seem worth two passes to avoid locking while iterating over AllFiles) |
134 ↗ | (On Diff #208686) | assumes isn't strong enough here - we're defining it this way, and should say why. e.g. "A file is only part of this CDB if lookup for the file would find this CDB." |
183 ↗ | (On Diff #208686) | I don't think we'll ever fix this, feel free to drop the FIXME if you like. |
clang-tools-extra/clangd/GlobalCompilationDatabase.h | ||
115 ↗ | (On Diff #208686) | (random note: we should really rename this something like FixedCDBDir. Probably not in this patch, but what a confusing name) |