- hook.on_mir_pass(&mir_ctxt, Some((def_id, &mir)));
- }
-
- Multi::from(tcx.alloc_steal_mir(mir))
-}
-
-struct MirCtxtImpl<'a, 'tcx: 'a> {
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
- pass_num: MirPassIndex,
- suite: MirSuite,
- def_id: DefId
-}
-
-impl<'a, 'tcx> MirCtxt<'a, 'tcx> for MirCtxtImpl<'a, 'tcx> {
- fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx> {
- self.tcx
- }
-
- fn suite(&self) -> MirSuite {
- self.suite
- }
-
- fn pass_num(&self) -> MirPassIndex {
- self.pass_num
- }
-
- fn def_id(&self) -> DefId {
- self.def_id
- }
-
- fn source(&self) -> MirSource {
- let id = self.tcx.hir.as_local_node_id(self.def_id)
- .expect("mir source requires local def-id");
- MirSource::from_node(self.tcx, id)
- }
-
- fn read_previous_mir(&self) -> Ref<'tcx, Mir<'tcx>> {
- self.previous_mir(self.def_id).borrow()
+ hook.on_mir_pass(tcx, suite, pass_num, &pass.name(), source, &mir, false);