Skip to content

Commit 4e71efc

Browse files
authored
Merge pull request #65166 from adrian-prantl/107984038
Update the scope of SILBuilder in ClosureCloner.
2 parents 4f5b7d4 + fbf4c92 commit 4e71efc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/Mandatory/CapturePromotion.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ void ClosureCloner::visitEndAccessInst(EndAccessInst *eai) {
687687
/// The two relevant cases are a direct load from a promoted address argument or
688688
/// a load of a struct_element_addr of a promoted address argument.
689689
void ClosureCloner::visitLoadBorrowInst(LoadBorrowInst *lbi) {
690+
getBuilder().setCurrentDebugScope(getOpScope(lbi->getDebugScope()));
690691
assert(lbi->getFunction()->hasOwnership() &&
691692
"We should only see a load borrow in ownership qualified SIL");
692693
if (SILValue value = getProjectBoxMappedVal(lbi->getOperand())) {
@@ -729,6 +730,7 @@ void ClosureCloner::visitLoadBorrowInst(LoadBorrowInst *lbi) {
729730
/// The two relevant cases are a direct load from a promoted address argument or
730731
/// a load of a struct_element_addr of a promoted address argument.
731732
void ClosureCloner::visitLoadInst(LoadInst *li) {
733+
getBuilder().setCurrentDebugScope(getOpScope(li->getDebugScope()));
732734
if (SILValue value = getProjectBoxMappedVal(li->getOperand())) {
733735
// Loads of the address argument get eliminated completely; the uses of
734736
// the loads get mapped to uses of the new object type argument.

0 commit comments

Comments
 (0)