[PATCH] D61446: Generalize the pass registration mechanism used by Polly to any third-party tool

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 08:14:52 PDT 2019


serge-sans-paille added inline comments.


================
Comment at: polly/lib/Support/RegisterPasses.cpp:727
+extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
+llvmGetPassPluginInfo() {
+  return getPassPluginInfo();
----------------
Meinersbur wrote:
> [serious] Unfortunately, the new pass manager's plugin system relies on the function name to be `llvmGetPassPluginInfo` in each plugin. This works with multiple dynamic libraries all declaring the same name using the `PassPlugin::Load` mechanism, but linking them all statically will violate the one-definition-rule.
> 
> IMHO, Polly.cpp would have been a better place for this function.
> but linking them all statically will violate the one-definition-rule.

They are unused when liked statically, and flagged as weak to avoid link-time conflict.

> IMHO, Polly.cpp would have been a better place for this function.
I still agree it's more explicit if linked conditionaly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61446/new/

https://reviews.llvm.org/D61446





More information about the llvm-commits mailing list