diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-05-29 00:19:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-29 00:19:55 +0200 |
| commit | ee08261c8c5bef635ff38f6d617bb7b72dd470cd (patch) | |
| tree | a50a6ad4aa4fcb5655d41562fb9d867a04ad3e9d /src/librustc_codegen_ssa | |
| parent | e19a229c88e39bc00f5672ff6a539aabe69bb545 (diff) | |
| parent | 95013e612d3ffaee2b674da4a29308aaa7551726 (diff) | |
| download | rust-ee08261c8c5bef635ff38f6d617bb7b72dd470cd.tar.gz rust-ee08261c8c5bef635ff38f6d617bb7b72dd470cd.zip | |
Rollup merge of #60928 - TheSirC:fix/60229, r=eddyb
Changes the type `mir::Mir` into `mir::Body` Fixes part 1 of #60229 (previously attempted in #60242). I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date. The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool.
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/analyze.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/mir/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/traits/debuginfo.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc_codegen_ssa/mir/analyze.rs b/src/librustc_codegen_ssa/mir/analyze.rs index 06d7b6c78f1..bb6a13ed15a 100644 --- a/src/librustc_codegen_ssa/mir/analyze.rs +++ b/src/librustc_codegen_ssa/mir/analyze.rs @@ -18,7 +18,7 @@ pub fn non_ssa_locals<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( let mir = fx.mir; let mut analyzer = LocalAnalyzer::new(fx); - analyzer.visit_mir(mir); + analyzer.visit_body(mir); for (index, ty) in mir.local_decls.iter().map(|l| l.ty).enumerate() { let ty = fx.monomorphize(&ty); @@ -272,9 +272,9 @@ impl CleanupKind { } } -pub fn cleanup_kinds<'a, 'tcx>(mir: &mir::Mir<'tcx>) -> IndexVec<mir::BasicBlock, CleanupKind> { +pub fn cleanup_kinds<'a, 'tcx>(mir: &mir::Body<'tcx>) -> IndexVec<mir::BasicBlock, CleanupKind> { fn discover_masters<'tcx>(result: &mut IndexVec<mir::BasicBlock, CleanupKind>, - mir: &mir::Mir<'tcx>) { + mir: &mir::Body<'tcx>) { for (bb, data) in mir.basic_blocks().iter_enumerated() { match data.terminator().kind { TerminatorKind::Goto { .. } | @@ -304,7 +304,7 @@ pub fn cleanup_kinds<'a, 'tcx>(mir: &mir::Mir<'tcx>) -> IndexVec<mir::BasicBlock } fn propagate<'tcx>(result: &mut IndexVec<mir::BasicBlock, CleanupKind>, - mir: &mir::Mir<'tcx>) { + mir: &mir::Body<'tcx>) { let mut funclet_succs = IndexVec::from_elem(None, mir.basic_blocks()); let mut set_successor = |funclet: mir::BasicBlock, succ| { diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs index fed12c9a29f..4a43201dedf 100644 --- a/src/librustc_codegen_ssa/mir/mod.rs +++ b/src/librustc_codegen_ssa/mir/mod.rs @@ -1,6 +1,6 @@ use rustc::ty::{self, Ty, TypeFoldable, UpvarSubsts}; use rustc::ty::layout::{TyLayout, HasTyCtxt, FnTypeExt}; -use rustc::mir::{self, Mir}; +use rustc::mir::{self, Body}; use rustc::session::config::DebugInfo; use rustc_mir::monomorphize::Instance; use rustc_target::abi::call::{FnType, PassMode, IgnoreMode}; @@ -27,7 +27,7 @@ use self::operand::{OperandRef, OperandValue}; pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> { instance: Instance<'tcx>, - mir: &'a mir::Mir<'tcx>, + mir: &'a mir::Body<'tcx>, debug_context: FunctionDebugContext<Bx::DIScope>, @@ -196,7 +196,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> LocalRef<'tcx, V> { pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( cx: &'a Bx::CodegenCx, llfn: Bx::Value, - mir: &'a Mir<'tcx>, + mir: &'a Body<'tcx>, instance: Instance<'tcx>, sig: ty::FnSig<'tcx>, ) { @@ -360,7 +360,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( } fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( - mir: &'a Mir<'tcx>, + mir: &'a Body<'tcx>, bx: &mut Bx, cleanup_kinds: &IndexVec<mir::BasicBlock, CleanupKind>, block_bxs: &IndexVec<mir::BasicBlock, Bx::BasicBlock>) diff --git a/src/librustc_codegen_ssa/traits/debuginfo.rs b/src/librustc_codegen_ssa/traits/debuginfo.rs index aadffc5932b..37b7a15e2ba 100644 --- a/src/librustc_codegen_ssa/traits/debuginfo.rs +++ b/src/librustc_codegen_ssa/traits/debuginfo.rs @@ -22,12 +22,12 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes { instance: Instance<'tcx>, sig: ty::FnSig<'tcx>, llfn: Self::Value, - mir: &mir::Mir<'_>, + mir: &mir::Body<'_>, ) -> FunctionDebugContext<Self::DIScope>; fn create_mir_scopes( &self, - mir: &mir::Mir<'_>, + mir: &mir::Body<'_>, debug_context: &mut FunctionDebugContext<Self::DIScope>, ) -> IndexVec<mir::SourceScope, MirDebugScope<Self::DIScope>>; fn extend_scope_to_file( |
