@@ -3891,7 +3891,7 @@ class DeclDeserializer {
3891
3891
ctor->setParameters (bodyParams);
3892
3892
3893
3893
SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
3894
- while (auto info = MF.maybeReadLifetimeDependence (bodyParams-> size () + 1 )) {
3894
+ while (auto info = MF.maybeReadLifetimeDependence ()) {
3895
3895
assert (info.has_value ());
3896
3896
lifetimeDependencies.push_back (*info);
3897
3897
}
@@ -4493,11 +4493,9 @@ class DeclDeserializer {
4493
4493
ParameterList *paramList;
4494
4494
SET_OR_RETURN_ERROR (paramList, MF.readParameterList ());
4495
4495
fn->setParameters (paramList);
4496
- auto numParams =
4497
- fn->hasImplicitSelfDecl () ? paramList->size () + 1 : paramList->size ();
4498
4496
4499
4497
SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
4500
- while (auto info = MF.maybeReadLifetimeDependence (numParams )) {
4498
+ while (auto info = MF.maybeReadLifetimeDependence ()) {
4501
4499
assert (info.has_value ());
4502
4500
lifetimeDependencies.push_back (*info);
4503
4501
}
@@ -7438,8 +7436,7 @@ detail::function_deserializer::deserialize(ModuleFile &MF,
7438
7436
7439
7437
SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
7440
7438
7441
- while (auto lifetimeDependence =
7442
- MF.maybeReadLifetimeDependence (params.size ())) {
7439
+ while (auto lifetimeDependence = MF.maybeReadLifetimeDependence ()) {
7443
7440
lifetimeDependencies.push_back (*lifetimeDependence);
7444
7441
}
7445
7442
if (!lifetimeDependencies.empty ()) {
@@ -8091,7 +8088,7 @@ Expected<Type> DESERIALIZE_TYPE(SIL_FUNCTION_TYPE)(
8091
8088
8092
8089
SmallVector<LifetimeDependenceInfo, 1 > lifetimeDependencies;
8093
8090
8094
- while (auto lifetimeDependence = MF.maybeReadLifetimeDependence (numParams )) {
8091
+ while (auto lifetimeDependence = MF.maybeReadLifetimeDependence ()) {
8095
8092
lifetimeDependencies.push_back (*lifetimeDependence);
8096
8093
}
8097
8094
@@ -9378,7 +9375,7 @@ bool ModuleFile::maybeReadLifetimeDependenceRecord(
9378
9375
}
9379
9376
9380
9377
std::optional<LifetimeDependenceInfo>
9381
- ModuleFile::maybeReadLifetimeDependence (unsigned numParams ) {
9378
+ ModuleFile::maybeReadLifetimeDependence () {
9382
9379
using namespace decls_block ;
9383
9380
9384
9381
SmallVector<uint64_t , 8 > scratch;
@@ -9387,28 +9384,29 @@ ModuleFile::maybeReadLifetimeDependence(unsigned numParams) {
9387
9384
}
9388
9385
9389
9386
unsigned targetIndex;
9387
+ unsigned paramIndicesLength;
9390
9388
bool isImmortal;
9391
9389
bool hasInheritLifetimeParamIndices;
9392
9390
bool hasScopeLifetimeParamIndices;
9393
9391
bool hasAddressableParamIndices;
9394
9392
ArrayRef<uint64_t > lifetimeDependenceData;
9395
9393
LifetimeDependenceLayout::readRecord (
9396
- scratch, targetIndex, isImmortal, hasInheritLifetimeParamIndices ,
9397
- hasScopeLifetimeParamIndices, hasAddressableParamIndices ,
9398
- lifetimeDependenceData);
9394
+ scratch, targetIndex, paramIndicesLength, isImmortal ,
9395
+ hasInheritLifetimeParamIndices, hasScopeLifetimeParamIndices ,
9396
+ hasAddressableParamIndices, lifetimeDependenceData);
9399
9397
9400
- SmallBitVector inheritLifetimeParamIndices (numParams , false );
9401
- SmallBitVector scopeLifetimeParamIndices (numParams , false );
9402
- SmallBitVector addressableParamIndices (numParams , false );
9398
+ SmallBitVector inheritLifetimeParamIndices (paramIndicesLength , false );
9399
+ SmallBitVector scopeLifetimeParamIndices (paramIndicesLength , false );
9400
+ SmallBitVector addressableParamIndices (paramIndicesLength , false );
9403
9401
9404
9402
unsigned startIndex = 0 ;
9405
9403
auto pushData = [&](SmallBitVector &bits) {
9406
- for (unsigned i = 0 ; i < numParams ; i++) {
9404
+ for (unsigned i = 0 ; i < paramIndicesLength ; i++) {
9407
9405
if (lifetimeDependenceData[startIndex + i]) {
9408
9406
bits.set (i);
9409
9407
}
9410
9408
}
9411
- startIndex += numParams ;
9409
+ startIndex += paramIndicesLength ;
9412
9410
};
9413
9411
9414
9412
if (hasInheritLifetimeParamIndices) {
0 commit comments