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 @@ -5259,6 +5259,16 @@ class DeclDeserializer {
52595259 elem->setAccess (std::max (cast<EnumDecl>(DC)->getFormalAccess (),
52605260 AccessLevel::Internal));
52615261
5262+ SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
5263+ while (auto info = MF.maybeReadLifetimeDependence ()) {
5264+ assert (info.has_value ());
5265+ lifetimeDependencies.push_back (*info);
5266+ }
5267+
5268+ ctx.evaluator .cacheOutput (LifetimeDependenceInfoRequest{elem},
5269+ lifetimeDependencies.empty ()? std::nullopt :
5270+ ctx.AllocateCopy (lifetimeDependencies));
5271+
52625272 return elem;
52635273 }
52645274
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 = 954 ; // Checked cast inst options
61+ const uint16_t SWIFTMODULE_VERSION_MINOR = 955 ; // 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 @@ -5021,6 +5021,14 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
50215021 nameComponentsAndDependencies);
50225022 if (auto *PL = elem->getParameterList ())
50235023 writeParameterList (PL);
5024+
5025+ auto fnType = ty->getAs <AnyFunctionType>();
5026+ if (fnType) {
5027+ auto lifetimeDependencies = fnType->getLifetimeDependencies ();
5028+ if (!lifetimeDependencies.empty ()) {
5029+ S.writeLifetimeDependencies (lifetimeDependencies);
5030+ }
5031+ }
50245032 }
50255033
50265034 void visitSubscriptDecl (const SubscriptDecl *subscript) {
You can’t perform that action at this time.
0 commit comments