aboutsummaryrefslogtreecommitdiff
path: root/clang/examples/AnnotateFunctions
AgeCommit message (Collapse)AuthorFilesLines
2016-08-05Reapply r276973 "Adjust Registry interface to not require plugins to export ↵John Brawn1-1/+1
a registry" This differs from the previous version by being more careful about template instantiation/specialization in order to prevent errors when building with clang -Werror. Specifically: * begin is not defined in the template and is instead instantiated when Head is. I think the warning when we don't do that is wrong (PR28815) but for now at least do it this way to avoid the warning. * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY instead provide a template definition then do explicit instantiation. No compiler I've tried has problems with doing it the other way, but strictly speaking it's not permitted by the C++ standard so better safe than sorry. 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: 277806
2016-07-28Revert r276973 "Adjust Registry interface to not require plugins to export a ↵John Brawn1-1/+1
registry" Buildbot failures when building with clang -Werror. Reverting while I try to figure this out. llvm-svn: 277008
2016-07-28Reapply r276856 "Adjust Registry interface to not require plugins to export ↵John Brawn1-1/+1
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
2016-07-27Revert r276856 "Adjust Registry interface to not require plugins to export a ↵John Brawn1-1/+1
registry" This is causing a huge pile of buildbot failures. llvm-svn: 276857
2016-07-27Adjust Registry interface to not require plugins to export a registryJohn Brawn1-1/+1
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
2016-06-09[CMake] Cleaning up CMake feature gating on 2.8.12Chris Bieneman1-1/+1
CMake 2.8.12 introduced interface libraries and some related policies. This removes the conditional block because we're now past 2.8.12. llvm-svn: 272312
2016-04-04AnnotateFunctions: Tweak for mingw.NAKAMURA Takumi1-0/+2
- Externalize the registry. - Update libdeps. llvm-svn: 265301
2016-04-04Add a PragmaHandler Registry for plugins to add PragmaHandlers toJohn Brawn1-1/+37
This allows plugins which add AST passes to also define pragmas to do things like only enable certain behaviour of the AST pass in files where a certain pragma is used. Differential Revision: http://reviews.llvm.org/D18319 llvm-svn: 265295
2016-03-15Make it possible for AST plugins to enable themselves by defaultJohn Brawn2-0/+61
Currently when an AST plugin is loaded it must then be enabled by passing -plugin pluginname or -add-plugin pluginname to the -cc1 command line. This patch adds a method to PluginASTAction which allows it to declare that the action happens before, instead of, or after the main AST action, plus the relevant changes to make the plugin action happen at that time automatically. Differential Revision: http://reviews.llvm.org/D17959 llvm-svn: 263546