Index: clangd/ClangdLSPServer.h =================================================================== --- clangd/ClangdLSPServer.h +++ clangd/ClangdLSPServer.h @@ -113,8 +113,6 @@ static CompilationDB makeDirectoryBased(llvm::Optional CompileCommandsDir); - void invalidate(PathRef File); - /// Sets the compilation command for a particular file. /// Only valid for in-memory CDB, no-op and error log on DirectoryBasedCDB. /// Index: clangd/ClangdLSPServer.cpp =================================================================== --- clangd/ClangdLSPServer.cpp +++ clangd/ClangdLSPServer.cpp @@ -393,7 +393,6 @@ // fail rather than giving wrong results. DraftMgr.removeDraft(File); Server->removeDocument(File); - CDB->invalidate(File); elog("Failed to update {0}: {1}", File, Contents.takeError()); return; } @@ -489,7 +488,6 @@ PathRef File = Params.textDocument.uri.file(); DraftMgr.removeDraft(File); Server->removeDocument(File); - CDB->invalidate(File); } void ClangdLSPServer::onDocumentOnTypeFormatting( @@ -804,11 +802,6 @@ /*IsDirectoryBased=*/true); } -void ClangdLSPServer::CompilationDB::invalidate(PathRef File) { - if (!IsDirectoryBased) - static_cast(CDB.get())->invalidate(File); -} - bool ClangdLSPServer::CompilationDB::setCompilationCommandForFile( PathRef File, tooling::CompileCommand CompilationCommand) { if (IsDirectoryBased) { Index: clangd/GlobalCompilationDatabase.h =================================================================== --- clangd/GlobalCompilationDatabase.h +++ clangd/GlobalCompilationDatabase.h @@ -100,10 +100,6 @@ bool setCompilationCommandForFile(PathRef File, tooling::CompileCommand CompilationCommand); - /// Removes the compilation command for \p File if it's present in the - /// mapping. - void invalidate(PathRef File); - private: mutable std::mutex Mutex; llvm::StringMap Commands; /* GUARDED_BY(Mut) */ Index: clangd/GlobalCompilationDatabase.cpp =================================================================== --- clangd/GlobalCompilationDatabase.cpp +++ clangd/GlobalCompilationDatabase.cpp @@ -135,10 +135,5 @@ return false; } -void InMemoryCompilationDb::invalidate(PathRef File) { - std::unique_lock Lock(Mutex); - Commands.erase(File); -} - } // namespace clangd } // namespace clang