LinearLifetimeChecker - make DeadEndBlocks optional

This commit is contained in:
Andrew Trick
2021-10-20 15:05:43 -07:00
parent 2743b83b8e
commit 103a6fefb8
9 changed files with 38 additions and 25 deletions

View File

@@ -130,7 +130,7 @@ static bool fixupReferenceCounts(
auto *stackLoc = builder.createAllocStack(loc, v->getType().getObjectType());
builder.createCopyAddr(loc, v, stackLoc, IsNotTake, IsInitialization);
LinearLifetimeChecker checker(deadEndBlocks);
LinearLifetimeChecker checker(&deadEndBlocks);
bool consumedInLoop = checker.completeConsumingUseSet(
pai, applySite.getCalleeOperand(),
[&](SILBasicBlock::iterator insertPt) {
@@ -173,7 +173,7 @@ static bool fixupReferenceCounts(
// just cares about the block the value is in. In a forthcoming commit, I
// am going to change this to use a different API on the linear lifetime
// checker that makes this clearer.
LinearLifetimeChecker checker(deadEndBlocks);
LinearLifetimeChecker checker(&deadEndBlocks);
bool consumedInLoop = checker.completeConsumingUseSet(
pai, applySite.getCalleeOperand(),
[&](SILBasicBlock::iterator insertPt) {
@@ -220,7 +220,7 @@ static bool fixupReferenceCounts(
// just cares about the block the value is in. In a forthcoming commit, I
// am going to change this to use a different API on the linear lifetime
// checker that makes this clearer.
LinearLifetimeChecker checker(deadEndBlocks);
LinearLifetimeChecker checker(&deadEndBlocks);
checker.completeConsumingUseSet(
pai, applySite.getCalleeOperand(),
[&](SILBasicBlock::iterator insertPt) {
@@ -257,7 +257,7 @@ static bool fixupReferenceCounts(
// just cares about the block the value is in. In a forthcoming commit, I
// am going to change this to use a different API on the linear lifetime
// checker that makes this clearer.
LinearLifetimeChecker checker(deadEndBlocks);
LinearLifetimeChecker checker(&deadEndBlocks);
checker.completeConsumingUseSet(
pai, applySite.getCalleeOperand(),
[&](SILBasicBlock::iterator insertPt) {