[ownership] Create a context structure for the linear lifetime checker.

This is just a simple refactoring commit in preparation for hiding more of the
details of the linear lifetime checker. This is NFC, just moving around code.
This commit is contained in:
Michael Gottesman
2019-09-16 19:38:41 -07:00
parent 4eb31633d7
commit dceca2bc3b
7 changed files with 67 additions and 47 deletions

View File

@@ -780,9 +780,8 @@ AvailableValueAggregator::addMissingDestroysForCopiedValues(
// Then perform the linear lifetime check. If we succeed, continue. We have
// no further work to do.
auto errorKind = ownership::ErrorBehaviorKind::ReturnFalse;
auto error =
valueHasLinearLifetime(cvi, {svi}, {}, visitedBlocks, deadEndBlocks,
errorKind, &leakingBlocks);
LinearLifetimeChecker checker(visitedBlocks, deadEndBlocks);
auto error = checker.checkValue(cvi, {svi}, {}, errorKind, &leakingBlocks);
if (!error.getFoundError())
continue;