================
@@ -49,7 +53,14 @@ struct PassPluginLibraryInfo {
 
   /// The callback for registering plugin passes with a \c PassBuilder
   /// instance
-  void (*RegisterPassBuilderCallbacks)(PassBuilder &);
+  void (*RegisterPassBuilderCallbacks)(PassBuilder &) = nullptr;
+
+  /// Callback called before running the back-end passes on the module. The
+  /// callback can generate code itself by writing the expected output to OS 
and
+  /// returning true to prevent the default pipeline and further plugin
+  /// callbacks from running.
+  bool (*PreCodeGenCallback)(Module &, TargetMachine &, CodeGenFileType,
----------------
aengelke wrote:

I would consider this to be out-of-scope for now. Back-end pipelines are, 
currently, target-specific and any support for plugins modifying these 
pipelines is likely to need a lot of further discussion (esp. as many back-end 
passes not really self-contained). There was some discussion on 
CodeGenPassBuilder to add callbacks for targets earlier this year, but it seems 
work on that has stalled. Additionally, the proposed plugin API already permits 
building and running a custom pass manager, so right now there would be no 
benefit of speculatively building a more generic API.

If there's a desire to add external hooks for CodeGenPassBuilder, I think this 
should be a separate function similar to the RegisterPassBuilderCallbacks that 
exists so far.

https://github.com/llvm/llvm-project/pull/170846
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to