Skip to content

Commit ec19f85

Browse files
committed
[mandatory-inlining] Fix up comments as requested by ArnoldS.
1 parent 6275b10 commit ec19f85

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/SILOptimizer/Mandatory/MandatoryInlining.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ static void fixupReferenceCounts(
9090
auto errorBehavior =
9191
ownership::ErrorBehaviorKind::ReturnFalseOnLeakAssertOtherwise;
9292

93-
// Ok, at this point we know that we have a direct SSA relationship in between
94-
// our partial_apply and
95-
9693
// Add a copy of each non-address type capture argument to lifetime extend the
9794
// captured argument over at least the inlined function and till the end of a
9895
// box if we have an address. This deals with the possibility of the closure
@@ -183,8 +180,11 @@ static void fixupReferenceCounts(
183180
break;
184181
}
185182

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.
188188
case ParameterConvention::Direct_Owned: {
189189
v = SILBuilderWithScope(pai).emitCopyValueOperation(loc, v);
190190

0 commit comments

Comments
 (0)