This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Allow using experimental Dex index
ClosedPublic

Authored by kbobyrev on Aug 17 2018, 7:17 AM.

Details

Summary

This patch adds hidden Clangd flag which replaces (currently) default MemIndex with DexIndex for the static index.

Diff Detail

Event Timeline

kbobyrev created this revision.Aug 17 2018, 7:17 AM
kbobyrev updated this revision to Diff 161239.Aug 17 2018, 7:17 AM

Fix anonymous namespace beginning placement in Clangd driver.

ioeric added inline comments.Aug 20 2018, 6:05 AM
clang-tools-extra/clangd/index/Index.h
360

I'd try to avoid this pattern as it implicitly requires T::build(std::shared_ptr<std::vector<const Symbol *>>) to be implemented. Alternatively, you could pull out a helper function that turns a SymbolSlab into std::shared_ptr<std::vector<const Symbol *>>, which can be shared by different indexes. It can probably live in MemIndex.h.

kbobyrev updated this revision to Diff 161487.Aug 20 2018, 8:27 AM
kbobyrev marked an inline comment as done.
ioeric added inline comments.Aug 21 2018, 3:18 AM
clang-tools-extra/clangd/index/MemIndex.h
47

Please add documentation.

clang-tools-extra/clangd/tool/ClangdMain.cpp
99

Why the move? A chunk of code in the middle of flags seems strange.

kbobyrev updated this revision to Diff 161679.Aug 21 2018, 3:27 AM
kbobyrev marked 2 inline comments as done.

Aww, the previous diff was the wrong one and didn't contain docs.

The move of the code to the middle of Clangd driver was justified by the assumption that it might be better to move the code that uses UseDex flag closer to the flag itself, but I agree: it looks strange. I moved it back.

This revision is now accepted and ready to land.Aug 21 2018, 3:28 AM
This revision was automatically updated to reflect the committed changes.