[PATCH] D91049: [clangd][remote] Check an index file correctly

Aleksandr Platonov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 10:43:46 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1bbf87e22a73: [clangd][remote] Check an index file correctly (authored by ArcsinX).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91049/new/

https://reviews.llvm.org/D91049

Files:
  clang-tools-extra/clangd/index/remote/server/Server.cpp


Index: clang-tools-extra/clangd/index/remote/server/Server.cpp
===================================================================
--- clang-tools-extra/clangd/index/remote/server/Server.cpp
+++ clang-tools-extra/clangd/index/remote/server/Server.cpp
@@ -357,24 +357,23 @@
     return Status.getError().value();
   }
 
-  auto Index = std::make_unique<clang::clangd::SwapIndex>(
-      clang::clangd::loadIndex(IndexPath));
-
-  if (!Index) {
+  auto SymIndex = clang::clangd::loadIndex(IndexPath);
+  if (!SymIndex) {
     llvm::errs() << "Failed to open the index.\n";
     return -1;
   }
+  clang::clangd::SwapIndex Index(std::move(SymIndex));
 
   std::thread HotReloadThread([&Index, &Status, &FS]() {
     llvm::vfs::Status LastStatus = *Status;
     static constexpr auto RefreshFrequency = std::chrono::seconds(30);
     while (!clang::clangd::shutdownRequested()) {
-      hotReload(*Index, llvm::StringRef(IndexPath), LastStatus, FS);
+      hotReload(Index, llvm::StringRef(IndexPath), LastStatus, FS);
       std::this_thread::sleep_for(RefreshFrequency);
     }
   });
 
-  runServerAndWait(*Index, ServerAddress, IndexPath);
+  runServerAndWait(Index, ServerAddress, IndexPath);
 
   HotReloadThread.join();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91049.303932.patch
Type: text/x-patch
Size: 1226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201109/d8e9a37a/attachment-0001.bin>


More information about the cfe-commits mailing list