This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Cleanup dependencies around RemoteIndex
ClosedPublic

Authored by kadircet on Nov 4 2020, 2:10 AM.

Details

Summary

RemoteIndexClient implementations only depends on clangdSupport for
logging functionality and has no dependence on clangDeamon itself. This clears
out that link time dependency and enables depending on it in clangDeamon itself,
so that we can have other index implementations that makes use of the
RemoteIndex.

Diff Detail

Event Timeline

kadircet created this revision.Nov 4 2020, 2:10 AM
kadircet requested review of this revision.Nov 4 2020, 2:10 AM
kbobyrev added inline comments.Nov 4 2020, 2:46 AM
clang-tools-extra/clangd/CMakeLists.txt
114

If we're moving clangdRemoteIndex to clangDaemon there is no need to link clangd itself to clangdRemoteIndex anymore (in tool/CMakeLists.txt).

clang-tools-extra/clangd/index/remote/CMakeLists.txt
30

I think changing it is inconsistent with LLVM CMake style. Having closing paren on the same indentation level as the items is awkward but that's what we do :(

clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
11

same here

kadircet updated this revision to Diff 302820.Nov 4 2020, 5:00 AM
kadircet marked 2 inline comments as done.
  • Revert indentation changes
  • Move all libraries to private to be consistent on what we link in ClangdMain.
clang-tools-extra/clangd/CMakeLists.txt
114

All of the libraries linked to clangDeamon are explicitly being linked again to clangd. Even though the ones coming from clang and clangTooling are marked as private here, others like clangdSupport and clangTidy are linked with "default" (whatever that means) visibility. Hence I kept the linking on the clangd side as well.

I suppose moving these to PRIVATE libraries and keeping the extra linking in ClangdMain is the more consistent thing. As ClangdMain still calls remote::getClient. Let me know if you disagree or I am missing something.

clang-tools-extra/clangd/index/remote/CMakeLists.txt
30

*sigh*

kbobyrev accepted this revision.Nov 4 2020, 5:23 AM

LGTM, thanks!

clang-tools-extra/clangd/CMakeLists.txt
114

I see, makes sense, thanks!

This revision is now accepted and ready to land.Nov 4 2020, 5:23 AM
This revision was automatically updated to reflect the committed changes.