File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,6 @@ static void fixupReferenceCounts(
90
90
auto errorBehavior =
91
91
ownership::ErrorBehaviorKind::ReturnFalseOnLeakAssertOtherwise;
92
92
93
- // Ok, at this point we know that we have a direct SSA relationship in between
94
- // our partial_apply and
95
-
96
93
// Add a copy of each non-address type capture argument to lifetime extend the
97
94
// captured argument over at least the inlined function and till the end of a
98
95
// box if we have an address. This deals with the possibility of the closure
@@ -183,8 +180,11 @@ static void fixupReferenceCounts(
183
180
break ;
184
181
}
185
182
186
- // If we have an owned value, we need to insert a copy here for lifetime
187
- // extension purposes.
183
+ // If we have an owned value, we insert a copy here for two reasons:
184
+ //
185
+ // 1. To balance the consuming argument.
186
+ // 2. To lifetime extend the value over the call site in case our partial
187
+ // apply has another use that would destroy our value first.
188
188
case ParameterConvention::Direct_Owned: {
189
189
v = SILBuilderWithScope (pai).emitCopyValueOperation (loc, v);
190
190
You can’t perform that action at this time.
0 commit comments