[PATCH] D127221: [Clang] Enable -print-pipeline-passes in clang.

Joshua Cranmer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 11 14:09:44 PDT 2023


jcranmer-intel added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:1102
+    outs() << "\n";
+    return;
+  }
----------------
aeubanks wrote:
> I wouldn't return here, doesn't seem right that we'll skip running the opt pipeline but continue with compilation. we should either bail out entirely  of producing any output files (which would probably require code changes elsewhere), or run everything as normal, not do something weird where we don't run the optimization pipeline but still output files
This is basically doing the same thing that `opt -print-pipeline-passes` is doing: https://github.com/llvm/llvm-project/blob/d1b418f55263ec48d14f220ad020d55f126cfcab/llvm/tools/opt/NewPMDriver.cpp#L500-L524.

In the case of emitting LLVM IR or bitcode, this logic is sufficient to not emit any output. In the case of .s or .o files, it looks like I have to also bail out of running `RunCodegenPipeline`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127221/new/

https://reviews.llvm.org/D127221



More information about the cfe-commits mailing list