Skip to content

Commit 1b153ae

Browse files
committed
LoadableByAddress: I don't think these GenericContextScopes are necessary
1 parent 57e2068 commit 1b153ae

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/IRGen/LoadableByAddress.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,6 @@ void LargeValueVisitor::visitMethodInst(MethodInst *instr) {
592592
if (fnType->isPolymorphic()) {
593593
genEnv = getGenericEnvironment(fnType);
594594
}
595-
Lowering::GenericContextScope GenericScope(
596-
instr->getModule().Types, fnType->getGenericSignature());
597595
if (shouldTransformFunctionType(genEnv, fnType, pass.Mod)) {
598596
pass.methodInstsToMod.push_back(instr);
599597
return;
@@ -2024,8 +2022,7 @@ static bool rewriteFunctionReturn(StructLoweringState &pass) {
20242022
void LoadableByAddress::runOnFunction(SILFunction *F) {
20252023
CanSILFunctionType funcType = F->getLoweredFunctionType();
20262024
IRGenModule *currIRMod = getIRGenModule()->IRGen.getGenModule(F);
2027-
Lowering::GenericContextScope GenericScope(getModule()->Types,
2028-
funcType->getGenericSignature());
2025+
20292026
if (F->isExternalDeclaration()) {
20302027
if (!modifiableFunction(funcType)) {
20312028
return;
@@ -2216,10 +2213,7 @@ void LoadableByAddress::recreateUncheckedEnumDataInstrs() {
22162213
for (auto *enumInstr : uncheckedEnumDataOfFunc) {
22172214
SILBuilderWithScope enumBuilder(enumInstr);
22182215
SILFunction *F = enumInstr->getFunction();
2219-
CanSILFunctionType funcType = F->getLoweredFunctionType();
22202216
IRGenModule *currIRMod = getIRGenModule()->IRGen.getGenModule(F);
2221-
Lowering::GenericContextScope GenericScope(getModule()->Types,
2222-
funcType->getGenericSignature());
22232217
SILType origType = enumInstr->getType();
22242218
GenericEnvironment *genEnv = F->getGenericEnvironment();
22252219
SILType newType = getNewSILType(genEnv, origType, *currIRMod);
@@ -2246,10 +2240,7 @@ void LoadableByAddress::recreateUncheckedTakeEnumDataAddrInst() {
22462240
for (auto *enumInstr : uncheckedTakeEnumDataAddrOfFunc) {
22472241
SILBuilderWithScope enumBuilder(enumInstr);
22482242
SILFunction *F = enumInstr->getFunction();
2249-
CanSILFunctionType funcType = F->getLoweredFunctionType();
22502243
IRGenModule *currIRMod = getIRGenModule()->IRGen.getGenModule(F);
2251-
Lowering::GenericContextScope GenericScope(getModule()->Types,
2252-
funcType->getGenericSignature());
22532244
SILType origType = enumInstr->getType();
22542245
GenericEnvironment *genEnv = F->getGenericEnvironment();
22552246
SILType newType = getNewSILType(genEnv, origType, *currIRMod);
@@ -2298,9 +2289,6 @@ void LoadableByAddress::recreateConvInstrs() {
22982289
currSILType = thinToPointer->getOperand()->getType();
22992290
}
23002291
auto currSILFunctionType = currSILType.castTo<SILFunctionType>();
2301-
Lowering::GenericContextScope GenericScope(
2302-
getModule()->Types,
2303-
currSILFunctionType->getGenericSignature());
23042292
GenericEnvironment *genEnv =
23052293
convInstr->getFunction()->getGenericEnvironment();
23062294
CanSILFunctionType newFnType =
@@ -2363,8 +2351,6 @@ void LoadableByAddress::recreateBuiltinInstrs() {
23632351
void LoadableByAddress::updateLoweredTypes(SILFunction *F) {
23642352
IRGenModule *currIRMod = getIRGenModule()->IRGen.getGenModule(F);
23652353
CanSILFunctionType funcType = F->getLoweredFunctionType();
2366-
Lowering::GenericContextScope GenericScope(getModule()->Types,
2367-
funcType->getGenericSignature());
23682354
GenericEnvironment *genEnv = F->getGenericEnvironment();
23692355
if (!genEnv && funcType->isPolymorphic()) {
23702356
genEnv = getGenericEnvironment(funcType);

0 commit comments

Comments
 (0)