8000 Graphviz debug output for generic dataflow analysis by ecstatic-morse · Pull Request #64828 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Graphviz debug output for generic dataflow analysis #64828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use separate files for debugging Qualif dataflow results
  • Loading branch information
ecstatic-morse committed Sep 30, 2019
commit cf5f5c55be027a055867bef7773d27be1799ac06
5 changes: 5 additions & 0 deletions src/librustc_mir/transform/check_consts/qualifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ impl QualifSet {
pub trait Qualif {
const IDX: usize;

/// The name of the file used to debug the dataflow analysis that computes this qualif.
const ANALYSIS_NAME: &'static str;

/// Whether this `Qualif` is cleared when a local is moved from.
const IS_CLEARED_ON_MOVE: bool = false;

Expand Down Expand Up @@ -207,6 +210,7 @@ pub struct HasMutInterior;

impl Qualif for HasMutInterior {
const IDX: usize = 0;
const ANALYSIS_NAME: &'static str = "flow_has_mut_interior";

fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
!ty.is_freeze(cx.tcx, cx.param_env, DUMMY_SP)
Expand Down Expand Up @@ -264,6 +268,7 @@ pub struct NeedsDrop;

impl Qualif for NeedsDrop {
const IDX: usize = 1;
const ANALYSIS_NAME: &'static str = "flow_needs_drop";
const IS_CLEARED_ON_MOVE: bool = true;

fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/transform/check_consts/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ where
{
type Idx = Local;

const NAME: &'static str = "flow_sensitive_qualif";
const NAME: &'static str = Q::ANALYSIS_NAME;

fn bits_per_block(&self, body: &mir::Body<'tcx>) -> usize {
body.local_decls.len()
Expand Down
0