[clangd] Move non-clang base pieces into separate support/ lib. NFCI
authorSam McCall <sam.mccall@gmail.com>
Tue, 28 Apr 2020 15:49:17 +0000 (17:49 +0200)
committerSam McCall <sam.mccall@gmail.com>
Wed, 29 Apr 2020 13:57:12 +0000 (15:57 +0200)
Summary:
This enforces layering, reduces a sprawling clangd/ directory, and makes life
easier for embedders.

Reviewers: kbobyrev

Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, jfb, kadircet, usaxena95, cfe-commits

Tags: #clang

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

117 files changed:
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdLSPServer.h
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/CodeComplete.h
clang-tools-extra/clangd/CompileCommands.cpp
clang-tools-extra/clangd/Compiler.cpp
clang-tools-extra/clangd/Diagnostics.cpp
clang-tools-extra/clangd/Diagnostics.h
clang-tools-extra/clangd/DraftStore.cpp
clang-tools-extra/clangd/DraftStore.h
clang-tools-extra/clangd/FS.h
clang-tools-extra/clangd/FileDistance.cpp
clang-tools-extra/clangd/FindSymbols.cpp
clang-tools-extra/clangd/FindTarget.cpp
clang-tools-extra/clangd/Format.cpp
clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
clang-tools-extra/clangd/GlobalCompilationDatabase.h
clang-tools-extra/clangd/HeaderSourceSwitch.cpp
clang-tools-extra/clangd/Headers.cpp
clang-tools-extra/clangd/Headers.h
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/IncludeFixer.cpp
clang-tools-extra/clangd/JSONTransport.cpp
clang-tools-extra/clangd/ParsedAST.cpp
clang-tools-extra/clangd/ParsedAST.h
clang-tools-extra/clangd/Preamble.cpp
clang-tools-extra/clangd/Preamble.h
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/clangd/QueryDriverDatabase.cpp
clang-tools-extra/clangd/Selection.cpp
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SourceCode.cpp
clang-tools-extra/clangd/SourceCode.h
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/TUScheduler.h
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/XRefs.h
clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp
clang-tools-extra/clangd/index/Background.cpp
clang-tools-extra/clangd/index/Background.h
clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp
clang-tools-extra/clangd/index/BackgroundIndexLoader.h
clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp
clang-tools-extra/clangd/index/BackgroundQueue.cpp
clang-tools-extra/clangd/index/BackgroundRebuild.cpp
clang-tools-extra/clangd/index/FileIndex.cpp
clang-tools-extra/clangd/index/FileIndex.h
clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/IndexAction.cpp
clang-tools-extra/clangd/index/MemIndex.cpp
clang-tools-extra/clangd/index/Merge.cpp
clang-tools-extra/clangd/index/Serialization.cpp
clang-tools-extra/clangd/index/SymbolCollector.cpp
clang-tools-extra/clangd/index/YAMLSerialization.cpp
clang-tools-extra/clangd/index/dex/Dex.cpp
clang-tools-extra/clangd/index/remote/CMakeLists.txt
clang-tools-extra/clangd/index/remote/Client.cpp
clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt
clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt
clang-tools-extra/clangd/index/remote/unimplemented/UnimplementedClient.cpp
clang-tools-extra/clangd/refactor/Rename.cpp
clang-tools-extra/clangd/refactor/Rename.h
clang-tools-extra/clangd/refactor/Tweak.cpp
clang-tools-extra/clangd/refactor/Tweak.h
clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp
clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp
clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp
clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp
clang-tools-extra/clangd/support/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/clangd/support/Cancellation.cpp [moved from clang-tools-extra/clangd/Cancellation.cpp with 97% similarity]
clang-tools-extra/clangd/support/Cancellation.h [moved from clang-tools-extra/clangd/Cancellation.h with 96% similarity]
clang-tools-extra/clangd/support/Context.cpp [moved from clang-tools-extra/clangd/Context.cpp with 97% similarity]
clang-tools-extra/clangd/support/Context.h [moved from clang-tools-extra/clangd/Context.h with 93% similarity]
clang-tools-extra/clangd/support/FSProvider.cpp [moved from clang-tools-extra/clangd/FSProvider.cpp with 98% similarity]
clang-tools-extra/clangd/support/FSProvider.h [moved from clang-tools-extra/clangd/FSProvider.h with 91% similarity]
clang-tools-extra/clangd/support/Function.h [moved from clang-tools-extra/clangd/Function.h with 96% similarity]
clang-tools-extra/clangd/support/Logger.cpp [moved from clang-tools-extra/clangd/Logger.cpp with 96% similarity]
clang-tools-extra/clangd/support/Logger.h [moved from clang-tools-extra/clangd/Logger.h with 97% similarity]
clang-tools-extra/clangd/support/Path.h [moved from clang-tools-extra/clangd/Path.h with 87% similarity]
clang-tools-extra/clangd/support/Shutdown.cpp [moved from clang-tools-extra/clangd/Shutdown.cpp with 91% similarity]
clang-tools-extra/clangd/support/Shutdown.h [moved from clang-tools-extra/clangd/Shutdown.h with 96% similarity]
clang-tools-extra/clangd/support/Threading.cpp [moved from clang-tools-extra/clangd/Threading.cpp with 93% similarity]
clang-tools-extra/clangd/support/Threading.h [moved from clang-tools-extra/clangd/Threading.h with 96% similarity]
clang-tools-extra/clangd/support/Trace.cpp [moved from clang-tools-extra/clangd/Trace.cpp with 98% similarity]
clang-tools-extra/clangd/support/Trace.h [moved from clang-tools-extra/clangd/Trace.h with 96% similarity]
clang-tools-extra/clangd/tool/ClangdMain.cpp
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp
clang-tools-extra/clangd/unittests/ClangdTests.cpp
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
clang-tools-extra/clangd/unittests/JSONTransportTests.cpp
clang-tools-extra/clangd/unittests/LSPClient.cpp
clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp
clang-tools-extra/clangd/unittests/TestFS.cpp
clang-tools-extra/clangd/unittests/TestFS.h
clang-tools-extra/clangd/unittests/TestTU.h
clang-tools-extra/clangd/unittests/support/CancellationTests.cpp [moved from clang-tools-extra/clangd/unittests/CancellationTests.cpp with 96% similarity]
clang-tools-extra/clangd/unittests/support/ContextTests.cpp [moved from clang-tools-extra/clangd/unittests/ContextTests.cpp with 98% similarity]
clang-tools-extra/clangd/unittests/support/FunctionTests.cpp [moved from clang-tools-extra/clangd/unittests/FunctionTests.cpp with 97% similarity]
clang-tools-extra/clangd/unittests/support/ThreadingTests.cpp [moved from clang-tools-extra/clangd/unittests/ThreadingTests.cpp with 98% similarity]
clang-tools-extra/clangd/unittests/support/TraceTests.cpp [moved from clang-tools-extra/clangd/unittests/TraceTests.cpp with 99% similarity]
clang-tools-extra/clangd/xpc/CMakeLists.txt
clang-tools-extra/clangd/xpc/Conversion.cpp
clang-tools-extra/clangd/xpc/XPCTransport.cpp

index 124f087..146f1b3 100644 (file)
@@ -1,3 +1,5 @@
+add_subdirectory(support)
+
 # Configure the Features.inc file.
 if (NOT DEFINED CLANGD_BUILD_XPC)
   if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -25,19 +27,8 @@ set(LLVM_LINK_COMPONENTS
   FrontendOpenMP
   )
 
-if(CLANG_BUILT_STANDALONE)
-  # needed to get HAVE_CXX_ATOMICS64_WITHOUT_LIB defined
-  include(CheckAtomic)
-endif()
-
-set(CLANGD_ATOMIC_LIB "")
-if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
-  list(APPEND CLANGD_ATOMIC_LIB "atomic")
-endif()
-
 add_clang_library(clangDaemon
   AST.cpp
-  Cancellation.cpp
   ClangdLSPServer.cpp
   ClangdServer.cpp
   CodeComplete.cpp
@@ -45,7 +36,6 @@ add_clang_library(clangDaemon
   CollectMacros.cpp
   CompileCommands.cpp
   Compiler.cpp
-  Context.cpp
   Diagnostics.cpp
   DraftStore.cpp
   ExpectedTypes.cpp
@@ -54,7 +44,6 @@ add_clang_library(clangDaemon
   FileDistance.cpp
   Format.cpp
   FS.cpp
-  FSProvider.cpp
   FormattedString.cpp
   FuzzyMatch.cpp
   GlobalCompilationDatabase.cpp
@@ -63,7 +52,6 @@ add_clang_library(clangDaemon
   Hover.cpp
   IncludeFixer.cpp
   JSONTransport.cpp
-  Logger.cpp
   PathMapping.cpp
   Protocol.cpp
   Quality.cpp
@@ -73,11 +61,8 @@ add_clang_library(clangDaemon
   Selection.cpp
   SemanticHighlighting.cpp
   SemanticSelection.cpp
-  Shutdown.cpp
   SourceCode.cpp
   QueryDriverDatabase.cpp
-  Threading.cpp
-  Trace.cpp
   TUScheduler.cpp
   URI.cpp
   XRefs.cpp
@@ -128,8 +113,7 @@ add_clang_library(clangDaemon
   clangToolingInclusions
   clangToolingRefactoring
   clangToolingSyntax
-  ${LLVM_PTHREAD_LIB}
-  ${CLANGD_ATOMIC_LIB}
+  clangdSupport
   ${ALL_CLANG_TIDY_CHECKS}
   )
 
index f58bfaf..4ca4f83 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "ClangdLSPServer.h"
-#include "Context.h"
 #include "Diagnostics.h"
 #include "DraftStore.h"
 #include "FormattedString.h"
 #include "SemanticHighlighting.h"
 #include "SourceCode.h"
 #include "TUScheduler.h"
-#include "Trace.h"
 #include "URI.h"
 #include "refactor/Tweak.h"
+#include "support/Context.h"
+#include "support/Trace.h"
 #include "clang/Basic/Version.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/ADT/ArrayRef.h"
index 9c35ca6..c3da2f9 100644 (file)
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDLSPSERVER_H
 
 #include "ClangdServer.h"
-#include "Context.h"
 #include "DraftStore.h"
 #include "Features.inc"
 #include "FindSymbols.h"
 #include "GlobalCompilationDatabase.h"
-#include "Path.h"
 #include "Protocol.h"
 #include "Transport.h"
+#include "support/Context.h"
+#include "support/Path.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringSet.h"
index c5148f8..3dce7fe 100644 (file)
@@ -13,7 +13,6 @@
 #include "FormattedString.h"
 #include "HeaderSourceSwitch.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Preamble.h"
 #include "Protocol.h"
 #include "SemanticSelection.h"
 #include "SourceCode.h"
 #include "TUScheduler.h"
-#include "Trace.h"
 #include "XRefs.h"
 #include "index/CanonicalIncludes.h"
 #include "index/FileIndex.h"
 #include "index/Merge.h"
 #include "refactor/Rename.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/Format/Format.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/CompilerInvocation.h"
index f6e7e07..d36dfd1 100644 (file)
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDSERVER_H
 
 #include "../clang-tidy/ClangTidyOptions.h"
-#include "Cancellation.h"
 #include "CodeComplete.h"
-#include "FSProvider.h"
 #include "FormattedString.h"
-#include "Function.h"
 #include "GlobalCompilationDatabase.h"
 #include "Hover.h"
 #include "Protocol.h"
@@ -26,6 +23,9 @@
 #include "index/Index.h"
 #include "refactor/Rename.h"
 #include "refactor/Tweak.h"
+#include "support/Cancellation.h"
+#include "support/FSProvider.h"
+#include "support/Function.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/ADT/FunctionExtras.h"
index 3d9bfe5..d218d6b 100644 (file)
 #include "FileDistance.h"
 #include "FuzzyMatch.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "Preamble.h"
 #include "Protocol.h"
 #include "Quality.h"
 #include "SourceCode.h"
 #include "TUScheduler.h"
-#include "Threading.h"
-#include "Trace.h"
 #include "URI.h"
 #include "index/Index.h"
 #include "index/Symbol.h"
 #include "index/SymbolOrigin.h"
+#include "support/Logger.h"
+#include "support/Threading.h"
+#include "support/Trace.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclBase.h"
 #include "clang/Basic/CharInfo.h"
index 3adea47..1e23704 100644 (file)
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CODECOMPLETE_H
 
 #include "Headers.h"
-#include "Logger.h"
-#include "Path.h"
 #include "Protocol.h"
 #include "Quality.h"
 #include "index/Index.h"
 #include "index/Symbol.h"
 #include "index/SymbolOrigin.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "clang/Sema/CodeCompleteConsumer.h"
 #include "clang/Sema/CodeCompleteOptions.h"
 #include "clang/Tooling/CompilationDatabase.h"
index ae343d5..84f72f5 100644 (file)
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CompileCommands.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Tooling/ArgumentsAdjusters.h"
 #include "llvm/Support/FileSystem.h"
index 47cec5a..957d7c3 100644 (file)
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Compiler.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "clang/Serialization/PCHContainerOperations.h"
index d72c2bd..3558ca9 100644 (file)
@@ -9,9 +9,9 @@
 #include "Diagnostics.h"
 #include "../clang-tidy/ClangTidyDiagnosticConsumer.h"
 #include "Compiler.h"
-#include "Logger.h"
 #include "Protocol.h"
 #include "SourceCode.h"
+#include "support/Logger.h"
 #include "clang/Basic/AllDiagnostics.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticIDs.h"
index 7461f85..ebf86ba 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIAGNOSTICS_H
 
-#include "Path.h"
 #include "Protocol.h"
+#include "support/Path.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "llvm/ADT/ArrayRef.h"
index 03867dc..bef48dd 100644 (file)
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "DraftStore.h"
-#include "Logger.h"
 #include "SourceCode.h"
+#include "support/Logger.h"
 #include "llvm/Support/Errc.h"
 
 namespace clang {
index babc679..3c2d0c6 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_DRAFTSTORE_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_DRAFTSTORE_H
 
-#include "Path.h"
 #include "Protocol.h"
+#include "support/Path.h"
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/StringMap.h"
 #include <mutex>
index 7b7f7cb..5994bdf 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FS_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FS_H
 
-#include "Path.h"
+#include "support/Path.h"
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringMap.h"
index a9ce3e5..584c64d 100644 (file)
@@ -31,7 +31,7 @@
 //===-------------------------------------------------------------------------//
 
 #include "FileDistance.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "llvm/ADT/STLExtras.h"
 #include <queue>
 
index 06c124c..58e2ee1 100644 (file)
@@ -9,11 +9,11 @@
 
 #include "AST.h"
 #include "FuzzyMatch.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Quality.h"
 #include "SourceCode.h"
 #include "index/Index.h"
+#include "support/Logger.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/Index/IndexDataConsumer.h"
 #include "clang/Index/IndexSymbol.h"
index be3306f..2813e30 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "FindTarget.h"
 #include "AST.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
index b8b9d8e..052cf74 100644 (file)
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 #include "Format.h"
-#include "Logger.h"
-#include "clang/Basic/SourceManager.h"
+#include "support/Logger.h"
 #include "clang/Basic/FileManager.h"
+#include "clang/Basic/SourceManager.h"
 #include "clang/Format/Format.h"
 #include "clang/Lex/Lexer.h"
 #include "clang/Tooling/Core/Replacement.h"
index 3f8a7d8..5e75864 100644 (file)
@@ -8,8 +8,8 @@
 
 #include "GlobalCompilationDatabase.h"
 #include "FS.h"
-#include "Logger.h"
-#include "Path.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Tooling/ArgumentsAdjusters.h"
 #include "clang/Tooling/CompilationDatabase.h"
index 2fc7549..e9a5417 100644 (file)
@@ -10,8 +10,8 @@
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_GLOBALCOMPILATIONDATABASE_H
 
 #include "CompileCommands.h"
-#include "Function.h"
-#include "Path.h"
+#include "support/Function.h"
+#include "support/Path.h"
 #include "clang/Tooling/ArgumentsAdjusters.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/Optional.h"
index 1490d3e..3ebf054 100644 (file)
@@ -8,9 +8,9 @@
 
 #include "HeaderSourceSwitch.h"
 #include "AST.h"
-#include "Logger.h"
 #include "SourceCode.h"
 #include "index/SymbolCollector.h"
+#include "support/Logger.h"
 #include "clang/AST/Decl.h"
 
 namespace clang {
index dd4cafd..c0e19f2 100644 (file)
@@ -8,8 +8,8 @@
 
 #include "Headers.h"
 #include "Compiler.h"
-#include "Logger.h"
 #include "SourceCode.h"
+#include "support/Logger.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Frontend/FrontendActions.h"
index 1f39687..2ffa902 100644 (file)
@@ -9,10 +9,10 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_HEADERS_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_HEADERS_H
 
-#include "Path.h"
 #include "Protocol.h"
 #include "SourceCode.h"
 #include "index/Symbol.h"
+#include "support/Path.h"
 #include "clang/Basic/TokenKinds.h"
 #include "clang/Format/Format.h"
 #include "clang/Lex/HeaderSearch.h"
index ba8fcd4..b0ac041 100644 (file)
 #include "CodeCompletionStrings.h"
 #include "FindTarget.h"
 #include "FormattedString.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "index/SymbolCollector.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Decl.h"
index 45fb07a..945f4ec 100644 (file)
@@ -9,11 +9,11 @@
 #include "IncludeFixer.h"
 #include "AST.h"
 #include "Diagnostics.h"
-#include "Logger.h"
 #include "SourceCode.h"
-#include "Trace.h"
 #include "index/Index.h"
 #include "index/Symbol.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclBase.h"
 #include "clang/AST/DeclarationName.h"
index a925473..fa86baf 100644 (file)
@@ -5,11 +5,11 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#include "Cancellation.h"
-#include "Logger.h"
 #include "Protocol.h" // For LSPError
-#include "Shutdown.h"
 #include "Transport.h"
+#include "support/Cancellation.h"
+#include "support/Logger.h"
+#include "support/Shutdown.h"
 #include "llvm/Support/Errno.h"
 #include "llvm/Support/Error.h"
 
index 7b24261..61221aa 100644 (file)
 #include "Diagnostics.h"
 #include "Headers.h"
 #include "IncludeFixer.h"
-#include "Logger.h"
 #include "SourceCode.h"
-#include "Trace.h"
 #include "index/CanonicalIncludes.h"
 #include "index/Index.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
 #include "clang/Basic/LangOptions.h"
index 88fb6c3..d90f77f 100644 (file)
@@ -24,9 +24,9 @@
 #include "Compiler.h"
 #include "Diagnostics.h"
 #include "Headers.h"
-#include "Path.h"
 #include "Preamble.h"
 #include "index/CanonicalIncludes.h"
+#include "support/Path.h"
 #include "clang/Frontend/FrontendAction.h"
 #include "clang/Frontend/PrecompiledPreamble.h"
 #include "clang/Lex/Preprocessor.h"
index 8392748..2768bd1 100644 (file)
@@ -9,8 +9,8 @@
 #include "Preamble.h"
 #include "Compiler.h"
 #include "Headers.h"
-#include "Logger.h"
-#include "Trace.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
index 10c292a..f2e1ba9 100644 (file)
@@ -27,8 +27,8 @@
 #include "Diagnostics.h"
 #include "FS.h"
 #include "Headers.h"
-#include "Path.h"
 #include "index/CanonicalIncludes.h"
+#include "support/Path.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Frontend/PrecompiledPreamble.h"
 #include "clang/Tooling/CompilationDatabase.h"
index b0c7ce2..314e6b0 100644 (file)
@@ -11,8 +11,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "Protocol.h"
-#include "Logger.h"
 #include "URI.h"
+#include "support/Logger.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Index/IndexSymbol.h"
 #include "llvm/ADT/Hashing.h"
index d6502c6..2ab217d 100644 (file)
@@ -30,9 +30,9 @@
 // in the paths that are explicitly whitelisted by the user.
 
 #include "GlobalCompilationDatabase.h"
-#include "Logger.h"
-#include "Path.h"
-#include "Trace.h"
+#include "support/Logger.h"
+#include "support/Path.h"
+#include "support/Trace.h"
 #include "clang/Driver/Types.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/DenseMap.h"
index b456544..7d52714 100644 (file)
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "Selection.h"
-#include "Logger.h"
 #include "SourceCode.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
index baf1375..d2470da 100644 (file)
@@ -8,10 +8,10 @@
 
 #include "SemanticHighlighting.h"
 #include "FindTarget.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Protocol.h"
 #include "SourceCode.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
index dd4c863..d50968b 100644 (file)
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 #include "SourceCode.h"
 
-#include "Context.h"
 #include "FuzzyMatch.h"
-#include "Logger.h"
 #include "Protocol.h"
 #include "refactor/Tweak.h"
+#include "support/Context.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
index d1e5aa5..c00cc17 100644 (file)
@@ -13,8 +13,8 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SOURCECODE_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SOURCECODE_H
 
-#include "Context.h"
 #include "Protocol.h"
+#include "support/Context.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
index 1ff6bba..db5ac85 100644 (file)
 // requests will receive latest build preamble, which might possibly be stale.
 
 #include "TUScheduler.h"
-#include "Cancellation.h"
 #include "Compiler.h"
-#include "Context.h"
 #include "Diagnostics.h"
 #include "GlobalCompilationDatabase.h"
-#include "Logger.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "Preamble.h"
-#include "Threading.h"
-#include "Trace.h"
 #include "index/CanonicalIncludes.h"
+#include "support/Cancellation.h"
+#include "support/Context.h"
+#include "support/Logger.h"
+#include "support/Path.h"
+#include "support/Threading.h"
+#include "support/Trace.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/FunctionExtras.h"
index 48ed2c7..f24a777 100644 (file)
 
 #include "Compiler.h"
 #include "Diagnostics.h"
-#include "Function.h"
 #include "GlobalCompilationDatabase.h"
-#include "Path.h"
-#include "Threading.h"
 #include "index/CanonicalIncludes.h"
+#include "support/Function.h"
+#include "support/Path.h"
+#include "support/Threading.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringMap.h"
index 7eb3c4f..4418564 100644 (file)
@@ -10,7 +10,6 @@
 #include "CodeCompletionStrings.h"
 #include "FindSymbols.h"
 #include "FindTarget.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Protocol.h"
 #include "Quality.h"
@@ -21,6 +20,7 @@
 #include "index/Merge.h"
 #include "index/Relation.h"
 #include "index/SymbolLocation.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Attr.h"
index 4645d32..d1ba7ba 100644 (file)
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_XREFS_H
 
 #include "FormattedString.h"
-#include "Path.h"
 #include "Protocol.h"
 #include "SourceCode.h"
 #include "index/Index.h"
 #include "index/SymbolLocation.h"
+#include "support/Path.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Type.h"
 #include "clang/Format/Format.h"
index 9776b05..982d5fa 100644 (file)
@@ -15,8 +15,8 @@
 #include "ClangdLSPServer.h"
 #include "ClangdServer.h"
 #include "CodeComplete.h"
-#include "FSProvider.h"
 #include "refactor/Rename.h"
+#include "support/FSProvider.h"
 #include <cstdio>
 #include <sstream>
 
index 4c5719d..67fed77 100644 (file)
@@ -8,16 +8,10 @@
 
 #include "index/Background.h"
 #include "Compiler.h"
-#include "Context.h"
-#include "FSProvider.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "SourceCode.h"
 #include "Symbol.h"
-#include "Threading.h"
-#include "Trace.h"
 #include "URI.h"
 #include "index/BackgroundIndexLoader.h"
 #include "index/FileIndex.h"
 #include "index/Relation.h"
 #include "index/Serialization.h"
 #include "index/SymbolCollector.h"
+#include "support/Context.h"
+#include "support/FSProvider.h"
+#include "support/Logger.h"
+#include "support/Path.h"
+#include "support/Threading.h"
+#include "support/Trace.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Driver/Types.h"
index 2ae11c7..ffaea75 100644 (file)
@@ -9,16 +9,16 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_BACKGROUND_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_BACKGROUND_H
 
-#include "Context.h"
-#include "FSProvider.h"
 #include "GlobalCompilationDatabase.h"
-#include "Path.h"
 #include "SourceCode.h"
-#include "Threading.h"
 #include "index/BackgroundRebuild.h"
 #include "index/FileIndex.h"
 #include "index/Index.h"
 #include "index/Serialization.h"
+#include "support/Context.h"
+#include "support/FSProvider.h"
+#include "support/Path.h"
+#include "support/Threading.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/Support/Threading.h"
index 08bf07d..5645569 100644 (file)
@@ -8,9 +8,9 @@
 
 #include "index/BackgroundIndexLoader.h"
 #include "GlobalCompilationDatabase.h"
-#include "Logger.h"
-#include "Path.h"
 #include "index/Background.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SmallString.h"
index 0caf1b4..aa7ee39 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_BACKGROUND_INDEX_LOADER_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_BACKGROUND_INDEX_LOADER_H
 
-#include "Path.h"
 #include "index/Background.h"
+#include "support/Path.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Optional.h"
index 765b710..eee050b 100644 (file)
@@ -7,9 +7,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "GlobalCompilationDatabase.h"
-#include "Logger.h"
-#include "Path.h"
 #include "index/Background.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/ScopeExit.h"
index 00d483f..3262a2f 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Logger.h"
 #include "index/Background.h"
+#include "support/Logger.h"
 
 namespace clang {
 namespace clangd {
index 5cc61a6..2aa5fa9 100644 (file)
@@ -9,13 +9,9 @@
 #include "index/BackgroundRebuild.h"
 #include "Compiler.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "SourceCode.h"
 #include "Symbol.h"
-#include "Threading.h"
-#include "Trace.h"
 #include "URI.h"
 #include "index/FileIndex.h"
 #include "index/IndexAction.h"
 #include "index/Relation.h"
 #include "index/Serialization.h"
 #include "index/SymbolCollector.h"
+#include "support/Logger.h"
+#include "support/Path.h"
+#include "support/Threading.h"
+#include "support/Trace.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
 #include "llvm/ADT/Hashing.h"
index 590bf46..6a94b9c 100644 (file)
@@ -8,9 +8,7 @@
 
 #include "FileIndex.h"
 #include "CollectMacros.h"
-#include "Logger.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "SymbolCollector.h"
 #include "index/CanonicalIncludes.h"
 #include "index/Index.h"
@@ -23,6 +21,8 @@
 #include "index/SymbolID.h"
 #include "index/SymbolOrigin.h"
 #include "index/dex/Dex.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Index/IndexingAction.h"
 #include "clang/Index/IndexingOptions.h"
index 539f232..5c87766 100644 (file)
 #include "Index.h"
 #include "MemIndex.h"
 #include "Merge.h"
-#include "Path.h"
 #include "index/CanonicalIncludes.h"
 #include "index/Ref.h"
 #include "index/Relation.h"
 #include "index/Serialization.h"
 #include "index/Symbol.h"
+#include "support/Path.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/DenseSet.h"
index 9ec4908..e4eb1b5 100644 (file)
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Index.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
index 8fd2159..9f294d4 100644 (file)
@@ -8,9 +8,9 @@
 
 #include "IndexAction.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "index/Relation.h"
 #include "index/SymbolOrigin.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTConsumer.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Basic/SourceLocation.h"
index 453b226..46e9c0a 100644 (file)
@@ -8,9 +8,9 @@
 
 #include "MemIndex.h"
 #include "FuzzyMatch.h"
-#include "Logger.h"
 #include "Quality.h"
-#include "Trace.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/Index/IndexSymbol.h"
 
 namespace clang {
index 0cef7dc..a93aa20 100644 (file)
@@ -7,11 +7,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "Merge.h"
-#include "Logger.h"
-#include "Trace.h"
 #include "index/Symbol.h"
 #include "index/SymbolLocation.h"
 #include "index/SymbolOrigin.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
index 6ba4e04..06527a6 100644 (file)
@@ -8,12 +8,12 @@
 
 #include "Serialization.h"
 #include "Headers.h"
-#include "Logger.h"
 #include "RIFF.h"
 #include "SymbolLocation.h"
 #include "SymbolOrigin.h"
-#include "Trace.h"
 #include "dex/Dex.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compression.h"
index 739aef8..b502dfb 100644 (file)
 #include "CodeComplete.h"
 #include "CodeCompletionStrings.h"
 #include "ExpectedTypes.h"
-#include "Logger.h"
 #include "SourceCode.h"
 #include "SymbolLocation.h"
 #include "URI.h"
 #include "index/SymbolID.h"
+#include "support/Logger.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclBase.h"
 #include "clang/AST/DeclCXX.h"
index fc515a1..4f6bd92 100644 (file)
@@ -17,8 +17,8 @@
 #include "Serialization.h"
 #include "SymbolLocation.h"
 #include "SymbolOrigin.h"
-#include "Trace.h"
 #include "dex/Dex.h"
+#include "support/Trace.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
index 36ddedd..a663e53 100644 (file)
@@ -9,11 +9,11 @@
 #include "Dex.h"
 #include "FileDistance.h"
 #include "FuzzyMatch.h"
-#include "Logger.h"
 #include "Quality.h"
-#include "Trace.h"
 #include "index/Index.h"
 #include "index/dex/Iterator.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/ScopedPrinter.h"
 #include <algorithm>
index 1bd336e..a358aae 100644 (file)
@@ -18,6 +18,7 @@ if (CLANGD_ENABLE_REMOTE)
     protobuf
     grpc++
     clangDaemon
+    clangdSupport
     )
 
   add_subdirectory(marshalling)
index 0c5fe14..3ba1dfe 100644 (file)
 
 #include "Client.h"
 #include "Index.grpc.pb.h"
-#include "Logger.h"
-#include "Trace.h"
 #include "index/Serialization.h"
 #include "marshalling/Marshalling.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "llvm/Support/YAMLTraits.h"
 
 namespace clang {
index d2ec071..60a258a 100644 (file)
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "Marshalling.h"
-#include "Logger.h"
 #include "index/Serialization.h"
+#include "support/Logger.h"
 
 namespace clang {
 namespace clangd {
index 725f0e4..f0fb612 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Logger.h"
 #include "index/remote/Client.h"
+#include "support/Logger.h"
 
 namespace clang {
 namespace clangd {
index 0585897..c08f6ea 100644 (file)
@@ -9,12 +9,12 @@
 #include "refactor/Rename.h"
 #include "AST.h"
 #include "FindTarget.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Selection.h"
 #include "SourceCode.h"
-#include "Trace.h"
 #include "index/SymbolCollector.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/Basic/SourceLocation.h"
index 5c53ba6..e279516 100644 (file)
@@ -9,9 +9,9 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_RENAME_H
 
-#include "Path.h"
 #include "Protocol.h"
 #include "SourceCode.h"
+#include "support/Path.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/Support/Error.h"
index 3e3033c..b1f4dcd 100644 (file)
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 #include "Tweak.h"
-#include "Logger.h"
-#include "Path.h"
 #include "SourceCode.h"
 #include "index/Index.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
index 84d3bdb..10e3e8d 100644 (file)
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_REFACTOR_ACTIONS_TWEAK_H
 
 #include "ParsedAST.h"
-#include "Path.h"
 #include "Protocol.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "index/Index.h"
+#include "support/Path.h"
 #include "clang/Tooling/Core/Replacement.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringMap.h"
index f2ef235..836ac9a 100644 (file)
@@ -8,8 +8,8 @@
 
 #include "AST.h"
 #include "FindTarget.h"
-#include "Logger.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 
index 995288b..c5bff2f 100644 (file)
@@ -30,6 +30,7 @@ add_clang_library(clangDaemonTweaks OBJECT
   clangAST
   clangBasic
   clangDaemon
+  clangdSupport
   clangFormat
   clangLex
   clangToolingCore
index b1057d8..e28a2c4 100644 (file)
@@ -8,11 +8,11 @@
 
 #include "AST.h"
 #include "FindTarget.h"
-#include "Logger.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "XRefs.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Decl.h"
index c2d344a..405ff90 100644 (file)
@@ -9,12 +9,12 @@
 #include "AST.h"
 #include "FindTarget.h"
 #include "HeaderSourceSwitch.h"
-#include "Logger.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
+#include "support/Path.h"
 #include "clang/AST/ASTTypeTraits.h"
 #include "clang/AST/Attr.h"
 #include "clang/AST/Decl.h"
index bffd6c0..d2dfc4a 100644 (file)
@@ -7,20 +7,20 @@
 //===----------------------------------------------------------------------===//
 #include "refactor/Tweak.h"
 
-#include "Logger.h"
+#include "XRefs.h"
+#include "support/Logger.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/TypeLoc.h"
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
+#include <AST.h>
 #include <climits>
 #include <memory>
 #include <string>
-#include <AST.h>
-#include "XRefs.h"
-#include "llvm/ADT/StringExtras.h"
 
 namespace clang {
 namespace clangd {
index a22b5ab..dd62670 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "AST.h"
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclTemplate.h"
index cf38227..69bfe67 100644 (file)
@@ -5,12 +5,12 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "Protocol.h"
 #include "Selection.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExprCXX.h"
index 62a306c..2534cf5 100644 (file)
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ExprObjC.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
index c5f480c..bec45be 100644 (file)
@@ -5,10 +5,10 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/AST/Stmt.h"
index 1d57cd5..2422743 100644 (file)
@@ -5,10 +5,10 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#include "Logger.h"
 #include "ParsedAST.h"
 #include "SourceCode.h"
 #include "refactor/Tweak.h"
+#include "support/Logger.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
 #include "clang/AST/Stmt.h"
diff --git a/clang-tools-extra/clangd/support/CMakeLists.txt b/clang-tools-extra/clangd/support/CMakeLists.txt
new file mode 100644 (file)
index 0000000..719d757
--- /dev/null
@@ -0,0 +1,31 @@
+# clangd/support contains low-level support libraries that do not depend
+# on clang either programmatically or conceptually.
+
+set(LLVM_LINK_COMPONENTS
+  Support
+  )
+
+if(CLANG_BUILT_STANDALONE)
+  # needed to get HAVE_CXX_ATOMICS64_WITHOUT_LIB defined
+  include(CheckAtomic)
+endif()
+
+set(CLANGD_ATOMIC_LIB "")
+if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+  list(APPEND CLANGD_ATOMIC_LIB "atomic")
+endif()
+
+include_directories(..)
+add_clang_library(clangdSupport
+  Cancellation.cpp
+  Context.cpp
+  FSProvider.cpp
+  Logger.cpp
+  Shutdown.cpp
+  Threading.cpp
+  Trace.cpp
+
+  LINK_LIBS
+  ${LLVM_PTHREAD_LIB}
+  ${CLANGD_ATOMIC_LIB}
+  )
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Cancellation.h"
+#include "support/Cancellation.h"
 #include <atomic>
 
 namespace clang {
similarity index 96%
rename from clang-tools-extra/clangd/Cancellation.h
rename to clang-tools-extra/clangd/support/Cancellation.h
index 0bee6f3..f33b0b5 100644 (file)
 //        Measuring the start -> cancel -> acknowledge -> finish timeline would
 //        help find where libraries' cancellation should be improved.
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CANCELLATION_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CANCELLATION_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_CANCELLATION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_CANCELLATION_H
 
-#include "Context.h"
+#include "support/Context.h"
 #include "llvm/Support/Error.h"
 #include <functional>
 #include <system_error>
similarity index 97%
rename from clang-tools-extra/clangd/Context.cpp
rename to clang-tools-extra/clangd/support/Context.cpp
index 8e8bba6..266dd00 100644 (file)
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Context.h"
+#include "support/Context.h"
 #include <cassert>
 
 namespace clang {
similarity index 93%
rename from clang-tools-extra/clangd/Context.h
rename to clang-tools-extra/clangd/support/Context.h
index 71aeaba..894032b 100644 (file)
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONTEXT_H_
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONTEXT_H_
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_CONTEXT_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_CONTEXT_H_
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Compiler.h"
@@ -120,20 +120,20 @@ public:
   template <class Type>
   Context derive(const Key<Type> &Key,
                  typename std::decay<Type>::type Value) const & {
-    return Context(std::make_shared<Data>(Data{
-        /*Parent=*/DataPtr, &Key,
-        std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
-            std::move(Value))}));
+    return Context(std::make_shared<Data>(
+        Data{/*Parent=*/DataPtr, &Key,
+             std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
+                 std::move(Value))}));
   }
 
   template <class Type>
   Context
   derive(const Key<Type> &Key,
          typename std::decay<Type>::type Value) && /* takes ownership */ {
-    return Context(std::make_shared<Data>(Data{
-        /*Parent=*/std::move(DataPtr), &Key,
-        std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
-            std::move(Value))}));
+    return Context(std::make_shared<Data>(
+        Data{/*Parent=*/std::move(DataPtr), &Key,
+             std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
+                 std::move(Value))}));
   }
 
   /// Derives a child context, using an anonymous key.
@@ -219,4 +219,4 @@ private:
 } // namespace clangd
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_CONTEXT_H_
+#endif
similarity index 98%
rename from clang-tools-extra/clangd/FSProvider.cpp
rename to clang-tools-extra/clangd/support/FSProvider.cpp
index 80d6be0..6474a3c 100644 (file)
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "FSProvider.h"
+#include "support/FSProvider.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
similarity index 91%
rename from clang-tools-extra/clangd/FSProvider.h
rename to clang-tools-extra/clangd/support/FSProvider.h
index 1fe3ba8..a53a414 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FSPROVIDER_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_FSPROVIDER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_FSPROVIDER_H
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/Support/VirtualFileSystem.h"
similarity index 96%
rename from clang-tools-extra/clangd/Function.h
rename to clang-tools-extra/clangd/support/Function.h
index cfcb4a5..2cac1b1 100644 (file)
@@ -10,8 +10,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_FUNCTION_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_FUNCTION_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_FUNCTION_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_FUNCTION_H
 
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/Support/Error.h"
similarity index 96%
rename from clang-tools-extra/clangd/Logger.cpp
rename to clang-tools-extra/clangd/support/Logger.cpp
index 7b8c9a3..768d2e5 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Logger.h"
-#include "Trace.h"
+#include "support/Logger.h"
+#include "support/Trace.h"
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
similarity index 97%
rename from clang-tools-extra/clangd/Logger.h
rename to clang-tools-extra/clangd/support/Logger.h
index 7a5d514..72d1408 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_LOGGER_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_LOGGER_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_LOGGER_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_LOGGER_H
 
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Debug.h"
similarity index 87%
rename from clang-tools-extra/clangd/Path.h
rename to clang-tools-extra/clangd/support/Path.h
index eaa7224..4d4ad7f 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_PATH_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_PATH_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_PATH_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_PATH_H
 
 #include "llvm/ADT/StringRef.h"
 #include <string>
similarity index 91%
rename from clang-tools-extra/clangd/Shutdown.cpp
rename to clang-tools-extra/clangd/support/Shutdown.cpp
index 36d9775..7ce01ee 100644 (file)
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Shutdown.h"
+#include "support/Shutdown.h"
 
 #include <atomic>
 #include <cstdlib>
@@ -31,10 +31,7 @@ void requestShutdown() {
     std::abort();
 }
 
-bool shutdownRequested() {
-  return ShutdownRequested;
-}
+bool shutdownRequested() { return ShutdownRequested; }
 
 } // namespace clangd
 } // namespace clang
-
similarity index 96%
rename from clang-tools-extra/clangd/Shutdown.h
rename to clang-tools-extra/clangd/support/Shutdown.h
index 94ada31..896e152 100644 (file)
@@ -40,8 +40,8 @@
 //    returns an error, etc.
 //
 //===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SHUTDOWN_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SHUTDOWN_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_SHUTDOWN_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_SHUTDOWN_H
 
 #include <cerrno>
 #include <chrono>
similarity index 93%
rename from clang-tools-extra/clangd/Threading.cpp
rename to clang-tools-extra/clangd/support/Threading.cpp
index a651b70..5f95888 100644 (file)
@@ -1,6 +1,5 @@
-#include "Threading.h"
-#include "Trace.h"
-#include "clang/Basic/Stack.h"
+#include "support/Threading.h"
+#include "support/Trace.h"
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Threading.h"
@@ -10,7 +9,7 @@
 #include <pthread.h>
 #elif defined(__APPLE__)
 #include <sys/resource.h>
-#elif defined (_WIN32)
+#elif defined(_WIN32)
 #include <windows.h>
 #endif
 
@@ -96,7 +95,8 @@ void AsyncTaskRunner::runAsync(const llvm::Twine &Name,
   };
 
   // Ensure our worker threads have big enough stacks to run clang.
-  llvm::llvm_execute_on_thread_async(std::move(Task), clang::DesiredStackSize);
+  llvm::llvm_execute_on_thread_async(std::move(Task),
+                                     /*clang::DesiredStackSize*/ 8 << 20);
 }
 
 Deadline timeoutSeconds(llvm::Optional<double> Seconds) {
similarity index 96%
rename from clang-tools-extra/clangd/Threading.h
rename to clang-tools-extra/clangd/support/Threading.h
index 878069f..310dd7b 100644 (file)
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_THREADING_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_THREADING_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_THREADING_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_THREADING_H
 
-#include "Context.h"
+#include "support/Context.h"
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ADT/Twine.h"
 #include <cassert>
similarity index 98%
rename from clang-tools-extra/clangd/Trace.cpp
rename to clang-tools-extra/clangd/support/Trace.cpp
index 5bcbf22..b880a5b 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Trace.h"
-#include "Context.h"
+#include "support/Trace.h"
+#include "support/Context.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/Support/Chrono.h"
@@ -149,10 +149,10 @@ private:
   void rawEvent(llvm::StringRef Phase,
                 const llvm::json::Object &Event) /*REQUIRES(Mu)*/ {
     // PID 0 represents the clangd process.
-    Out.object([&]{
+    Out.object([&] {
       Out.attribute("pid", 0);
       Out.attribute("ph", Phase);
-      for (const autoKV : Event)
+      for (const auto &KV : Event)
         Out.attribute(KV.first, KV.second);
     });
   }
similarity index 96%
rename from clang-tools-extra/clangd/Trace.h
rename to clang-tools-extra/clangd/support/Trace.h
index 55dc0ef..e2c91eb 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRACE_H_
-#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRACE_H_
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_TRACE_H_
+#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SUPPORT_TRACE_H_
 
-#include "Context.h"
+#include "support/Context.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
@@ -104,4 +104,4 @@ private:
 } // namespace clangd
 } // namespace clang
 
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRACE_H_
+#endif
index 92e46a6..575722e 100644 (file)
@@ -9,15 +9,15 @@
 #include "ClangdLSPServer.h"
 #include "CodeComplete.h"
 #include "Features.inc"
-#include "Path.h"
 #include "PathMapping.h"
 #include "Protocol.h"
-#include "Shutdown.h"
-#include "Trace.h"
 #include "Transport.h"
 #include "index/Background.h"
 #include "index/Serialization.h"
 #include "refactor/Rename.h"
+#include "support/Path.h"
+#include "support/Shutdown.h"
+#include "support/Trace.h"
 #include "clang/Basic/Version.h"
 #include "clang/Format/Format.h"
 #include "llvm/ADT/Optional.h"
index 4119445..962a878 100644 (file)
@@ -27,7 +27,6 @@ add_unittest(ClangdUnitTests ClangdTests
   Annotations.cpp
   ASTTests.cpp
   BackgroundIndexTests.cpp
-  CancellationTests.cpp
   CanonicalIncludesTests.cpp
   ClangdTests.cpp
   ClangdLSPServerTests.cpp
@@ -35,7 +34,6 @@ add_unittest(ClangdUnitTests ClangdTests
   CodeCompletionStringsTests.cpp
   CollectMacrosTests.cpp
   CompileCommandsTests.cpp
-  ContextTests.cpp
   DexTests.cpp
   DiagnosticsTests.cpp
   DraftStoreTests.cpp
@@ -47,7 +45,6 @@ add_unittest(ClangdUnitTests ClangdTests
   FormattedStringTests.cpp
   FormatTests.cpp
   FSTests.cpp
-  FunctionTests.cpp
   FuzzyMatchTests.cpp
   GlobalCompilationDatabaseTests.cpp
   HeadersTests.cpp
@@ -76,14 +73,18 @@ add_unittest(ClangdUnitTests ClangdTests
   TestFS.cpp
   TestIndex.cpp
   TestTU.cpp
-  ThreadingTests.cpp
-  TraceTests.cpp
   TypeHierarchyTests.cpp
   TweakTests.cpp
   TweakTesting.cpp
   URITests.cpp
   XRefsTests.cpp
 
+  support/CancellationTests.cpp
+  support/ContextTests.cpp
+  support/FunctionTests.cpp
+  support/ThreadingTests.cpp
+  support/TraceTests.cpp
+
   $<TARGET_OBJECTS:obj.clangDaemonTweaks>
   )
 
@@ -107,6 +108,7 @@ clang_target_link_libraries(ClangdTests
 target_link_libraries(ClangdTests
   PRIVATE
   clangDaemon
+  clangdSupport
   clangTidy
   LLVMSupport
   LLVMTestingSupport
index 5f169fe..aa65a2e 100644 (file)
 #include "ClangdLSPServer.h"
 #include "CodeComplete.h"
 #include "LSPClient.h"
-#include "Logger.h"
 #include "Protocol.h"
 #include "TestFS.h"
 #include "refactor/Rename.h"
+#include "support/Logger.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Testing/Support/SupportHelpers.h"
 #include "gmock/gmock.h"
index 8bb4cad..81075ff 100644 (file)
@@ -14,8 +14,8 @@
 #include "Matchers.h"
 #include "SyncAPI.h"
 #include "TestFS.h"
-#include "Threading.h"
 #include "URI.h"
+#include "support/Threading.h"
 #include "clang/Config/config.h"
 #include "clang/Sema/CodeCompleteConsumer.h"
 #include "llvm/ADT/SmallVector.h"
index 4763702..d8926d4 100644 (file)
@@ -18,9 +18,9 @@
 #include "TestFS.h"
 #include "TestIndex.h"
 #include "TestTU.h"
-#include "Threading.h"
 #include "index/Index.h"
 #include "index/MemIndex.h"
+#include "support/Threading.h"
 #include "clang/Sema/CodeCompleteConsumer.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/Support/Error.h"
index 7f4cff1..90d3621 100644 (file)
@@ -9,13 +9,13 @@
 #include "Annotations.h"
 #include "Diagnostics.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "Protocol.h"
 #include "SourceCode.h"
 #include "TestFS.h"
 #include "TestIndex.h"
 #include "TestTU.h"
 #include "index/MemIndex.h"
+#include "support/Path.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticSema.h"
 #include "llvm/Support/ScopedPrinter.h"
index aaae58b..e68b8d7 100644 (file)
@@ -9,8 +9,8 @@
 #include "GlobalCompilationDatabase.h"
 
 #include "Matchers.h"
-#include "Path.h"
 #include "TestFS.h"
+#include "support/Path.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallString.h"
index 2a167bd..07ab70e 100644 (file)
@@ -5,9 +5,9 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-#include "Cancellation.h"
 #include "Protocol.h"
 #include "Transport.h"
+#include "support/Cancellation.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include <cstdio>
index 5e43314..08bbba2 100644 (file)
@@ -4,8 +4,8 @@
 
 #include "Protocol.h"
 #include "TestFS.h"
-#include "Threading.h"
 #include "Transport.h"
+#include "support/Threading.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 #include <queue>
index 71721fe..0521327 100644 (file)
@@ -6,10 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 #include "Annotations.h"
-#include "Context.h"
 #include "Protocol.h"
 #include "SourceCode.h"
 #include "TestTU.h"
+#include "support/Context.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/TokenKinds.h"
index 6f50a5a..1ed73ed 100644 (file)
@@ -7,17 +7,17 @@
 //===----------------------------------------------------------------------===//
 
 #include "Annotations.h"
-#include "Cancellation.h"
 #include "ClangdServer.h"
-#include "Context.h"
 #include "Diagnostics.h"
 #include "Matchers.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "Preamble.h"
 #include "TUScheduler.h"
 #include "TestFS.h"
-#include "Threading.h"
+#include "support/Cancellation.h"
+#include "support/Context.h"
+#include "support/Path.h"
+#include "support/Threading.h"
 #include "clang/Basic/DiagnosticDriver.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
index aad08f2..c436e9a 100644 (file)
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 #include "TestFS.h"
 #include "GlobalCompilationDatabase.h"
-#include "Path.h"
 #include "URI.h"
+#include "support/Path.h"
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
index a635d7c..7dde78d 100644 (file)
@@ -13,7 +13,7 @@
 #define LLVM_CLANG_TOOLS_EXTRA_UNITTESTS_CLANGD_TESTFS_H
 #include "ClangdServer.h"
 #include "GlobalCompilationDatabase.h"
-#include "Path.h"
+#include "support/Path.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/VirtualFileSystem.h"
index 229f65a..415326e 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "Compiler.h"
 #include "ParsedAST.h"
-#include "Path.h"
 #include "index/Index.h"
+#include "support/Path.h"
 #include "llvm/ADT/StringMap.h"
 #include "gtest/gtest.h"
 #include <string>
@@ -1,6 +1,6 @@
-#include "Cancellation.h"
-#include "Context.h"
-#include "Threading.h"
+#include "support/Cancellation.h"
+#include "support/Context.h"
+#include "support/Threading.h"
 #include "llvm/Support/Error.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Context.h"
+#include "support/Context.h"
 
 #include "gtest/gtest.h"
 
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Function.h"
+#include "support/Function.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Threading.h"
+#include "support/Threading.h"
 #include "gtest/gtest.h"
 #include <mutex>
 
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "Trace.h"
+#include "support/Trace.h"
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallString.h"
index f05767c..df8c361 100644 (file)
@@ -20,10 +20,10 @@ set(LLVM_OPTIONAL_SOURCES Conversion.cpp XPCTransport.cpp)
 
 add_clang_library(clangdXpcJsonConversions
   Conversion.cpp
-  LINK_LIBS clangDaemon
+  LINK_LIBS clangDaemon clangdSupport
   )
 
 add_clang_library(clangdXpcTransport
   XPCTransport.cpp
-  LINK_LIBS clangDaemon clangdXpcJsonConversions
+  LINK_LIBS clangDaemon clangdSupport clangdXpcJsonConversions
   )
index 3e8d36b..9b52a68 100644 (file)
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "xpc/Conversion.h"
-#include "Logger.h"
+#include "support/Logger.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ScopedPrinter.h"
 #include <string>
index 02c1b08..50eacf2 100644 (file)
@@ -6,9 +6,9 @@
 //
 //===----------------------------------------------------------------------===//
 #include "Conversion.h"
-#include "Logger.h"
 #include "Protocol.h" // For LSPError
 #include "Transport.h"
+#include "support/Logger.h"
 #include "llvm/Support/Errno.h"
 
 #include <xpc/xpc.h>