summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/plugin
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-09-30 17:22:58 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-09-30 17:22:58 +0000
commitbc70c26ef43641ae1f1e161cb674fe3539805650 (patch)
tree012a144509cb564ca7b82caee0a013a960e119fe /clang-tools-extra/clang-tidy/plugin
parent20623f2343487a73d3e9b8990b837a65786f7da8 (diff)
downloadbcm5719-llvm-bc70c26ef43641ae1f1e161cb674fe3539805650.tar.gz
bcm5719-llvm-bc70c26ef43641ae1f1e161cb674fe3539805650.zip
Allow clang-tidy to be built without a dependency on the clang static analyzer.
Patch by Stephen Kelly. llvm-svn: 343415
Diffstat (limited to 'clang-tools-extra/clang-tidy/plugin')
-rw-r--r--clang-tools-extra/clang-tidy/plugin/CMakeLists.txt7
-rw-r--r--clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/plugin/CMakeLists.txt b/clang-tools-extra/clang-tidy/plugin/CMakeLists.txt
index 3540b2be712..7a12d7fd599 100644
--- a/clang-tools-extra/clang-tidy/plugin/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/plugin/CMakeLists.txt
@@ -20,7 +20,6 @@ add_clang_library(clangTidyPlugin
clangTidyLLVMModule
clangTidyMiscModule
clangTidyModernizeModule
- clangTidyMPIModule
clangTidyObjCModule
clangTidyPerformanceModule
clangTidyPortabilityModule
@@ -28,3 +27,9 @@ add_clang_library(clangTidyPlugin
clangTidyZirconModule
clangTooling
)
+
+if(CLANG_ENABLE_STATIC_ANALYZER)
+ target_link_libraries(clangTidyPlugin PRIVATE
+ clangTidyMPIModule
+ )
+endif()
diff --git a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
index 34556120553..f998d6a5a4d 100644
--- a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
+++ b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
@@ -133,10 +133,12 @@ extern volatile int ModernizeModuleAnchorSource;
static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination =
ModernizeModuleAnchorSource;
+#if CLANG_ENABLE_STATIC_ANALYZER
// This anchor is used to force the linker to link the MPIModule.
extern volatile int MPIModuleAnchorSource;
static int LLVM_ATTRIBUTE_UNUSED MPIModuleAnchorDestination =
MPIModuleAnchorSource;
+#endif
// This anchor is used to force the linker to link the ObjCModule.
extern volatile int ObjCModuleAnchorSource;
OpenPOWER on IntegriCloud