@@ -1477,6 +1477,8 @@ struct MoveOnlyAddressCheckerPImpl {
14771477 // / Information about destroys that we use when inserting destroys.
14781478 ConsumeInfo consumes;
14791479
1480+ DeadEndBlocksAnalysis *deba;
1481+
14801482 // / PostOrderAnalysis used by the BorrowToDestructureTransform.
14811483 PostOrderAnalysis *poa;
14821484
@@ -1486,10 +1488,11 @@ struct MoveOnlyAddressCheckerPImpl {
14861488 MoveOnlyAddressCheckerPImpl (
14871489 SILFunction *fn, DiagnosticEmitter &diagnosticEmitter,
14881490 DominanceInfo *domTree, PostOrderAnalysis *poa,
1491+ DeadEndBlocksAnalysis *deba,
14891492 borrowtodestructure::IntervalMapAllocator &allocator)
14901493 : fn(fn), deleter(), canonicalizer(fn, domTree, deleter),
14911494 addressUseState (domTree), diagnosticEmitter(diagnosticEmitter),
1492- poa(poa), allocator(allocator) {
1495+ deba(deba), poa(poa), allocator(allocator) {
14931496 deleter.setCallbacks (std::move (
14941497 InstModCallbacks ().onDelete ([&](SILInstruction *instToDelete) {
14951498 if (auto *mvi =
@@ -2049,7 +2052,9 @@ struct GatherUsesVisitor : public TransitiveAddressWalker<GatherUsesVisitor> {
20492052 liveness->initializeDef (bai);
20502053 liveness->computeSimple ();
20512054 for (auto *consumingUse : li->getConsumingUses ()) {
2052- if (!liveness->isWithinBoundary (consumingUse->getUser ())) {
2055+ if (!liveness->areUsesWithinBoundary (
2056+ {consumingUse},
2057+ moveChecker.deba ->get (consumingUse->getFunction ()))) {
20532058 diagnosticEmitter.emitAddressExclusivityHazardDiagnostic (
20542059 markedValue, consumingUse->getUser ());
20552060 emittedError = true ;
@@ -3981,7 +3986,7 @@ bool MoveOnlyAddressChecker::check(
39813986 assert (moveIntroducersToProcess.size () &&
39823987 " Must have checks to process to call this function" );
39833988 MoveOnlyAddressCheckerPImpl pimpl (fn, diagnosticEmitter, domTree, poa,
3984- allocator);
3989+ deadEndBlocksAnalysis, allocator);
39853990
39863991#ifndef NDEBUG
39873992 static uint64_t numProcessed = 0 ;
0 commit comments