================
@@ -58,11 +58,13 @@ struct PassPluginLibraryInfo {
   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.
+  /// 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. DwoOS behaves the same way with respect to the
+  /// return value. It is null unless the .dwo contents go to a separate file.
   bool (*PreCodeGenCallback)(Module &, TargetMachine &, CodeGenFileType,
-                             raw_pwrite_stream &OS) = nullptr;
+                             raw_pwrite_stream &OS,
+                             raw_pwrite_stream *DwoOS) = nullptr;
----------------
weliveindetail wrote:

Agreed and implemented. Thanks for the quick feedback.

I kept the `bool` return type for plugins, because they can fall back while 
`runCodeGenPipeline()` cannot. The body of invokePreCodeGenCallback() moves 
into PassPlugin.cpp, so the header doesn't need the VFS definition.

I like the idea to call `runCodeGenPipeline()` from `Bye` to keep the parameter 
lists in sync. But it would mean that every in-tree tool that we test with Bye 
needs to link RunCodeGen. `opt` doesn't want that. We could use the 
CGTestPlugin from unit-tests instead. It used to cover the legacy codegen 
registration path. WYDT?

I started to work on CGTestPlugin locally and ran into more issues to fix. It's 
a bit of rabbit hole. Do you think I can add that in a follow-up PR?

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

Reply via email to