mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
Remove unused arguments from ResultsVisitor::visit_block_{start,end}
.
This commit is contained in:
parent
7a34091eed
commit
f312775e4f
@ -196,7 +196,7 @@ impl Direction for Backward {
|
||||
{
|
||||
results.reset_to_block_entry(state, block);
|
||||
|
||||
vis.visit_block_end(results, state, block_data, block);
|
||||
vis.visit_block_end(state);
|
||||
|
||||
// Terminator
|
||||
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_block_start(results, state, block_data, block);
|
||||
vis.visit_block_start(state);
|
||||
}
|
||||
|
||||
fn join_state_into_successors_of<'tcx, A>(
|
||||
@ -449,7 +449,7 @@ impl Direction for Forward {
|
||||
{
|
||||
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() {
|
||||
let loc = Location { block, statement_index };
|
||||
@ -466,7 +466,7 @@ impl Direction for Forward {
|
||||
results.reconstruct_terminator_effect(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>(
|
||||
|
@ -545,25 +545,13 @@ where
|
||||
{
|
||||
type FlowState = A::Domain;
|
||||
|
||||
fn visit_block_start(
|
||||
&mut self,
|
||||
_results: &mut Results<'tcx, A>,
|
||||
state: &Self::FlowState,
|
||||
_block_data: &mir::BasicBlockData<'tcx>,
|
||||
_block: BasicBlock,
|
||||
) {
|
||||
fn visit_block_start(&mut self, state: &Self::FlowState) {
|
||||
if A::Direction::IS_FORWARD {
|
||||
self.prev_state.clone_from(state);
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_block_end(
|
||||
&mut self,
|
||||
_results: &mut Results<'tcx, A>,
|
||||
state: &Self::FlowState,
|
||||
_block_data: &mir::BasicBlockData<'tcx>,
|
||||
_block: BasicBlock,
|
||||
) {
|
||||
fn visit_block_end(&mut self, state: &Self::FlowState) {
|
||||
if A::Direction::IS_BACKWARD {
|
||||
self.prev_state.clone_from(state);
|
||||
}
|
||||
|
@ -31,14 +31,7 @@ pub fn visit_results<'mir, 'tcx, F, R>(
|
||||
pub trait ResultsVisitor<'mir, 'tcx, R> {
|
||||
type FlowState;
|
||||
|
||||
fn visit_block_start(
|
||||
&mut self,
|
||||
_results: &mut R,
|
||||
_state: &Self::FlowState,
|
||||
_block_data: &'mir mir::BasicBlockData<'tcx>,
|
||||
_block: BasicBlock,
|
||||
) {
|
||||
}
|
||||
fn visit_block_start(&mut self, _state: &Self::FlowState) {}
|
||||
|
||||
/// Called with the `before_statement_effect` of the given statement applied to `state` but not
|
||||
/// its `statement_effect`.
|
||||
@ -86,14 +79,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
|
||||
) {
|
||||
}
|
||||
|
||||
fn visit_block_end(
|
||||
&mut self,
|
||||
_results: &mut R,
|
||||
_state: &Self::FlowState,
|
||||
_block_data: &'mir mir::BasicBlockData<'tcx>,
|
||||
_block: BasicBlock,
|
||||
) {
|
||||
}
|
||||
fn visit_block_end(&mut self, _state: &Self::FlowState) {}
|
||||
}
|
||||
|
||||
/// Things that can be visited by a `ResultsVisitor`.
|
||||
|
Loading…
Reference in New Issue
Block a user