diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2019-09-29 21:43:09 -0700 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2019-09-30 11:24:27 -0700 |
| commit | cf5f5c55be027a055867bef7773d27be1799ac06 (patch) | |
| tree | c9a9b0ede95feaa4d2acb2f6ca4e0c27d1ce1d6f | |
| parent | cd24cd4eecf39c545b0373746631a8bddf2b46d3 (diff) | |
| download | rust-cf5f5c55be027a055867bef7773d27be1799ac06.tar.gz rust-cf5f5c55be027a055867bef7773d27be1799ac06.zip | |
Use separate files for debugging `Qualif` dataflow results
| -rw-r--r-- | src/librustc_mir/transform/check_consts/qualifs.rs | 5 | ||||
| -rw-r--r-- | src/librustc_mir/transform/check_consts/resolver.rs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/check_consts/qualifs.rs b/src/librustc_mir/transform/check_consts/qualifs.rs index 0c6468309dc..40007eb3c4a 100644 --- a/src/librustc_mir/transform/check_consts/qualifs.rs +++ b/src/librustc_mir/transform/check_consts/qualifs.rs @@ -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; @@ -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) @@ -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 { diff --git a/src/librustc_mir/transform/check_consts/resolver.rs b/src/librustc_mir/transform/check_consts/resolver.rs index 54cb4fbad6d..4fa4eba4c23 100644 --- a/src/librustc_mir/transform/check_consts/resolver.rs +++ b/src/librustc_mir/transform/check_consts/resolver.rs @@ -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() |
