diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-05-27 17:11:59 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-08-16 18:12:18 +0000 |
| commit | 7ded3409b83710b9de105a35e1c32a5fa88b1b20 (patch) | |
| tree | e4cf6b192bff086badee361881915fe386e12ec9 /compiler/rustc_mir_dataflow/src | |
| parent | aa697f599e8060ca05ee8f56dc1bd19c73911503 (diff) | |
| download | rust-7ded3409b83710b9de105a35e1c32a5fa88b1b20.tar.gz rust-7ded3409b83710b9de105a35e1c32a5fa88b1b20.zip | |
Specify that method only applies statement effects.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/direction.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/engine.rs | 17 |
2 files changed, 14 insertions, 9 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/direction.rs b/compiler/rustc_mir_dataflow/src/framework/direction.rs index c75a2c6d4f7..8a9e37c5a4f 100644 --- a/compiler/rustc_mir_dataflow/src/framework/direction.rs +++ b/compiler/rustc_mir_dataflow/src/framework/direction.rs @@ -33,7 +33,7 @@ pub trait Direction { where A: Analysis<'tcx>; - fn gen_kill_effects_in_block<'tcx, A>( + fn gen_kill_statement_effects_in_block<'tcx, A>( analysis: &mut A, trans: &mut GenKillSet<A::Idx>, block: BasicBlock, @@ -93,7 +93,7 @@ impl Direction for Backward { edges } - fn gen_kill_effects_in_block<'tcx, A>( + fn gen_kill_statement_effects_in_block<'tcx, A>( analysis: &mut A, trans: &mut GenKillSet<A::Idx>, block: BasicBlock, @@ -350,7 +350,7 @@ impl Direction for Forward { analysis.apply_terminator_effect(state, terminator, location) } - fn gen_kill_effects_in_block<'tcx, A>( + fn gen_kill_statement_effects_in_block<'tcx, A>( analysis: &mut A, trans: &mut GenKillSet<A::Idx>, block: BasicBlock, diff --git a/compiler/rustc_mir_dataflow/src/framework/engine.rs b/compiler/rustc_mir_dataflow/src/framework/engine.rs index 346e875f637..a29962d7717 100644 --- a/compiler/rustc_mir_dataflow/src/framework/engine.rs +++ b/compiler/rustc_mir_dataflow/src/framework/engine.rs @@ -144,7 +144,7 @@ where // gen/kill problems on cyclic CFGs. This is not ideal, but it doesn't seem to degrade // performance in practice. I've tried a few ways to avoid this, but they have downsides. See // the message for the commit that added this FIXME for more information. - apply_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, + apply_statement_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, } impl<'a, 'tcx, A, D, T> Engine<'a, 'tcx, A> @@ -170,7 +170,12 @@ where for (block, block_data) in body.basic_blocks.iter_enumerated() { let trans = &mut trans_for_block[block]; - A::Direction::gen_kill_effects_in_block(&mut analysis, trans, block, block_data); + A::Direction::gen_kill_statement_effects_in_block( + &mut analysis, + trans, + block, + block_data, + ); } let apply_trans = Box::new(move |bb: BasicBlock, state: &mut A::Domain| { @@ -199,7 +204,7 @@ where tcx: TyCtxt<'tcx>, body: &'a mir::Body<'tcx>, analysis: A, - apply_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, + apply_statement_trans_for_block: Option<Box<dyn Fn(BasicBlock, &mut A::Domain)>>, ) -> Self { let mut entry_sets = IndexVec::from_fn_n(|_| analysis.bottom_value(body), body.basic_blocks.len()); @@ -210,7 +215,7 @@ where bug!("`initialize_start_block` is not yet supported for backward dataflow analyses"); } - Engine { analysis, tcx, body, pass_name: None, entry_sets, apply_trans_for_block } + Engine { analysis, tcx, body, pass_name: None, entry_sets, apply_statement_trans_for_block } } /// Adds an identifier to the graphviz output for this particular run of a dataflow analysis. @@ -232,7 +237,7 @@ where body, mut entry_sets, tcx, - apply_trans_for_block, + apply_statement_trans_for_block, pass_name, .. } = self; @@ -269,7 +274,7 @@ where &mut state, bb, bb_data, - apply_trans_for_block.as_deref(), + apply_statement_trans_for_block.as_deref(), ); A::Direction::join_state_into_successors_of( |
