1
Fork 0

Rollup merge of #111619 - cjgillot:profile-pass, r=WaffleLapkin

Add timings for MIR passes to profiling report

This will help identify which pass is responsible for a regression.
This commit is contained in:
Dylan DPC 2023-05-20 12:20:59 +05:30 committed by GitHub
commit 1397827f25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -101,7 +101,7 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
/// pass will be named after the type, and it will consist of a main
/// loop that goes over each available MIR and applies `run_pass`.
pub trait MirPass<'tcx> {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
let name = std::any::type_name::<Self>();
if let Some((_, tail)) = name.rsplit_once(':') { tail } else { name }
}