mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
LinearLifetimeChecker - make DeadEndBlocks optional
This commit is contained in:
@@ -88,7 +88,7 @@ public:
|
||||
SmallVector<Operand *, 8> endScopeUses;
|
||||
transform(access->getEndAccesses(), std::back_inserter(endScopeUses),
|
||||
[](EndAccessInst *eai) { return &eai->getAllOperands()[0]; });
|
||||
LinearLifetimeChecker checker(ctx.getDeadEndBlocks());
|
||||
LinearLifetimeChecker checker(&ctx.getDeadEndBlocks());
|
||||
if (!checker.validateLifetime(access, endScopeUses,
|
||||
liveRange.getAllConsumingUses())) {
|
||||
// If we fail the linear lifetime check, then just recur:
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
// Ok, we have some writes. See if any of them are within our live
|
||||
// range. If any are, we definitely can not promote to load_borrow.
|
||||
SmallVector<BeginAccessInst *, 16> foundBeginAccess;
|
||||
LinearLifetimeChecker checker(ctx.getDeadEndBlocks());
|
||||
LinearLifetimeChecker checker(&ctx.getDeadEndBlocks());
|
||||
SILValue introducerValue = liveRange.getIntroducer().value;
|
||||
if (!checker.usesNotContainedWithinLifetime(introducerValue,
|
||||
liveRange.getDestroyingUses(),
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
value.visitLocalScopeEndingUses(
|
||||
[&](Operand *use) { endScopeInsts.push_back(use); return true; });
|
||||
|
||||
LinearLifetimeChecker checker(ctx.getDeadEndBlocks());
|
||||
LinearLifetimeChecker checker(&ctx.getDeadEndBlocks());
|
||||
|
||||
// Returns true on success. So we invert.
|
||||
bool foundError = !checker.validateLifetime(
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
|
||||
// Then make sure that all of our load [copy] uses are within the
|
||||
// destroy_addr.
|
||||
LinearLifetimeChecker checker(ctx.getDeadEndBlocks());
|
||||
LinearLifetimeChecker checker(&ctx.getDeadEndBlocks());
|
||||
// Returns true on success. So we invert.
|
||||
bool foundError = !checker.validateLifetime(
|
||||
stack, addrDestroyingOperands /*consuming users*/,
|
||||
|
||||
Reference in New Issue
Block a user