From ad97ccf6b26a29262c9cbf5b3e7f6e84c6dcf55f Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 28 Apr 2020 17:49:17 +0200 Subject: [PATCH] [clangd] Move non-clang base pieces into separate support/ lib. NFCI 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 --- clang-tools-extra/clangd/CMakeLists.txt | 22 +++------------ clang-tools-extra/clangd/ClangdLSPServer.cpp | 4 +-- clang-tools-extra/clangd/ClangdLSPServer.h | 4 +-- clang-tools-extra/clangd/ClangdServer.cpp | 4 +-- clang-tools-extra/clangd/ClangdServer.h | 6 ++--- clang-tools-extra/clangd/CodeComplete.cpp | 6 ++--- clang-tools-extra/clangd/CodeComplete.h | 4 +-- clang-tools-extra/clangd/CompileCommands.cpp | 2 +- clang-tools-extra/clangd/Compiler.cpp | 2 +- clang-tools-extra/clangd/Diagnostics.cpp | 2 +- clang-tools-extra/clangd/Diagnostics.h | 2 +- clang-tools-extra/clangd/DraftStore.cpp | 2 +- clang-tools-extra/clangd/DraftStore.h | 2 +- clang-tools-extra/clangd/FS.h | 2 +- clang-tools-extra/clangd/FileDistance.cpp | 2 +- clang-tools-extra/clangd/FindSymbols.cpp | 2 +- clang-tools-extra/clangd/FindTarget.cpp | 2 +- clang-tools-extra/clangd/Format.cpp | 4 +-- .../clangd/GlobalCompilationDatabase.cpp | 4 +-- .../clangd/GlobalCompilationDatabase.h | 4 +-- clang-tools-extra/clangd/HeaderSourceSwitch.cpp | 2 +- clang-tools-extra/clangd/Headers.cpp | 2 +- clang-tools-extra/clangd/Headers.h | 2 +- clang-tools-extra/clangd/Hover.cpp | 2 +- clang-tools-extra/clangd/IncludeFixer.cpp | 4 +-- clang-tools-extra/clangd/JSONTransport.cpp | 6 ++--- clang-tools-extra/clangd/ParsedAST.cpp | 4 +-- clang-tools-extra/clangd/ParsedAST.h | 2 +- clang-tools-extra/clangd/Preamble.cpp | 4 +-- clang-tools-extra/clangd/Preamble.h | 2 +- clang-tools-extra/clangd/Protocol.cpp | 2 +- clang-tools-extra/clangd/QueryDriverDatabase.cpp | 6 ++--- clang-tools-extra/clangd/Selection.cpp | 2 +- clang-tools-extra/clangd/SemanticHighlighting.cpp | 2 +- clang-tools-extra/clangd/SourceCode.cpp | 4 +-- clang-tools-extra/clangd/SourceCode.h | 2 +- clang-tools-extra/clangd/TUScheduler.cpp | 12 ++++----- clang-tools-extra/clangd/TUScheduler.h | 6 ++--- clang-tools-extra/clangd/XRefs.cpp | 2 +- clang-tools-extra/clangd/XRefs.h | 2 +- clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp | 2 +- clang-tools-extra/clangd/index/Background.cpp | 12 ++++----- clang-tools-extra/clangd/index/Background.h | 8 +++--- .../clangd/index/BackgroundIndexLoader.cpp | 4 +-- .../clangd/index/BackgroundIndexLoader.h | 2 +- .../clangd/index/BackgroundIndexStorage.cpp | 4 +-- clang-tools-extra/clangd/index/BackgroundQueue.cpp | 2 +- .../clangd/index/BackgroundRebuild.cpp | 8 +++--- clang-tools-extra/clangd/index/FileIndex.cpp | 4 +-- clang-tools-extra/clangd/index/FileIndex.h | 2 +- clang-tools-extra/clangd/index/Index.cpp | 2 +- clang-tools-extra/clangd/index/IndexAction.cpp | 2 +- clang-tools-extra/clangd/index/MemIndex.cpp | 4 +-- clang-tools-extra/clangd/index/Merge.cpp | 4 +-- clang-tools-extra/clangd/index/Serialization.cpp | 4 +-- clang-tools-extra/clangd/index/SymbolCollector.cpp | 2 +- .../clangd/index/YAMLSerialization.cpp | 2 +- clang-tools-extra/clangd/index/dex/Dex.cpp | 4 +-- .../clangd/index/remote/CMakeLists.txt | 1 + clang-tools-extra/clangd/index/remote/Client.cpp | 4 +-- .../clangd/index/remote/marshalling/CMakeLists.txt | 1 + .../index/remote/marshalling/Marshalling.cpp | 2 +- .../index/remote/unimplemented/CMakeLists.txt | 1 + .../remote/unimplemented/UnimplementedClient.cpp | 2 +- clang-tools-extra/clangd/refactor/Rename.cpp | 4 +-- clang-tools-extra/clangd/refactor/Rename.h | 2 +- clang-tools-extra/clangd/refactor/Tweak.cpp | 4 +-- clang-tools-extra/clangd/refactor/Tweak.h | 2 +- .../clangd/refactor/tweaks/AddUsing.cpp | 2 +- .../clangd/refactor/tweaks/CMakeLists.txt | 1 + .../clangd/refactor/tweaks/DefineInline.cpp | 2 +- .../clangd/refactor/tweaks/DefineOutline.cpp | 4 +-- .../clangd/refactor/tweaks/ExpandAutoType.cpp | 8 +++--- .../clangd/refactor/tweaks/ExtractFunction.cpp | 2 +- .../clangd/refactor/tweaks/ExtractVariable.cpp | 2 +- .../refactor/tweaks/ObjCLocalizeStringLiteral.cpp | 2 +- .../clangd/refactor/tweaks/RawStringLiteral.cpp | 2 +- .../clangd/refactor/tweaks/SwapIfBranches.cpp | 2 +- clang-tools-extra/clangd/support/CMakeLists.txt | 31 ++++++++++++++++++++++ .../clangd/{ => support}/Cancellation.cpp | 2 +- .../clangd/{ => support}/Cancellation.h | 6 ++--- clang-tools-extra/clangd/{ => support}/Context.cpp | 2 +- clang-tools-extra/clangd/{ => support}/Context.h | 22 +++++++-------- .../clangd/{ => support}/FSProvider.cpp | 2 +- .../clangd/{ => support}/FSProvider.h | 4 +-- clang-tools-extra/clangd/{ => support}/Function.h | 4 +-- clang-tools-extra/clangd/{ => support}/Logger.cpp | 4 +-- clang-tools-extra/clangd/{ => support}/Logger.h | 4 +-- clang-tools-extra/clangd/{ => support}/Path.h | 4 +-- .../clangd/{ => support}/Shutdown.cpp | 7 ++--- clang-tools-extra/clangd/{ => support}/Shutdown.h | 4 +-- .../clangd/{ => support}/Threading.cpp | 10 +++---- clang-tools-extra/clangd/{ => support}/Threading.h | 6 ++--- clang-tools-extra/clangd/{ => support}/Trace.cpp | 8 +++--- clang-tools-extra/clangd/{ => support}/Trace.h | 8 +++--- clang-tools-extra/clangd/tool/ClangdMain.cpp | 6 ++--- clang-tools-extra/clangd/unittests/CMakeLists.txt | 12 +++++---- .../clangd/unittests/ClangdLSPServerTests.cpp | 2 +- clang-tools-extra/clangd/unittests/ClangdTests.cpp | 2 +- .../clangd/unittests/CodeCompleteTests.cpp | 2 +- .../clangd/unittests/DiagnosticsTests.cpp | 2 +- .../unittests/GlobalCompilationDatabaseTests.cpp | 2 +- .../clangd/unittests/JSONTransportTests.cpp | 2 +- clang-tools-extra/clangd/unittests/LSPClient.cpp | 2 +- .../clangd/unittests/SourceCodeTests.cpp | 2 +- .../clangd/unittests/TUSchedulerTests.cpp | 8 +++--- clang-tools-extra/clangd/unittests/TestFS.cpp | 2 +- clang-tools-extra/clangd/unittests/TestFS.h | 2 +- clang-tools-extra/clangd/unittests/TestTU.h | 2 +- .../unittests/{ => support}/CancellationTests.cpp | 6 ++--- .../unittests/{ => support}/ContextTests.cpp | 2 +- .../unittests/{ => support}/FunctionTests.cpp | 2 +- .../unittests/{ => support}/ThreadingTests.cpp | 2 +- .../clangd/unittests/{ => support}/TraceTests.cpp | 2 +- clang-tools-extra/clangd/xpc/CMakeLists.txt | 4 +-- clang-tools-extra/clangd/xpc/Conversion.cpp | 2 +- clang-tools-extra/clangd/xpc/XPCTransport.cpp | 2 +- 117 files changed, 245 insertions(+), 227 deletions(-) create mode 100644 clang-tools-extra/clangd/support/CMakeLists.txt rename clang-tools-extra/clangd/{ => support}/Cancellation.cpp (97%) rename clang-tools-extra/clangd/{ => support}/Cancellation.h (96%) rename clang-tools-extra/clangd/{ => support}/Context.cpp (97%) rename clang-tools-extra/clangd/{ => support}/Context.h (93%) rename clang-tools-extra/clangd/{ => support}/FSProvider.cpp (98%) rename clang-tools-extra/clangd/{ => support}/FSProvider.h (91%) rename clang-tools-extra/clangd/{ => support}/Function.h (96%) rename clang-tools-extra/clangd/{ => support}/Logger.cpp (96%) rename clang-tools-extra/clangd/{ => support}/Logger.h (97%) rename clang-tools-extra/clangd/{ => support}/Path.h (87%) rename clang-tools-extra/clangd/{ => support}/Shutdown.cpp (91%) rename clang-tools-extra/clangd/{ => support}/Shutdown.h (96%) rename clang-tools-extra/clangd/{ => support}/Threading.cpp (93%) rename clang-tools-extra/clangd/{ => support}/Threading.h (96%) rename clang-tools-extra/clangd/{ => support}/Trace.cpp (98%) rename clang-tools-extra/clangd/{ => support}/Trace.h (96%) rename clang-tools-extra/clangd/unittests/{ => support}/CancellationTests.cpp (96%) rename clang-tools-extra/clangd/unittests/{ => support}/ContextTests.cpp (98%) rename clang-tools-extra/clangd/unittests/{ => support}/FunctionTests.cpp (97%) rename clang-tools-extra/clangd/unittests/{ => support}/ThreadingTests.cpp (98%) rename clang-tools-extra/clangd/unittests/{ => support}/TraceTests.cpp (99%) diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt index 124f087..146f1b3 100644 --- a/clang-tools-extra/clangd/CMakeLists.txt +++ b/clang-tools-extra/clangd/CMakeLists.txt @@ -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} ) diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index f58bfaf..4ca4f83 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "ClangdLSPServer.h" -#include "Context.h" #include "Diagnostics.h" #include "DraftStore.h" #include "FormattedString.h" @@ -16,9 +15,10 @@ #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" diff --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h index 9c35ca6..c3da2f9 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.h +++ b/clang-tools-extra/clangd/ClangdLSPServer.h @@ -10,14 +10,14 @@ #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" diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index c5148f8..3dce7fe 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -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" @@ -21,13 +20,14 @@ #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" diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h index f6e7e07..d36dfd1 100644 --- a/clang-tools-extra/clangd/ClangdServer.h +++ b/clang-tools-extra/clangd/ClangdServer.h @@ -10,11 +10,8 @@ #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" diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 3d9bfe5..d218d6b 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -26,18 +26,18 @@ #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" diff --git a/clang-tools-extra/clangd/CodeComplete.h b/clang-tools-extra/clangd/CodeComplete.h index 3adea47..1e23704 100644 --- a/clang-tools-extra/clangd/CodeComplete.h +++ b/clang-tools-extra/clangd/CodeComplete.h @@ -16,13 +16,13 @@ #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" diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp index ae343d5..84f72f5 100644 --- a/clang-tools-extra/clangd/CompileCommands.cpp +++ b/clang-tools-extra/clangd/CompileCommands.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Compiler.cpp b/clang-tools-extra/clangd/Compiler.cpp index 47cec5a..957d7c3 100644 --- a/clang-tools-extra/clangd/Compiler.cpp +++ b/clang-tools-extra/clangd/Compiler.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Diagnostics.cpp b/clang-tools-extra/clangd/Diagnostics.cpp index d72c2bd..3558ca9 100644 --- a/clang-tools-extra/clangd/Diagnostics.cpp +++ b/clang-tools-extra/clangd/Diagnostics.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Diagnostics.h b/clang-tools-extra/clangd/Diagnostics.h index 7461f852..ebf86ba 100644 --- a/clang-tools-extra/clangd/Diagnostics.h +++ b/clang-tools-extra/clangd/Diagnostics.h @@ -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" diff --git a/clang-tools-extra/clangd/DraftStore.cpp b/clang-tools-extra/clangd/DraftStore.cpp index 03867dc..bef48dd 100644 --- a/clang-tools-extra/clangd/DraftStore.cpp +++ b/clang-tools-extra/clangd/DraftStore.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "DraftStore.h" -#include "Logger.h" #include "SourceCode.h" +#include "support/Logger.h" #include "llvm/Support/Errc.h" namespace clang { diff --git a/clang-tools-extra/clangd/DraftStore.h b/clang-tools-extra/clangd/DraftStore.h index babc679..3c2d0c6 100644 --- a/clang-tools-extra/clangd/DraftStore.h +++ b/clang-tools-extra/clangd/DraftStore.h @@ -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 diff --git a/clang-tools-extra/clangd/FS.h b/clang-tools-extra/clangd/FS.h index 7b7f7cb..5994bdf 100644 --- a/clang-tools-extra/clangd/FS.h +++ b/clang-tools-extra/clangd/FS.h @@ -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" diff --git a/clang-tools-extra/clangd/FileDistance.cpp b/clang-tools-extra/clangd/FileDistance.cpp index a9ce3e5..584c64d 100644 --- a/clang-tools-extra/clangd/FileDistance.cpp +++ b/clang-tools-extra/clangd/FileDistance.cpp @@ -31,7 +31,7 @@ //===-------------------------------------------------------------------------// #include "FileDistance.h" -#include "Logger.h" +#include "support/Logger.h" #include "llvm/ADT/STLExtras.h" #include diff --git a/clang-tools-extra/clangd/FindSymbols.cpp b/clang-tools-extra/clangd/FindSymbols.cpp index 06c124c..58e2ee1 100644 --- a/clang-tools-extra/clangd/FindSymbols.cpp +++ b/clang-tools-extra/clangd/FindSymbols.cpp @@ -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" diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp index be3306f..2813e30 100644 --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Format.cpp b/clang-tools-extra/clangd/Format.cpp index b8b9d8e..052cf74 100644 --- a/clang-tools-extra/clangd/Format.cpp +++ b/clang-tools-extra/clangd/Format.cpp @@ -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" diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp index 3f8a7d8..5e75864 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp @@ -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" diff --git a/clang-tools-extra/clangd/GlobalCompilationDatabase.h b/clang-tools-extra/clangd/GlobalCompilationDatabase.h index 2fc7549..e9a5417 100644 --- a/clang-tools-extra/clangd/GlobalCompilationDatabase.h +++ b/clang-tools-extra/clangd/GlobalCompilationDatabase.h @@ -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" diff --git a/clang-tools-extra/clangd/HeaderSourceSwitch.cpp b/clang-tools-extra/clangd/HeaderSourceSwitch.cpp index 1490d3e..3ebf054 100644 --- a/clang-tools-extra/clangd/HeaderSourceSwitch.cpp +++ b/clang-tools-extra/clangd/HeaderSourceSwitch.cpp @@ -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 { diff --git a/clang-tools-extra/clangd/Headers.cpp b/clang-tools-extra/clangd/Headers.cpp index dd4cafd..c0e19f2 100644 --- a/clang-tools-extra/clangd/Headers.cpp +++ b/clang-tools-extra/clangd/Headers.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Headers.h b/clang-tools-extra/clangd/Headers.h index 1f39687..2ffa902 100644 --- a/clang-tools-extra/clangd/Headers.h +++ b/clang-tools-extra/clangd/Headers.h @@ -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" diff --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp index ba8fcd4..b0ac041 100644 --- a/clang-tools-extra/clangd/Hover.cpp +++ b/clang-tools-extra/clangd/Hover.cpp @@ -12,11 +12,11 @@ #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" diff --git a/clang-tools-extra/clangd/IncludeFixer.cpp b/clang-tools-extra/clangd/IncludeFixer.cpp index 45fb07a..945f4ec 100644 --- a/clang-tools-extra/clangd/IncludeFixer.cpp +++ b/clang-tools-extra/clangd/IncludeFixer.cpp @@ -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" diff --git a/clang-tools-extra/clangd/JSONTransport.cpp b/clang-tools-extra/clangd/JSONTransport.cpp index a925473..fa86baf 100644 --- a/clang-tools-extra/clangd/JSONTransport.cpp +++ b/clang-tools-extra/clangd/JSONTransport.cpp @@ -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" diff --git a/clang-tools-extra/clangd/ParsedAST.cpp b/clang-tools-extra/clangd/ParsedAST.cpp index 7b24261..61221aa 100644 --- a/clang-tools-extra/clangd/ParsedAST.cpp +++ b/clang-tools-extra/clangd/ParsedAST.cpp @@ -14,11 +14,11 @@ #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" diff --git a/clang-tools-extra/clangd/ParsedAST.h b/clang-tools-extra/clangd/ParsedAST.h index 88fb6c3b2d..d90f77f 100644 --- a/clang-tools-extra/clangd/ParsedAST.h +++ b/clang-tools-extra/clangd/ParsedAST.h @@ -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" diff --git a/clang-tools-extra/clangd/Preamble.cpp b/clang-tools-extra/clangd/Preamble.cpp index 8392748..2768bd1 100644 --- a/clang-tools-extra/clangd/Preamble.cpp +++ b/clang-tools-extra/clangd/Preamble.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Preamble.h b/clang-tools-extra/clangd/Preamble.h index 10c292a..f2e1ba9 100644 --- a/clang-tools-extra/clangd/Preamble.h +++ b/clang-tools-extra/clangd/Preamble.h @@ -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" diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp index b0c7ce2..314e6b0 100644 --- a/clang-tools-extra/clangd/Protocol.cpp +++ b/clang-tools-extra/clangd/Protocol.cpp @@ -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" diff --git a/clang-tools-extra/clangd/QueryDriverDatabase.cpp b/clang-tools-extra/clangd/QueryDriverDatabase.cpp index d6502c6..2ab217da 100644 --- a/clang-tools-extra/clangd/QueryDriverDatabase.cpp +++ b/clang-tools-extra/clangd/QueryDriverDatabase.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Selection.cpp b/clang-tools-extra/clangd/Selection.cpp index b456544..7d52714 100644 --- a/clang-tools-extra/clangd/Selection.cpp +++ b/clang-tools-extra/clangd/Selection.cpp @@ -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" diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp index baf1375..d2470da 100644 --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -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" diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp index dd4c863..d50968b 100644 --- a/clang-tools-extra/clangd/SourceCode.cpp +++ b/clang-tools-extra/clangd/SourceCode.cpp @@ -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" diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h index d1e5aa5..c00cc17 100644 --- a/clang-tools-extra/clangd/SourceCode.h +++ b/clang-tools-extra/clangd/SourceCode.h @@ -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" diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp index 1ff6bba..db5ac85 100644 --- a/clang-tools-extra/clangd/TUScheduler.cpp +++ b/clang-tools-extra/clangd/TUScheduler.cpp @@ -47,18 +47,18 @@ // 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" diff --git a/clang-tools-extra/clangd/TUScheduler.h b/clang-tools-extra/clangd/TUScheduler.h index 48ed2c7..f24a777 100644 --- a/clang-tools-extra/clangd/TUScheduler.h +++ b/clang-tools-extra/clangd/TUScheduler.h @@ -11,11 +11,11 @@ #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" diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp index 7eb3c4f..4418564 100644 --- a/clang-tools-extra/clangd/XRefs.cpp +++ b/clang-tools-extra/clangd/XRefs.cpp @@ -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" diff --git a/clang-tools-extra/clangd/XRefs.h b/clang-tools-extra/clangd/XRefs.h index 4645d32..d1ba7ba 100644 --- a/clang-tools-extra/clangd/XRefs.h +++ b/clang-tools-extra/clangd/XRefs.h @@ -14,11 +14,11 @@ #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" diff --git a/clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp b/clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp index 9776b05..982d5fa 100644 --- a/clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp +++ b/clang-tools-extra/clangd/fuzzer/clangd-fuzzer.cpp @@ -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 #include diff --git a/clang-tools-extra/clangd/index/Background.cpp b/clang-tools-extra/clangd/index/Background.cpp index 4c5719d..67fed77 100644 --- a/clang-tools-extra/clangd/index/Background.cpp +++ b/clang-tools-extra/clangd/index/Background.cpp @@ -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" @@ -27,6 +21,12 @@ #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" diff --git a/clang-tools-extra/clangd/index/Background.h b/clang-tools-extra/clangd/index/Background.h index 2ae11c7..ffaea75 100644 --- a/clang-tools-extra/clangd/index/Background.h +++ b/clang-tools-extra/clangd/index/Background.h @@ -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" diff --git a/clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp b/clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp index 08bf07d..5645569 100644 --- a/clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp +++ b/clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/BackgroundIndexLoader.h b/clang-tools-extra/clangd/index/BackgroundIndexLoader.h index 0caf1b4..aa7ee39 100644 --- a/clang-tools-extra/clangd/index/BackgroundIndexLoader.h +++ b/clang-tools-extra/clangd/index/BackgroundIndexLoader.h @@ -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" diff --git a/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp b/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp index 765b710..eee050b 100644 --- a/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp +++ b/clang-tools-extra/clangd/index/BackgroundIndexStorage.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/BackgroundQueue.cpp b/clang-tools-extra/clangd/index/BackgroundQueue.cpp index 00d483f..3262a2f 100644 --- a/clang-tools-extra/clangd/index/BackgroundQueue.cpp +++ b/clang-tools-extra/clangd/index/BackgroundQueue.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "Logger.h" #include "index/Background.h" +#include "support/Logger.h" namespace clang { namespace clangd { diff --git a/clang-tools-extra/clangd/index/BackgroundRebuild.cpp b/clang-tools-extra/clangd/index/BackgroundRebuild.cpp index 5cc61a6..2aa5fa9 100644 --- a/clang-tools-extra/clangd/index/BackgroundRebuild.cpp +++ b/clang-tools-extra/clangd/index/BackgroundRebuild.cpp @@ -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" @@ -24,6 +20,10 @@ #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" diff --git a/clang-tools-extra/clangd/index/FileIndex.cpp b/clang-tools-extra/clangd/index/FileIndex.cpp index 590bf46..6a94b9c 100644 --- a/clang-tools-extra/clangd/index/FileIndex.cpp +++ b/clang-tools-extra/clangd/index/FileIndex.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/FileIndex.h b/clang-tools-extra/clangd/index/FileIndex.h index 539f232..5c87766 100644 --- a/clang-tools-extra/clangd/index/FileIndex.h +++ b/clang-tools-extra/clangd/index/FileIndex.h @@ -19,12 +19,12 @@ #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" diff --git a/clang-tools-extra/clangd/index/Index.cpp b/clang-tools-extra/clangd/index/Index.cpp index 9ec4908..e4eb1b5 100644 --- a/clang-tools-extra/clangd/index/Index.cpp +++ b/clang-tools-extra/clangd/index/Index.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp index 8fd2159..9f294d4 100644 --- a/clang-tools-extra/clangd/index/IndexAction.cpp +++ b/clang-tools-extra/clangd/index/IndexAction.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/MemIndex.cpp b/clang-tools-extra/clangd/index/MemIndex.cpp index 453b226..46e9c0a8 100644 --- a/clang-tools-extra/clangd/index/MemIndex.cpp +++ b/clang-tools-extra/clangd/index/MemIndex.cpp @@ -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 { diff --git a/clang-tools-extra/clangd/index/Merge.cpp b/clang-tools-extra/clangd/index/Merge.cpp index 0cef7dc..a93aa20 100644 --- a/clang-tools-extra/clangd/index/Merge.cpp +++ b/clang-tools-extra/clangd/index/Merge.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/Serialization.cpp b/clang-tools-extra/clangd/index/Serialization.cpp index 6ba4e04..06527a6 100644 --- a/clang-tools-extra/clangd/index/Serialization.cpp +++ b/clang-tools-extra/clangd/index/Serialization.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp b/clang-tools-extra/clangd/index/SymbolCollector.cpp index 739aef8..b502dfb 100644 --- a/clang-tools-extra/clangd/index/SymbolCollector.cpp +++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp @@ -12,11 +12,11 @@ #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" diff --git a/clang-tools-extra/clangd/index/YAMLSerialization.cpp b/clang-tools-extra/clangd/index/YAMLSerialization.cpp index fc515a1..4f6bd92 100644 --- a/clang-tools-extra/clangd/index/YAMLSerialization.cpp +++ b/clang-tools-extra/clangd/index/YAMLSerialization.cpp @@ -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" diff --git a/clang-tools-extra/clangd/index/dex/Dex.cpp b/clang-tools-extra/clangd/index/dex/Dex.cpp index 36ddedd..a663e53 100644 --- a/clang-tools-extra/clangd/index/dex/Dex.cpp +++ b/clang-tools-extra/clangd/index/dex/Dex.cpp @@ -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 diff --git a/clang-tools-extra/clangd/index/remote/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/CMakeLists.txt index 1bd336e..a358aae 100644 --- a/clang-tools-extra/clangd/index/remote/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/CMakeLists.txt @@ -18,6 +18,7 @@ if (CLANGD_ENABLE_REMOTE) protobuf grpc++ clangDaemon + clangdSupport ) add_subdirectory(marshalling) diff --git a/clang-tools-extra/clangd/index/remote/Client.cpp b/clang-tools-extra/clangd/index/remote/Client.cpp index 0c5fe14..3ba1dfe 100644 --- a/clang-tools-extra/clangd/index/remote/Client.cpp +++ b/clang-tools-extra/clangd/index/remote/Client.cpp @@ -10,10 +10,10 @@ #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 { diff --git a/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt index 4789a72..0e5e513 100644 --- a/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/marshalling/CMakeLists.txt @@ -6,4 +6,5 @@ add_clang_library(clangdRemoteMarshalling protobuf clangDaemon + clangdSupport ) diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp index d2ec071..60a258a 100644 --- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "Marshalling.h" -#include "Logger.h" #include "index/Serialization.h" +#include "support/Logger.h" namespace clang { namespace clangd { diff --git a/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt b/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt index aebe4e6..5d223ad 100644 --- a/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt +++ b/clang-tools-extra/clangd/index/remote/unimplemented/CMakeLists.txt @@ -7,4 +7,5 @@ add_clang_library(clangdRemoteIndex LINK_LIBS clangDaemon + clangdSupport ) diff --git a/clang-tools-extra/clangd/index/remote/unimplemented/UnimplementedClient.cpp b/clang-tools-extra/clangd/index/remote/unimplemented/UnimplementedClient.cpp index 725f0e4..f0fb612 100644 --- a/clang-tools-extra/clangd/index/remote/unimplemented/UnimplementedClient.cpp +++ b/clang-tools-extra/clangd/index/remote/unimplemented/UnimplementedClient.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "Logger.h" #include "index/remote/Client.h" +#include "support/Logger.h" namespace clang { namespace clangd { diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp index 0585897..c08f6ea 100644 --- a/clang-tools-extra/clangd/refactor/Rename.cpp +++ b/clang-tools-extra/clangd/refactor/Rename.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/Rename.h b/clang-tools-extra/clangd/refactor/Rename.h index 5c53ba6..e279516 100644 --- a/clang-tools-extra/clangd/refactor/Rename.h +++ b/clang-tools-extra/clangd/refactor/Rename.h @@ -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" diff --git a/clang-tools-extra/clangd/refactor/Tweak.cpp b/clang-tools-extra/clangd/refactor/Tweak.cpp index 3e3033c..b1f4dcd 100644 --- a/clang-tools-extra/clangd/refactor/Tweak.cpp +++ b/clang-tools-extra/clangd/refactor/Tweak.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/Tweak.h b/clang-tools-extra/clangd/refactor/Tweak.h index 84d3bdb..10e3e8d 100644 --- a/clang-tools-extra/clangd/refactor/Tweak.h +++ b/clang-tools-extra/clangd/refactor/Tweak.h @@ -20,11 +20,11 @@ #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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp index f2ef235..836ac9a 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt index 995288b..c5bff2f 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt +++ b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt @@ -30,6 +30,7 @@ add_clang_library(clangDaemonTweaks OBJECT clangAST clangBasic clangDaemon + clangdSupport clangFormat clangLex clangToolingCore diff --git a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp index b1057d8..e28a2c4 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp b/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp index c2d344a..405ff90 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp index bffd6c0..d2dfc4a 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp @@ -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 #include #include #include -#include -#include "XRefs.h" -#include "llvm/ADT/StringExtras.h" namespace clang { namespace clangd { diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp index a22b5ab..dd62670 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp @@ -47,11 +47,11 @@ //===----------------------------------------------------------------------===// #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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp index cf38227c2..69bfe67 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp b/clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp index 62a306c..2534cf5 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ObjCLocalizeStringLiteral.cpp @@ -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" diff --git a/clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp b/clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp index c5f480c..bec45be 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/RawStringLiteral.cpp @@ -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/refactor/tweaks/SwapIfBranches.cpp b/clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp index 1d57cd5c..2422743 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/SwapIfBranches.cpp @@ -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 index 0000000..719d757 --- /dev/null +++ b/clang-tools-extra/clangd/support/CMakeLists.txt @@ -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} + ) diff --git a/clang-tools-extra/clangd/Cancellation.cpp b/clang-tools-extra/clangd/support/Cancellation.cpp similarity index 97% rename from clang-tools-extra/clangd/Cancellation.cpp rename to clang-tools-extra/clangd/support/Cancellation.cpp index 2120e70..d544c17 100644 --- a/clang-tools-extra/clangd/Cancellation.cpp +++ b/clang-tools-extra/clangd/support/Cancellation.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Cancellation.h" +#include "support/Cancellation.h" #include namespace clang { diff --git a/clang-tools-extra/clangd/Cancellation.h b/clang-tools-extra/clangd/support/Cancellation.h similarity index 96% rename from clang-tools-extra/clangd/Cancellation.h rename to clang-tools-extra/clangd/support/Cancellation.h index 0bee6f3..f33b0b5 100644 --- a/clang-tools-extra/clangd/Cancellation.h +++ b/clang-tools-extra/clangd/support/Cancellation.h @@ -54,10 +54,10 @@ // 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 #include diff --git a/clang-tools-extra/clangd/Context.cpp b/clang-tools-extra/clangd/support/Context.cpp similarity index 97% rename from clang-tools-extra/clangd/Context.cpp rename to clang-tools-extra/clangd/support/Context.cpp index 8e8bba6..266dd00 100644 --- a/clang-tools-extra/clangd/Context.cpp +++ b/clang-tools-extra/clangd/support/Context.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Context.h" +#include "support/Context.h" #include namespace clang { diff --git a/clang-tools-extra/clangd/Context.h b/clang-tools-extra/clangd/support/Context.h similarity index 93% rename from clang-tools-extra/clangd/Context.h rename to clang-tools-extra/clangd/support/Context.h index 71aeaba..894032b 100644 --- a/clang-tools-extra/clangd/Context.h +++ b/clang-tools-extra/clangd/support/Context.h @@ -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 Context derive(const Key &Key, typename std::decay::type Value) const & { - return Context(std::make_shared(Data{ - /*Parent=*/DataPtr, &Key, - std::make_unique::type>>( - std::move(Value))})); + return Context(std::make_shared( + Data{/*Parent=*/DataPtr, &Key, + std::make_unique::type>>( + std::move(Value))})); } template Context derive(const Key &Key, typename std::decay::type Value) && /* takes ownership */ { - return Context(std::make_shared(Data{ - /*Parent=*/std::move(DataPtr), &Key, - std::make_unique::type>>( - std::move(Value))})); + return Context(std::make_shared( + Data{/*Parent=*/std::move(DataPtr), &Key, + std::make_unique::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 diff --git a/clang-tools-extra/clangd/FSProvider.cpp b/clang-tools-extra/clangd/support/FSProvider.cpp similarity index 98% rename from clang-tools-extra/clangd/FSProvider.cpp rename to clang-tools-extra/clangd/support/FSProvider.cpp index 80d6be0..6474a3c 100644 --- a/clang-tools-extra/clangd/FSProvider.cpp +++ b/clang-tools-extra/clangd/support/FSProvider.cpp @@ -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" diff --git a/clang-tools-extra/clangd/FSProvider.h b/clang-tools-extra/clangd/support/FSProvider.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 --- a/clang-tools-extra/clangd/FSProvider.h +++ b/clang-tools-extra/clangd/support/FSProvider.h @@ -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" diff --git a/clang-tools-extra/clangd/Function.h b/clang-tools-extra/clangd/support/Function.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 --- a/clang-tools-extra/clangd/Function.h +++ b/clang-tools-extra/clangd/support/Function.h @@ -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" diff --git a/clang-tools-extra/clangd/Logger.cpp b/clang-tools-extra/clangd/support/Logger.cpp similarity index 96% rename from clang-tools-extra/clangd/Logger.cpp rename to clang-tools-extra/clangd/support/Logger.cpp index 7b8c9a3..768d2e5 100644 --- a/clang-tools-extra/clangd/Logger.cpp +++ b/clang-tools-extra/clangd/support/Logger.cpp @@ -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" diff --git a/clang-tools-extra/clangd/Logger.h b/clang-tools-extra/clangd/support/Logger.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 --- a/clang-tools-extra/clangd/Logger.h +++ b/clang-tools-extra/clangd/support/Logger.h @@ -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" diff --git a/clang-tools-extra/clangd/Path.h b/clang-tools-extra/clangd/support/Path.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 --- a/clang-tools-extra/clangd/Path.h +++ b/clang-tools-extra/clangd/support/Path.h @@ -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 diff --git a/clang-tools-extra/clangd/Shutdown.cpp b/clang-tools-extra/clangd/support/Shutdown.cpp similarity index 91% rename from clang-tools-extra/clangd/Shutdown.cpp rename to clang-tools-extra/clangd/support/Shutdown.cpp index 36d9775..7ce01ee 100644 --- a/clang-tools-extra/clangd/Shutdown.cpp +++ b/clang-tools-extra/clangd/support/Shutdown.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Shutdown.h" +#include "support/Shutdown.h" #include #include @@ -31,10 +31,7 @@ void requestShutdown() { std::abort(); } -bool shutdownRequested() { - return ShutdownRequested; -} +bool shutdownRequested() { return ShutdownRequested; } } // namespace clangd } // namespace clang - diff --git a/clang-tools-extra/clangd/Shutdown.h b/clang-tools-extra/clangd/support/Shutdown.h similarity index 96% rename from clang-tools-extra/clangd/Shutdown.h rename to clang-tools-extra/clangd/support/Shutdown.h index 94ada31..896e152 100644 --- a/clang-tools-extra/clangd/Shutdown.h +++ b/clang-tools-extra/clangd/support/Shutdown.h @@ -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 #include diff --git a/clang-tools-extra/clangd/Threading.cpp b/clang-tools-extra/clangd/support/Threading.cpp similarity index 93% rename from clang-tools-extra/clangd/Threading.cpp rename to clang-tools-extra/clangd/support/Threading.cpp index a651b70..5f95888 100644 --- a/clang-tools-extra/clangd/Threading.cpp +++ b/clang-tools-extra/clangd/support/Threading.cpp @@ -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 #elif defined(__APPLE__) #include -#elif defined (_WIN32) +#elif defined(_WIN32) #include #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 Seconds) { diff --git a/clang-tools-extra/clangd/Threading.h b/clang-tools-extra/clangd/support/Threading.h similarity index 96% rename from clang-tools-extra/clangd/Threading.h rename to clang-tools-extra/clangd/support/Threading.h index 878069f..310dd7b 100644 --- a/clang-tools-extra/clangd/Threading.h +++ b/clang-tools-extra/clangd/support/Threading.h @@ -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 diff --git a/clang-tools-extra/clangd/Trace.cpp b/clang-tools-extra/clangd/support/Trace.cpp similarity index 98% rename from clang-tools-extra/clangd/Trace.cpp rename to clang-tools-extra/clangd/support/Trace.cpp index 5bcbf22..b880a5b 100644 --- a/clang-tools-extra/clangd/Trace.cpp +++ b/clang-tools-extra/clangd/support/Trace.cpp @@ -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 auto& KV : Event) + for (const auto &KV : Event) Out.attribute(KV.first, KV.second); }); } diff --git a/clang-tools-extra/clangd/Trace.h b/clang-tools-extra/clangd/support/Trace.h similarity index 96% rename from clang-tools-extra/clangd/Trace.h rename to clang-tools-extra/clangd/support/Trace.h index 55dc0ef..e2c91eb 100644 --- a/clang-tools-extra/clangd/Trace.h +++ b/clang-tools-extra/clangd/support/Trace.h @@ -14,10 +14,10 @@ // //===----------------------------------------------------------------------===// -#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 diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index 92e46a6..575722e 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt b/clang-tools-extra/clangd/unittests/CMakeLists.txt index 4119445..962a878 100644 --- a/clang-tools-extra/clangd/unittests/CMakeLists.txt +++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt @@ -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 + $ ) @@ -107,6 +108,7 @@ clang_target_link_libraries(ClangdTests target_link_libraries(ClangdTests PRIVATE clangDaemon + clangdSupport clangTidy LLVMSupport LLVMTestingSupport diff --git a/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp b/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp index 5f169fe..aa65a2e 100644 --- a/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp +++ b/clang-tools-extra/clangd/unittests/ClangdLSPServerTests.cpp @@ -10,10 +10,10 @@ #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" diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp b/clang-tools-extra/clangd/unittests/ClangdTests.cpp index 8bb4cad..81075ff 100644 --- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp +++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp index 4763702..d8926d4 100644 --- a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp +++ b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp index 7f4cff1..90d3621 100644 --- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp +++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp index aaae58b..e68b8d7 100644 --- a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp +++ b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/JSONTransportTests.cpp b/clang-tools-extra/clangd/unittests/JSONTransportTests.cpp index 2a167bd..07ab70e 100644 --- a/clang-tools-extra/clangd/unittests/JSONTransportTests.cpp +++ b/clang-tools-extra/clangd/unittests/JSONTransportTests.cpp @@ -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 diff --git a/clang-tools-extra/clangd/unittests/LSPClient.cpp b/clang-tools-extra/clangd/unittests/LSPClient.cpp index 5e43314d..08bbba2 100644 --- a/clang-tools-extra/clangd/unittests/LSPClient.cpp +++ b/clang-tools-extra/clangd/unittests/LSPClient.cpp @@ -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 diff --git a/clang-tools-extra/clangd/unittests/SourceCodeTests.cpp b/clang-tools-extra/clangd/unittests/SourceCodeTests.cpp index 71721fe8..0521327 100644 --- a/clang-tools-extra/clangd/unittests/SourceCodeTests.cpp +++ b/clang-tools-extra/clangd/unittests/SourceCodeTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp b/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp index 6f50a5a..1ed73ed 100644 --- a/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp +++ b/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/TestFS.cpp b/clang-tools-extra/clangd/unittests/TestFS.cpp index aad08f2..c436e9a 100644 --- a/clang-tools-extra/clangd/unittests/TestFS.cpp +++ b/clang-tools-extra/clangd/unittests/TestFS.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/TestFS.h b/clang-tools-extra/clangd/unittests/TestFS.h index a635d7c..7dde78d 100644 --- a/clang-tools-extra/clangd/unittests/TestFS.h +++ b/clang-tools-extra/clangd/unittests/TestFS.h @@ -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" diff --git a/clang-tools-extra/clangd/unittests/TestTU.h b/clang-tools-extra/clangd/unittests/TestTU.h index 229f65a..415326e 100644 --- a/clang-tools-extra/clangd/unittests/TestTU.h +++ b/clang-tools-extra/clangd/unittests/TestTU.h @@ -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 diff --git a/clang-tools-extra/clangd/unittests/CancellationTests.cpp b/clang-tools-extra/clangd/unittests/support/CancellationTests.cpp similarity index 96% rename from clang-tools-extra/clangd/unittests/CancellationTests.cpp rename to clang-tools-extra/clangd/unittests/support/CancellationTests.cpp index 09f9807..905ee5e 100644 --- a/clang-tools-extra/clangd/unittests/CancellationTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/CancellationTests.cpp @@ -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" diff --git a/clang-tools-extra/clangd/unittests/ContextTests.cpp b/clang-tools-extra/clangd/unittests/support/ContextTests.cpp similarity index 98% rename from clang-tools-extra/clangd/unittests/ContextTests.cpp rename to clang-tools-extra/clangd/unittests/support/ContextTests.cpp index c76d565..2f195fd 100644 --- a/clang-tools-extra/clangd/unittests/ContextTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/ContextTests.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Context.h" +#include "support/Context.h" #include "gtest/gtest.h" diff --git a/clang-tools-extra/clangd/unittests/FunctionTests.cpp b/clang-tools-extra/clangd/unittests/support/FunctionTests.cpp similarity index 97% rename from clang-tools-extra/clangd/unittests/FunctionTests.cpp rename to clang-tools-extra/clangd/unittests/support/FunctionTests.cpp index 0cd8b79..bfb1ea4 100644 --- a/clang-tools-extra/clangd/unittests/FunctionTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/FunctionTests.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Function.h" +#include "support/Function.h" #include "gmock/gmock.h" #include "gtest/gtest.h" diff --git a/clang-tools-extra/clangd/unittests/ThreadingTests.cpp b/clang-tools-extra/clangd/unittests/support/ThreadingTests.cpp similarity index 98% rename from clang-tools-extra/clangd/unittests/ThreadingTests.cpp rename to clang-tools-extra/clangd/unittests/support/ThreadingTests.cpp index 18b9146..015af09 100644 --- a/clang-tools-extra/clangd/unittests/ThreadingTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/ThreadingTests.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Threading.h" +#include "support/Threading.h" #include "gtest/gtest.h" #include diff --git a/clang-tools-extra/clangd/unittests/TraceTests.cpp b/clang-tools-extra/clangd/unittests/support/TraceTests.cpp similarity index 99% rename from clang-tools-extra/clangd/unittests/TraceTests.cpp rename to clang-tools-extra/clangd/unittests/support/TraceTests.cpp index 1871e6a..1599df5 100644 --- a/clang-tools-extra/clangd/unittests/TraceTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/TraceTests.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Trace.h" +#include "support/Trace.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallString.h" diff --git a/clang-tools-extra/clangd/xpc/CMakeLists.txt b/clang-tools-extra/clangd/xpc/CMakeLists.txt index f05767c..df8c361 100644 --- a/clang-tools-extra/clangd/xpc/CMakeLists.txt +++ b/clang-tools-extra/clangd/xpc/CMakeLists.txt @@ -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 ) diff --git a/clang-tools-extra/clangd/xpc/Conversion.cpp b/clang-tools-extra/clangd/xpc/Conversion.cpp index 3e8d36b..9b52a68 100644 --- a/clang-tools-extra/clangd/xpc/Conversion.cpp +++ b/clang-tools-extra/clangd/xpc/Conversion.cpp @@ -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 diff --git a/clang-tools-extra/clangd/xpc/XPCTransport.cpp b/clang-tools-extra/clangd/xpc/XPCTransport.cpp index 02c1b08..50eacf2 100644 --- a/clang-tools-extra/clangd/xpc/XPCTransport.cpp +++ b/clang-tools-extra/clangd/xpc/XPCTransport.cpp @@ -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 -- 2.7.4