diff options
Diffstat (limited to 'clang-tools-extra/clangd/GlobalCompilationDatabase.h')
-rw-r--r-- | clang-tools-extra/clangd/GlobalCompilationDatabase.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.h b/clang-tools-extra/clangd/GlobalCompilationDatabase.h index 70e79041655..5633607fb85 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.h +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.h @@ -86,33 +86,6 @@ private: llvm::Optional<Path> CompileCommandsDir; }; -/// A wrapper around GlobalCompilationDatabase that caches the compile commands. -/// Note that only results of getCompileCommand are cached. -class CachingCompilationDb : public GlobalCompilationDatabase { -public: - explicit CachingCompilationDb(const GlobalCompilationDatabase &InnerCDB); - - /// Gets compile command for \p File from cache or CDB if it's not in the - /// cache. - llvm::Optional<tooling::CompileCommand> - getCompileCommand(PathRef File) const override; - - /// Forwards to the inner CDB. Results of this function are not cached. - tooling::CompileCommand getFallbackCommand(PathRef File) const override; - - /// Removes an entry for \p File if it's present in the cache. - void invalidate(PathRef File); - - /// Removes all cached compile commands. - void clear(); - -private: - const GlobalCompilationDatabase &InnerCDB; - mutable std::mutex Mut; - mutable llvm::StringMap<llvm::Optional<tooling::CompileCommand>> - Cached; /* GUARDED_BY(Mut) */ -}; - /// Gets compile args from an in-memory mapping based on a filepath. Typically /// used by clients who provide the compile commands themselves. class InMemoryCompilationDb : public GlobalCompilationDatabase { |