[PATCH] D57878: [clangd] Use Dex for dynamic index by default.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 7 01:17:38 PST 2019

ioeric created this revision.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

Memory usage for a sample TU:

  Without Dex: 17.9M
  With    Dex: 24.4M

The memory increase is considerable but seems tolerable.

  rCTE Clang Tools Extra



Index: clangd/tool/ClangdMain.cpp
--- clangd/tool/ClangdMain.cpp
+++ clangd/tool/ClangdMain.cpp
@@ -27,11 +27,6 @@
 namespace clang {
 namespace clangd {
-// FIXME: remove this option when Dex is cheap enough.
-static llvm::cl::opt<bool>
-    UseDex("use-dex-index",
-           llvm::cl::desc("Use experimental Dex dynamic index."),
-           llvm::cl::init(false), llvm::cl::Hidden);
 static llvm::cl::opt<Path> CompileCommandsDir(
@@ -394,7 +389,7 @@
   if (!ResourceDir.empty())
     Opts.ResourceDir = ResourceDir;
   Opts.BuildDynamicSymbolIndex = EnableIndex;
-  Opts.HeavyweightDynamicSymbolIndex = UseDex;
+  Opts.HeavyweightDynamicSymbolIndex = true;
   Opts.BackgroundIndex = EnableBackgroundIndex;
   Opts.BackgroundIndexRebuildPeriodMs = BackgroundIndexRebuildPeriod;
   std::unique_ptr<SymbolIndex> StaticIdx;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57878.185717.patch
Type: text/x-patch
Size: 927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190207/14fe676d/attachment.bin>

More information about the cfe-commits mailing list