Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_attr_ir/src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ pub enum RustcDumpLayoutKind {
#[derive(Clone, Debug, StableHash, Encodable, Decodable, PrintAttribute, PartialEq, Eq)]
pub enum RustcMirKind {
PrettyLiveLocals,
PrettyPreciseLiveness,
PrettyTransitiveLiveLocals,
PeekMaybeInit,
PeekMaybeUninit,
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,10 @@ impl CombineAttributeParser for RustcMirParser {
cx.expect_no_args(mi.args())?;
Some(RustcMirKind::PrettyLiveLocals)
}
sym::rustc_pretty_precise_liveness => {
cx.expect_no_args(mi.args())?;
Some(RustcMirKind::PrettyPreciseLiveness)
}
sym::rustc_pretty_transitive_live_locals => {
cx.expect_no_args(mi.args())?;
Some(RustcMirKind::PrettyTransitiveLiveLocals)
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_mir_dataflow/src/framework/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ impl Direction for Backward {
analysis.apply_primary_statement_effect(state, stmt, loc);
vis.visit_after_primary_statement_effect(state, stmt, loc);
}

vis.visit_block_exit(state, block);
}
}

Expand Down Expand Up @@ -242,5 +244,7 @@ impl Direction for Forward {
vis.visit_after_early_terminator_effect(state, term, loc);
analysis.apply_primary_terminator_effect(state, term, loc);
vis.visit_after_primary_terminator_effect(state, term, loc);

vis.visit_block_exit(state, block);
}
}
7 changes: 7 additions & 0 deletions compiler/rustc_mir_dataflow/src/framework/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ pub trait ResultsVisitor<'tcx, A>
where
A: Analysis<'tcx>,
{
/// Called after all effects in a block have been applied in the direction
/// of the analysis.
///
/// In a forwards analysis, `state` is from the block's end. In a backwards
/// analysis, `state` is from the block's start.
fn visit_block_exit(&mut self, _state: &A::Domain, _block: BasicBlock) {}

/// Called after the "early" effect of the given statement is applied to `state`.
fn visit_after_early_statement_effect(
&mut self,
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_mir_dataflow/src/impls/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod borrowed_locals;
mod initialized;
mod liveness;
mod precise_liveness;
mod storage_liveness;

pub use self::borrowed_locals::{MaybeBorrowedLocals, borrowed_locals};
Expand All @@ -11,6 +12,10 @@ pub use self::initialized::{
pub use self::liveness::{
DefUse, LivenessTransferFunction, MaybeLiveLocals, MaybeTransitiveLiveLocals,
};
pub use self::precise_liveness::{
SplitPointEffect, SplitPointIndex, VisitAllocatedLocalsWith, VisitDeallocatedLocalsWith,
dump_liveness_matrix, liveness_matrix,
};
pub use self::storage_liveness::{
MaybeRequiresStorage, MaybeStorageDead, MaybeStorageLive, always_storage_live_locals,
};
Loading
Loading