[PATCH] D35258: [Plugins] Add a slim plugin API to work together with the new PM

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 03:44:32 PST 2018


chandlerc added inline comments.


================
Comment at: include/llvm/Support/Plugin.h:33
+
+  void (*RegisterPassBuilderCallbacks)(PassBuilder &);
+};
----------------
This seems like a somewhat nasty layering...

If plugins fundamentally deal in pass builders, I wouldn't expect the plugin infrastructure to be in the Support library at all. I think the only reason the plugin stuff started off in the support library is because it relied exclusively on global ctors to connect to any functionality. I really like the idea of moving away from that for plugins and having a more proper callback mechanism, but I think it means we need to either use some abstraction or just make the plugin logic (somewhat) specific to *pass builder* plugins.


Beyond getting the layering and pass build stuff designed nicely, I suspect we should rope some folks more broadly in the community in to make sure the high level approach to plugins here makes sense long term... I'll try to ask around and see who has opinions here.


https://reviews.llvm.org/D35258





More information about the llvm-commits mailing list