[PATCH] D21385: Adjust Registry interface to not require plugins to export a registry

John Brawn via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 09:03:50 PDT 2016


john.brawn created this revision.
john.brawn added reviewers: ehsan, reames, chapuni.
john.brawn added subscribers: llvm-commits, cfe-commits.
john.brawn set the repository for this revision to rL LLVM.
Herald added a subscriber: klimek.

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.


Repository:
  rL LLVM

http://reviews.llvm.org/D21385

Files:
  cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
  cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
  cfe/trunk/examples/analyzer-plugin/CMakeLists.txt
  cfe/trunk/include/clang/Frontend/FrontendPluginRegistry.h
  cfe/trunk/include/clang/Lex/Preprocessor.h
  cfe/trunk/lib/Frontend/FrontendAction.cpp
  cfe/trunk/lib/Lex/Preprocessor.cpp
  cfe/trunk/lib/Tooling/CompilationDatabase.cpp
  llvm/trunk/include/llvm/Support/Registry.h
  llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
  llvm/trunk/lib/CodeGen/GCStrategy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21385.60844.patch
Type: text/x-patch
Size: 8442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160615/dfe5bba0/attachment.bin>


More information about the cfe-commits mailing list