File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -443,9 +443,24 @@ OperandOwnershipClassifier::visitFullApply(FullApplySite apply) {
443
443
? SILArgumentConvention (apply.getSubstCalleeType ()->getCalleeConvention ())
444
444
: apply.getArgumentConvention (op);
445
445
446
- return getFunctionArgOwnership (
447
- argConv,
448
- /* hasScopeInCaller*/ apply.beginsCoroutineEvaluation ());
446
+ auto argOwnership = getFunctionArgOwnership (
447
+ argConv, /* hasScopeInCaller*/ apply.beginsCoroutineEvaluation ());
448
+
449
+ // OSSA cleanup needs to handle each of these callee ownership cases.
450
+ //
451
+ // OperandOwnership::ForwardingConsume is only for thick @callee_owned.
452
+ //
453
+ // OperandOwnership::Borrow would only happen for a coroutine closure, which
454
+ // isn't yet possible.
455
+ if (apply.isCalleeOperand (op)) {
456
+ assert ((argOwnership == OperandOwnership::TrivialUse
457
+ || argOwnership == OperandOwnership::UnownedInstantaneousUse
458
+ || argOwnership == OperandOwnership::InstantaneousUse
459
+ || argOwnership == OperandOwnership::ForwardingConsume
460
+ || argOwnership == OperandOwnership::Borrow) &&
461
+ " unsupported callee ownership" );
462
+ }
463
+ return argOwnership;
449
464
}
450
465
451
466
OperandOwnership
You can’t perform that action at this time.
0 commit comments