@@ -2120,6 +2120,10 @@ void ApplyRewriter::rewriteApply(ArrayRef<SILValue> newCallArgs) {
2120
2120
// will be deleted with its destructure_tuple.
2121
2121
}
2122
2122
2123
+ // / Emit end_borrows for a an incomplete BorrowedValue with only nonlifetime
2124
+ // / ending uses.
2125
+ static void emitEndBorrows (SILValue value, AddressLoweringState &pass);
2126
+
2123
2127
void ApplyRewriter::convertBeginApplyWithOpaqueYield () {
2124
2128
auto *origCall = cast<BeginApplyInst>(apply.getInstruction ());
2125
2129
SmallVector<SILValue, 4 > opValues;
@@ -2762,10 +2766,6 @@ class UseRewriter : SILInstructionVisitor<UseRewriter> {
2762
2766
2763
2767
void visitStoreInst (StoreInst *storeInst);
2764
2768
2765
- // / Emit end_borrows for a an incomplete BorrowedValue with only nonlifetime
2766
- // / ending uses.
2767
- void emitEndBorrows (SILValue value);
2768
-
2769
2769
void emitExtract (SingleValueInstruction *extractInst);
2770
2770
2771
2771
void visitSelectEnumInst (SelectEnumInst *sei) {
@@ -2832,7 +2832,7 @@ class UseRewriter : SILInstructionVisitor<UseRewriter> {
2832
2832
builder.emitLoadBorrowOperation (uncheckedCastInst->getLoc (), destAddr);
2833
2833
uncheckedCastInst->replaceAllUsesWith (load);
2834
2834
pass.deleter .forceDelete (uncheckedCastInst);
2835
- emitEndBorrows (load);
2835
+ emitEndBorrows (load, pass );
2836
2836
}
2837
2837
2838
2838
void visitUnconditionalCheckedCastInst (
@@ -2944,7 +2944,7 @@ void UseRewriter::visitStoreInst(StoreInst *storeInst) {
2944
2944
2945
2945
// / Emit end_borrows for a an incomplete BorrowedValue with only nonlifetime
2946
2946
// / ending uses. This function inserts end_borrows on the lifetime boundary.
2947
- void UseRewriter:: emitEndBorrows (SILValue value) {
2947
+ static void emitEndBorrows (SILValue value, AddressLoweringState &pass ) {
2948
2948
assert (BorrowedValue (value));
2949
2949
2950
2950
// Place end_borrows that cover the load_borrow uses. It is not necessary to
@@ -3002,7 +3002,7 @@ void UseRewriter::emitExtract(SingleValueInstruction *extractInst) {
3002
3002
SILValue loadElement =
3003
3003
builder.emitLoadBorrowOperation (extractInst->getLoc (), extractAddr);
3004
3004
replaceUsesWithLoad (extractInst, loadElement);
3005
- emitEndBorrows (loadElement);
3005
+ emitEndBorrows (loadElement, pass );
3006
3006
}
3007
3007
3008
3008
void UseRewriter::visitStructExtractInst (StructExtractInst *extractInst) {
0 commit comments