@@ -44,10 +44,6 @@ std::string LifetimeDependenceInfo::getString() const {
4444 lifetimeDependenceString +=
4545 " _borrow(" + getOnIndices (borrowLifetimeParamIndices) + " )" ;
4646 }
47- if (mutateLifetimeParamIndices && !mutateLifetimeParamIndices->isEmpty ()) {
48- lifetimeDependenceString +=
49- " _mutate(" + getOnIndices (mutateLifetimeParamIndices) + " )" ;
50- }
5147 return lifetimeDependenceString;
5248}
5349
@@ -58,9 +54,6 @@ void LifetimeDependenceInfo::Profile(llvm::FoldingSetNodeID &ID) const {
5854 if (borrowLifetimeParamIndices) {
5955 borrowLifetimeParamIndices->Profile (ID);
6056 }
61- if (mutateLifetimeParamIndices) {
62- mutateLifetimeParamIndices->Profile (ID);
63- }
6457}
6558
6659LifetimeDependenceInfo LifetimeDependenceInfo::getForParamIndex (
@@ -71,18 +64,12 @@ LifetimeDependenceInfo LifetimeDependenceInfo::getForParamIndex(
7164 auto indexSubset = IndexSubset::get (ctx, capacity, {index});
7265 if (ownership == ValueOwnership::Owned) {
7366 return LifetimeDependenceInfo{/* inheritLifetimeParamIndices*/ indexSubset,
74- /* borrowLifetimeParamIndices*/ nullptr ,
75- /* mutateLifetimeParamIndices*/ nullptr };
76- }
77- if (ownership == ValueOwnership::Shared) {
78- return LifetimeDependenceInfo{/* inheritLifetimeParamIndices*/ nullptr ,
79- /* borrowLifetimeParamIndices*/ indexSubset,
80- /* mutateLifetimeParamIndices*/ nullptr };
67+ /* borrowLifetimeParamIndices*/ nullptr };
8168 }
82- assert (ownership == ValueOwnership::InOut);
69+ assert (ownership == ValueOwnership::Shared ||
70+ ownership == ValueOwnership::InOut);
8371 return LifetimeDependenceInfo{/* inheritLifetimeParamIndices*/ nullptr ,
84- /* borrowLifetimeParamIndices*/ nullptr ,
85- /* mutateLifetimeParamIndices*/ indexSubset};
72+ /* borrowLifetimeParamIndices*/ indexSubset};
8673}
8774
8875void LifetimeDependenceInfo::getConcatenatedData (
@@ -107,9 +94,6 @@ void LifetimeDependenceInfo::getConcatenatedData(
10794 if (hasBorrowLifetimeParamIndices ()) {
10895 pushData (borrowLifetimeParamIndices);
10996 }
110- if (hasMutateLifetimeParamIndices ()) {
111- pushData (mutateLifetimeParamIndices);
112- }
11397}
11498
11599llvm::Optional<LifetimeDependenceInfo>
@@ -124,7 +108,6 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
124108
125109 SmallBitVector inheritLifetimeParamIndices (capacity);
126110 SmallBitVector borrowLifetimeParamIndices (capacity);
127- SmallBitVector mutateLifetimeParamIndices (capacity);
128111
129112 auto updateLifetimeDependenceInfo = [&](LifetimeDependenceSpecifier specifier,
130113 unsigned paramIndexToSet,
@@ -167,11 +150,10 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
167150 if (kind == LifetimeDependenceKind::Copy ||
168151 kind == LifetimeDependenceKind::Consume) {
169152 inheritLifetimeParamIndices.set (paramIndexToSet);
170- } else if (kind == LifetimeDependenceKind::Borrow) {
171- borrowLifetimeParamIndices.set (paramIndexToSet);
172153 } else {
173- assert (kind == LifetimeDependenceKind::Mutate);
174- mutateLifetimeParamIndices.set (paramIndexToSet);
154+ assert (kind == LifetimeDependenceKind::Borrow ||
155+ kind == LifetimeDependenceKind::Mutate);
156+ borrowLifetimeParamIndices.set (paramIndexToSet);
175157 }
176158 return false ;
177159 };
@@ -247,9 +229,6 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
247229 : nullptr ,
248230 borrowLifetimeParamIndices.any ()
249231 ? IndexSubset::get (ctx, borrowLifetimeParamIndices)
250- : nullptr ,
251- mutateLifetimeParamIndices.any ()
252- ? IndexSubset::get (ctx, mutateLifetimeParamIndices)
253232 : nullptr );
254233}
255234
0 commit comments