diff options
-rw-r--r-- | clang-tools-extra/clang-tidy/CMakeLists.txt | 2 | ||||
-rw-r--r-- | clang-tools-extra/clang-tidy/ClangTidy.cpp | 8 | ||||
-rw-r--r-- | clang-tools-extra/clang-tidy/Makefile | 2 | ||||
-rw-r--r-- | clang-tools-extra/clang-tidy/tool/CMakeLists.txt | 2 | ||||
-rw-r--r-- | clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 14 | ||||
-rw-r--r-- | clang-tools-extra/unittests/clang-tidy/CMakeLists.txt | 2 |
6 files changed, 19 insertions, 11 deletions
diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt index 5bcf70bbac4..b5479728dd3 100644 --- a/clang-tools-extra/clang-tidy/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/CMakeLists.txt @@ -14,8 +14,6 @@ target_link_libraries(clangTidy clangTooling clangBasic clangRewriteFrontend - clangTidyLLVMModule - clangTidyGoogleModule ) add_subdirectory(tool) diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index f5569bc934c..b7d38350b34 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -172,13 +172,5 @@ void handleErrors(SmallVectorImpl<ClangTidyError> &Errors, bool Fix) { Rewrite.overwriteChangedFiles(); } -// This anchor is used to force the linker to link the LLVMModule. -extern volatile int LLVMModuleAnchorSource; -static int LLVMModuleAnchorDestination = LLVMModuleAnchorSource; - -// This anchor is used to force the linker to link the GoogleModule. -extern volatile int GoogleModuleAnchorSource; -static int GoogleModuleAnchorDestination = GoogleModuleAnchorSource; - } // namespace tidy } // namespace clang diff --git a/clang-tools-extra/clang-tidy/Makefile b/clang-tools-extra/clang-tidy/Makefile index 67d32b0f0e6..c221742c420 100644 --- a/clang-tools-extra/clang-tidy/Makefile +++ b/clang-tools-extra/clang-tidy/Makefile @@ -1,4 +1,4 @@ -##===- tools/extra/clang-tidy/Makefile ----sssss------------*- Makefile -*-===## +##===- tools/extra/clang-tidy/Makefile ---------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # diff --git a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt index 27d511fdb23..b966410477c 100644 --- a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt @@ -11,6 +11,8 @@ add_clang_executable(clang-tidy ) target_link_libraries(clang-tidy clangTidy + clangTidyLLVMModule + clangTidyGoogleModule ) install(TARGETS clang-tidy diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 59508a1bd08..47aefe7be0e 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -52,3 +52,17 @@ int main(int argc, const char **argv) { return 0; } + +namespace clang { +namespace tidy { + +// This anchor is used to force the linker to link the LLVMModule. +extern volatile int LLVMModuleAnchorSource; +static int LLVMModuleAnchorDestination = LLVMModuleAnchorSource; + +// This anchor is used to force the linker to link the GoogleModule. +extern volatile int GoogleModuleAnchorSource; +static int GoogleModuleAnchorDestination = GoogleModuleAnchorSource; + +} // namespace tidy +} // namespace clang diff --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt index d0500428a20..c0f94cc928d 100644 --- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt +++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt @@ -14,6 +14,8 @@ target_link_libraries(ClangTidyTests gtest gtest_main clangTidy + clangTidyLLVMModule + clangTidyGoogleModule clangTooling clangBasic clangASTMatchers |