File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
include/swift/SILOptimizer/Utils
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,14 @@ void releasePartialApplyCapturedArg(
281
281
SILParameterInfo paramInfo,
282
282
InstModCallbacks callbacks = InstModCallbacks());
283
283
284
- // / Insert destroys of captured arguments of partial_apply [stack].
284
+ // / Insert destroys of captured arguments of partial_apply [stack]. \p builder
285
+ // / indicates a position at which the closure's lifetime ends.
286
+ // /
287
+ // / The \p getValueToDestroy callback allows the caller to handle some captured
288
+ // / arguments specially. For example, ClosureLifetimeFixup generates borrow
289
+ // / scopes for captured arguments; each getValueToDestroy callback then inserts
290
+ // / the corresponding end_borrow and returns the owned operand of the borrow,
291
+ // / which will then be destroyed as usual.
285
292
void insertDestroyOfCapturedArguments (
286
293
PartialApplyInst *pai, SILBuilder &builder,
287
294
llvm::function_ref<SILValue(SILValue)> getValueToDestroy =
Original file line number Diff line number Diff line change @@ -619,7 +619,6 @@ static SILValue tryRewriteToPartialApplyStack(
619
619
if (!argTy.isAddress () && !argTy.isTrivial (*cvt->getFunction ())) {
620
620
SILValue argValue = arg.get ();
621
621
bool foundNoImplicitCopy = false ;
622
- // !!!
623
622
if (auto *mmci = dyn_cast<MoveOnlyWrapperToCopyableValueInst>(argValue)) {
624
623
if (mmci->hasOwnedInitialKind () && mmci->hasOneUse ()) {
625
624
foundNoImplicitCopy = true ;
You can’t perform that action at this time.
0 commit comments