[PATCH] D47858: [New PM] Introducing PassInstrumentation framework

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 15 08:46:58 PDT 2018


philip.pfaffe added inline comments.


================
Comment at: include/llvm/Passes/PassBuilder.h:564-568
+  /// Calls registration function \p C on PassInstrumentationCallbacks object
+  /// to register pass instrumentation callbacks there.
+  ///
+  /// \Returns false if there is no pass instrumentation object available.
+  bool registerPassInstrumentation(
----------------
fedor.sergeev wrote:
> chandlerc wrote:
> > I'm somewhat curious what the expected usage of this method is? It isn't obvious to me at all...
> It allows to use PassBuilder as sort of a central place for registering all the callbacks, w/o polluting Passbuilder with all the interfaces.
> Particularly useful for plugins, I believe.
> You can see how it is being used in -print-after-all and -pass-times implementation followups or in the unittests.
> 
> Alternative solution would be to introduce PassBuilder::getPassInstrumentationCallbacks() method and use it for registration purposes, but I did not really like that (and yes, getPassInstrumentationCallbacks should have been dropped).
For plugins I'd really like  to retain some means of accessing the Callbacks registry through PassBuilder. To keep it off the PassBuilder API, maybe we should pass it in the plugin APIs `RegisterPassBuilderCallbacks` instead? Could be done in a followup change.


Repository:
  rL LLVM

https://reviews.llvm.org/D47858





More information about the llvm-commits mailing list