fn run_pass<'a, 'tcx>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
source: MirSource<'tcx>,
- mir: &mut Mir<'tcx>) {
+ mir: &mut Body<'tcx>) {
if tcx.sess.opts.debugging_opts.mir_opt_level >= 2 {
Inliner { tcx, source }.run_pass(mir);
}
}
impl<'a, 'tcx> Inliner<'a, 'tcx> {
- fn run_pass(&self, caller_mir: &mut Mir<'tcx>) {
+ fn run_pass(&self, caller_mir: &mut Body<'tcx>) {
// Keep a queue of callsites to try inlining on. We take
// advantage of the fact that queries detect cycles here to
// allow us to try and fetch the fully optimized MIR of a
fn get_valid_function_call(&self,
bb: BasicBlock,
bb_data: &BasicBlockData<'tcx>,
- caller_mir: &Mir<'tcx>,
+ caller_mir: &Body<'tcx>,
param_env: ParamEnv<'tcx>,
) -> Option<CallSite<'tcx>> {
// Don't inline calls that are in cleanup blocks.
fn consider_optimizing(&self,
callsite: CallSite<'tcx>,
- callee_mir: &Mir<'tcx>)
+ callee_mir: &Body<'tcx>)
-> bool
{
debug!("consider_optimizing({:?})", callsite);
fn should_inline(&self,
callsite: CallSite<'tcx>,
- callee_mir: &Mir<'tcx>)
+ callee_mir: &Body<'tcx>)
-> bool
{
debug!("should_inline({:?})", callsite);
fn inline_call(&self,
callsite: CallSite<'tcx>,
- caller_mir: &mut Mir<'tcx>,
- mut callee_mir: Mir<'tcx>) -> bool {
+ caller_mir: &mut Body<'tcx>,
+ mut callee_mir: Body<'tcx>) -> bool {
let terminator = caller_mir[callsite.bb].terminator.take().unwrap();
match terminator.kind {
// FIXME: Handle inlining of diverging calls
&self,
args: Vec<Operand<'tcx>>,
callsite: &CallSite<'tcx>,
- caller_mir: &mut Mir<'tcx>,
+ caller_mir: &mut Body<'tcx>,
) -> Vec<Local> {
let tcx = self.tcx;
&self,
arg: Operand<'tcx>,
callsite: &CallSite<'tcx>,
- caller_mir: &mut Mir<'tcx>,
+ caller_mir: &mut Body<'tcx>,
) -> Local {
// FIXME: Analysis of the usage of the arguments to avoid
// unnecessary temporaries.