Adjust Registry interface to not require plugins to export a registry
authorJohn Brawn <john.brawn@arm.com>
Wed, 27 Jul 2016 11:18:38 +0000 (11:18 +0000)
committerJohn Brawn <john.brawn@arm.com>
Wed, 27 Jul 2016 11:18:38 +0000 (11:18 +0000)
commit63aff61019e0a6bdae4cfdac2a3cc0be9fdcfa97
tree6cf40a21310a7cd814e0483a34bd509fac65219e
parent10bf0ff879fac0fb02f33907385e969acb9b1f24
Adjust Registry interface to not require plugins to export a registry

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.

Differential Revision: http://reviews.llvm.org/D21385

llvm-svn: 276856
clang/examples/AnnotateFunctions/CMakeLists.txt
clang/examples/PrintFunctionNames/CMakeLists.txt
clang/include/clang/Frontend/FrontendPluginRegistry.h
clang/include/clang/Lex/Preprocessor.h
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Lex/Preprocessor.cpp
clang/lib/Tooling/CompilationDatabase.cpp
llvm/include/llvm/Support/Registry.h
llvm/lib/CodeGen/GCMetadataPrinter.cpp
llvm/lib/CodeGen/GCStrategy.cpp