File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1784,14 +1784,12 @@ void CallArgRewriter::rewriteIndirectArgument(Operand *operand) {
1784
1784
});
1785
1785
} else {
1786
1786
auto borrow = argBuilder.emitBeginBorrowOperation (callLoc, argValue);
1787
- auto *storeInst =
1788
- argBuilder.emitStoreBorrowOperation (callLoc, borrow, allocInst);
1787
+ argBuilder.emitStoreBorrowOperation (callLoc, borrow, allocInst);
1789
1788
1790
1789
apply.insertAfterFullEvaluation ([&](SILBuilder &callBuilder) {
1791
- if (auto *storeBorrow = dyn_cast<StoreBorrowInst>(storeInst) ) {
1792
- callBuilder.emitEndBorrowOperation (callLoc, storeBorrow );
1790
+ if (borrow != argValue ) {
1791
+ callBuilder.emitEndBorrowOperation (callLoc, borrow );
1793
1792
}
1794
- callBuilder.emitEndBorrowOperation (callLoc, borrow);
1795
1793
callBuilder.createDeallocStack (callLoc, allocInst);
1796
1794
});
1797
1795
}
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-emit-silgen -enable-sil-opaque-values -Xllvm -sil-full-demangle %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-runtime
2
+ // RUN: %target-swift-emit-sil -enable-sil-opaque-values -Xllvm -sil-full-demangle %s
2
3
3
4
// Test SILGen -enable-sil-opaque-values with tests that depend on the stdlib.
4
5
You can’t perform that action at this time.
0 commit comments