diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-18 10:35:16 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-27 10:54:07 -0800 |
| commit | e1f8a22271cdca71c7ca310e935ef6446e66c585 (patch) | |
| tree | 1d05fe64a2be629ee185199a091be5b5bed21649 /src/librustc_mir/dataflow/impls | |
| parent | ecad4341af86665a2fb94dac732362d47608c73f (diff) | |
Rename `RequiresStorage` to `MaybeRequiresStorage`
...to be consistent with the naming of other dataflow analyses.
Diffstat (limited to 'src/librustc_mir/dataflow/impls')
| -rw-r--r-- | src/librustc_mir/dataflow/impls/storage_liveness.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc_mir/dataflow/impls/storage_liveness.rs b/src/librustc_mir/dataflow/impls/storage_liveness.rs index 828321f7031..fabe562e68a 100644 --- a/src/librustc_mir/dataflow/impls/storage_liveness.rs +++ b/src/librustc_mir/dataflow/impls/storage_liveness.rs @@ -71,24 +71,24 @@ type BorrowedLocalsResults<'a, 'tcx> = ResultsRefCursor<'a, 'a, 'tcx, MaybeBorro /// Dataflow analysis that determines whether each local requires storage at a /// given location; i.e. whether its storage can go away without being observed. -pub struct RequiresStorage<'mir, 'tcx> { +pub struct MaybeRequiresStorage<'mir, 'tcx> { body: ReadOnlyBodyAndCache<'mir, 'tcx>, borrowed_locals: RefCell<BorrowedLocalsResults<'mir, 'tcx>>, } -impl<'mir, 'tcx> RequiresStorage<'mir, 'tcx> { +impl<'mir, 'tcx> MaybeRequiresStorage<'mir, 'tcx> { pub fn new( body: ReadOnlyBodyAndCache<'mir, 'tcx>, borrowed_locals: &'mir Results<'tcx, MaybeBorrowedLocals>, ) -> Self { - RequiresStorage { + MaybeRequiresStorage { body, borrowed_locals: RefCell::new(ResultsRefCursor::new(*body, borrowed_locals)), } } } -impl<'mir, 'tcx> dataflow::AnalysisDomain<'tcx> for RequiresStorage<'mir, 'tcx> { +impl<'mir, 'tcx> dataflow::AnalysisDomain<'tcx> for MaybeRequiresStorage<'mir, 'tcx> { type Idx = Local; const NAME: &'static str = "requires_storage"; @@ -106,7 +106,7 @@ impl<'mir, 'tcx> dataflow::AnalysisDomain<'tcx> for RequiresStorage<'mir, 'tcx> } } -impl<'mir, 'tcx> dataflow::GenKillAnalysis<'tcx> for RequiresStorage<'mir, 'tcx> { +impl<'mir, 'tcx> dataflow::GenKillAnalysis<'tcx> for MaybeRequiresStorage<'mir, 'tcx> { fn before_statement_effect( &self, trans: &mut impl GenKill<Self::Idx>, @@ -232,7 +232,7 @@ impl<'mir, 'tcx> dataflow::GenKillAnalysis<'tcx> for RequiresStorage<'mir, 'tcx> } } -impl<'mir, 'tcx> RequiresStorage<'mir, 'tcx> { +impl<'mir, 'tcx> MaybeRequiresStorage<'mir, 'tcx> { /// Kill locals that are fully moved and have not been borrowed. fn check_for_move(&self, trans: &mut impl GenKill<Local>, loc: Location) { let mut visitor = MoveVisitor { trans, borrowed_locals: &self.borrowed_locals }; @@ -240,7 +240,7 @@ impl<'mir, 'tcx> RequiresStorage<'mir, 'tcx> { } } -impl<'mir, 'tcx> BottomValue for RequiresStorage<'mir, 'tcx> { +impl<'mir, 'tcx> BottomValue for MaybeRequiresStorage<'mir, 'tcx> { /// bottom = dead const BOTTOM_VALUE: bool = false; } |
