fn make_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
instance: ty::InstanceDef<'tcx>)
- -> &'tcx Mir<'tcx>
+ -> &'tcx Body<'tcx>
{
debug!("make_shim({:?})", instance);
debug!("make_shim({:?}) = {:?}", instance, result);
- tcx.alloc_mir(result)
+ tcx.arena.alloc(result)
}
#[derive(Copy, Clone, Debug, PartialEq)]
fn build_drop_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
ty: Option<Ty<'tcx>>)
- -> Mir<'tcx>
+ -> Body<'tcx>
{
debug!("build_drop_shim(def_id={:?}, ty={:?})", def_id, ty);
block(&mut blocks, TerminatorKind::Goto { target: return_block });
block(&mut blocks, TerminatorKind::Return);
- let mut mir = Mir::new(
+ let mut mir = Body::new(
blocks,
IndexVec::from_elem_n(
SourceScopeData { span: span, parent_scope: None }, 1
}
pub struct DropShimElaborator<'a, 'tcx: 'a> {
- pub mir: &'a Mir<'tcx>,
+ pub mir: &'a Body<'tcx>,
pub patch: MirPatch<'tcx>,
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
pub param_env: ty::ParamEnv<'tcx>,
type Path = ();
fn patch(&mut self) -> &mut MirPatch<'tcx> { &mut self.patch }
- fn mir(&self) -> &'a Mir<'tcx> { self.mir }
+ fn mir(&self) -> &'a Body<'tcx> { self.mir }
fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx> { self.tcx }
fn param_env(&self) -> ty::ParamEnv<'tcx> { self.param_env }
fn build_clone_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
self_ty: Ty<'tcx>)
- -> Mir<'tcx>
+ -> Body<'tcx>
{
debug!("build_clone_shim(def_id={:?})", def_id);
}
}
- fn into_mir(self) -> Mir<'tcx> {
- Mir::new(
+ fn into_mir(self) -> Body<'tcx> {
+ Body::new(
self.blocks,
IndexVec::from_elem_n(
SourceScopeData { span: self.span, parent_scope: None }, 1
rcvr_adjustment: Adjustment,
call_kind: CallKind,
untuple_args: Option<&[Ty<'tcx>]>)
- -> Mir<'tcx>
+ -> Body<'tcx>
{
debug!("build_call_shim(def_id={:?}, rcvr_adjustment={:?}, \
call_kind={:?}, untuple_args={:?})",
block(&mut blocks, vec![], TerminatorKind::Resume, true);
}
- let mut mir = Mir::new(
+ let mut mir = Body::new(
blocks,
IndexVec::from_elem_n(
SourceScopeData { span: span, parent_scope: None }, 1
ctor_id: hir::HirId,
fields: &[hir::StructField],
span: Span)
- -> Mir<'tcx>
+ -> Body<'tcx>
{
let tcx = infcx.tcx;
let gcx = tcx.global_tcx();
is_cleanup: false
};
- Mir::new(
+ Body::new(
IndexVec::from_elem_n(start_block, 1),
IndexVec::from_elem_n(
SourceScopeData { span: span, parent_scope: None }, 1