@@ -870,6 +870,7 @@ void EscapeAnalysis::ConnectionGraph::computeUsePoints() {
870
870
#include " swift/AST/ReferenceStorage.def"
871
871
case SILInstructionKind::StrongReleaseInst:
872
872
case SILInstructionKind::ReleaseValueInst:
873
+ case SILInstructionKind::DestroyValueInst:
873
874
case SILInstructionKind::ApplyInst:
874
875
case SILInstructionKind::TryApplyInst: {
875
876
// / Actually we only add instructions which may release a reference.
@@ -2589,8 +2590,9 @@ bool EscapeAnalysis::canEscapeToUsePoint(SILValue value,
2589
2590
SILInstruction *usePoint,
2590
2591
ConnectionGraph *conGraph) {
2591
2592
2592
- assert ((FullApplySite::isa (usePoint) || isa<RefCountingInst>(usePoint))
2593
- && " use points are only created for calls and refcount instructions" );
2593
+ assert ((FullApplySite::isa (usePoint) || isa<RefCountingInst>(usePoint) ||
2594
+ isa<DestroyValueInst>(usePoint)) &&
2595
+ " use points are only created for calls and refcount instructions" );
2594
2596
2595
2597
CGNode *node = conGraph->getValueContent (value);
2596
2598
if (!node)
@@ -2649,6 +2651,14 @@ bool EscapeAnalysis::canEscapeTo(SILValue V, RefCountingInst *RI) {
2649
2651
return canEscapeToUsePoint (V, RI, ConGraph);
2650
2652
}
2651
2653
2654
+ bool EscapeAnalysis::canEscapeTo (SILValue V, DestroyValueInst *DVI) {
2655
+ // If it's not uniquely identified we don't know anything about the value.
2656
+ if (!isUniquelyIdentified (V))
2657
+ return true ;
2658
+ auto *ConGraph = getConnectionGraph (DVI->getFunction ());
2659
+ return canEscapeToUsePoint (V, DVI, ConGraph);
2660
+ }
2661
+
2652
2662
// / Utility to get the function which contains both values \p V1 and \p V2.
2653
2663
static SILFunction *getCommonFunction (SILValue V1, SILValue V2) {
2654
2664
SILBasicBlock *BB1 = V1->getParentBlock ();
0 commit comments