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