This also turns off implicit discovery of additional compilation
databases.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 34675 Build 34674: arc lint + arc unit
Event Timeline
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
106 | 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 | |
209 | 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 | 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 | actually we have a nullstorage for that, which just logs a messsage and doesn't persist the shard. |
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
109 | I don't think we'll ever fix this, feel free to drop the FIXME if you like. | |
118 | return Path == Result.PI.SourceRoot? | |
125 | (Why not do this in the one pass above? Doesn't seem worth two passes to avoid locking while iterating over AllFiles) | |
134 | 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." | |
clang-tools-extra/clangd/GlobalCompilationDatabase.h | ||
115 | (random note: we should really rename this something like FixedCDBDir. Probably not in this patch, but what a confusing name) |
(random note: we should really rename this something like FixedCDBDir. Probably not in this patch, but what a confusing name)