summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/plugin
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2018-10-01 20:24:22 +0000
committerStephen Kelly <steveire@gmail.com>2018-10-01 20:24:22 +0000
commita3c4206e415963b3ac84327b1946dba98ec572e7 (patch)
tree5fc4b25426e5ba65e7fa95e5b4eac9acab4f252b /clang-tools-extra/clang-tidy/plugin
parent746eb09127267738b3b882d2cfb900ed9f41a5b1 (diff)
downloadbcm5719-llvm-a3c4206e415963b3ac84327b1946dba98ec572e7.tar.gz
bcm5719-llvm-a3c4206e415963b3ac84327b1946dba98ec572e7.zip
[clang-tidy] Build it even without static analyzer
Conditionally compile the parts of clang-tidy which depend on the static analyzer. Funnily enough, I made the patch to exclude this from the build in 2013, and it was committed with the comment that the tool should not be fully excluded, but only the parts of it which depend on the analyzer should be excluded. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130617/081797.html This commit implements that idea. Reviewed By: aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52334 llvm-svn: 343528
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.cpp3
2 files changed, 9 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..22448939e83 100644
--- a/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
+++ b/clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp
@@ -9,6 +9,7 @@
#include "../ClangTidy.h"
#include "../ClangTidyModule.h"
+#include "clang/Config/config.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Frontend/MultiplexConsumer.h"
@@ -133,10 +134,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