From 89bbab09dd4665f9b3009b47c187c38ea5bac340 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Sun, 4 Aug 2013 15:56:30 +0000 Subject: [PATCH] Fix clang-tidy dependencies and bad file comment. This addresses comments in post-commit review of r187345. llvm-svn: 187707 --- clang-tools-extra/clang-tidy/CMakeLists.txt | 2 -- clang-tools-extra/clang-tidy/ClangTidy.cpp | 8 -------- clang-tools-extra/clang-tidy/Makefile | 2 +- clang-tools-extra/clang-tidy/tool/CMakeLists.txt | 2 ++ clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 14 ++++++++++++++ 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 5bcf70b..b547972 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 f5569bc..b7d3835 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -172,13 +172,5 @@ void handleErrors(SmallVectorImpl &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 67d32b0..c221742 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 27d511f..b966410 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 59508a1..47aefe7 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 d050042..c0f94cc 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 -- 2.7.4