Trait Inliner

Source
trait Inliner<'tcx> {
Show 13 methods // Required methods fn new(tcx: TyCtxt<'tcx>, def_id: DefId, body: &Body<'tcx>) -> Self; fn tcx(&self) -> TyCtxt<'tcx>; fn typing_env(&self) -> TypingEnv<'tcx>; fn history(&self) -> &[DefId]; fn caller_def_id(&self) -> DefId; fn changed(self) -> bool; fn should_inline_for_callee(&self, def_id: DefId) -> bool; fn check_caller_mir_body(&self, body: &Body<'tcx>) -> bool; fn check_callee_mir_body( &self, callsite: &CallSite<'tcx>, callee_body: &Body<'tcx>, callee_attrs: &CodegenFnAttrs, ) -> Result<(), &'static str>; fn inline_limit_for_block(&self) -> Option<usize>; fn on_inline_success( &mut self, callsite: &CallSite<'tcx>, caller_body: &mut Body<'tcx>, new_blocks: Range<BasicBlock>, ); fn on_inline_failure(&self, callsite: &CallSite<'tcx>, reason: &'static str); fn on_inline_limit_reached(&self) -> bool;
}

Required Methods§

Source

fn new(tcx: TyCtxt<'tcx>, def_id: DefId, body: &Body<'tcx>) -> Self

Source

fn tcx(&self) -> TyCtxt<'tcx>

Source

fn typing_env(&self) -> TypingEnv<'tcx>

Source

fn history(&self) -> &[DefId]

Source

fn caller_def_id(&self) -> DefId

Source

fn changed(self) -> bool

Has the caller body been changed?

Source

fn should_inline_for_callee(&self, def_id: DefId) -> bool

Should inlining happen for a given callee?

Source

fn check_caller_mir_body(&self, body: &Body<'tcx>) -> bool

Source

fn check_callee_mir_body( &self, callsite: &CallSite<'tcx>, callee_body: &Body<'tcx>, callee_attrs: &CodegenFnAttrs, ) -> Result<(), &'static str>

Returns inlining decision that is based on the examination of callee MIR body. Assumes that codegen attributes have been checked for compatibility already.

Source

fn inline_limit_for_block(&self) -> Option<usize>

Source

fn on_inline_success( &mut self, callsite: &CallSite<'tcx>, caller_body: &mut Body<'tcx>, new_blocks: Range<BasicBlock>, )

Called when inlining succeeds.

Source

fn on_inline_failure(&self, callsite: &CallSite<'tcx>, reason: &'static str)

Called when inlining failed or was not performed.

Source

fn on_inline_limit_reached(&self) -> bool

Called when the inline limit for a body is reached.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx>

Source§

impl<'tcx> Inliner<'tcx> for NormalInliner<'tcx>