[llvm] [Passes] Add new runCodeGenPipeline abstraction (PR #220305)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 09:10:13 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/include/llvm/Passes/RunCodeGen.h llvm/lib/Passes/RunCodeGen.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Passes/RunCodeGen.cpp b/llvm/lib/Passes/RunCodeGen.cpp
index 795f71d6f..66e48b802 100644
--- a/llvm/lib/Passes/RunCodeGen.cpp
+++ b/llvm/lib/Passes/RunCodeGen.cpp
@@ -31,11 +31,12 @@ static cl::opt<cl::boolOrDefault>
                         "option will default to what the target prefers."),
                cl::init(cl::boolOrDefault::BOU_UNSET));
 
-static Error
-runCodeGenPipelineLegacy(TargetMachine &TM, Module &M, raw_pwrite_stream &OS,
-                         std::unique_ptr<ToolOutputFile> &DwoOS,
-                         CodeGenFileType CGFT, bool PrintPipelinePasses,
-                         bool DisableVerify) {
+static Error runCodeGenPipelineLegacy(TargetMachine &TM, Module &M,
+                                      raw_pwrite_stream &OS,
+                                      std::unique_ptr<ToolOutputFile> &DwoOS,
+                                      CodeGenFileType CGFT,
+                                      bool PrintPipelinePasses,
+                                      bool DisableVerify) {
   legacy::PassManager CodeGenPasses;
   CodeGenPasses.add(
       createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis()));
@@ -56,11 +57,11 @@ runCodeGenPipelineLegacy(TargetMachine &TM, Module &M, raw_pwrite_stream &OS,
   return Error::success();
 }
 
-static Error
-runCodeGenPipelineNewPM(TargetMachine &TM, Module &M, raw_pwrite_stream &OS,
-                        std::unique_ptr<ToolOutputFile> &DwoOS,
-                        CodeGenFileType CGFT, bool DisableVerify,
-                        IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
+static Error runCodeGenPipelineNewPM(TargetMachine &TM, Module &M,
+                                     raw_pwrite_stream &OS,
+                                     std::unique_ptr<ToolOutputFile> &DwoOS,
+                                     CodeGenFileType CGFT, bool DisableVerify,
+                                     IntrusiveRefCntPtr<vfs::FileSystem> VFS) {
   ModulePassManager MPM;
   MachineFunctionAnalysisManager MFAM;
   LoopAnalysisManager LAM;

``````````

</details>


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


More information about the llvm-commits mailing list