https://reviews.llvm.org/D50923 enabled the IR printing support for the new pass manager, but only for the case when opt tool is used as a driver. This patch is to enable the IR printing when clang is used as a driver.
Yep, you are right, standard instrumentation needs to be passed into PassBuilder for printing and time-passes to work.
Main changes are fine, just a small note on the test below.
|1 ↗||(On Diff #214233)|
Can this test avoid using -O2 and check for some generic always-present pass like ModuleVerifier?
@fedor.sergeev Sorry for the late reply. I missed your comment.
I found that with the new pass manager module verifier is not scheduled by default, and AlwaysInlinerPass is the only one scheduled if I provide no -O option. I removed -O2 from the test command and replaced ForceFunctionAttrPass to AlwaysInlinerPass.