summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/ClangdLSPServer.cpp7
-rw-r--r--clang-tools-extra/clangd/ClangdLSPServer.h2
-rw-r--r--clang-tools-extra/clangd/GlobalCompilationDatabase.cpp5
-rw-r--r--clang-tools-extra/clangd/GlobalCompilationDatabase.h4
4 files changed, 0 insertions, 18 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index f50d3ab0c82..e7e25f23be1 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -393,7 +393,6 @@ void ClangdLSPServer::onDocumentDidChange(
// 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 @@ void ClangdLSPServer::onDocumentDidClose(
PathRef File = Params.textDocument.uri.file();
DraftMgr.removeDraft(File);
Server->removeDocument(File);
- CDB->invalidate(File);
}
void ClangdLSPServer::onDocumentOnTypeFormatting(
@@ -804,11 +802,6 @@ ClangdLSPServer::CompilationDB::makeDirectoryBased(
/*IsDirectoryBased=*/true);
}
-void ClangdLSPServer::CompilationDB::invalidate(PathRef File) {
- if (!IsDirectoryBased)
- static_cast<InMemoryCompilationDb *>(CDB.get())->invalidate(File);
-}
-
bool ClangdLSPServer::CompilationDB::setCompilationCommandForFile(
PathRef File, tooling::CompileCommand CompilationCommand) {
if (IsDirectoryBased) {
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h
index 70d13fc0d28..768db0f1931 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.h
+++ b/clang-tools-extra/clangd/ClangdLSPServer.h
@@ -113,8 +113,6 @@ private:
static CompilationDB
makeDirectoryBased(llvm::Optional<Path> 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.
///
diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
index 57fac1cd0fe..0e09cd122d1 100644
--- a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
+++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
@@ -135,10 +135,5 @@ bool InMemoryCompilationDb::setCompilationCommandForFile(
return false;
}
-void InMemoryCompilationDb::invalidate(PathRef File) {
- std::unique_lock<std::mutex> Lock(Mutex);
- Commands.erase(File);
-}
-
} // namespace clangd
} // namespace clang
diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.h b/clang-tools-extra/clangd/GlobalCompilationDatabase.h
index 5633607fb85..f09045ecbaf 100644
--- a/clang-tools-extra/clangd/GlobalCompilationDatabase.h
+++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.h
@@ -100,10 +100,6 @@ public:
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<tooling::CompileCommand> Commands; /* GUARDED_BY(Mut) */
OpenPOWER on IntegriCloud