[clang-tools-extra] ed424b4 - [clangd] Cleanup dependencies around RemoteIndex

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 08:03:20 PST 2020


Author: Kadir Cetinkaya
Date: 2020-11-04T16:58:11+01:00
New Revision: ed424b42880e256f579d4bc9fb13d2156d8e8eb4

URL: https://github.com/llvm/llvm-project/commit/ed424b42880e256f579d4bc9fb13d2156d8e8eb4
DIFF: https://github.com/llvm/llvm-project/commit/ed424b42880e256f579d4bc9fb13d2156d8e8eb4.diff

LOG: [clangd] Cleanup dependencies around RemoteIndex

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.

Differential Revision: https://reviews.llvm.org/D90746

Added: 
    

Modified: 
    clang-tools-extra/clangd/CMakeLists.txt
    clang-tools-extra/clangd/index/remote/CMakeLists.txt
    clang-tools-extra/clangd/index/remote/Client.cpp
    clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
    clang-tools-extra/clangd/tool/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index 9d2ab5be222a..0ea925b033ea 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -28,7 +28,7 @@ set(LLVM_LINK_COMPONENTS
   FrontendOpenMP
   Option
   )
-  
+
 include(${CMAKE_CURRENT_SOURCE_DIR}/quality/CompletionModel.cmake)
 gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/quality/model CompletionModel clang::clangd::Example)
 
@@ -111,12 +111,6 @@ add_clang_library(clangDaemon
   refactor/Rename.cpp
   refactor/Tweak.cpp
 
-  LINK_LIBS
-  clangdSupport
-  clangTidy
-  ${LLVM_PTHREAD_LIB}
-  ${ALL_CLANG_TIDY_CHECKS}
-
   DEPENDS
   omp_gen
   )
@@ -145,6 +139,17 @@ clang_target_link_libraries(clangDaemon
   clangToolingSyntax
   )
 
+target_link_libraries(clangDaemon
+  PRIVATE
+  ${LLVM_PTHREAD_LIB}
+
+  clangTidy
+  ${ALL_CLANG_TIDY_CHECKS}
+
+  clangdSupport
+  clangdRemoteIndex
+  )
+
 add_subdirectory(refactor/tweaks)
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
   # FIXME: Make fuzzer not use linux-specific APIs, build it everywhere.

diff  --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt
index a07dd994b5a3..8625fa8f351e 100644
--- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt
+++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt
@@ -18,10 +18,8 @@ if (CLANGD_ENABLE_REMOTE)
     RemoteIndexProto
     RemoteIndexServiceProto
     clangdRemoteMarshalling
-
     protobuf
     grpc++
-    clangDaemon
     clangdSupport
 
     DEPENDS

diff  --git a/clang-tools-extra/clangd/index/remote/Client.cpp b/clang-tools-extra/clangd/index/remote/Client.cpp
index ef5c6ce430f6..4980a4bee74e 100644
--- a/clang-tools-extra/clangd/index/remote/Client.cpp
+++ b/clang-tools-extra/clangd/index/remote/Client.cpp
@@ -11,7 +11,6 @@
 #include "Client.h"
 #include "Service.grpc.pb.h"
 #include "index/Index.h"
-#include "index/Serialization.h"
 #include "marshalling/Marshalling.h"
 #include "support/Logger.h"
 #include "support/Trace.h"

diff  --git a/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
index 5d223ad3c8b3..5729017813d5 100644
--- a/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
+++ b/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
@@ -6,6 +6,5 @@ add_clang_library(clangdRemoteIndex
   UnimplementedClient.cpp
 
   LINK_LIBS
-  clangDaemon
   clangdSupport
   )

diff  --git a/clang-tools-extra/clangd/tool/CMakeLists.txt b/clang-tools-extra/clangd/tool/CMakeLists.txt
index 65e0aa35f265..da9d2060f700 100644
--- a/clang-tools-extra/clangd/tool/CMakeLists.txt
+++ b/clang-tools-extra/clangd/tool/CMakeLists.txt
@@ -28,12 +28,14 @@ clang_target_link_libraries(clangd
   clangToolingCore
   clangToolingRefactoring
   clangToolingSyntax
-  clangdRemoteIndex
   )
+
 target_link_libraries(clangd
   PRIVATE
   clangTidy
+
   clangDaemon
+  clangdRemoteIndex
   clangdSupport
   ${CLANGD_XPC_LIBS}
   )


        


More information about the cfe-commits mailing list