@@ -592,8 +592,6 @@ void LargeValueVisitor::visitMethodInst(MethodInst *instr) {
592
592
if (fnType->isPolymorphic ()) {
593
593
genEnv = getGenericEnvironment (fnType);
594
594
}
595
- Lowering::GenericContextScope GenericScope (
596
- instr->getModule ().Types , fnType->getGenericSignature ());
597
595
if (shouldTransformFunctionType (genEnv, fnType, pass.Mod )) {
598
596
pass.methodInstsToMod .push_back (instr);
599
597
return ;
@@ -2024,8 +2022,7 @@ static bool rewriteFunctionReturn(StructLoweringState &pass) {
2024
2022
void LoadableByAddress::runOnFunction (SILFunction *F) {
2025
2023
CanSILFunctionType funcType = F->getLoweredFunctionType ();
2026
2024
IRGenModule *currIRMod = getIRGenModule ()->IRGen .getGenModule (F);
2027
- Lowering::GenericContextScope GenericScope (getModule ()->Types ,
2028
- funcType->getGenericSignature ());
2025
+
2029
2026
if (F->isExternalDeclaration ()) {
2030
2027
if (!modifiableFunction (funcType)) {
2031
2028
return ;
@@ -2216,10 +2213,7 @@ void LoadableByAddress::recreateUncheckedEnumDataInstrs() {
2216
2213
for (auto *enumInstr : uncheckedEnumDataOfFunc) {
2217
2214
SILBuilderWithScope enumBuilder (enumInstr);
2218
2215
SILFunction *F = enumInstr->getFunction ();
2219
- CanSILFunctionType funcType = F->getLoweredFunctionType ();
2220
2216
IRGenModule *currIRMod = getIRGenModule ()->IRGen .getGenModule (F);
2221
- Lowering::GenericContextScope GenericScope (getModule ()->Types ,
2222
- funcType->getGenericSignature ());
2223
2217
SILType origType = enumInstr->getType ();
2224
2218
GenericEnvironment *genEnv = F->getGenericEnvironment ();
2225
2219
SILType newType = getNewSILType (genEnv, origType, *currIRMod);
@@ -2246,10 +2240,7 @@ void LoadableByAddress::recreateUncheckedTakeEnumDataAddrInst() {
2246
2240
for (auto *enumInstr : uncheckedTakeEnumDataAddrOfFunc) {
2247
2241
SILBuilderWithScope enumBuilder (enumInstr);
2248
2242
SILFunction *F = enumInstr->getFunction ();
2249
- CanSILFunctionType funcType = F->getLoweredFunctionType ();
2250
2243
IRGenModule *currIRMod = getIRGenModule ()->IRGen .getGenModule (F);
2251
- Lowering::GenericContextScope GenericScope (getModule ()->Types ,
2252
- funcType->getGenericSignature ());
2253
2244
SILType origType = enumInstr->getType ();
2254
2245
GenericEnvironment *genEnv = F->getGenericEnvironment ();
2255
2246
SILType newType = getNewSILType (genEnv, origType, *currIRMod);
@@ -2298,9 +2289,6 @@ void LoadableByAddress::recreateConvInstrs() {
2298
2289
currSILType = thinToPointer->getOperand ()->getType ();
2299
2290
}
2300
2291
auto currSILFunctionType = currSILType.castTo <SILFunctionType>();
2301
- Lowering::GenericContextScope GenericScope (
2302
- getModule ()->Types ,
2303
- currSILFunctionType->getGenericSignature ());
2304
2292
GenericEnvironment *genEnv =
2305
2293
convInstr->getFunction ()->getGenericEnvironment ();
2306
2294
CanSILFunctionType newFnType =
@@ -2363,8 +2351,6 @@ void LoadableByAddress::recreateBuiltinInstrs() {
2363
2351
void LoadableByAddress::updateLoweredTypes (SILFunction *F) {
2364
2352
IRGenModule *currIRMod = getIRGenModule ()->IRGen .getGenModule (F);
2365
2353
CanSILFunctionType funcType = F->getLoweredFunctionType ();
2366
- Lowering::GenericContextScope GenericScope (getModule ()->Types ,
2367
- funcType->getGenericSignature ());
2368
2354
GenericEnvironment *genEnv = F->getGenericEnvironment ();
2369
2355
if (!genEnv && funcType->isPolymorphic ()) {
2370
2356
genEnv = getGenericEnvironment (funcType);
0 commit comments