Add tracking of unreachability
This commit is contained in:
parent
16dedba1c8
commit
fe84bbf844
4 changed files with 82 additions and 30 deletions
|
@ -148,7 +148,6 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'tcx> {
|
|||
) {
|
||||
// FIXME: The dataflow framework only provides the state if we call `apply()`, which makes
|
||||
// this more inefficient than it has to be.
|
||||
// FIXME: Perhaps we rather need a proper unreachability flag for every block.
|
||||
let mut discr_value = None;
|
||||
let mut handled = false;
|
||||
apply_edge_effects.apply(|state, target| {
|
||||
|
@ -181,8 +180,8 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'tcx> {
|
|||
// Branch is taken. Has no effect on state.
|
||||
handled = true;
|
||||
} else {
|
||||
// Branch is not taken, we can flood everything with bottom.
|
||||
state.flood_all_with(FlatSet::Bottom);
|
||||
// Branch is not taken.
|
||||
state.mark_unreachable();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue