about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2016-05-17 09:06:18 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2016-05-17 09:06:18 +0200
commit8999e877ed860961a6ca3c1150e5641ba6eb336f (patch)
treee0f2249fd8b6a761fef36f4a131ee62ed32cdecc
parent90a652617b23f56e4a89db822b464de341e61049 (diff)
downloadrust-8999e877ed860961a6ca3c1150e5641ba6eb336f.tar.gz
rust-8999e877ed860961a6ca3c1150e5641ba6eb336f.zip
`mir::dataflow::sanity_check`: removed hackish `tmp = val` propagation code.
(it was an artifact of an earlier design of the `rustc_peek` API, but
its totally unnecessary now.)
-rw-r--r--src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs43
1 files changed, 8 insertions, 35 deletions
diff --git a/src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs b/src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs
index 39eb0c33dfb..b45b7922912 100644
--- a/src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs
+++ b/src/librustc_borrowck/borrowck/mir/dataflow/sanity_check.rs
@@ -145,43 +145,16 @@ pub fn sanity_check_via_rustc_peek<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                 }
             }
 
-            enum Effect<'a, 'tcx:'a> { Propagate(&'a repr::Lvalue<'tcx>), Compute }
-            let lvalue_effect: Effect = match *rvalue {
-                // tmp = rhs
-                repr::Rvalue::Use(repr::Operand::Consume(ref rhs_lval)) =>
-                    Effect::Propagate(rhs_lval),
-
-                repr::Rvalue::Use(repr::Operand::Constant(_)) =>
-                    Effect::Compute,
-
-                _ => {
-                    // (fall back to BitDenotation for all other kinds of Rvalues
-                    Effect::Compute
-                }
-            };
-
             let lhs_mpi = move_data.rev_lookup.find(lvalue);
 
-            if let Effect::Propagate(rhs_lval) = lvalue_effect {
-                let rhs_mpi = move_data.rev_lookup.find(rhs_lval);
-                let state = sets.on_entry.get_bit(rhs_mpi.idx());
-                debug!("rustc_peek: propagate into lvalue {:?} ({:?}) from rhs: {:?} state: {}",
-                       lvalue, lhs_mpi, rhs_lval, state);
-                if state {
-                    sets.on_entry.set_bit(lhs_mpi.idx());
-                } else {
-                    sets.on_entry.clear_bit(lhs_mpi.idx());
-                }
-            } else {
-                debug!("rustc_peek: computing effect on lvalue: {:?} ({:?}) in stmt: {:?}",
-                       lvalue, lhs_mpi, stmt);
-                // reset GEN and KILL sets before emulating their effect.
-                for e in &mut sets.gen_set[..] { *e = 0; }
-                for e in &mut sets.kill_set[..] { *e = 0; }
-                results.0.operator.statement_effect(flow_ctxt, &mut sets, bb, j);
-                bitwise(sets.on_entry, sets.gen_set, &Union);
-                bitwise(sets.on_entry, sets.kill_set, &Subtract);
-            }
+            debug!("rustc_peek: computing effect on lvalue: {:?} ({:?}) in stmt: {:?}",
+                   lvalue, lhs_mpi, stmt);
+            // reset GEN and KILL sets before emulating their effect.
+            for e in &mut sets.gen_set[..] { *e = 0; }
+            for e in &mut sets.kill_set[..] { *e = 0; }
+            results.0.operator.statement_effect(flow_ctxt, &mut sets, bb, j);
+            bitwise(sets.on_entry, sets.gen_set, &Union);
+            bitwise(sets.on_entry, sets.kill_set, &Subtract);
         }
 
         tcx.sess.span_err(span, &format!("rustc_peek: MIR did not match \