@@ -1473,6 +1473,8 @@ struct MoveOnlyAddressCheckerPImpl {
1473
1473
// / Information about destroys that we use when inserting destroys.
1474
1474
ConsumeInfo consumes;
1475
1475
1476
+ DeadEndBlocksAnalysis *deba;
1477
+
1476
1478
// / PostOrderAnalysis used by the BorrowToDestructureTransform.
1477
1479
PostOrderAnalysis *poa;
1478
1480
@@ -1482,10 +1484,11 @@ struct MoveOnlyAddressCheckerPImpl {
1482
1484
MoveOnlyAddressCheckerPImpl (
1483
1485
SILFunction *fn, DiagnosticEmitter &diagnosticEmitter,
1484
1486
DominanceInfo *domTree, PostOrderAnalysis *poa,
1487
+ DeadEndBlocksAnalysis *deba,
1485
1488
borrowtodestructure::IntervalMapAllocator &allocator)
1486
1489
: fn(fn), deleter(), canonicalizer(fn, domTree, deleter),
1487
1490
addressUseState (domTree), diagnosticEmitter(diagnosticEmitter),
1488
- poa(poa), allocator(allocator) {
1491
+ deba(deba), poa(poa), allocator(allocator) {
1489
1492
deleter.setCallbacks (std::move (
1490
1493
InstModCallbacks ().onDelete ([&](SILInstruction *instToDelete) {
1491
1494
if (auto *mvi =
@@ -2045,7 +2048,9 @@ struct GatherUsesVisitor : public TransitiveAddressWalker<GatherUsesVisitor> {
2045
2048
liveness->initializeDef (bai);
2046
2049
liveness->computeSimple ();
2047
2050
for (auto *consumingUse : li->getConsumingUses ()) {
2048
- if (!liveness->isWithinBoundary (consumingUse->getUser ())) {
2051
+ if (!liveness->areUsesWithinBoundary (
2052
+ {consumingUse},
2053
+ moveChecker.deba ->get (consumingUse->getFunction ()))) {
2049
2054
diagnosticEmitter.emitAddressExclusivityHazardDiagnostic (
2050
2055
markedValue, consumingUse->getUser ());
2051
2056
emittedError = true ;
@@ -3976,7 +3981,7 @@ bool MoveOnlyAddressChecker::check(
3976
3981
assert (moveIntroducersToProcess.size () &&
3977
3982
" Must have checks to process to call this function" );
3978
3983
MoveOnlyAddressCheckerPImpl pimpl (fn, diagnosticEmitter, domTree, poa,
3979
- allocator);
3984
+ deadEndBlocksAnalysis, allocator);
3980
3985
3981
3986
#ifndef NDEBUG
3982
3987
static uint64_t numProcessed = 0 ;
0 commit comments