]> git.lizzy.rs Git - rust.git/commitdiff
Remove BasicBlock parameter from mir visitor methods
authorMatthew Jasper <mjjasper1@gmail.com>
Mon, 22 Apr 2019 20:07:14 +0000 (21:07 +0100)
committerMatthew Jasper <mjjasper1@gmail.com>
Fri, 26 Apr 2019 20:35:10 +0000 (21:35 +0100)
19 files changed:
src/librustc/mir/visit.rs
src/librustc_codegen_ssa/mir/analyze.rs
src/librustc_mir/borrow_check/borrow_set.rs
src/librustc_mir/borrow_check/nll/constraint_generation.rs
src/librustc_mir/borrow_check/nll/invalidation.rs
src/librustc_mir/borrow_check/used_muts.rs
src/librustc_mir/dataflow/impls/borrowed_locals.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_mir/transform/check_unsafety.rs
src/librustc_mir/transform/cleanup_post_borrowck.rs
src/librustc_mir/transform/const_prop.rs
src/librustc_mir/transform/erase_regions.rs
src/librustc_mir/transform/generator.rs
src/librustc_mir/transform/inline.rs
src/librustc_mir/transform/no_landing_pads.rs
src/librustc_mir/transform/qualify_consts.rs
src/librustc_mir/transform/uniform_array_move_out.rs
src/librustc_mir/util/liveness.rs
src/librustc_mir/util/pretty.rs

index b04c28cde571cdfea5c9bf737dd135953b7ad2ea..73dd24059a500300b150a10fd85f060038c69d45 100644 (file)
@@ -88,32 +88,28 @@ fn visit_source_scope_data(&mut self,
             }
 
             fn visit_statement(&mut self,
-                               block: BasicBlock,
                                statement: & $($mutability)? Statement<'tcx>,
                                location: Location) {
-                self.super_statement(block, statement, location);
+                self.super_statement(statement, location);
             }
 
             fn visit_assign(&mut self,
-                            block: BasicBlock,
                             place: & $($mutability)? Place<'tcx>,
                             rvalue: & $($mutability)? Rvalue<'tcx>,
                             location: Location) {
-                self.super_assign(block, place, rvalue, location);
+                self.super_assign(place, rvalue, location);
             }
 
             fn visit_terminator(&mut self,
-                                block: BasicBlock,
                                 terminator: & $($mutability)? Terminator<'tcx>,
                                 location: Location) {
-                self.super_terminator(block, terminator, location);
+                self.super_terminator(terminator, location);
             }
 
             fn visit_terminator_kind(&mut self,
-                                     block: BasicBlock,
                                      kind: & $($mutability)? TerminatorKind<'tcx>,
                                      location: Location) {
-                self.super_terminator_kind(block, kind, location);
+                self.super_terminator_kind(kind, location);
             }
 
             fn visit_assert_message(&mut self,
@@ -327,13 +323,13 @@ fn super_basic_block_data(&mut self,
                 let mut index = 0;
                 for statement in statements {
                     let location = Location { block: block, statement_index: index };
-                    self.visit_statement(block, statement, location);
+                    self.visit_statement(statement, location);
                     index += 1;
                 }
 
                 if let Some(terminator) = terminator {
                     let location = Location { block: block, statement_index: index };
-                    self.visit_terminator(block, terminator, location);
+                    self.visit_terminator(terminator, location);
                 }
             }
 
@@ -350,7 +346,6 @@ fn super_source_scope_data(&mut self, scope_data: & $($mutability)? SourceScopeD
             }
 
             fn super_statement(&mut self,
-                               block: BasicBlock,
                                statement: & $($mutability)? Statement<'tcx>,
                                location: Location) {
                 let Statement {
@@ -361,7 +356,7 @@ fn super_statement(&mut self,
                 self.visit_source_info(source_info);
                 match kind {
                     StatementKind::Assign(place, rvalue) => {
-                        self.visit_assign(block, place, rvalue, location);
+                        self.visit_assign(place, rvalue, location);
                     }
                     StatementKind::FakeRead(_, place) => {
                         self.visit_place(
@@ -415,7 +410,6 @@ fn super_statement(&mut self,
             }
 
             fn super_assign(&mut self,
-                            _block: BasicBlock,
                             place: &$($mutability)? Place<'tcx>,
                             rvalue: &$($mutability)? Rvalue<'tcx>,
                             location: Location) {
@@ -428,19 +422,18 @@ fn super_assign(&mut self,
             }
 
             fn super_terminator(&mut self,
-                                block: BasicBlock,
                                 terminator: &$($mutability)? Terminator<'tcx>,
                                 location: Location) {
                 let Terminator { source_info, kind } = terminator;
 
                 self.visit_source_info(source_info);
-                self.visit_terminator_kind(block, kind, location);
+                self.visit_terminator_kind(kind, location);
             }
 
             fn super_terminator_kind(&mut self,
-                                     block: BasicBlock,
                                      kind: & $($mutability)? TerminatorKind<'tcx>,
                                      source_location: Location) {
+                let block = source_location.block;
                 match kind {
                     TerminatorKind::Goto { target } => {
                         self.visit_branch(block, *target);
@@ -890,12 +883,12 @@ fn visit_location(&mut self, mir: & $($mutability)? Mir<'tcx>, location: Locatio
                 let basic_block = & $($mutability)? mir[location.block];
                 if basic_block.statements.len() == location.statement_index {
                     if let Some(ref $($mutability)? terminator) = basic_block.terminator {
-                        self.visit_terminator(location.block, terminator, location)
+                        self.visit_terminator(terminator, location)
                     }
                 } else {
                     let statement = & $($mutability)?
                         basic_block.statements[location.statement_index];
-                    self.visit_statement(location.block, statement, location)
+                    self.visit_statement(statement, location)
                 }
             }
         }
@@ -912,21 +905,21 @@ pub trait MirVisitable<'tcx> {
 impl<'tcx> MirVisitable<'tcx> for Statement<'tcx> {
     fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
     {
-        visitor.visit_statement(location.block, self, location)
+        visitor.visit_statement(self, location)
     }
 }
 
 impl<'tcx> MirVisitable<'tcx> for Terminator<'tcx> {
     fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
     {
-        visitor.visit_terminator(location.block, self, location)
+        visitor.visit_terminator(self, location)
     }
 }
 
 impl<'tcx> MirVisitable<'tcx> for Option<Terminator<'tcx>> {
     fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
     {
-        visitor.visit_terminator(location.block, self.as_ref().unwrap(), location)
+        visitor.visit_terminator(self.as_ref().unwrap(), location)
     }
 }
 
index 8253a1672454d33cb688269101ab5e05259f3904..c3eac4edd0ae6a91d5be4d4209fd2d2e4fb190a6 100644 (file)
@@ -97,11 +97,10 @@ fn assign(&mut self, local: mir::Local, location: Location) {
 impl<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
     for LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
     fn visit_assign(&mut self,
-                    block: mir::BasicBlock,
                     place: &mir::Place<'tcx>,
                     rvalue: &mir::Rvalue<'tcx>,
                     location: Location) {
-        debug!("visit_assign(block={:?}, place={:?}, rvalue={:?})", block, place, rvalue);
+        debug!("visit_assign(place={:?}, rvalue={:?})", place, rvalue);
 
         if let mir::Place::Base(mir::PlaceBase::Local(index)) = *place {
             self.assign(index, location);
@@ -120,7 +119,6 @@ fn visit_assign(&mut self,
     }
 
     fn visit_terminator_kind(&mut self,
-                             block: mir::BasicBlock,
                              kind: &mir::TerminatorKind<'tcx>,
                              location: Location) {
         let check = match *kind {
@@ -148,7 +146,7 @@ fn visit_terminator_kind(&mut self,
             }
         }
 
-        self.super_terminator_kind(block, kind, location);
+        self.super_terminator_kind(kind, location);
     }
 
     fn visit_place(&mut self,
index 918192395c3f4eaa42f36c11af31c0638fb0de61..f7d3aef4d766cd7740b0f946b9b8a4677248cdfb 100644 (file)
@@ -184,7 +184,6 @@ struct GatherBorrows<'a, 'gcx: 'tcx, 'tcx: 'a> {
 impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {
     fn visit_assign(
         &mut self,
-        block: mir::BasicBlock,
         assigned_place: &mir::Place<'tcx>,
         rvalue: &mir::Rvalue<'tcx>,
         location: mir::Location,
@@ -215,7 +214,7 @@ fn visit_assign(
             }
         }
 
-        self.super_assign(block, assigned_place, rvalue, location)
+        self.super_assign(assigned_place, rvalue, location)
     }
 
     fn visit_local(
@@ -287,15 +286,6 @@ fn visit_rvalue(&mut self, rvalue: &mir::Rvalue<'tcx>, location: mir::Location)
 
         return self.super_rvalue(rvalue, location);
     }
-
-    fn visit_statement(
-        &mut self,
-        block: mir::BasicBlock,
-        statement: &mir::Statement<'tcx>,
-        location: Location,
-    ) {
-        return self.super_statement(block, statement, location);
-    }
 }
 
 impl<'a, 'gcx, 'tcx> GatherBorrows<'a, 'gcx, 'tcx> {
index bf9cff1e4ae03c8f65f757f579591a2da615838c..bfba9738a6488e57f6daa524a78d678e590b58bf 100644 (file)
@@ -100,7 +100,6 @@ fn visit_closure_substs(&mut self, substs: &ClosureSubsts<'tcx>, location: Locat
 
     fn visit_statement(
         &mut self,
-        block: BasicBlock,
         statement: &Statement<'tcx>,
         location: Location,
     ) {
@@ -117,12 +116,11 @@ fn visit_statement(
             ));
         }
 
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 
     fn visit_assign(
         &mut self,
-        block: BasicBlock,
         place: &Place<'tcx>,
         rvalue: &Rvalue<'tcx>,
         location: Location,
@@ -141,12 +139,11 @@ fn visit_assign(
             }
         }
 
-        self.super_assign(block, place, rvalue, location);
+        self.super_assign(place, rvalue, location);
     }
 
     fn visit_terminator(
         &mut self,
-        block: BasicBlock,
         terminator: &Terminator<'tcx>,
         location: Location,
     ) {
@@ -167,7 +164,7 @@ fn visit_terminator(
             }
         }
 
-        self.super_terminator(block, terminator, location);
+        self.super_terminator(terminator, location);
     }
 
     fn visit_ascribe_user_ty(
index 8cbf68c476a7e77cae156a4da2dc1c3848c87896..999b43d90d027850b2bc42efdc6e415a674e0399 100644 (file)
@@ -58,7 +58,6 @@ struct InvalidationGenerator<'cx, 'tcx: 'cx, 'gcx: 'tcx> {
 impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> {
     fn visit_statement(
         &mut self,
-        block: BasicBlock,
         statement: &Statement<'tcx>,
         location: Location,
     ) {
@@ -134,13 +133,12 @@ fn visit_statement(
             }
         }
 
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 
     fn visit_terminator(
         &mut self,
-        block: BasicBlock,
-        terminator: &Terminator<'tcx>,
+        kind: &Terminator<'tcx>,
         location: Location
     ) {
         self.check_activations(location);
@@ -258,7 +256,7 @@ fn visit_terminator(
             }
         }
 
-        self.super_terminator(block, terminator, location);
+        self.super_terminator(terminator, location);
     }
 }
 
index b102bced0e335e18822f3a7d7019d464ae5297e3..f3b33c411a63621253a54bcced5b26f0d7049b6c 100644 (file)
@@ -1,6 +1,6 @@
 use rustc::mir::visit::{PlaceContext, Visitor};
 use rustc::mir::{
-    BasicBlock, Local, Location, Place, PlaceBase, Statement, StatementKind, TerminatorKind
+    Local, Location, Place, PlaceBase, Statement, StatementKind, TerminatorKind
 };
 
 use rustc_data_structures::fx::FxHashSet;
@@ -55,7 +55,6 @@ struct GatherUsedMutsVisitor<'visit, 'cx: 'visit, 'gcx: 'tcx, 'tcx: 'cx> {
 impl<'visit, 'cx, 'gcx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'cx, 'gcx, 'tcx> {
     fn visit_terminator_kind(
         &mut self,
-        _block: BasicBlock,
         kind: &TerminatorKind<'tcx>,
         _location: Location,
     ) {
@@ -77,7 +76,6 @@ fn visit_terminator_kind(
 
     fn visit_statement(
         &mut self,
-        _block: BasicBlock,
         statement: &Statement<'tcx>,
         _location: Location,
     ) {
index 9d4600d13ac138a169daf3cb6476abdb2a797f50..42c2387b7052da02d6949cb95e37f0bd34f5d892 100644 (file)
@@ -44,7 +44,7 @@ fn statement_effect(&self,
 
         BorrowedLocalsVisitor {
             sets,
-        }.visit_statement(loc.block, stmt, loc);
+        }.visit_statement(stmt, loc);
 
         // StorageDead invalidates all borrows and raw pointers to a local
         match stmt.kind {
@@ -58,7 +58,7 @@ fn terminator_effect(&self,
                          loc: Location) {
         BorrowedLocalsVisitor {
             sets,
-        }.visit_terminator(loc.block, self.mir[loc.block].terminator(), loc);
+        }.visit_terminator(self.mir[loc.block].terminator(), loc);
     }
 
     fn propagate_call_return(
index 47fe136e0e451a0c4251108f669926adb41a23d3..d5c5c3eda1de1f0b9c3c7110dd66dea1d3eea2a4 100644 (file)
@@ -615,7 +615,6 @@ fn visit_const(&mut self, constant: &&'tcx ty::Const<'tcx>, location: Location)
     }
 
     fn visit_terminator_kind(&mut self,
-                             block: mir::BasicBlock,
                              kind: &mir::TerminatorKind<'tcx>,
                              location: Location) {
         debug!("visiting terminator {:?} @ {:?}", kind, location);
@@ -654,7 +653,7 @@ fn visit_terminator_kind(&mut self,
             mir::TerminatorKind::FalseUnwind { .. } => bug!(),
         }
 
-        self.super_terminator_kind(block, kind, location);
+        self.super_terminator_kind(kind, location);
     }
 
     fn visit_place(&mut self,
index 87c02b7f01da32ba322250aac8d71eb0e34897e8..e072fafb1df0e393f90ccbf4b50d4e26ab127c95 100644 (file)
@@ -65,7 +65,6 @@ fn new(
 
 impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
     fn visit_terminator(&mut self,
-                        block: BasicBlock,
                         terminator: &Terminator<'tcx>,
                         location: Location)
     {
@@ -97,11 +96,10 @@ fn visit_terminator(&mut self,
                 }
             }
         }
-        self.super_terminator(block, terminator, location);
+        self.super_terminator(terminator, location);
     }
 
     fn visit_statement(&mut self,
-                       block: BasicBlock,
                        statement: &Statement<'tcx>,
                        location: Location)
     {
@@ -124,7 +122,7 @@ fn visit_statement(&mut self,
                     UnsafetyViolationKind::General)
             },
         }
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 
     fn visit_rvalue(&mut self,
index 349b27523a0a10ecce6fd1a21f8d51c5a5200955..64fd0b1365690a1864546f8224983806bf246fe9 100644 (file)
@@ -16,7 +16,7 @@
 //! [`FakeRead`]: rustc::mir::StatementKind::FakeRead
 //! [`Nop`]: rustc::mir::StatementKind::Nop
 
-use rustc::mir::{BasicBlock, BorrowKind, Rvalue, Location, Mir};
+use rustc::mir::{BorrowKind, Rvalue, Location, Mir};
 use rustc::mir::{Statement, StatementKind};
 use rustc::mir::visit::MutVisitor;
 use rustc::ty::TyCtxt;
@@ -38,7 +38,6 @@ fn run_pass<'a, 'tcx>(&self,
 
 impl<'tcx> MutVisitor<'tcx> for DeleteNonCodegenStatements {
     fn visit_statement(&mut self,
-                       block: BasicBlock,
                        statement: &mut Statement<'tcx>,
                        location: Location) {
         match statement.kind {
@@ -47,6 +46,6 @@ fn visit_statement(&mut self,
             | StatementKind::FakeRead(..) => statement.make_nop(),
             _ => (),
         }
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 }
index b5bdc9e1c8c6e61f9ce0e8736c145e483fa7fde5..75b9a6bc4ff72dfee2922d1ea39fb8732d6d7700 100644 (file)
@@ -4,7 +4,7 @@
 
 use rustc::hir::def::Def;
 use rustc::mir::{Constant, Location, Place, PlaceBase, Mir, Operand, Rvalue, Local};
-use rustc::mir::{NullOp, UnOp, StatementKind, Statement, BasicBlock, LocalKind, Static, StaticKind};
+use rustc::mir::{NullOp, UnOp, StatementKind, Statement, LocalKind, Static, StaticKind};
 use rustc::mir::{TerminatorKind, ClearCrossCrate, SourceInfo, BinOp, ProjectionElem};
 use rustc::mir::visit::{Visitor, PlaceContext, MutatingUseContext, NonMutatingUseContext};
 use rustc::mir::interpret::{InterpError, Scalar, GlobalId, EvalResult};
@@ -549,7 +549,6 @@ fn visit_constant(
 
     fn visit_statement(
         &mut self,
-        block: BasicBlock,
         statement: &Statement<'tcx>,
         location: Location,
     ) {
@@ -571,16 +570,15 @@ fn visit_statement(
                 }
             }
         }
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 
     fn visit_terminator_kind(
         &mut self,
-        block: BasicBlock,
         kind: &TerminatorKind<'tcx>,
         location: Location,
     ) {
-        self.super_terminator_kind(block, kind, location);
+        self.super_terminator_kind(kind, location);
         let source_info = *self.mir.source_info(location);
         if let TerminatorKind::Assert { expected, msg, cond, .. } = kind {
             if let Some(value) = self.eval_operand(cond, source_info) {
@@ -601,7 +599,7 @@ fn visit_terminator_kind(
                         },
                         Operand::Constant(_) => {}
                     }
-                    let span = self.mir[block]
+                    let span = self.mir[location.block]
                         .terminator
                         .as_ref()
                         .unwrap()
index a853f8d92beaeacb7f6ee0eb9c906bea8b0479cf..924428deaee997dea829732e235eb947f1be61fe 100644 (file)
@@ -41,10 +41,9 @@ fn visit_substs(&mut self, substs: &mut SubstsRef<'tcx>, _: Location) {
     }
 
     fn visit_statement(&mut self,
-                       block: BasicBlock,
                        statement: &mut Statement<'tcx>,
                        location: Location) {
-        self.super_statement(block, statement, location);
+        self.super_statement(statement, location);
     }
 }
 
index 2b909feb9603f0c675745ba02383c09610a5421a..ba802370183357b9654afa34040224d39e51dba0 100644 (file)
@@ -369,7 +369,6 @@ fn replace_result_variable<'tcx>(
 
 impl<'tcx> Visitor<'tcx> for StorageIgnored {
     fn visit_statement(&mut self,
-                       _block: BasicBlock,
                        statement: &Statement<'tcx>,
                        _location: Location) {
         match statement.kind {
index e96a40ad2f036f1be0a4180a45d9773ef8869c66..de1d424108d0bf86f33640099471e8cae7d9e153 100644 (file)
@@ -723,9 +723,9 @@ fn visit_retag(
         }
     }
 
-    fn visit_terminator_kind(&mut self, block: BasicBlock,
+    fn visit_terminator_kind(&mut self,
                              kind: &mut TerminatorKind<'tcx>, loc: Location) {
-        self.super_terminator_kind(block, kind, loc);
+        self.super_terminator_kind(kind, loc);
 
         match *kind {
             TerminatorKind::GeneratorDrop |
index 089d9b9b544540a83cc3e2bb4af4b097adfa2ef7..d39f76a9901f4b38fd8f699249523b77ac64b49c 100644 (file)
@@ -25,12 +25,11 @@ pub fn no_landing_pads<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, mir: &mut Mir<'tcx
 
 impl<'tcx> MutVisitor<'tcx> for NoLandingPads {
     fn visit_terminator(&mut self,
-                        bb: BasicBlock,
                         terminator: &mut Terminator<'tcx>,
                         location: Location) {
         if let Some(unwind) = terminator.kind.unwind_mut() {
             unwind.take();
         }
-        self.super_terminator(bb, terminator, location);
+        self.super_terminator(terminator, location);
     }
 }
index bbcdd2c1812ae34e91aea2e854b1e9419583b11e..c30666e53806dfdcfb0d0b2df269254a24670406 100644 (file)
@@ -1182,10 +1182,9 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
     }
 
     fn visit_terminator_kind(&mut self,
-                             bb: BasicBlock,
                              kind: &TerminatorKind<'tcx>,
                              location: Location) {
-        debug!("visit_terminator_kind: bb={:?} kind={:?} location={:?}", bb, kind, location);
+        debug!("visit_terminator_kind: kind={:?} location={:?}", kind, location);
         if let TerminatorKind::Call { ref func, ref args, ref destination, .. } = *kind {
             if let Some((ref dest, _)) = *destination {
                 self.assign(dest, ValueSource::Call {
@@ -1313,7 +1312,7 @@ fn visit_terminator_kind(&mut self,
                         continue;
                     }
 
-                    let candidate = Candidate::Argument { bb, index: i };
+                    let candidate = Candidate::Argument { bb: location.block, index: i };
                     // Since the argument is required to be constant,
                     // we care about constness, not promotability.
                     // If we checked for promotability, we'd miss out on
@@ -1346,7 +1345,7 @@ fn visit_terminator_kind(&mut self,
                 self.visit_operand(arg, location);
             }
         } else if let TerminatorKind::Drop { location: ref place, .. } = *kind {
-            self.super_terminator_kind(bb, kind, location);
+            self.super_terminator_kind(kind, location);
 
             // Deny *any* live drops anywhere other than functions.
             if self.mode != Mode::Fn {
@@ -1377,12 +1376,11 @@ fn visit_terminator_kind(&mut self,
             }
         } else {
             // Qualify any operands inside other terminators.
-            self.super_terminator_kind(bb, kind, location);
+            self.super_terminator_kind(kind, location);
         }
     }
 
     fn visit_assign(&mut self,
-                    _: BasicBlock,
                     dest: &Place<'tcx>,
                     rvalue: &Rvalue<'tcx>,
                     location: Location) {
@@ -1397,11 +1395,11 @@ fn visit_source_info(&mut self, source_info: &SourceInfo) {
         self.span = source_info.span;
     }
 
-    fn visit_statement(&mut self, bb: BasicBlock, statement: &Statement<'tcx>, location: Location) {
-        debug!("visit_statement: bb={:?} statement={:?} location={:?}", bb, statement, location);
+    fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
+        debug!("visit_statement: statement={:?} location={:?}", statement, location);
         match statement.kind {
             StatementKind::Assign(..) => {
-                self.super_statement(bb, statement, location);
+                self.super_statement(statement, location);
             }
             // FIXME(eddyb) should these really do nothing?
             StatementKind::FakeRead(..) |
@@ -1414,14 +1412,6 @@ fn visit_statement(&mut self, bb: BasicBlock, statement: &Statement<'tcx>, locat
             StatementKind::Nop => {}
         }
     }
-
-    fn visit_terminator(&mut self,
-                        bb: BasicBlock,
-                        terminator: &Terminator<'tcx>,
-                        location: Location) {
-        debug!("visit_terminator: bb={:?} terminator={:?} location={:?}", bb, terminator, location);
-        self.super_terminator(bb, terminator, location);
-    }
 }
 
 pub fn provide(providers: &mut Providers<'_>) {
index 616944dd7ef99ed87eb2361d783af84d15593554..cb23abd8a0dc36ee15b2b816831b2a85a6765056 100644 (file)
@@ -58,7 +58,6 @@ struct UniformArrayMoveOutVisitor<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> Visitor<'tcx> for UniformArrayMoveOutVisitor<'a, 'tcx> {
     fn visit_assign(&mut self,
-                    block: BasicBlock,
                     dst_place: &Place<'tcx>,
                     rvalue: &Rvalue<'tcx>,
                     location: Location) {
@@ -82,7 +81,7 @@ fn visit_assign(&mut self,
                 }
             }
         }
-        self.super_assign(block, dst_place, rvalue, location)
+        self.super_assign(dst_place, rvalue, location)
     }
 }
 
@@ -294,14 +293,13 @@ struct RestoreDataCollector {
 
 impl<'tcx> Visitor<'tcx> for RestoreDataCollector {
     fn visit_assign(&mut self,
-                    block: BasicBlock,
                     place: &Place<'tcx>,
                     rvalue: &Rvalue<'tcx>,
                     location: Location) {
         if let Rvalue::Aggregate(box AggregateKind::Array(_), _) = *rvalue {
             self.candidates.push(location);
         }
-        self.super_assign(block, place, rvalue, location)
+        self.super_assign(place, rvalue, location)
     }
 
     fn visit_local(&mut self,
index cbdd50cf4052af71d62f40f2bb97e77b22767836..29f281fb8d430fd353eaa40f63d180751cf6e30f 100644 (file)
@@ -247,9 +247,9 @@ fn block<'tcx>(
 
     // Visit the various parts of the basic block in reverse. If we go
     // forward, the logic in `add_def` and `add_use` would be wrong.
-    visitor.visit_terminator(BasicBlock::new(0), b.terminator(), dummy_location);
+    visitor.visit_terminator(b.terminator(), dummy_location);
     for statement in b.statements.iter().rev() {
-        visitor.visit_statement(BasicBlock::new(0), statement, dummy_location);
+        visitor.visit_statement(statement, dummy_location);
     }
 
     visitor.defs_uses
index 1f55a728f9c720c01a6bd27d9f330791cba5f148..6c377684bee5196bc915a08a2a7ec70e1739e936 100644 (file)
@@ -337,7 +337,7 @@ pub fn write_basic_block<'cx, 'gcx, 'tcx, F>(
         )?;
 
         write_extra(tcx, w, |visitor| {
-            visitor.visit_statement(current_location.block, statement, current_location);
+            visitor.visit_statement(statement, current_location);
         })?;
 
         extra_data(PassWhere::AfterLocation(current_location), w)?;
@@ -358,7 +358,7 @@ pub fn write_basic_block<'cx, 'gcx, 'tcx, F>(
     )?;
 
     write_extra(tcx, w, |visitor| {
-        visitor.visit_terminator(current_location.block, data.terminator(), current_location);
+        visitor.visit_terminator(data.terminator(), current_location);
     })?;
 
     extra_data(PassWhere::AfterLocation(current_location), w)?;