[clangd] Print numbers of symbols and refs as well when loading the
authorHaojian Wu <hokein@google.com>
Wed, 17 Oct 2018 08:48:04 +0000 (08:48 +0000)
committerHaojian Wu <hokein@google.com>
Wed, 17 Oct 2018 08:48:04 +0000 (08:48 +0000)
index.

llvm-svn: 344679

clang-tools-extra/clangd/index/Serialization.cpp

index e7d49da..35cca72 100644 (file)
@@ -496,13 +496,18 @@ std::unique_ptr<SymbolIndex> loadIndex(llvm::StringRef SymbolFilename,
     }
   }
 
+  size_t SymSize = Symbols.size();
+  size_t RefSize = Refs.size();
   trace::Span Tracer("BuildIndex");
   auto Index =
       UseDex ? dex::Dex::build(std::move(Symbols), std::move(Refs), URISchemes)
              : MemIndex::build(std::move(Symbols), std::move(Refs));
-  vlog("Loaded {0} from {1} with estimated memory usage {2}",
+  vlog("Loaded {0} from {1} with estimated memory usage {2} bytes\n"
+       "  - number of symbos: {3}\n"
+       "  - number of refs: {4}\n",
        UseDex ? "Dex" : "MemIndex", SymbolFilename,
-       Index->estimateMemoryUsage());
+       Index->estimateMemoryUsage(),
+       SymSize, RefSize);
   return Index;
 }