1
Fork 0

Profile MIR passes.

This commit is contained in:
Camille GILLOT 2023-05-15 20:23:34 +00:00
parent 2913ad6db0
commit addc72799a
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 }
}