File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -5213,6 +5213,16 @@ class DeclDeserializer {
52135213 elem->setAccess (std::max (cast<EnumDecl>(DC)->getFormalAccess (),
52145214 AccessLevel::Internal));
52155215
5216+ SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
5217+ while (auto info = MF.maybeReadLifetimeDependence ()) {
5218+ assert (info.has_value ());
5219+ lifetimeDependencies.push_back (*info);
5220+ }
5221+
5222+ ctx.evaluator .cacheOutput (LifetimeDependenceInfoRequest{elem},
5223+ lifetimeDependencies.empty ()? std::nullopt :
5224+ ctx.AllocateCopy (lifetimeDependencies));
5225+
52165226 return elem;
52175227 }
52185228
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858// / describe what change you made. The content of this comment isn't important;
5959// / it just ensures a conflict if two people change the module format.
6060// / Don't worry about adhering to the 80-column limit for this line.
61- const uint16_t SWIFTMODULE_VERSION_MINOR = 942 ; // update LifetimeDependenceLayout
61+ const uint16_t SWIFTMODULE_VERSION_MINOR = 943 ; // Lifetime dependencies on enum element
6262
6363// / A standard hash seed used for all string hashes in a serialized module.
6464// /
Original file line number Diff line number Diff line change @@ -5014,6 +5014,14 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
50145014 nameComponentsAndDependencies);
50155015 if (auto *PL = elem->getParameterList ())
50165016 writeParameterList (PL);
5017+
5018+ auto fnType = ty->getAs <AnyFunctionType>();
5019+ if (fnType) {
5020+ auto lifetimeDependencies = fnType->getLifetimeDependencies ();
5021+ if (!lifetimeDependencies.empty ()) {
5022+ S.writeLifetimeDependencies (lifetimeDependencies);
5023+ }
5024+ }
50175025 }
50185026
50195027 void visitSubscriptDecl (const SubscriptDecl *subscript) {
You can’t perform that action at this time.
0 commit comments