Struct rustc_mir_transform::inline::Inliner [−][src]
struct Inliner<'tcx> {
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
codegen_fn_attrs: &'tcx CodegenFnAttrs,
hir_id: HirId,
history: Vec<Instance<'tcx>>,
changed: bool,
}
Fields
tcx: TyCtxt<'tcx>
param_env: ParamEnv<'tcx>
codegen_fn_attrs: &'tcx CodegenFnAttrs
Caller codegen attributes.
hir_id: HirId
Caller HirID.
history: Vec<Instance<'tcx>>
Stack of inlined Instances.
changed: bool
Indicates that the caller body has been modified.
Implementations
fn try_inlining(
&self,
caller_body: &mut Body<'tcx>,
callsite: &CallSite<'tcx>
) -> Result<Range<BasicBlock>, &'static str>
fn try_inlining(
&self,
caller_body: &mut Body<'tcx>,
callsite: &CallSite<'tcx>
) -> Result<Range<BasicBlock>, &'static str>
Attempts to inline a callsite into the caller body. When successful returns basic blocks containing the inlined body. Otherwise returns an error describing why inlining didn’t take place.
fn check_mir_is_available(
&self,
caller_body: &Body<'tcx>,
callee: &Instance<'tcx>
) -> Result<(), &'static str>
fn resolve_callsite(
&self,
caller_body: &Body<'tcx>,
bb: BasicBlock,
bb_data: &BasicBlockData<'tcx>
) -> Option<CallSite<'tcx>>
fn check_codegen_attributes(
&self,
callsite: &CallSite<'tcx>,
callee_attrs: &CodegenFnAttrs
) -> Result<(), &'static str>
fn check_codegen_attributes(
&self,
callsite: &CallSite<'tcx>,
callee_attrs: &CodegenFnAttrs
) -> Result<(), &'static str>
Returns an error if inlining is not possible based on codegen attributes alone. A success indicates that inlining decision should be based on other criteria.
fn check_mir_body(
&self,
callsite: &CallSite<'tcx>,
callee_body: &Body<'tcx>,
callee_attrs: &CodegenFnAttrs
) -> Result<(), &'static str>
fn check_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.
fn inline_call(
&self,
caller_body: &mut Body<'tcx>,
callsite: &CallSite<'tcx>,
callee_body: Body<'tcx>
)
fn make_call_args(
&self,
args: Vec<Operand<'tcx>>,
callsite: &CallSite<'tcx>,
caller_body: &mut Body<'tcx>,
callee_body: &Body<'tcx>
) -> Vec<Local>
If arg
is already a temporary, returns it. Otherwise, introduces a fresh
temporary T
and an instruction T = arg
, and returns T
.
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Inliner<'tcx>
impl<'tcx> !UnwindSafe for Inliner<'tcx>
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes