summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidy.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2016-07-28 12:48:17 +0000
committerJohn Brawn <john.brawn@arm.com>2016-07-28 12:48:17 +0000
commit778c3c6c61b7080a9537685b38d6b9df282e0d05 (patch)
treeb7d2ad88f85ba52c2f6c6d37a406bbbfcec17ed5 /clang-tools-extra/clang-tidy/ClangTidy.cpp
parent3b572002a233bc880c9b542c9e85ff98966fbaa4 (diff)
downloadbcm5719-llvm-778c3c6c61b7080a9537685b38d6b9df282e0d05.tar.gz
bcm5719-llvm-778c3c6c61b7080a9537685b38d6b9df282e0d05.zip
Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"
This version has two fixes compared to the original: * In Registry.h the template static members are instantiated before they are used, as clang gives an error if you do it the other way around. * The use of the Registry template in clang-tidy is updated in the same way as has been done everywhere else. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 276973
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidy.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/ClangTidy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index af1c7f9e61e..562e1e80f54 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -47,7 +47,7 @@ using namespace clang::driver;
using namespace clang::tooling;
using namespace llvm;
-template class llvm::Registry<clang::tidy::ClangTidyModule>;
+LLVM_INSTANTIATE_REGISTRY(clang::tidy::ClangTidyModuleRegistry)
namespace clang {
namespace tidy {
OpenPOWER on IntegriCloud