Update passes with new interface
This commit is contained in:
@@ -37,21 +37,16 @@ struct CallSite<'tcx> {
|
||||
source_info: SourceInfo,
|
||||
}
|
||||
|
||||
/// Returns true if MIR inlining is enabled in the current compilation session.
|
||||
crate fn is_enabled(tcx: TyCtxt<'_>) -> bool {
|
||||
if let Some(enabled) = tcx.sess.opts.debugging_opts.inline_mir {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
tcx.sess.mir_opt_level() >= 3
|
||||
}
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for Inline {
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
if !is_enabled(tcx) {
|
||||
return;
|
||||
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
|
||||
if let Some(enabled) = sess.opts.debugging_opts.inline_mir {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
sess.opts.mir_opt_level() >= 3
|
||||
}
|
||||
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
let span = trace_span!("inline", body = %tcx.def_path_str(body.source.def_id()));
|
||||
let _guard = span.enter();
|
||||
if inline(tcx, body) {
|
||||
|
||||
Reference in New Issue
Block a user