Currently, -ftime-report + new pass manager emits one line of report for each
pass run. This potentially causes huge output text especially with regular LTO
or large single file (Obeserved in private tests and was reported in D51276).
The behaviour of -ftime-report + legacy pass manager is
emitting one line of report for each pass object which has relatively reasonable
text output size. This patch adds a flag -ftime-report= to control time report
aggregation for new pass manager.
The flag is for new pass manager only. Using it with legacy pass manager gives
an error. It is a driver and cc1 flag. per-pass is the new default so
-ftime-report is aliased to -ftime-report=per-pass. Before this patch,
functionality-wise -ftime-report is aliased to -ftime-report=per-pass-run.
- Adds an boolean variable TimePassesHandler::PerRun to control per-pass vs per-pass-run.
- Adds a new clang CodeGen flag CodeGenOptions::TimePassesPerRun to work with the existing CodeGenOptions::TimePasses.
- Remove FrontendOptions::ShowTimers, its uses are replaced by the existing CodeGenOptions::TimePasses.
- Remove FrontendTimesIsEnabled (It was introduced in D45619 which was largely reverted.)