Skip to content

Commit d617692

Browse files
committed
auto
1 parent fb10940 commit d617692

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/SILOptimizer/Mandatory/TransferNonSendable.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ struct InferredCallerArgumentTypeInfo {
695695
/// we may represent all of the actor isolation information at the SIL level,
696696
/// but we are not there yet today.
697697
void initForApply(ApplyIsolationCrossing isolationCrossing);
698+
void initForPartialApply(const Operand *op, AbstractClosureExpr *expr);
698699

699700
void initForApply(const Operand *op, ApplyExpr *expr);
700701
void initForAutoclosure(const Operand *op, AutoClosureExpr *expr);
@@ -727,6 +728,16 @@ void InferredCallerArgumentTypeInfo::initForApply(
727728
applyUses.emplace_back(baseInferredType, isolationCrossing);
728729
}
729730

731+
void InferredCallerArgumentTypeInfo::initForPartialApply(const Operand *op, AbstractClosureExpr *ace) {
732+
SmallVector<std::tuple<unsigned, const CapturedValue *, ApplyIsolationCrossing>, 8> capturedIsolationCrossings;
733+
ace->getCaptureIsolationCrossings(capturedIsolationCrossings);
734+
assert(capturedIsolationCrossings.size());
735+
736+
auto &data = capturedIsolationCrossings.front();
737+
738+
applyUses.emplace_back(baseInferredType, std::get<2>(capturedIsolationCrossings.front()));
739+
}
740+
730741
void InferredCallerArgumentTypeInfo::initForApply(const Operand *op,
731742
ApplyExpr *sourceApply) {
732743
auto isolationCrossing = *sourceApply->getIsolationCrossing();
@@ -846,6 +857,12 @@ void InferredCallerArgumentTypeInfo::init(const Operand *op) {
846857
}
847858
}
848859

860+
if (auto *pai = dyn_cast<PartialApplyInst>(nonConstOp->getUser())) {
861+
if (auto *ace = pai->getLoc().getAsASTNode<AbstractClosureExpr>()) {
862+
return initForPartialApply(op, ace);
863+
}
864+
}
865+
849866
auto *autoClosureExpr = loc.getAsASTNode<AutoClosureExpr>();
850867
if (!autoClosureExpr) {
851868
llvm::report_fatal_error("Unknown node");

0 commit comments

Comments
 (0)