[PATCH] D57325: [clangd] Collect macros in static index.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 28 06:52:01 PST 2019
hokein created this revision.
hokein added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov.
We are missing macros in static index.
symbols: before 407 K vs after 420 K
dex memory usage (static index): before 299 MB vs 304 MB
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D57325
Files:
clangd/index/IndexAction.cpp
unittests/clangd/BackgroundIndexTests.cpp
Index: unittests/clangd/BackgroundIndexTests.cpp
===================================================================
--- unittests/clangd/BackgroundIndexTests.cpp
+++ unittests/clangd/BackgroundIndexTests.cpp
@@ -136,6 +136,7 @@
// B_CC is dropped as we don't collect symbols from A.h in this compilation.
EXPECT_THAT(runFuzzyFind(Idx, ""),
UnorderedElementsAre(Named("common"), Named("A_CC"), Named("g"),
+ Named("A"),
AllOf(Named("f_b"), Declared(), Defined())));
auto Syms = runFuzzyFind(Idx, "common");
Index: clangd/index/IndexAction.cpp
===================================================================
--- clangd/index/IndexAction.cpp
+++ clangd/index/IndexAction.cpp
@@ -174,6 +174,7 @@
index::IndexingOptions::SystemSymbolFilterKind::All;
Opts.CollectIncludePath = true;
Opts.CountReferences = true;
+ Opts.CollectMacro = true;
Opts.Origin = SymbolOrigin::Static;
if (RefsCallback != nullptr) {
Opts.RefFilter = RefKind::All;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57325.183849.patch
Type: text/x-patch
Size: 1058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190128/bb5bcd11/attachment.bin>
More information about the cfe-commits
mailing list