[llvm-branch-commits] [clang] [llvm] [RFC][LLVM][Clang] Add LLVM plugin hook for back-ends (PR #170846)

Alexis Engelke via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 11 09:03:52 PST 2025


================
@@ -1265,6 +1259,14 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
 void EmitAssemblyHelper::RunCodegenPipeline(
     BackendAction Action, std::unique_ptr<raw_pwrite_stream> &OS,
     std::unique_ptr<llvm::ToolOutputFile> &DwoOS) {
+  // Invoke pre-codegen callback from plugin, which might want to take over the
+  // entire code generation itself.
+  for (auto &Plugin : Plugins) {
+    CodeGenFileType CGFT = getCodeGenFileType(Action);
----------------
aengelke wrote:

Thanks for catching this. To keep things simple and manageable, I'm going to split the Clang part into a separate PR with tests.

https://github.com/llvm/llvm-project/pull/170846


More information about the llvm-branch-commits mailing list