Skip to content

Commit aba12b3

Browse files
committed
[OpaqueValues] Use silConv for keypath args.
Replace direct calls to SILParamInfo::getSILStorageType with calls to SILModuleConventions::getSILType for keypath functions.
1 parent 77e694a commit aba12b3

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,8 +3071,9 @@ static SILFunction *getOrCreateKeyPathGetter(SILGenModule &SGM,
30713071
auto baseArg = entry->createFunctionArgument(baseArgTy);
30723072
SILValue indexPtrArg;
30733073
if (!indexes.empty()) {
3074-
auto indexArgTy = signature->getParameters()[1].getSILStorageType(
3075-
SGM.M, signature, subSGF.F.getTypeExpansionContext());
3074+
auto indexArgTy =
3075+
subSGF.silConv.getSILType(signature->getParameters()[1], signature,
3076+
subSGF.F.getTypeExpansionContext());
30763077
indexPtrArg = entry->createFunctionArgument(indexArgTy);
30773078
}
30783079

@@ -3234,10 +3235,12 @@ static SILFunction *getOrCreateKeyPathSetter(SILGenModule &SGM,
32343235
subSGF.F.getTypeExpansionContext());
32353236

32363237
auto entry = thunk->begin();
3237-
auto valueArgTy = signature->getParameters()[0].getSILStorageType(
3238-
SGM.M, signature, subSGF.getTypeExpansionContext());
3239-
auto baseArgTy = signature->getParameters()[1].getSILStorageType(
3240-
SGM.M, signature, subSGF.getTypeExpansionContext());
3238+
auto valueArgTy =
3239+
subSGF.silConv.getSILType(signature->getParameters()[0], signature,
3240+
subSGF.getTypeExpansionContext());
3241+
auto baseArgTy =
3242+
subSGF.silConv.getSILType(signature->getParameters()[1], signature,
3243+
subSGF.getTypeExpansionContext());
32413244
if (genericEnv) {
32423245
valueArgTy = genericEnv->mapTypeIntoContext(SGM.M, valueArgTy);
32433246
baseArgTy = genericEnv->mapTypeIntoContext(SGM.M, baseArgTy);
@@ -3247,8 +3250,9 @@ static SILFunction *getOrCreateKeyPathSetter(SILGenModule &SGM,
32473250
SILValue indexPtrArg;
32483251

32493252
if (!indexes.empty()) {
3250-
auto indexArgTy = signature->getParameters()[2].getSILStorageType(
3251-
SGM.M, signature, subSGF.getTypeExpansionContext());
3253+
auto indexArgTy =
3254+
subSGF.silConv.getSILType(signature->getParameters()[2], signature,
3255+
subSGF.getTypeExpansionContext());
32523256
indexPtrArg = entry->createFunctionArgument(indexArgTy);
32533257
}
32543258

@@ -3414,10 +3418,10 @@ getOrCreateKeyPathEqualsAndHash(SILGenModule &SGM,
34143418
SILGenFunction subSGF(SGM, *equals, SGM.SwiftModule);
34153419
equals->setGenericEnvironment(genericEnv);
34163420
auto entry = equals->begin();
3417-
auto lhsPtr = entry->createFunctionArgument(params[0].getSILStorageType(
3418-
SGM.M, signature, subSGF.getTypeExpansionContext()));
3419-
auto rhsPtr = entry->createFunctionArgument(params[1].getSILStorageType(
3420-
SGM.M, signature, subSGF.getTypeExpansionContext()));
3421+
auto lhsPtr = entry->createFunctionArgument(subSGF.silConv.getSILType(
3422+
params[0], signature, subSGF.getTypeExpansionContext()));
3423+
auto rhsPtr = entry->createFunctionArgument(subSGF.silConv.getSILType(
3424+
params[1], signature, subSGF.getTypeExpansionContext()));
34213425

34223426
Scope scope(subSGF, loc);
34233427

@@ -3588,8 +3592,8 @@ getOrCreateKeyPathEqualsAndHash(SILGenModule &SGM,
35883592
SILGenFunction subSGF(SGM, *hash, SGM.SwiftModule);
35893593
hash->setGenericEnvironment(genericEnv);
35903594
auto entry = hash->begin();
3591-
auto indexPtr = entry->createFunctionArgument(params[0].getSILStorageType(
3592-
SGM.M, signature, subSGF.getTypeExpansionContext()));
3595+
auto indexPtr = entry->createFunctionArgument(subSGF.silConv.getSILType(
3596+
params[0], signature, subSGF.getTypeExpansionContext()));
35933597

35943598
SILValue hashCode;
35953599

0 commit comments

Comments
 (0)