@@ -695,6 +695,7 @@ struct InferredCallerArgumentTypeInfo {
695
695
// / we may represent all of the actor isolation information at the SIL level,
696
696
// / but we are not there yet today.
697
697
void initForApply (ApplyIsolationCrossing isolationCrossing);
698
+ void initForPartialApply (const Operand *op, AbstractClosureExpr *expr);
698
699
699
700
void initForApply (const Operand *op, ApplyExpr *expr);
700
701
void initForAutoclosure (const Operand *op, AutoClosureExpr *expr);
@@ -727,6 +728,16 @@ void InferredCallerArgumentTypeInfo::initForApply(
727
728
applyUses.emplace_back (baseInferredType, isolationCrossing);
728
729
}
729
730
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
+
730
741
void InferredCallerArgumentTypeInfo::initForApply (const Operand *op,
731
742
ApplyExpr *sourceApply) {
732
743
auto isolationCrossing = *sourceApply->getIsolationCrossing ();
@@ -846,6 +857,12 @@ void InferredCallerArgumentTypeInfo::init(const Operand *op) {
846
857
}
847
858
}
848
859
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
+
849
866
auto *autoClosureExpr = loc.getAsASTNode <AutoClosureExpr>();
850
867
if (!autoClosureExpr) {
851
868
llvm::report_fatal_error (" Unknown node" );
0 commit comments