@@ -40,9 +40,9 @@ std::string LifetimeDependenceInfo::getString() const {
4040 lifetimeDependenceString =
4141 " _inherit(" + getOnIndices (inheritLifetimeParamIndices) + " )" ;
4242 }
43- if (borrowLifetimeParamIndices && !borrowLifetimeParamIndices ->isEmpty ()) {
43+ if (scopeLifetimeParamIndices && !scopeLifetimeParamIndices ->isEmpty ()) {
4444 lifetimeDependenceString +=
45- " _borrow (" + getOnIndices (borrowLifetimeParamIndices ) + " )" ;
45+ " _scope (" + getOnIndices (scopeLifetimeParamIndices ) + " )" ;
4646 }
4747 return lifetimeDependenceString;
4848}
@@ -51,8 +51,8 @@ void LifetimeDependenceInfo::Profile(llvm::FoldingSetNodeID &ID) const {
5151 if (inheritLifetimeParamIndices) {
5252 inheritLifetimeParamIndices->Profile (ID);
5353 }
54- if (borrowLifetimeParamIndices ) {
55- borrowLifetimeParamIndices ->Profile (ID);
54+ if (scopeLifetimeParamIndices ) {
55+ scopeLifetimeParamIndices ->Profile (ID);
5656 }
5757}
5858
@@ -64,12 +64,12 @@ LifetimeDependenceInfo LifetimeDependenceInfo::getForParamIndex(
6464 auto indexSubset = IndexSubset::get (ctx, capacity, {index});
6565 if (ownership == ValueOwnership::Owned) {
6666 return LifetimeDependenceInfo{/* inheritLifetimeParamIndices*/ indexSubset,
67- /* borrowLifetimeParamIndices */ nullptr };
67+ /* scopeLifetimeParamIndices */ nullptr };
6868 }
6969 assert (ownership == ValueOwnership::Shared ||
7070 ownership == ValueOwnership::InOut);
7171 return LifetimeDependenceInfo{/* inheritLifetimeParamIndices*/ nullptr ,
72- /* borrowLifetimeParamIndices */ indexSubset};
72+ /* scopeLifetimeParamIndices */ indexSubset};
7373}
7474
7575void LifetimeDependenceInfo::getConcatenatedData (
@@ -92,7 +92,7 @@ void LifetimeDependenceInfo::getConcatenatedData(
9292 pushData (inheritLifetimeParamIndices);
9393 }
9494 if (hasBorrowLifetimeParamIndices ()) {
95- pushData (borrowLifetimeParamIndices );
95+ pushData (scopeLifetimeParamIndices );
9696 }
9797}
9898
@@ -107,7 +107,7 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
107107 cast<LifetimeDependentReturnTypeRepr>(afd->getResultTypeRepr ());
108108
109109 SmallBitVector inheritLifetimeParamIndices (capacity);
110- SmallBitVector borrowLifetimeParamIndices (capacity);
110+ SmallBitVector scopeLifetimeParamIndices (capacity);
111111
112112 auto updateLifetimeDependenceInfo = [&](LifetimeDependenceSpecifier specifier,
113113 unsigned paramIndexToSet,
@@ -143,7 +143,7 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
143143 return true ;
144144 }
145145 if (inheritLifetimeParamIndices.test (paramIndexToSet) ||
146- borrowLifetimeParamIndices .test (paramIndexToSet)) {
146+ scopeLifetimeParamIndices .test (paramIndexToSet)) {
147147 diags.diagnose (loc, diag::lifetime_dependence_duplicate_param_id);
148148 return true ;
149149 }
@@ -153,7 +153,7 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
153153 } else {
154154 assert (kind == LifetimeDependenceKind::Borrow ||
155155 kind == LifetimeDependenceKind::Mutate);
156- borrowLifetimeParamIndices .set (paramIndexToSet);
156+ scopeLifetimeParamIndices .set (paramIndexToSet);
157157 }
158158 return false ;
159159 };
@@ -227,8 +227,8 @@ LifetimeDependenceInfo::fromTypeRepr(AbstractFunctionDecl *afd, Type resultType,
227227 inheritLifetimeParamIndices.any ()
228228 ? IndexSubset::get (ctx, inheritLifetimeParamIndices)
229229 : nullptr ,
230- borrowLifetimeParamIndices .any ()
231- ? IndexSubset::get (ctx, borrowLifetimeParamIndices )
230+ scopeLifetimeParamIndices .any ()
231+ ? IndexSubset::get (ctx, scopeLifetimeParamIndices )
232232 : nullptr );
233233}
234234
@@ -323,4 +323,5 @@ LifetimeDependenceInfo::get(AbstractFunctionDecl *afd, Type resultType,
323323 }
324324 return LifetimeDependenceInfo::infer (afd, resultType);
325325}
326+
326327} // namespace swift
0 commit comments