summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/tool
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/tool')
-rw-r--r--clang-tools-extra/clang-tidy/tool/CMakeLists.txt2
-rw-r--r--clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp14
2 files changed, 16 insertions, 0 deletions
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
OpenPOWER on IntegriCloud