@@ -2436,6 +2436,7 @@ handleConditionalDestroys(SILValue ControlVariableAddr) {
2436
2436
auto &Availability = CDElt.Availability ;
2437
2437
2438
2438
B.setInsertionPoint (Release);
2439
+ B.setCurrentDebugScope (Release->getDebugScope ());
2439
2440
2440
2441
// Value types and root classes don't require any fancy handling.
2441
2442
// Just conditionally destroy each memory element, and for classes,
@@ -2507,10 +2508,12 @@ handleConditionalDestroys(SILValue ControlVariableAddr) {
2507
2508
2508
2509
// If true, self.init or super.init was called and self was consumed.
2509
2510
B.setInsertionPoint (ConsumedBlock->begin ());
2511
+ B.setCurrentDebugScope (ConsumedBlock->begin ()->getDebugScope ());
2510
2512
processUninitializedRelease (Release, true , B.getInsertionPoint ());
2511
2513
2512
2514
// If false, self is uninitialized and must be freed.
2513
2515
B.setInsertionPoint (DeallocBlock->begin ());
2516
+ B.setCurrentDebugScope (DeallocBlock->begin ()->getDebugScope ());
2514
2517
destroyMemoryElements (Loc, Availability);
2515
2518
processUninitializedRelease (Release, false , B.getInsertionPoint ());
2516
2519
@@ -2541,11 +2544,13 @@ handleConditionalDestroys(SILValue ControlVariableAddr) {
2541
2544
2542
2545
// If true, self was consumed or is fully initialized.
2543
2546
B.setInsertionPoint (LiveBlock->begin ());
2547
+ B.setCurrentDebugScope (LiveBlock->begin ()->getDebugScope ());
2544
2548
emitReleaseOfSelfWhenNotConsumed (Loc, Release);
2545
2549
isDeadRelease = false ;
2546
2550
2547
2551
// If false, self is uninitialized and must be freed.
2548
2552
B.setInsertionPoint (DeallocBlock->begin ());
2553
+ B.setCurrentDebugScope (DeallocBlock->begin ()->getDebugScope ());
2549
2554
destroyMemoryElements (Loc, Availability);
2550
2555
processUninitializedRelease (Release, false , B.getInsertionPoint ());
2551
2556
0 commit comments