Remove unused arguments from ResultsVisitor::visit_block_{start,end}
.
This commit is contained in:
parent
7a34091eed
commit
f312775e4f
3 changed files with 8 additions and 34 deletions
|
@ -196,7 +196,7 @@ impl Direction for Backward {
|
||||||
{
|
{
|
||||||
results.reset_to_block_entry(state, block);
|
results.reset_to_block_entry(state, block);
|
||||||
|
|
||||||
vis.visit_block_end(results, state, block_data, block);
|
vis.visit_block_end(state);
|
||||||
|
|
||||||
// Terminator
|
// Terminator
|
||||||
let loc = Location { block, statement_index: block_data.statements.len() };
|
let loc = Location { block, statement_index: block_data.statements.len() };
|
||||||
|
@ -214,7 +214,7 @@ impl Direction for Backward {
|
||||||
vis.visit_statement_after_primary_effect(results, state, stmt, loc);
|
vis.visit_statement_after_primary_effect(results, state, stmt, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
vis.visit_block_start(results, state, block_data, block);
|
vis.visit_block_start(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn join_state_into_successors_of<'tcx, A>(
|
fn join_state_into_successors_of<'tcx, A>(
|
||||||
|
@ -449,7 +449,7 @@ impl Direction for Forward {
|
||||||
{
|
{
|
||||||
results.reset_to_block_entry(state, block);
|
results.reset_to_block_entry(state, block);
|
||||||
|
|
||||||
vis.visit_block_start(results, state, block_data, block);
|
vis.visit_block_start(state);
|
||||||
|
|
||||||
for (statement_index, stmt) in block_data.statements.iter().enumerate() {
|
for (statement_index, stmt) in block_data.statements.iter().enumerate() {
|
||||||
let loc = Location { block, statement_index };
|
let loc = Location { block, statement_index };
|
||||||
|
@ -466,7 +466,7 @@ impl Direction for Forward {
|
||||||
results.reconstruct_terminator_effect(state, term, loc);
|
results.reconstruct_terminator_effect(state, term, loc);
|
||||||
vis.visit_terminator_after_primary_effect(results, state, term, loc);
|
vis.visit_terminator_after_primary_effect(results, state, term, loc);
|
||||||
|
|
||||||
vis.visit_block_end(results, state, block_data, block);
|
vis.visit_block_end(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn join_state_into_successors_of<'tcx, A>(
|
fn join_state_into_successors_of<'tcx, A>(
|
||||||
|
|
|
@ -545,25 +545,13 @@ where
|
||||||
{
|
{
|
||||||
type FlowState = A::Domain;
|
type FlowState = A::Domain;
|
||||||
|
|
||||||
fn visit_block_start(
|
fn visit_block_start(&mut self, state: &Self::FlowState) {
|
||||||
&mut self,
|
|
||||||
_results: &mut Results<'tcx, A>,
|
|
||||||
state: &Self::FlowState,
|
|
||||||
_block_data: &mir::BasicBlockData<'tcx>,
|
|
||||||
_block: BasicBlock,
|
|
||||||
) {
|
|
||||||
if A::Direction::IS_FORWARD {
|
if A::Direction::IS_FORWARD {
|
||||||
self.prev_state.clone_from(state);
|
self.prev_state.clone_from(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_block_end(
|
fn visit_block_end(&mut self, state: &Self::FlowState) {
|
||||||
&mut self,
|
|
||||||
_results: &mut Results<'tcx, A>,
|
|
||||||
state: &Self::FlowState,
|
|
||||||
_block_data: &mir::BasicBlockData<'tcx>,
|
|
||||||
_block: BasicBlock,
|
|
||||||
) {
|
|
||||||
if A::Direction::IS_BACKWARD {
|
if A::Direction::IS_BACKWARD {
|
||||||
self.prev_state.clone_from(state);
|
self.prev_state.clone_from(state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,7 @@ pub fn visit_results<'mir, 'tcx, F, R>(
|
||||||
pub trait ResultsVisitor<'mir, 'tcx, R> {
|
pub trait ResultsVisitor<'mir, 'tcx, R> {
|
||||||
type FlowState;
|
type FlowState;
|
||||||
|
|
||||||
fn visit_block_start(
|
fn visit_block_start(&mut self, _state: &Self::FlowState) {}
|
||||||
&mut self,
|
|
||||||
_results: &mut R,
|
|
||||||
_state: &Self::FlowState,
|
|
||||||
_block_data: &'mir mir::BasicBlockData<'tcx>,
|
|
||||||
_block: BasicBlock,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Called with the `before_statement_effect` of the given statement applied to `state` but not
|
/// Called with the `before_statement_effect` of the given statement applied to `state` but not
|
||||||
/// its `statement_effect`.
|
/// its `statement_effect`.
|
||||||
|
@ -86,14 +79,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_block_end(
|
fn visit_block_end(&mut self, _state: &Self::FlowState) {}
|
||||||
&mut self,
|
|
||||||
_results: &mut R,
|
|
||||||
_state: &Self::FlowState,
|
|
||||||
_block_data: &'mir mir::BasicBlockData<'tcx>,
|
|
||||||
_block: BasicBlock,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Things that can be visited by a `ResultsVisitor`.
|
/// Things that can be visited by a `ResultsVisitor`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue