[PATCH] D51352: [clangd] Switch to Dex by default for the static index

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 28 06:19:13 PDT 2018

kbobyrev created this revision.
kbobyrev added reviewers: ioeric, ilya-biryukov, sammccall.
kbobyrev added a project: clang-tools-extra.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay.

Dex is now mature enough to be used as the default static index. This patch performs the switch but introduces a hidden flag to allow users fallback to Mem in case something happens.



Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -30,8 +30,8 @@
 using namespace clang::clangd;
 static llvm::cl::opt<bool>
-    UseDex("use-dex-index",
-           llvm::cl::desc("Use experimental Dex static index."),
+    UseMem("use-mem",
+           llvm::cl::desc("Use Mem for static index."),
            llvm::cl::init(false), llvm::cl::Hidden);
 namespace {
@@ -52,8 +52,8 @@
   for (auto Sym : Slab)
-  return UseDex ? dex::DexIndex::build(std::move(SymsBuilder).build())
-                : MemIndex::build(std::move(SymsBuilder).build());
+  return UseMem ? MemIndex::build(std::move(SymsBuilder).build())
+                : dex::DexIndex::build(std::move(SymsBuilder).build());
 } // namespace

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51352.162838.patch
Type: text/x-patch
Size: 918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180828/32d0974d/attachment.bin>

More information about the cfe-commits mailing list